- size_used = round_page_32(actual * sizeof(vm_offset_t));
- (void) vm_map_wire(ipc_kernel_map,
- addr, addr + size,
- VM_PROT_READ|VM_PROT_WRITE, FALSE);
- (void) vm_map_copyin(
- ipc_kernel_map,
- addr,
- size_used,
+ size_used = vm_map_round_page(actual * sizeof(vm_offset_t),
+ VM_MAP_PAGE_MASK(ipc_kernel_map));
+ (void) vm_map_wire(
+ ipc_kernel_map,
+ vm_map_trunc_page(addr,
+ VM_MAP_PAGE_MASK(ipc_kernel_map)),
+ vm_map_round_page(addr + size,
+ VM_MAP_PAGE_MASK(ipc_kernel_map)),
+ VM_PROT_READ|VM_PROT_WRITE,
+ FALSE);
+ (void) vm_map_copyin(ipc_kernel_map,
+ (vm_map_address_t)addr,
+ (vm_map_size_t)size_used,