mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 08:24:32 -08:00
Improve syscall definitions
- Allow constant id specification - Define function signature in SYSCALL macro - Move implementation into src/kernel/syscalls/*.cpp
This commit is contained in:
@@ -6,12 +6,20 @@ struct cpu_state;
|
||||
|
||||
enum class syscall : uint64_t
|
||||
{
|
||||
#define SYSCALL(name, nargs) name ,
|
||||
#define SYSCALL(id, name, result, ...) name = id,
|
||||
#include "syscalls.inc"
|
||||
#undef SYSCALL
|
||||
|
||||
COUNT
|
||||
// Maximum syscall id. If you change this, also change
|
||||
// MAX_SYSCALLS in syscall.s
|
||||
MAX = 64
|
||||
};
|
||||
|
||||
void syscall_enable();
|
||||
extern "C" void syscall_invalid(uint64_t call);
|
||||
|
||||
namespace syscalls
|
||||
{
|
||||
#define SYSCALL(id, name, result, ...) result name (__VA_ARGS__);
|
||||
#include "syscalls.inc"
|
||||
#undef SYSCALL
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user