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: --- kern/exception.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'kern/exception.c') diff --git a/kern/exception.c b/kern/exception.c index 6a812490..2ff122f2 100644 --- a/kern/exception.c +++ b/kern/exception.c @@ -269,9 +269,9 @@ exception_no_server(void) struct mach_exception { mach_msg_header_t Head; mach_msg_type_t threadType; - mach_port_t thread; + mach_port_name_t thread; mach_msg_type_t taskType; - mach_port_t task; + mach_port_name_t task; mach_msg_type_t exceptionType; integer_t exception; mach_msg_type_t codeType; @@ -607,10 +607,12 @@ exception_raise( { kern_return_t kr; ipc_entry_t entry; + mach_port_name_t port_name; - kr = ipc_entry_get (space, &exc->Head.msgh_remote_port, &entry); + kr = ipc_entry_get (space, &port_name, &entry); if (kr) goto abort_copyout; + exc->Head.msgh_remote_port = (mach_port_t) port_name; { mach_port_gen_t gen; -- cgit v1.2.3