summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMaksym Planeta <mcsim.planeta@gmail.com>2012-10-08 16:01:13 +0200
committerMaksym Planeta <mcsim.planeta@gmail.com>2012-10-28 12:23:14 +0100
commite70ecc311676b9f30cbc5ca7c2029b7f522cbb25 (patch)
treec55707e26f15135bf9cd6b565f2528690c4c5a60 /include
parent6a08b518a60bd0e9448278f88f6f55681a5b9c6c (diff)
Add IPC functions that allow user to manipulate with memory advice.
* include/mach/mach_types.defs (vm_advice_t): New type definition. * include/mach/mach.defs (vm_advise): New RPC definition. (memory_object_set_advice): Likewise. (memory_object_get_advice): Likewise. * kern/ipc_mig.c (syscall_vm_advice): New function. This is optimization function for RPC that is processed by kernel. * kern/syscall_sw.c (syscall_vm_advice): Add function prototype. (mach_trap_table): Add syscall_vm_advice to trap table. * vm/memory_object.c (memory_object_set_advice): New function. Sets memory advice for memory object. (memory_object_get_advice): New function. Returns memory advice of memory object. * vm/vm_user.c (vm_advise): New function. Wrapper for vm_map_advice. * vm/vm_map.h (vm_map_advice): Add function prototype. * vm/vm_map.c (vm_map_advice): New function. Sets memory advice for memory range.
Diffstat (limited to 'include')
-rw-r--r--include/mach/mach.defs23
-rw-r--r--include/mach/mach_types.defs1
2 files changed, 21 insertions, 3 deletions
diff --git a/include/mach/mach.defs b/include/mach/mach.defs
index 58510805..c5ffbc05 100644
--- a/include/mach/mach.defs
+++ b/include/mach/mach.defs
@@ -282,7 +282,18 @@ routine vm_statistics(
target_task : vm_task_t;
out vm_stats : vm_statistics_data_t);
-skip; /* old task_by_u*x_pid */
+
+/*
+ * Set the page fault policy attribute for the specified range
+ * of the virtual address space of the target task.
+ * The advice value is either random or sequential, and
+ * specifies how kernel should consider access to lacking page.
+ */
+routine vm_advise(
+ target_task : vm_task_t;
+ address : vm_address_t;
+ size : vm_size_t;
+ advice : vm_advice_t);
skip; /* old vm_pageable */
/*
@@ -681,8 +692,14 @@ simpleroutine memory_object_change_attributes(
MACH_MSG_TYPE_MAKE_SEND_ONCE|polymorphic);
skip; /* old host_callout_statistics_reset */
-skip; /* old port_set_select */
-skip; /* old port_set_backup */
+
+simpleroutine memory_object_set_advice(
+ memory_control : memory_object_control_t;
+ advice : vm_advice_t);
+
+routine memory_object_get_advice(
+ memory_control : memory_object_control_t;
+ out advice : vm_advice_t);
/*
* Set/Get special properties of memory associated
diff --git a/include/mach/mach_types.defs b/include/mach/mach_types.defs
index 607d5d92..12c4b7c7 100644
--- a/include/mach/mach_types.defs
+++ b/include/mach/mach_types.defs
@@ -117,6 +117,7 @@ type vm_offset_t = natural_t;
type vm_size_t = natural_t;
type vm_prot_t = int;
type vm_inherit_t = int;
+type vm_advice_t = int;
type vm_statistics_data_t = struct[13] of integer_t;
type vm_machine_attribute_t = int;
type vm_machine_attribute_val_t = int;