[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 01/15] fix rpc types for KERNEL_USER stubs
From: |
Luca Dariz |
Subject: |
[PATCH 01/15] fix rpc types for KERNEL_USER stubs |
Date: |
Tue, 28 Jun 2022 12:10:40 +0200 |
* include/mach/mach_types.defs: use rpc_ vm types for KERNEL_USER stubs.
This change fixes two use cases:
* internal rpc, e.g. when a memory object is initialized as a
consequence of vm_map(); for example, the bootstrap modules use the
"time" kernel device and memory-map it during startup. This
triggers a kernel-side rpc to initialize the memory object and
install the map, which is completely transparent form user-space.
* notifications from kernel to user-space
Signed-off-by: Luca Dariz <luca@orpolo.org>
---
include/mach/mach_types.defs | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/include/mach/mach_types.defs b/include/mach/mach_types.defs
index a271d597..5c9fb2a8 100644
--- a/include/mach/mach_types.defs
+++ b/include/mach/mach_types.defs
@@ -110,9 +110,9 @@ type ipc_space_t = mach_port_t
#endif /* KERNEL_SERVER */
;
-#if defined(KERNEL_SERVER) && defined(USER32)
+#if defined(KERNEL) && defined(USER32)
type rpc_vm_size_t = uint32_t;
-#else /* KERNEL_SERVER and USER32 */
+#else /* KERNEL and USER32 */
#if defined(__x86_64__)
type rpc_vm_size_t = uint64_t;
#else /* __x86_64__ */
@@ -121,21 +121,27 @@ type rpc_vm_size_t = uint32_t;
#endif /* KERNEL_SERVER and USER32 */
type vm_address_t = rpc_vm_size_t
-#if defined(KERNEL_SERVER) || defined(KERNEL_USER)
+#if defined(KERNEL_SERVER)
intran: vm_address_t convert_vm_from_user(rpc_vm_address_t)
outtran: rpc_vm_address_t convert_vm_to_user(vm_address_t)
+#elif defined(KERNEL_USER)
+ ctype: rpc_vm_address_t
#endif
;
type vm_offset_t = rpc_vm_size_t
-#if defined(KERNEL_SERVER) || defined(KERNEL_USER)
+#if defined(KERNEL_SERVER)
intran: vm_offset_t convert_vm_from_user(rpc_vm_offset_t)
outtran: rpc_vm_offset_t convert_vm_to_user(vm_offset_t)
+#elif defined(KERNEL_USER)
+ ctype: rpc_vm_offset_t
#endif
;
type vm_size_t = rpc_vm_size_t
-#if defined(KERNEL_SERVER) || defined(KERNEL_USER)
+#if defined(KERNEL_SERVER)
intran: vm_size_t convert_vm_from_user(rpc_vm_size_t)
outtran: rpc_vm_size_t convert_vm_to_user(vm_size_t)
+#elif defined(KERNEL_USER)
+ ctype: rpc_vm_size_t
#endif
;
type vm_prot_t = int;
--
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 <=
- [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, 2022/06/28
- [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