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_target.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ipc/ipc_target.h') diff --git a/ipc/ipc_target.h b/ipc/ipc_target.h index a66e6875..86a0e44b 100644 --- a/ipc/ipc_target.h +++ b/ipc/ipc_target.h @@ -33,7 +33,7 @@ typedef struct ipc_target { struct ipc_object ipt_object; - mach_port_t ipt_name; + mach_port_name_t ipt_name; struct ipc_mqueue ipt_messages; #ifdef MIGRATING_THREADS @@ -56,7 +56,7 @@ typedef struct ipc_target { #define IPT_TYPE_MESSAGE_RPC 1 #define IPT_TYPE_MIGRATE_RPC 2 -void ipc_target_init(struct ipc_target *ipt, mach_port_t name); +void ipc_target_init(struct ipc_target *ipt, mach_port_name_t name); void ipc_target_terminate(struct ipc_target *ipt); #define ipt_lock(ipt) io_lock(&(ipt)->ipt_object) -- cgit v1.2.3