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-17 23:50:13 +0100
commit4541faab2ec63444e5afdb1aa17b0cb6180a3d55 (patch)
tree39e67314186422e57f168ed45c9163c9f8e28c6c
parent69620634858b2992e1a362e33c95d9a8ee57bce7 (diff)
Reorder mach_msg_type_t fields to ensure msgt_name and msgt_size are byte alignedv1.8+git20231217
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.
-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 21e99896..0b8b34d4 100644
--- a/include/mach/message.h
+++ b/include/mach/message.h
@@ -256,12 +256,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,
@@ -281,12 +281,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;
};
};