[PATCH] Add kern/mach.h and kern/gnumach.h to define rpc prototypes

2023-01-16 Thread Flavio Cruz
This will remove more warnings for -Wmissing-prototypes. --- Makefrag.am | 2 + kern/gnumach.h | 62 +++ kern/ipc_tt.c| 1 + kern/mach.h | 223 +++ kern/mach_host.h | 9 ++ kern/slab.c

[PATCH] Delete x86 string functions

2023-01-16 Thread Flavio Cruz
The i386 functions are not used and the more portable versions in kern/strings.c are faster (1-4x faster in synthetic benchmarks compiled with -O2 on my x86_64 box). --- i386/i386/strings.c | 54 - 1 file changed, 54 deletions(-) diff --git a/i386/i386

[PATCH] Delete util/putchar.{c,h} and util/puts.c

2023-01-16 Thread Flavio Cruz
Those functions are unused. --- Makefrag.am| 3 --- util/putchar.c | 32 util/putchar.h | 32 util/puts.c| 40 4 files changed, 107 deletions(-) delete mode 100644 util/putchar.c d

Re: [PATCH] Add host_get_time64 RPC to return the time as time_value64_t.

2023-01-16 Thread Samuel Thibault
Flavio Cruz, le ven. 13 janv. 2023 03:27:05 -0500, a ecrit: > #define time_value64_assert(val) \ > - assert(0 <= (val)->nanoseconds && (val)->nanoseconds < TIME_NANOS_MAX); > + assert(0 <= (val).nanoseconds && (val).nanoseconds < TIME_NANOS_MAX); [...] > +#define time_va

Re: [PATCH 1/4] add missing argument names

2023-01-16 Thread Samuel Thibault
Applied the series, thanks! Samuel

[PATCH 1/4] add missing argument names

2023-01-16 Thread Luca Dariz
* ddb/db_break.c: add argument name, compilation fails on Debian/Linux stable with gcc 10.2 otherwise. For some reason on Debian/Hurd a simple test program without argname succeeds, unless I force -std=c11 or similar; I suppose because newer gcc have different defaults. Gnumach seem to stil

[PATCH 4/4] fix warnings

2023-01-16 Thread Luca Dariz
* ipc/ipc_kmsg.c: fix cast to the correct pointer type * ipc/ipc_port.c: upcast rpc_vm_offset_t to full vm_offset_t * kern/pc_sample.c: Likewise --- ipc/ipc_kmsg.c | 5 ++--- ipc/ipc_port.c | 2 +- kern/pc_sample.c | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ipc/ipc_

[PATCH 2/4] add required include

2023-01-16 Thread Luca Dariz
* kern/syscall_sw.h: add missing include Signed-off-by: Luca Dariz --- kern/syscall_sw.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kern/syscall_sw.h b/kern/syscall_sw.h index 34eaf90b..9e76fc60 100644 --- a/kern/syscall_sw.h +++ b/kern/syscall_sw.h @@ -27,6 +27,8 @@ #ifndef_

[PATCH 3/4] remove unused file ipc/mach_rpc.c

2023-01-16 Thread Luca Dariz
* Makefrag.am: remove ipc/mach_rpc.c * ipc/mach_rpc.c: remove file, all functions here seem unused. --- Makefrag.am| 1 - ipc/mach_rpc.c | 150 - 2 files changed, 151 deletions(-) delete mode 100644 ipc/mach_rpc.c diff --git a/Makefrag.am b/M

[PATCH 0/7] update rpc for x86_64

2023-01-16 Thread Luca Dariz
These patches address the comments raised in the previous submission and add support for 32-bit rpc and syscalls on a 64-bit kernel. Luca Dariz (7): add msg_user_header_t for user-side msg structure x86_64: expand and shrink messages in copy{in,out}msg routines update syscall signature with

[PATCH 4/7] update writev syscall signature with rpc types

2023-01-16 Thread Luca Dariz
* device/device_emul.h: write/writev: update trap argument types * device/ds_routines.c: update argument types and adjust copyin * device/ds_routines.h: write/writev: update trap argument type * include/device/device_types.h: add rpc_io_buf_vec_t type * kern/ipc_mig.c: write/writev: update trap arg

[PATCH 1/7] add msg_user_header_t for user-side msg structure

2023-01-16 Thread Luca Dariz
* include/mach/message.h: use mach_msg_user_header_t only in KERNEL, and define it as mach_msh_header_t for user space * ipc/ipc_kmsg.c: use mach_msg_user_header_t where appropriate * ipc/ipc_kmsg.h: Likewise * ipc/mach_msg.c: Likewise * ipc/mach_msg.h: Likewise * kern/thread.h: Likewise --- inc

[PATCH 6/7] add conversion helpers for invalid mach port names

2023-01-16 Thread Luca Dariz
* include/mach/port.h: add _NAME_ variants for port NULL and DEAD and add helpers to check for invalid port names * ipc/port.h: add helpers to properly convert to/from invalid mach port names. --- include/mach/port.h | 8 ++-- ipc/port.h | 20 2 files change

[PATCH 5/7] adjust rdxtree key to the correct size

2023-01-16 Thread Luca Dariz
* Makefile.am: define RDXTREE_KEY_32 --- Makefile.am | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile.am b/Makefile.am index fb557ba6..54fcf685 100644 --- a/Makefile.am +++ b/Makefile.am @@ -82,6 +82,9 @@ endif # We do not support or need position-independent AM_CFLAGS += \

[PATCH 7/7] replace mach_port_t with mach_port_name_t

2023-01-16 Thread Luca Dariz
This is a cleanup following the introduction of mach_port_name_t. The same set of changes is applied to all files: - rename mach_port_t to mach_port_name_t where a port name is used, - use MACH_PORT_NAME_NULL and MACH_PORT_NAME_DEAD where appropriate, - use invalid_port_to_name() and invalid_name_t

[PATCH 3/7] update syscall signature with rpc_vm_* and mach_port_name_t

2023-01-16 Thread Luca Dariz
* include/mach/mach_types.h: use mach port names * kern/ipc_mig.c: update vm types and use copyin/copyout helpers * kern/ipc_mig.h: Likewise Signed-off-by: Luca Dariz --- include/mach/mach_traps.h | 18 - kern/ipc_mig.c| 41 +-- ke

[PATCH 2/7] x86_64: expand and shrink messages in copy{in, out}msg routines

2023-01-16 Thread Luca Dariz
* i386/i386/copy_user.h: new file to handle 32/64 bit differences - add msg_usize() to recontruct the user-space message size - add copyin/copyout helpers for addresses and ports * include/mach/message.h: add msg alignment macros * ipc/ipc_kmsg.c: - copyin/out ports names instead of using poi