aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLuca Dariz <luca@orpolo.org>2023-01-16 11:58:51 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-01-18 02:11:34 +0100
commitcc05ed085b731232a2436efcaf03aa1e92ad20be (patch)
tree1bfaf6bc8d7db296eeac477206dcb2c186c25e49 /include
parentc17cb87cc97f817f9705ef932fe2da6d23a1d01a (diff)
downloadgnumach-cc05ed085b731232a2436efcaf03aa1e92ad20be.tar.gz
gnumach-cc05ed085b731232a2436efcaf03aa1e92ad20be.tar.bz2
gnumach-cc05ed085b731232a2436efcaf03aa1e92ad20be.zip
add msg_user_header_t for user-side msg structure
* include/mach/message.h: use mach_msg_user_header_t only in KERNEL, and define it as mach_msh_header_t for user space * ipc/ipc_kmsg.c: use mach_msg_user_header_t where appropriate * ipc/ipc_kmsg.h: Likewise * ipc/mach_msg.c: Likewise * ipc/mach_msg.h: Likewise * kern/thread.h: Likewise Message-Id: <20230116105857.240210-2-luca@orpolo.org>
Diffstat (limited to 'include')
-rw-r--r--include/mach/message.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/include/mach/message.h b/include/mach/message.h
index 798b47b4..c3081e66 100644
--- a/include/mach/message.h
+++ b/include/mach/message.h
@@ -132,6 +132,7 @@ typedef unsigned int mach_msg_size_t;
typedef natural_t mach_msg_seqno_t;
typedef integer_t mach_msg_id_t;
+/* full header structure, may have different size in user/kernel spaces */
typedef struct mach_msg_header {
mach_msg_bits_t msgh_bits;
mach_msg_size_t msgh_size;
@@ -144,6 +145,20 @@ typedef struct mach_msg_header {
mach_msg_id_t msgh_id;
} mach_msg_header_t;
+#ifdef KERNEL
+/* user-side header format, needed in the kernel */
+typedef struct {
+ mach_msg_bits_t msgh_bits;
+ mach_msg_size_t msgh_size;
+ mach_port_name_t msgh_remote_port;
+ mach_port_name_t msgh_local_port;
+ mach_port_seqno_t msgh_seqno;
+ mach_msg_id_t msgh_id;
+} mach_msg_user_header_t;
+#else
+typedef mach_msg_header_t mach_msg_user_header_t;
+#endif
+
/*
* There is no fixed upper bound to the size of Mach messages.
*/
@@ -389,7 +404,7 @@ typedef kern_return_t mach_msg_return_t;
extern mach_msg_return_t
mach_msg_trap
- (mach_msg_header_t *msg,
+ (mach_msg_user_header_t *msg,
mach_msg_option_t option,
mach_msg_size_t send_size,
mach_msg_size_t rcv_size,