diff options
author | Flavio Cruz <flaviocruz@gmail.com> | 2022-11-30 02:14:20 -0500 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2022-11-30 22:26:30 +0100 |
commit | 958686efa2175abe3f7044890c2c2370e29147f2 (patch) | |
tree | f4052284d57e063d7f1b3583a3b8a387cba0cd3f /ipc/mach_msg.c | |
parent | 0afd533bfef628d0ef8476bbaaab78c6a1336873 (diff) | |
download | gnumach-958686efa2175abe3f7044890c2c2370e29147f2.tar.gz gnumach-958686efa2175abe3f7044890c2c2370e29147f2.tar.bz2 gnumach-958686efa2175abe3f7044890c2c2370e29147f2.zip |
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: <Y4cCzNmc6vC4bjsX@viriathus>
Diffstat (limited to 'ipc/mach_msg.c')
-rw-r--r-- | ipc/mach_msg.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/ipc/mach_msg.c b/ipc/mach_msg.c index 3a75fef6..c4b1fed6 100644 --- a/ipc/mach_msg.c +++ b/ipc/mach_msg.c @@ -93,7 +93,7 @@ mach_msg_send( mach_msg_option_t option, mach_msg_size_t send_size, mach_msg_timeout_t time_out, - mach_port_t notify) + mach_port_name_t notify) { ipc_space_t space = current_space(); vm_map_t map = current_map(); @@ -174,9 +174,9 @@ mach_msg_receive( mach_msg_header_t *msg, mach_msg_option_t option, mach_msg_size_t rcv_size, - mach_port_t rcv_name, + mach_port_name_t rcv_name, mach_msg_timeout_t time_out, - mach_port_t notify) + mach_port_name_t notify) { ipc_thread_t self = current_thread(); ipc_space_t space = current_space(); @@ -384,9 +384,9 @@ mach_msg_trap( mach_msg_option_t option, mach_msg_size_t send_size, mach_msg_size_t rcv_size, - mach_port_t rcv_name, + mach_port_name_t rcv_name, mach_msg_timeout_t time_out, - mach_port_t notify) + mach_port_name_t notify) { mach_msg_return_t mr; @@ -482,7 +482,7 @@ mach_msg_trap( MACH_MSG_TYPE_MAKE_SEND_ONCE): { ipc_port_t reply_port; { - mach_port_t reply_name = + mach_port_name_t reply_name = kmsg->ikm_header.msgh_local_port; if (reply_name != rcv_name) @@ -500,7 +500,7 @@ mach_msg_trap( } { - mach_port_t dest_name = + mach_port_name_t dest_name = kmsg->ikm_header.msgh_remote_port; ipc_entry_t entry; @@ -602,7 +602,7 @@ mach_msg_trap( /* sending a reply message */ { - mach_port_t reply_name = + mach_port_name_t reply_name = kmsg->ikm_header.msgh_local_port; if (reply_name != MACH_PORT_NULL) @@ -614,7 +614,7 @@ mach_msg_trap( { ipc_entry_t entry; - mach_port_t dest_name = + mach_port_name_t dest_name = kmsg->ikm_header.msgh_remote_port; entry = ipc_entry_lookup (space, dest_name); @@ -950,7 +950,7 @@ mach_msg_trap( MACH_MSG_TYPE_PORT_SEND_ONCE): { ipc_port_t reply_port = (ipc_port_t) kmsg->ikm_header.msgh_local_port; - mach_port_t dest_name, reply_name; + mach_port_name_t dest_name, reply_name; unsigned long payload; /* receiving a request message */ @@ -1055,7 +1055,7 @@ mach_msg_trap( } case MACH_MSGH_BITS(MACH_MSG_TYPE_PORT_SEND_ONCE, 0): { - mach_port_t dest_name; + mach_port_name_t dest_name; unsigned long payload; /* receiving a reply message */ @@ -1100,7 +1100,7 @@ mach_msg_trap( case MACH_MSGH_BITS_COMPLEX| MACH_MSGH_BITS(MACH_MSG_TYPE_PORT_SEND_ONCE, 0): { - mach_port_t dest_name; + mach_port_name_t dest_name; unsigned long payload; /* receiving a complex reply message */ |