X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/8f6c56a50524aa785f7e596d52dddfb331e18961..4a3eedf9ecc9bbe3f3a5c6ce5e53ad199d639d32:/osfmk/ppc/commpage/commpage.c diff --git a/osfmk/ppc/commpage/commpage.c b/osfmk/ppc/commpage/commpage.c index f152a87e8..6b0227322 100644 --- a/osfmk/ppc/commpage/commpage.c +++ b/osfmk/ppc/commpage/commpage.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2004 Apple Computer, Inc. All rights reserved. + * Copyright (c) 2003-2007 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * @@ -57,8 +57,8 @@ #include #include -extern vm_map_t com_region_map32; // the 32-bit shared submap, set up in vm init -extern vm_map_t com_region_map64; // the 64-bit shared submap +extern vm_map_t commpage32_map; // the 32-bit shared submap, set up in vm init +extern vm_map_t commpage64_map; // the 64-bit shared submap char *commPagePtr32 = NULL; // virtual address of 32-bit comm page in kernel map char *commPagePtr64 = NULL; // and 64-bit commpage @@ -193,9 +193,9 @@ static commpage_descriptor *routines[] = { */ static void* commpage_allocate( - vm_map_t submap ) // com_region_map32 or com_region_map64 + vm_map_t submap ) // commpage32_map or commpage64_map { - vm_offset_t kernel_addr; // address of commpage in kernel map + vm_offset_t kernel_addr = 0; // address of commpage in kernel map vm_offset_t zero = 0; vm_size_t size = _COMM_PAGE_AREA_USED; // size actually populated vm_map_entry_t entry; @@ -204,7 +204,7 @@ commpage_allocate( if (submap == NULL) panic("commpage submap is null"); - if (vm_allocate(kernel_map,&kernel_addr,_COMM_PAGE_AREA_USED,VM_FLAGS_ANYWHERE)) + if (vm_map(kernel_map,&kernel_addr,_COMM_PAGE_AREA_USED,0,VM_FLAGS_ANYWHERE,NULL,0,FALSE,VM_PROT_ALL,VM_PROT_ALL,VM_INHERIT_NONE)) panic("cannot allocate commpage"); if (vm_map_wire(kernel_map,kernel_addr,kernel_addr+_COMM_PAGE_AREA_USED,VM_PROT_DEFAULT,FALSE)) @@ -225,7 +225,7 @@ commpage_allocate( if (mach_make_memory_entry( kernel_map, // target map &size, // size kernel_addr, // offset (address in kernel map) - VM_PROT_DEFAULT, // map it RW + VM_PROT_ALL, // map it RWX &handle, // this is the object handle we get NULL )) // parent_entry panic("cannot make entry for commpage"); @@ -238,8 +238,8 @@ commpage_allocate( handle, // port is the memory entry we just made 0, // offset (map 1st page in memory entry) FALSE, // copy - VM_PROT_READ, // cur_protection (R-only in user map) - VM_PROT_READ, // max_protection + VM_PROT_READ|VM_PROT_EXECUTE, // cur_protection (R-only in user map) + VM_PROT_READ|VM_PROT_EXECUTE, // max_protection VM_INHERIT_SHARE )) // inheritance panic("cannot map commpage"); @@ -319,7 +319,7 @@ commpage_stuff( char *dest = commpage_addr_of(address); if (dest < next) - panic("commpage overlap: %08 - %08X", dest, next); + panic("commpage overlap: %p - %p", dest, next); bcopy((const char*)source,dest,length); @@ -670,9 +670,9 @@ void commpage_populate( void ) { commpage_init_cpu_capabilities(); - commpage_populate_one( com_region_map32, &commPagePtr32, kCommPage32, "commpage 32-bit"); + commpage_populate_one( commpage32_map, &commPagePtr32, kCommPage32, "commpage 32-bit"); if (_cpu_capabilities & k64Bit) { - commpage_populate_one( com_region_map64, &commPagePtr64, kCommPage64, "commpage 64-bit"); + commpage_populate_one( commpage64_map, &commPagePtr64, kCommPage64, "commpage 64-bit"); pmap_init_sharedpage((vm_offset_t)commPagePtr64); // Do the 64-bit version }