From 082c028624b0f16699d4ea4bd7909c8646598688 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Tue, 23 Sep 2025 17:28:26 -0400 Subject: usr: libc: Add libc syscall interface Signed-off-by: Ian Moffett --- src/sys/include/compat/unix/syscall.h | 11 ----------- src/sys/include/sys/syscall.h | 20 +++++++++++++++++--- 2 files changed, 17 insertions(+), 14 deletions(-) (limited to 'src/sys/include') diff --git a/src/sys/include/compat/unix/syscall.h b/src/sys/include/compat/unix/syscall.h index a3e7257..88c86ba 100644 --- a/src/sys/include/compat/unix/syscall.h +++ b/src/sys/include/compat/unix/syscall.h @@ -34,17 +34,6 @@ #include #include -/* - * Default syscall numbers - * - * Defines marked as (mandatory) must be implemented - * between latches. - */ -#define SYS_none 0x00 -#define SYS_exit 0x01 -#define SYS_write 0x02 -#define SYS_cross 0x03 /* cross a border (mandatory) */ - /* * Exit the current process - exit(2) syscall */ diff --git a/src/sys/include/sys/syscall.h b/src/sys/include/sys/syscall.h index 9d9c765..3f8ab10 100644 --- a/src/sys/include/sys/syscall.h +++ b/src/sys/include/sys/syscall.h @@ -32,6 +32,23 @@ #include #include +#if !defined(_KERNEL) +#include +#endif /* _!KERNEL */ + +/* + * Default syscall numbers + * + * Defines marked as (mandatory) must be implemented + * between latches. + */ +#define SYS_none 0x00 +#define SYS_exit 0x01 +#define SYS_write 0x02 +#define SYS_cross 0x03 /* cross a border (mandatory) */ + +typedef __ssize_t scret_t; +typedef __ssize_t scarg_t; #if defined(_KERNEL) /* @@ -39,9 +56,6 @@ */ #define SCARG(SCARGS, TYPE, SYSNO) ((TYPE)(SCARGS)->arg[(SYSNO)]) -typedef ssize_t scret_t; -typedef ssize_t scarg_t; - struct syscall_args { scarg_t arg[6]; struct trapframe *tf; -- cgit v1.2.3