From 958686efa2175abe3f7044890c2c2370e29147f2 Mon Sep 17 00:00:00 2001 From: Flavio Cruz Date: Wed, 30 Nov 2022 02:14:20 -0500 Subject: Update ipc/ directory to use mach_port_name_t Make it explicit where we use port names versus actual ports. For the 64 bit kernel, port names and ports are of different size so this corrects the syscall arguments and internal structs to have the right size. This patch also uncovered several issues we need to solve to make GNUMach work well on 64 bits. First, the mach_msg call will receive 4 byte port names while the kernel "thinks" they are 8 bytes, which will be a problem. Also, when we send a message, the kernel translates the port names into port pointers in the message copied from user space. This also won't work on 64 bits. In this patch, I added several TODOs to fix the issues later. Message-Id: --- ipc/ipc_kmsg.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'ipc/ipc_kmsg.h') diff --git a/ipc/ipc_kmsg.h b/ipc/ipc_kmsg.h index 2d75b173..ffda9b5e 100644 --- a/ipc/ipc_kmsg.h +++ b/ipc/ipc_kmsg.h @@ -254,26 +254,26 @@ extern void ipc_kmsg_put_to_kernel(mach_msg_header_t *, ipc_kmsg_t, mach_msg_size_t); extern mach_msg_return_t -ipc_kmsg_copyin_header(mach_msg_header_t *, ipc_space_t, mach_port_t); +ipc_kmsg_copyin_header(mach_msg_header_t *, ipc_space_t, mach_port_name_t); extern mach_msg_return_t -ipc_kmsg_copyin(ipc_kmsg_t, ipc_space_t, vm_map_t, mach_port_t); +ipc_kmsg_copyin(ipc_kmsg_t, ipc_space_t, vm_map_t, mach_port_name_t); extern void ipc_kmsg_copyin_from_kernel(ipc_kmsg_t); extern mach_msg_return_t -ipc_kmsg_copyout_header(mach_msg_header_t *, ipc_space_t, mach_port_t); +ipc_kmsg_copyout_header(mach_msg_header_t *, ipc_space_t, mach_port_name_t); extern mach_msg_return_t ipc_kmsg_copyout_object(ipc_space_t, ipc_object_t, - mach_msg_type_name_t, mach_port_t *); + mach_msg_type_name_t, mach_port_name_t *); extern mach_msg_return_t ipc_kmsg_copyout_body(ipc_kmsg_t, ipc_space_t, vm_map_t); extern mach_msg_return_t -ipc_kmsg_copyout(ipc_kmsg_t, ipc_space_t, vm_map_t, mach_port_t); +ipc_kmsg_copyout(ipc_kmsg_t, ipc_space_t, vm_map_t, mach_port_name_t); extern mach_msg_return_t ipc_kmsg_copyout_pseudo(ipc_kmsg_t, ipc_space_t, vm_map_t); -- cgit v1.2.3