summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2021-11-07 17:49:18 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2021-11-07 17:51:36 +0100
commitd8c4e675e639ba6a8e573804ce6875c828471b47 (patch)
treebc16d560eee3f892773ab02ceb92de533f611ae3
parent48c4664974ef5b16b25f3116120eb145b8f2d9e5 (diff)
memory_object: Fix memory_object_t type in the kernel
mach_port_t is for userland, kernel sees the translated ipc_port_t. * include/mach/memory_object.h [MACH_KERNEL]: Include ipc/ipc_types.h [MACH_KERNEL] (memory_object_t): Typedef to ipc_port_t instead of mach_port_t. (memory_object_array_t): Typedef to memory_object_t* instead of mach_port_t*.
-rw-r--r--include/mach/memory_object.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/mach/memory_object.h b/include/mach/memory_object.h
index f281f04d..7e0c3741 100644
--- a/include/mach/memory_object.h
+++ b/include/mach/memory_object.h
@@ -40,14 +40,18 @@
#include <mach/port.h>
+#ifdef MACH_KERNEL
+#include <ipc/ipc_types.h>
+typedef ipc_port_t memory_object_t;
+#else
typedef mach_port_t memory_object_t;
+#endif
/* Represents a memory object ... */
/* Used by user programs to specify */
/* 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 memory_object_t *memory_object_array_t;
typedef mach_port_t memory_object_control_t;
/* Provided to a memory manager; ... */