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_entry.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'ipc/ipc_entry.h') diff --git a/ipc/ipc_entry.h b/ipc/ipc_entry.h index b429984b..9f7b593e 100644 --- a/ipc/ipc_entry.h +++ b/ipc/ipc_entry.h @@ -55,7 +55,7 @@ typedef unsigned int ipc_entry_bits_t; typedef ipc_table_elems_t ipc_entry_num_t; /* number of entries */ typedef struct ipc_entry { - mach_port_t ie_name; + mach_port_name_t ie_name; ipc_entry_bits_t ie_bits; struct ipc_object *ie_object; union { @@ -97,14 +97,14 @@ extern struct kmem_cache ipc_entry_cache; #define ie_free(e) kmem_cache_free(&ipc_entry_cache, (vm_offset_t) (e)) extern kern_return_t -ipc_entry_alloc(ipc_space_t space, mach_port_t *namep, ipc_entry_t *entryp); +ipc_entry_alloc(ipc_space_t space, mach_port_name_t *namep, ipc_entry_t *entryp); extern kern_return_t -ipc_entry_alloc_name(ipc_space_t space, mach_port_t name, ipc_entry_t *entryp); +ipc_entry_alloc_name(ipc_space_t space, mach_port_name_t name, ipc_entry_t *entryp); ipc_entry_t db_ipc_object_by_name( - task_t task, - mach_port_t name); + task_t task, + mach_port_name_t name); #endif /* _IPC_IPC_ENTRY_H_ */ -- cgit v1.2.3