From eaee9424a120c289abc3eeeff331cb0d45efe971 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Thu, 9 Jul 2015 14:13:25 +0200 Subject: Allow non-privileged tasks to wire 64KiB task memory * doc/mach.texi (vm_wire): Document that the host port does not have to be privileged. * include/mach/mach_hosts.defs (vm_wire): Use mach_port_t instead of host_priv_t. * vm/vm_map.h (vm_map): Add user_wired field. * vm/vm_map.c (vm_map_setup): Initialize user_wired field to 0. (vm_map_pageable_common, vm_map_entry_delete, vm_map_copy_overwrite, vm_map_copyout_page_list, vm_map_copyin_page_list): When switching user_wired_count field of entry between 0 and non-0, accumulate the corresponding size into the user_wired field of map. * vm/vm_user.c (vm_wire): Turn host parameter into port parameter, and inline a version of convert_port_to_host_priv which records whether the host port is privileged or not. When it is not privileged, check whether the additional amount to user_wired will overcome 64KiB. --- include/mach/mach_host.defs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/mach/mach_host.defs') diff --git a/include/mach/mach_host.defs b/include/mach/mach_host.defs index 6699a50..28439a0 100644 --- a/include/mach/mach_host.defs +++ b/include/mach/mach_host.defs @@ -296,7 +296,7 @@ routine host_reboot( * [ To unwire the pages, specify VM_PROT_NONE. ] */ routine vm_wire( - host_priv : host_priv_t; + host : mach_port_t; task : vm_task_t; address : vm_address_t; size : vm_size_t; -- cgit v1.2.3