bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 10/14] expose MACH_MSG_USER_ALIGNMENT for manually-built messages


From: Luca Dariz
Subject: [PATCH 10/14] expose MACH_MSG_USER_ALIGNMENT for manually-built messages
Date: Thu, 28 Dec 2023 20:42:57 +0100

---
 include/mach/message.h | 19 ++++++++++---------
 1 file 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) )
-- 
2.39.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]