summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2009-11-28 17:37:54 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2009-11-28 17:37:54 +0100
commitd088a062c1dcbd5047a6bf41ccb2cb1da2c78060 (patch)
tree8754ffd902b553ca3e95486d3ee6fba4d3c2ec46 /include
parent43347f8e5f17cf246d2199b4db5b899e8bb08557 (diff)
Add memory object proxies
Memory object proxies permit to replicate objects with different parameters, like reduced privileged, different offset, etc. They are e.g. essential for properly managing memory access permissions. 2005-06-06 Marcus Brinkmann <marcus@gnu.org> * include/mach/mach4.defs: Add memory_object_create_proxy interface. * Makefile.in (vm-cfiles): Add memory_object_proxy.c. * i386/include/mach/i386/vm_types.h (vm_offset_array_t): New type. * include/mach/memory_object.h (memory_object_array_t): New type. * vm/memory_object_proxy.c: New file. * kern/ipc_kobject.h: New macro IKOT_PAGER_PROXY. Bump up macros IKOT_UNKNOWN and IKOT_MAX_TYPE. * kern/ipc_kobject.c (ipc_kobject_notify): Call memory_object_proxy_notify for IKOT_PAGER_PROXY. * vm/vm_init.c (vm_mem_init): Call memory_object_proxy_init. * vm/vm_user.c (vm_map): Implement support for proxy memory objects.
Diffstat (limited to 'include')
-rw-r--r--include/mach/mach4.defs30
-rw-r--r--include/mach/memory_object.h3
2 files changed, 33 insertions, 0 deletions
diff --git a/include/mach/mach4.defs b/include/mach/mach4.defs
index e4f363f..114edf4 100644
--- a/include/mach/mach4.defs
+++ b/include/mach/mach4.defs
@@ -79,4 +79,34 @@ skip /* pc_sampling reserved 1*/;
skip /* pc_sampling reserved 2*/;
skip /* pc_sampling reserved 3*/;
skip /* pc_sampling reserved 4*/;
+
+#else
+
+skip; /* task_enable_pc_sampling */
+skip; /* task_disable_pc_sampling */
+skip; /* task_get_sampled_pcs */
+skip; /* thread_enable_pc_sampling */
+skip; /* thread_disable_pc_sampling */
+skip; /* thread_get_sampled_pcs */
+
+skip /* pc_sampling reserved 1*/;
+skip /* pc_sampling reserved 2*/;
+skip /* pc_sampling reserved 3*/;
+skip /* pc_sampling reserved 4*/;
+
#endif
+
+
+/* Create a new proxy memory object from [START;START+LEN) in the
+ given OBJECT at OFFSET in the new object with the maximum
+ protection MAX_PROTECTION and return it in *PORT. */
+type vm_offset_array_t = array[*:1024] of vm_offset_t;
+routine memory_object_create_proxy(
+ task : ipc_space_t;
+ max_protection : vm_prot_t;
+ object : memory_object_array_t =
+ array[*:1024] of memory_object_t;
+ offset : vm_offset_array_t;
+ start : vm_offset_array_t;
+ len : vm_offset_array_t;
+ out proxy : mach_port_t);
diff --git a/include/mach/memory_object.h b/include/mach/memory_object.h
index b4dd71f..f281f04 100644
--- a/include/mach/memory_object.h
+++ b/include/mach/memory_object.h
@@ -46,6 +46,9 @@ typedef mach_port_t memory_object_t;
/* the object to map; used by the */
/* kernel to retrieve or store data */
+typedef mach_port_t * memory_object_array_t;
+ /* should be memory_object_t * */
+
typedef mach_port_t memory_object_control_t;
/* Provided to a memory manager; ... */
/* used to control a memory object */