mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 08:24:32 -08:00
Since SYSCALL/SYSRET rely on MSRs to control their function, split out syscall_enable() into syscall_initialize() and syscall_enable(), the latter being called on all CPUs. This affects not just syscalls but also the kernel_to_user_trampoline. Additionally, do away with the max syscalls, and just make a single page of syscall pointers and name pointers. Max syscalls was fragile and needed to be kept in sync in multiple places.
24 lines
400 B
C++
24 lines
400 B
C++
#pragma once
|
|
|
|
#include <stdint.h>
|
|
#include "j6/types.h"
|
|
|
|
struct cpu_state;
|
|
|
|
enum class syscall : uint64_t
|
|
{
|
|
#define SYSCALL(id, name, ...) name = id,
|
|
#include "j6/tables/syscalls.inc"
|
|
#undef SYSCALL
|
|
};
|
|
|
|
void syscall_initialize();
|
|
extern "C" void syscall_enable();
|
|
|
|
namespace syscalls
|
|
{
|
|
#define SYSCALL(id, name, ...) j6_status_t name (__VA_ARGS__);
|
|
#include "j6/tables/syscalls.inc"
|
|
#undef SYSCALL
|
|
}
|