[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 08/15] use port name type in mach_port_names()
From: |
Luca Dariz |
Subject: |
[PATCH 08/15] use port name type in mach_port_names() |
Date: |
Tue, 28 Jun 2022 12:10:47 +0200 |
* ipc/mach_port.c: use mach_port_name_t instead of mach_port_t, since
they could have different size. Fortunately we can keep the same
optimization about allocationg memory, since mach_port_type_t has
the same size as a name.
Signed-off-by: Luca Dariz <luca@orpolo.org>
---
ipc/mach_port.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/ipc/mach_port.c b/ipc/mach_port.c
index 0757bb84..54e2e09f 100644
--- a/ipc/mach_port.c
+++ b/ipc/mach_port.c
@@ -74,7 +74,7 @@ mach_port_names_helper(
ipc_port_timestamp_t timestamp,
ipc_entry_t entry,
mach_port_t name,
- mach_port_t *names,
+ mach_port_name_t *names,
mach_port_type_t *types,
ipc_entry_num_t *actualp)
{
@@ -145,14 +145,14 @@ mach_port_names_helper(
kern_return_t
mach_port_names(
ipc_space_t space,
- mach_port_t **namesp,
+ mach_port_name_t **namesp,
mach_msg_type_number_t *namesCnt,
mach_port_type_t **typesp,
mach_msg_type_number_t *typesCnt)
{
ipc_entry_num_t actual; /* this many names */
ipc_port_timestamp_t timestamp; /* logical time of this operation */
- mach_port_t *names;
+ mach_port_name_t *names;
mach_port_type_t *types;
kern_return_t kr;
@@ -163,7 +163,7 @@ mach_port_names(
vm_map_copy_t memory2; /* copied-in memory, for types */
/* safe simplifying assumption */
- assert_static(sizeof(mach_port_t) == sizeof(mach_port_type_t));
+ assert_static(sizeof(mach_port_name_t) == sizeof(mach_port_type_t));
if (space == IS_NULL)
return KERN_INVALID_TASK;
@@ -225,7 +225,7 @@ mach_port_names(
}
/* space is read-locked and active */
- names = (mach_port_t *) addr1;
+ names = (mach_port_name_t *) addr1;
types = (mach_port_type_t *) addr2;
actual = 0;
@@ -287,7 +287,7 @@ mach_port_names(
}
}
- *namesp = (mach_port_t *) memory1;
+ *namesp = (mach_port_name_t *) memory1;
*namesCnt = actual;
*typesp = (mach_port_type_t *) memory2;
*typesCnt = actual;
--
2.30.2
- [PATCH 00/15] Add preliminary support for 32-bit userspace on a x86_64 kernel, Luca Dariz, 2022/06/28
- [PATCH 01/15] fix rpc types for KERNEL_USER stubs, Luca Dariz, 2022/06/28
- [PATCH 03/15] fix argument passing to bootstrap modules, Luca Dariz, 2022/06/28
- [PATCH 06/15] kmsg: fix msg body alignment, Luca Dariz, 2022/06/28
- [PATCH 09/15] x86_64: fix exception stack alignment, Luca Dariz, 2022/06/28
- [PATCH 04/15] compute mach port size from the corresponding type, Luca Dariz, 2022/06/28
- [PATCH 05/15] sign-extend mask in vm_map() with 32-bit userspace, Luca Dariz, 2022/06/28
- [PATCH 08/15] use port name type in mach_port_names(),
Luca Dariz <=
- [PATCH 10/15] x86_64: expand and shrink messages in copy{in, out}msg routines, Luca Dariz, 2022/06/28
- [PATCH 02/15] simplify ipc_kmsg_copyout_body() usage, Luca Dariz, 2022/06/28
- [PATCH 07/15] fix host_info structure definition, Luca Dariz, 2022/06/28
- [PATCH 11/15] update syscall signature with rpc_vm_* and mach_port_name_t, Luca Dariz, 2022/06/28
- [PATCH 15/15] enable syscalls on x86_64, Luca Dariz, 2022/06/28
- [PATCH 14/15] hack vm memory object proxy creation for vm arrays, Luca Dariz, 2022/06/28
- [PATCH 13/15] cleanup headers in printf.c, Luca Dariz, 2022/06/28
- [PATCH 12/15] fix warnings for 32 bit builds, Luca Dariz, 2022/06/28