diff options
author | Richard Braun <rbraun@sceen.net> | 2016-12-24 02:31:34 +0100 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2016-12-24 02:31:34 +0100 |
commit | 2b0f19f602e08fd9d37268233b962674fd592634 (patch) | |
tree | 90a4bfa49483ccdcddbbcd20749de7f864272d64 /include | |
parent | 023401c5b97023670a44059a60eb2a3a11c8a929 (diff) | |
download | gnumach-2b0f19f602e08fd9d37268233b962674fd592634.tar.gz gnumach-2b0f19f602e08fd9d37268233b962674fd592634.tar.bz2 gnumach-2b0f19f602e08fd9d37268233b962674fd592634.zip |
VM: add the vm_wire_all call
This call maps the POSIX mlockall and munlockall calls.
* Makefrag.am (include_mach_HEADERS): Add include/mach/vm_wire.h.
* include/mach/gnumach.defs (vm_wire_t): New type.
(vm_wire_all): New routine.
* include/mach/mach_types.h: Include mach/vm_wire.h.
* vm/vm_map.c: Likewise.
(vm_map_enter): Automatically wire new entries if requested.
(vm_map_copyout): Likewise.
(vm_map_pageable_all): New function.
vm/vm_map.h: Include mach/vm_wire.h.
(struct vm_map): Update description of member `wiring_required'.
(vm_map_pageable_all): New function.
* vm/vm_user.c (vm_wire_all): New function.
Diffstat (limited to 'include')
-rw-r--r-- | include/mach/gnumach.defs | 15 | ||||
-rw-r--r-- | include/mach/mach_types.h | 1 | ||||
-rw-r--r-- | include/mach/vm_wire.h | 30 |
3 files changed, 46 insertions, 0 deletions
diff --git a/include/mach/gnumach.defs b/include/mach/gnumach.defs index 5235df63..b484accc 100644 --- a/include/mach/gnumach.defs +++ b/include/mach/gnumach.defs @@ -35,6 +35,8 @@ GNUMACH_IMPORTS type vm_cache_statistics_data_t = struct[11] of integer_t; +type vm_wire_t = int; + /* * Return page cache statistics for the host on which the target task * resides. @@ -136,3 +138,16 @@ simpleroutine gsync_requeue( wake_one : boolean_t; flags : int); +/* + * If the VM_WIRE_CURRENT flag is passed, specify that the entire + * virtual address space of the target task must not cause page faults. + * + * If the VM_WIRE_FUTURE flag is passed, automatically wire new + * mappings in the address space of the target task. + * + * If the flags are empty (VM_WIRE_NONE), unwire all mappings. + */ +routine vm_wire_all( + host : mach_port_t; + task : vm_task_t; + flags : vm_wire_t); diff --git a/include/mach/mach_types.h b/include/mach/mach_types.h index 87684824..65164a99 100644 --- a/include/mach/mach_types.h +++ b/include/mach/mach_types.h @@ -53,6 +53,7 @@ #include <mach/vm_prot.h> #include <mach/vm_statistics.h> #include <mach/vm_cache_statistics.h> +#include <mach/vm_wire.h> #ifdef MACH_KERNEL #include <kern/task.h> /* for task_array_t */ diff --git a/include/mach/vm_wire.h b/include/mach/vm_wire.h new file mode 100644 index 00000000..1552dfa7 --- /dev/null +++ b/include/mach/vm_wire.h @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2017 Free Software Foundation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef _MACH_VM_WIRE_H_ +#define _MACH_VM_WIRE_H_ + +typedef int vm_wire_t; + +#define VM_WIRE_NONE 0 +#define VM_WIRE_CURRENT 1 +#define VM_WIRE_FUTURE 2 + +#define VM_WIRE_ALL (VM_WIRE_CURRENT | VM_WIRE_FUTURE) + +#endif /* _MACH_VM_WIRE_H_ */ |