summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlavio Cruz <flaviocruz@gmail.com>2023-11-25 01:27:53 -0500
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-12-03 01:00:46 +0100
commit2db6b9b7b23b3bab944665b3b6012d24dd425d97 (patch)
tree0b8834e28536f345b79293290b50a30e96bd7442
parent6e0f722df45f6c261f250a8814458e19c2bed550 (diff)
Reorder mach_msg_type_t fields to ensure msgt_name and msgt_size are byte aligned
msgt_unused appears right after msgt_size since msgt_size can be reduced to only 8 bits in the future, so we leave the door opened to make msgt_unused 13 bits long. Message-ID: <ZWGT6a6GeqFAtOUn@jupiter.tail36e24.ts.net>
-rw-r--r--include/mach/message.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/include/mach/message.h b/include/mach/message.h
index 17d3592f..906ae797 100644
--- a/include/mach/message.h
+++ b/include/mach/message.h
@@ -238,12 +238,12 @@ typedef struct {
* kernel. Otherwise, we would have to replicate some of the MiG logic
* internally in the kernel.
*/
- unsigned int msgt_inline : 1,
- msgt_longform : 1,
- msgt_deallocate : 1,
- msgt_name : 8,
+ unsigned int msgt_name : 8,
msgt_size : 16,
- msgt_unused : 5;
+ msgt_unused : 5,
+ msgt_inline : 1,
+ msgt_longform : 1,
+ msgt_deallocate : 1;
mach_msg_type_number_t msgt_number;
#else
unsigned int msgt_name : 8,
@@ -263,12 +263,12 @@ typedef struct {
* union to overlay with the old field names. */
mach_msg_type_t msgtl_header;
struct {
- unsigned int msgtl_inline : 1,
- msgtl_longform : 1,
- msgtl_deallocate : 1,
- msgtl_name : 8,
+ unsigned int msgtl_name : 8,
msgtl_size : 16,
- msgtl_unused : 5;
+ msgtl_unused : 5,
+ msgtl_inline : 1,
+ msgtl_longform : 1,
+ msgtl_deallocate : 1;
mach_msg_type_number_t msgtl_number;
};
};