From 4541faab2ec63444e5afdb1aa17b0cb6180a3d55 Mon Sep 17 00:00:00 2001 From: Flavio Cruz Date: Sat, 25 Nov 2023 01:27:53 -0500 Subject: 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. --- include/mach/message.h | 20 ++++++++++---------- 1 file 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; }; }; -- cgit v1.2.3