Files
jsix/src/kernel/syscall.h
Justin C. Miller 8375870af6 Improve syscall definitions
- Allow constant id specification
- Define function signature in SYSCALL macro
- Move implementation into src/kernel/syscalls/*.cpp
2019-04-03 10:03:15 -07:00

26 lines
428 B
C++

#pragma once
#include <stdint.h>
struct cpu_state;
enum class syscall : uint64_t
{
#define SYSCALL(id, name, result, ...) name = id,
#include "syscalls.inc"
#undef SYSCALL
// Maximum syscall id. If you change this, also change
// MAX_SYSCALLS in syscall.s
MAX = 64
};
void syscall_enable();
namespace syscalls
{
#define SYSCALL(id, name, result, ...) result name (__VA_ARGS__);
#include "syscalls.inc"
#undef SYSCALL
}