kernel/inc/platform/syscall.h

71 lines
2.5 KiB
C
Raw Normal View History

// This file is part of noxos and licensed under the MIT open source license
#ifndef NOX_SYSCALL_H
#define NOX_SYSCALL_H
#include "platform/cpu.h"
#include "utils/status.h"
typedef enum {
2023-05-29 13:42:56 +00:00
SYSCALLS_FILES = 0x00,
SYSCALLS_MEMORY = 0x01,
SYSCALLS_PROCESS = 0x02,
SYSCALLS_DRIVER = 0x03,
SYSCALLS_RUNTIME_LINKER = 0x04,
SYSCALLS_COMPATABILITY = 0x05,
SYSCALLS_KERNEL = 0xFF
}syscall_group_E;
typedef enum {
2023-05-29 13:42:56 +00:00
SYSCALL_FILES_OPEN = 0x0001,
SYSCALL_FILES_CLOSE = 0x0002,
SYSCALL_FILES_READ = 0x0003,
SYSCALL_FILES_WRITE = 0x0004,
SYSCALL_FILES_DELETE = 0x0005,
SYSCALL_FILES_LIST = 0x0006,
SYSCALL_FILES_INFO = 0x0007,
2023-05-29 13:42:56 +00:00
SYSCALL_MEMORY_MAP = 0x0101,
SYSCALL_MEMORY_UNMAP = 0x0102,
SYSCALL_MEMORY_LABEL = 0x0103,
SYSCALL_MEMORY_RANGE = 0x0104,
SYSCALL_MEMORY_ACCESS = 0x0105,
2023-05-29 13:42:56 +00:00
SYSCALL_PROCESS_CREATE = 0x0201,
SYSCALL_PROCESS_ENV = 0x0202,
SYSCALL_PROCESS_SIGNAL = 0x0203,
SYSCALL_PROCESS_THREAD_CREATE = 0x0204,
SYSCALL_PROCESS_THREAD_START = 0x0205,
SYSCALL_PROCESS_THREAD_PAUSE = 0x0206,
SYSCALL_PROCESS_THREAD_KILL = 0x0207,
SYSCALL_DRIVER_REGISTER = 0x0301,
SYSCALL_DRIVER_CREATE_COMMAND_BUFFER = 0x0302,
SYSCALL_DRIVER_FLUSH_COMMAND_BUFFER = 0x0303,
SYSCALL_RUNTIME_LINKER_OPEN = 0x7f01,
SYSCALL_RUNTIME_LINKER_CLOSE = 0x7f02,
SYSCALL_RUNTIME_LINKER_LOAD_SYMBOL = 0x7f03,
SYSCALL_RUNTIME_LINKER_STATUS = 0x7f04,
SYSCALL_RUNTIME_LINKER_STANDARD_MOD = 0x7f05,
2023-05-29 13:42:56 +00:00
SYSCALL_COMPATABILITY_ABI_TYPE = 0x0501,
SYSCALL_COMPATABILITY_ABI_VERSION = 0x0502,
SYSCALL_COMPATABILITY_ACTION = 0x0503,
2023-05-29 13:42:56 +00:00
SYSCALL_KERNEL_SCHEDULER_START = 0xFF00,
SYSCALL_KERNEL_PANIC = 0xFF01
} syscall_E;
typedef enum {
SYSCALL_NX_MMAP_FLAG_WRITE,
SYSCALL_NX_MMAP_FLAG_NO_EXEC
} syscall_nx_mmap_flags_E;
extern status_E syscall_perform(syscall_E id, uint64_t arg1, uint64_t arg2, uint64_t arg3, uint64_t arg4);
cpu_state_T* syscall_handle(cpu_state_T* state);
#endif //NOX_SYSCALL_H