summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLuca Dariz <luca@orpolo.org>2023-12-28 20:42:57 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-12-29 15:16:44 +0100
commit7538b56278a95d87b9a4ddec01e5679376cc5b13 (patch)
tree18404a2044aed558118aa365bd59db4b5387c3b7 /include
parent06885ceb139976763aa815dd5ff1d972cecea4c9 (diff)
expose MACH_MSG_USER_ALIGNMENT for manually-built messages
Message-ID: <20231228194301.745811-11-luca@orpolo.org>
Diffstat (limited to 'include')
-rw-r--r--include/mach/message.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/include/mach/message.h b/include/mach/message.h
index 0b8b34d4..9790ef98 100644
--- a/include/mach/message.h
+++ b/include/mach/message.h
@@ -401,6 +401,16 @@ typedef integer_t mach_msg_option_t;
#define MACH_SEND_ALWAYS 0x00010000 /* internal use only */
+#ifdef __x86_64__
+#if defined(KERNEL) && defined(USER32)
+#define MACH_MSG_USER_ALIGNMENT 4
+#else
+#define MACH_MSG_USER_ALIGNMENT 8
+#endif
+#else
+#define MACH_MSG_USER_ALIGNMENT 4
+#endif
+
#ifdef KERNEL
/* This is the alignment of msg descriptors and the actual data
* for both in kernel messages and user land messages.
@@ -411,15 +421,6 @@ typedef integer_t mach_msg_option_t;
* so that kernel messages are correctly aligned.
*/
#define MACH_MSG_KERNEL_ALIGNMENT sizeof(uintptr_t)
-#ifdef __x86_64__
-#ifdef USER32
-#define MACH_MSG_USER_ALIGNMENT 4
-#else
-#define MACH_MSG_USER_ALIGNMENT 8
-#endif
-#else
-#define MACH_MSG_USER_ALIGNMENT 4
-#endif
#define mach_msg_align(x, alignment) \
( ( ((vm_offset_t)(x)) + ((alignment)-1) ) & ~((alignment)-1) )