diff options
Diffstat (limited to 'src/sys/include/sys/syscall.h')
-rw-r--r-- | src/sys/include/sys/syscall.h | 49 |
1 files changed, 46 insertions, 3 deletions
diff --git a/src/sys/include/sys/syscall.h b/src/sys/include/sys/syscall.h index 108f164..e0891e6 100644 --- a/src/sys/include/sys/syscall.h +++ b/src/sys/include/sys/syscall.h @@ -31,6 +31,7 @@ #define _SYS_SYSCALL_H_ #include <sys/types.h> +#include <sys/limits.h> /* * Syscall numbers @@ -52,9 +53,51 @@ struct syscall_args { struct trapframe *tf; }; -extern scret_t(*g_sctab[])(struct syscall_args *); -extern const size_t MAX_SYSCALLS; +/* Syscall callback */ +typedef scret_t(*sccb_t)(struct syscall_args *); -#endif /* _KERNEL */ +/* + * L5 supports syscall windows in where there can be a + * given set of syscalls and whatever syscall traps into + * kernel space will address the syscalls referenced by the + * current focused window. The window can be slid to change + * the type of syscall interface used by the running application. + * + * @sctab: Syscall table for this window + * @nimpl: The number of syscalls implemented + * @p: Present bit to indicate usability + */ +struct syscall_win { + sccb_t *sctab; + size_t nimpl; + uint8_t p : 1; +}; + +/* + * Valid platform latch constants + */ +typedef enum { + SC_PLATCH_UNIX = 0x00, + SC_PLATCH_L5, + __SC_PLATCH_MAX +} platch_t; +/* + * L5 provides the concept of "syscall domains". A syscall domain + * is a collection of syscall windows along with a sliding index + * known as the platform latch (`platch') to govern which syscall + * interface is to be used. + * + * @slots: List of windows within this domain + * @platch: Platform latch + */ +struct syscall_domain { + struct syscall_win slots[SCWIN_MAX]; + platch_t platch; +}; + +/* Implemented platforms */ +extern scret_t(*g_unix_sctab[])(struct syscall_args *); +extern const size_t UNIX_SCTAB_LEN; +#endif /* _KERNEL */ #endif /* !_SYS_SYSCALL_H_ */ |