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/ipc_port.h | |
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/ipc_port.h')
-rw-r--r-- | ipc/ipc_port.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/ipc/ipc_port.h b/ipc/ipc_port.h index ade69679..b0433876 100644 --- a/ipc/ipc_port.h +++ b/ipc/ipc_port.h @@ -137,7 +137,7 @@ typedef struct ipc_port_request { } notify; union { - mach_port_t name; + mach_port_name_t name; struct ipc_table_size *size; } name; } *ipc_port_request_t; @@ -208,14 +208,14 @@ ipc_port_timestamp(void); (ipc_object_t *) (portp)) extern kern_return_t -ipc_port_dnrequest(ipc_port_t, mach_port_t, ipc_port_t, +ipc_port_dnrequest(ipc_port_t, mach_port_name_t, ipc_port_t, ipc_port_request_index_t *); extern kern_return_t ipc_port_dngrow(ipc_port_t); extern ipc_port_t -ipc_port_dncancel(ipc_port_t, mach_port_t, ipc_port_request_index_t); +ipc_port_dncancel(ipc_port_t, mach_port_name_t, ipc_port_request_index_t); #define ipc_port_dnrename(port, index, oname, nname) \ MACRO_BEGIN \ @@ -273,13 +273,13 @@ extern void ipc_port_clear_receiver(ipc_port_t); extern void -ipc_port_init(ipc_port_t, ipc_space_t, mach_port_t); +ipc_port_init(ipc_port_t, ipc_space_t, mach_port_name_t); extern kern_return_t -ipc_port_alloc(ipc_space_t, mach_port_t *, ipc_port_t *); +ipc_port_alloc(ipc_space_t, mach_port_name_t *, ipc_port_t *); extern kern_return_t -ipc_port_alloc_name(ipc_space_t, mach_port_t, ipc_port_t *); +ipc_port_alloc_name(ipc_space_t, mach_port_name_t, ipc_port_t *); extern void ipc_port_destroy(ipc_port_t); @@ -288,7 +288,7 @@ extern boolean_t ipc_port_check_circularity(ipc_port_t, ipc_port_t); extern ipc_port_t -ipc_port_lookup_notify(ipc_space_t, mach_port_t); +ipc_port_lookup_notify(ipc_space_t, mach_port_name_t); extern ipc_port_t ipc_port_make_send(ipc_port_t); @@ -296,7 +296,7 @@ ipc_port_make_send(ipc_port_t); extern ipc_port_t ipc_port_copy_send(ipc_port_t); -extern mach_port_t +extern mach_port_name_t ipc_port_copyout_send(ipc_port_t, ipc_space_t); extern void |