aboutsummaryrefslogtreecommitdiff
path: root/ipc/ipc_right.c
diff options
context:
space:
mode:
authorFlavio Cruz <flaviocruz@gmail.com>2022-11-30 02:14:20 -0500
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2022-11-30 22:26:30 +0100
commit958686efa2175abe3f7044890c2c2370e29147f2 (patch)
treef4052284d57e063d7f1b3583a3b8a387cba0cd3f /ipc/ipc_right.c
parent0afd533bfef628d0ef8476bbaaab78c6a1336873 (diff)
downloadgnumach-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_right.c')
-rw-r--r--ipc/ipc_right.c74
1 files changed, 37 insertions, 37 deletions
diff --git a/ipc/ipc_right.c b/ipc/ipc_right.c
index 773b3b10..b62c9314 100644
--- a/ipc/ipc_right.c
+++ b/ipc/ipc_right.c
@@ -65,9 +65,9 @@
kern_return_t
ipc_right_lookup_write(
- ipc_space_t space,
- mach_port_t name,
- ipc_entry_t *entryp)
+ ipc_space_t space,
+ mach_port_name_t name,
+ ipc_entry_t *entryp)
{
ipc_entry_t entry;
@@ -105,11 +105,11 @@ boolean_t
ipc_right_reverse(
ipc_space_t space,
ipc_object_t object,
- mach_port_t *namep,
+ mach_port_name_t *namep,
ipc_entry_t *entryp)
{
ipc_port_t port;
- mach_port_t name;
+ mach_port_name_t name;
ipc_entry_t entry;
/* would switch on io_otype to handle multiple types of object */
@@ -184,11 +184,11 @@ ipc_right_reverse(
kern_return_t
ipc_right_dnrequest(
- ipc_space_t space,
- mach_port_t name,
- boolean_t immediate,
- ipc_port_t notify,
- ipc_port_t *previousp)
+ ipc_space_t space,
+ mach_port_name_t name,
+ boolean_t immediate,
+ ipc_port_t notify,
+ ipc_port_t *previousp)
{
ipc_port_t previous;
@@ -304,10 +304,10 @@ ipc_right_dnrequest(
ipc_port_t
ipc_right_dncancel(
- ipc_space_t space,
- ipc_port_t port,
- mach_port_t name,
- ipc_entry_t entry)
+ ipc_space_t space,
+ ipc_port_t port,
+ mach_port_name_t name,
+ ipc_entry_t entry)
{
ipc_port_t dnrequest;
@@ -333,7 +333,7 @@ ipc_right_dncancel(
boolean_t
ipc_right_inuse(
ipc_space_t space,
- mach_port_t name,
+ mach_port_name_t name,
ipc_entry_t entry)
{
ipc_entry_bits_t bits = entry->ie_bits;
@@ -362,7 +362,7 @@ boolean_t
ipc_right_check(
ipc_space_t space,
ipc_port_t port,
- mach_port_t name,
+ mach_port_name_t name,
ipc_entry_t entry)
{
ipc_entry_bits_t bits;
@@ -431,7 +431,7 @@ ipc_right_check(
void
ipc_right_clean(
ipc_space_t space,
- mach_port_t name,
+ mach_port_name_t name,
ipc_entry_t entry)
{
ipc_entry_bits_t bits = entry->ie_bits;
@@ -555,9 +555,9 @@ ipc_right_clean(
kern_return_t
ipc_right_destroy(
- ipc_space_t space,
- mach_port_t name,
- ipc_entry_t entry)
+ ipc_space_t space,
+ mach_port_name_t name,
+ ipc_entry_t entry)
{
ipc_entry_bits_t bits = entry->ie_bits;
mach_port_type_t type = IE_BITS_TYPE(bits);
@@ -698,7 +698,7 @@ ipc_right_destroy(
kern_return_t
ipc_right_dealloc(
ipc_space_t space,
- mach_port_t name,
+ mach_port_name_t name,
ipc_entry_t entry)
{
ipc_entry_bits_t bits = entry->ie_bits;
@@ -874,7 +874,7 @@ ipc_right_dealloc(
kern_return_t
ipc_right_delta(
ipc_space_t space,
- mach_port_t name,
+ mach_port_name_t name,
ipc_entry_t entry,
mach_port_right_t right,
mach_port_delta_t delta)
@@ -1196,7 +1196,7 @@ ipc_right_delta(
kern_return_t
ipc_right_info(
ipc_space_t space,
- mach_port_t name,
+ mach_port_name_t name,
ipc_entry_t entry,
mach_port_type_t *typep,
mach_port_urefs_t *urefsp)
@@ -1239,7 +1239,7 @@ ipc_right_info(
boolean_t
ipc_right_copyin_check(
ipc_space_t space,
- mach_port_t name,
+ mach_port_name_t name,
ipc_entry_t entry,
mach_msg_type_name_t msgt_name)
{
@@ -1327,7 +1327,7 @@ ipc_right_copyin_check(
kern_return_t
ipc_right_copyin(
ipc_space_t space,
- mach_port_t name,
+ mach_port_name_t name,
ipc_entry_t entry,
mach_msg_type_name_t msgt_name,
boolean_t deadok,
@@ -1660,7 +1660,7 @@ ipc_right_copyin(
void
ipc_right_copyin_undo(
ipc_space_t space,
- mach_port_t name,
+ mach_port_name_t name,
ipc_entry_t entry,
mach_msg_type_name_t msgt_name,
ipc_object_t object,
@@ -1746,11 +1746,11 @@ ipc_right_copyin_undo(
kern_return_t
ipc_right_copyin_two(
- ipc_space_t space,
- mach_port_t name,
- ipc_entry_t entry,
- ipc_object_t *objectp,
- ipc_port_t *sorightp)
+ ipc_space_t space,
+ mach_port_name_t name,
+ ipc_entry_t entry,
+ ipc_object_t *objectp,
+ ipc_port_t *sorightp)
{
ipc_entry_bits_t bits = entry->ie_bits;
mach_port_urefs_t urefs;
@@ -1846,7 +1846,7 @@ ipc_right_copyin_two(
kern_return_t
ipc_right_copyout(
ipc_space_t space,
- mach_port_t name,
+ mach_port_name_t name,
ipc_entry_t entry,
mach_msg_type_name_t msgt_name,
boolean_t overflow,
@@ -2028,11 +2028,11 @@ ipc_right_copyout_multiname(space, name, entry, object)
kern_return_t
ipc_right_rename(
- ipc_space_t space,
- mach_port_t oname,
- ipc_entry_t oentry,
- mach_port_t nname,
- ipc_entry_t nentry)
+ ipc_space_t space,
+ mach_port_name_t oname,
+ ipc_entry_t oentry,
+ mach_port_name_t nname,
+ ipc_entry_t nentry)
{
ipc_entry_bits_t bits = oentry->ie_bits;
ipc_port_request_index_t request = oentry->ie_request;