diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2015-07-09 14:13:25 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2015-07-09 14:13:25 +0200 |
commit | eaee9424a120c289abc3eeeff331cb0d45efe971 (patch) | |
tree | e0bb7aec9484943d15277c67292d5036a9702569 /vm/vm_map.h | |
parent | 1e0429e5f39ec219cbef3af2752528b8a29bc1be (diff) | |
download | gnumach-eaee9424a120c289abc3eeeff331cb0d45efe971.tar.gz gnumach-eaee9424a120c289abc3eeeff331cb0d45efe971.tar.bz2 gnumach-eaee9424a120c289abc3eeeff331cb0d45efe971.zip |
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.
Diffstat (limited to 'vm/vm_map.h')
-rw-r--r-- | vm/vm_map.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/vm/vm_map.h b/vm/vm_map.h index fc7730a2..9b31f90a 100644 --- a/vm/vm_map.h +++ b/vm/vm_map.h @@ -170,6 +170,7 @@ struct vm_map { #define max_offset hdr.links.end /* end of range */ pmap_t pmap; /* Physical map */ vm_size_t size; /* virtual size */ + vm_size_t user_wired; /* wired by user size */ int ref_count; /* Reference count */ decl_simple_lock_data(, ref_lock) /* Lock for ref_count field */ vm_map_entry_t hint; /* hint for quick lookups */ |