summaryrefslogtreecommitdiff
path: root/ipc
diff options
context:
space:
mode:
authorFlavio Cruz <flaviocruz@gmail.com>2023-06-13 00:01:25 -0400
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-09-25 10:58:14 +0200
commit25ece371fb21dfd874187f623593064c476d9ca2 (patch)
tree8cd1b4932b994a42884cbed7ac671acba994a6fa /ipc
parentb3921098e2807d6225d277986bc8063b6a271e88 (diff)
Update the 64bit RPC ABI to be simpler
* Make full use of the 8 bytes available in mach_msg_type_t by moving into the unused 4 bytes. This allows us to use 32bits for mach_msg_type_number_t whether we use the longform or not. * Make mach_msg_type_long_t exactly the same as mach_msg_type_t. Updating MiG is strongly encouraged since it will generate better code to handle this new format. After this change, any compatibility with compiled binaries for Hurd x86_64 will break since the message format is different. However, the new schema simplifies the overall ABI, without having "holes" and also avoids the need to have a 16 byte mach_msg_type_long_t. Was able to boot a basic system up to a bash shell. Message-Id: <ZIfqFe5bPNPeH4xg@jupiter.lan>
Diffstat (limited to 'ipc')
-rw-r--r--ipc/ipc_kmsg.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ipc/ipc_kmsg.c b/ipc/ipc_kmsg.c
index 5012e607..d31c3ee9 100644
--- a/ipc/ipc_kmsg.c
+++ b/ipc/ipc_kmsg.c
@@ -1343,9 +1343,11 @@ ipc_kmsg_copyin_body(
is_port = MACH_MSG_TYPE_PORT_ANY(name);
if ((is_port && (size != PORT_T_SIZE_IN_BITS)) ||
+#ifndef __x86_64__
(longform && ((type->msgtl_header.msgt_name != 0) ||
(type->msgtl_header.msgt_size != 0) ||
(type->msgtl_header.msgt_number != 0))) ||
+#endif
(((mach_msg_type_t*)type)->msgt_unused != 0) ||
(dealloc && is_inline)) {
ipc_kmsg_clean_partial(kmsg, taddr, FALSE, 0);
@@ -2832,9 +2834,11 @@ ipc_msg_print(mach_msg_header_t *msgh)
is_port = MACH_MSG_TYPE_PORT_ANY(name);
if ((is_port && (size != PORT_T_SIZE_IN_BITS)) ||
+#ifndef __x86_64__
(longform && ((type->msgtl_header.msgt_name != 0) ||
(type->msgtl_header.msgt_size != 0) ||
(type->msgtl_header.msgt_number != 0))) ||
+#endif
(((mach_msg_type_t*)type)->msgt_unused != 0) ||
(dealloc && is_inline)) {
db_printf("*** invalid type\n");