summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2014-03-03 19:12:52 +0100
committerJustus Winter <4winter@informatik.uni-hamburg.de>2014-03-25 08:44:10 +0100
commit50cc5152ebb4872b57a764d7b5ad62636f674e01 (patch)
treea506bbf3baac6e9593a4799623ed50a86cf12a75 /include
parente33a07f421a84e54360628354e4faa0cf4a5d36f (diff)
include: make the memory_object_t types translation functions mutable
Make the intran, outtran and destructor functions mutable using preprocessor macros. Make it possible to inject imports using the MEMORY_OBJECT_IMPORTS macro. This way, userspace servers can provide their own translation functions. * include/mach/mach_types.defs (memory_object_t): Make the translation mutable using preprocessor macros. * include/mach/memory_object.defs: Likewise for the inlined type declarations. Honor MEMORY_OBJECT_IMPORTS. * include/mach/memory_object_default.defs: Likewise.
Diffstat (limited to 'include')
-rw-r--r--include/mach/mach_types.defs10
-rw-r--r--include/mach/memory_object.defs28
-rw-r--r--include/mach/memory_object_default.defs4
3 files changed, 38 insertions, 4 deletions
diff --git a/include/mach/mach_types.defs b/include/mach/mach_types.defs
index 607d5d9..bfce6cb 100644
--- a/include/mach/mach_types.defs
+++ b/include/mach/mach_types.defs
@@ -135,6 +135,16 @@ type memory_object_t = mach_port_t
ctype: mach_port_t
#if KERNEL_SERVER
intran: ipc_port_t null_conversion(mach_port_t)
+#else /* KERNEL_SERVER */
+#ifdef MEMORY_OBJECT_INTRAN
+ intran: MEMORY_OBJECT_INTRAN
+#endif
+#ifdef MEMORY_OBJECT_OUTTRAN
+ outtran: MEMORY_OBJECT_OUTTRAN
+#endif
+#ifdef MEMORY_OBJECT_DESTRUCTOR
+ destructor: MEMORY_OBJECT_DESTRUCTOR
+#endif
#endif /* KERNEL_SERVER */
;
diff --git a/include/mach/memory_object.defs b/include/mach/memory_object.defs
index ea7989a..0ed8dbc 100644
--- a/include/mach/memory_object.defs
+++ b/include/mach/memory_object.defs
@@ -42,6 +42,10 @@ subsystem
#include <mach/std_types.defs>
#include <mach/mach_types.defs>
+#ifdef MEMORY_OBJECT_IMPORTS
+MEMORY_OBJECT_IMPORTS
+#endif
+
#if SEQNOS
serverprefix seqnos_;
serverdemux seqnos_memory_object_server;
@@ -85,7 +89,11 @@ simpleroutine memory_object_init(
simpleroutine memory_object_terminate(
memory_object : memory_object_t =
MACH_MSG_TYPE_MOVE_SEND
- ctype: mach_port_t;
+ ctype: mach_port_t
+#ifdef MEMORY_OBJECT_INTRAN
+ intran: MEMORY_OBJECT_INTRAN
+#endif
+ ;
#if SEQNOS
msgseqno seqno : mach_port_seqno_t;
#endif /* SEQNOS */
@@ -221,7 +229,11 @@ simpleroutine memory_object_data_write(
simpleroutine memory_object_lock_completed(
memory_object : memory_object_t =
polymorphic|MACH_MSG_TYPE_PORT_SEND_ONCE
- ctype: mach_port_t;
+ ctype: mach_port_t
+#ifdef MEMORY_OBJECT_INTRAN
+ intran: MEMORY_OBJECT_INTRAN
+#endif
+ ;
#if SEQNOS
msgseqno seqno : mach_port_seqno_t;
#endif /* SEQNOS */
@@ -252,7 +264,11 @@ simpleroutine memory_object_lock_completed(
simpleroutine memory_object_supply_completed(
memory_object : memory_object_t =
polymorphic|MACH_MSG_TYPE_PORT_SEND_ONCE
- ctype: mach_port_t;
+ ctype: mach_port_t
+#ifdef MEMORY_OBJECT_INTRAN
+ intran: MEMORY_OBJECT_INTRAN
+#endif
+ ;
#if SEQNOS
msgseqno seqno : mach_port_seqno_t;
#endif /* SEQNOS */
@@ -298,7 +314,11 @@ simpleroutine memory_object_data_return(
simpleroutine memory_object_change_completed(
memory_object : memory_object_t =
polymorphic|MACH_MSG_TYPE_PORT_SEND_ONCE
- ctype: mach_port_t;
+ ctype: mach_port_t
+#ifdef MEMORY_OBJECT_INTRAN
+ intran: MEMORY_OBJECT_INTRAN
+#endif
+ ;
#if SEQNOS
msgseqno seqno : mach_port_seqno_t;
#endif /* SEQNOS */
diff --git a/include/mach/memory_object_default.defs b/include/mach/memory_object_default.defs
index 0eac271..cfd54a4 100644
--- a/include/mach/memory_object_default.defs
+++ b/include/mach/memory_object_default.defs
@@ -40,6 +40,10 @@ subsystem
#include <mach/std_types.defs>
#include <mach/mach_types.defs>
+#ifdef MEMORY_OBJECT_IMPORTS
+MEMORY_OBJECT_IMPORTS
+#endif
+
#if SEQNOS
serverprefix seqnos_;
serverdemux seqnos_memory_object_default_server;