56 lines
1.7 KiB
C
56 lines
1.7 KiB
C
// 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 {
|
|
SYSCALLS_FILES = 0x00,
|
|
SYSCALLS_MEMORY = 0x01,
|
|
SYSCALLS_PROC = 0x02,
|
|
SYSCALLS_DRIVERS = 0x03,
|
|
|
|
SYSCALLS_KERNEL = 0xFF
|
|
}syscall_group_E;
|
|
|
|
typedef enum {
|
|
SYSCALL_NX_FS_OPEN = 0x0001,
|
|
SYSCALL_NX_FS_CLOSE = 0x0002,
|
|
SYSCALL_NX_FS_READ = 0x0003,
|
|
SYSCALL_NX_FS_WRITE = 0x0004,
|
|
SYSCALL_NX_FS_DELETE = 0x0005,
|
|
SYSCALL_NX_FS_LIST = 0x0006,
|
|
SYSCALL_NX_FS_INFO = 0x0007,
|
|
|
|
SYSCALL_NX_MEM_ALLOC = 0x0101,
|
|
SYSCALL_NX_MEM_FREE = 0x0102,
|
|
SYSCALL_NX_MEM_LABEL = 0x0103,
|
|
SYSCALL_NX_MEM_UNLABEL = 0x0104,
|
|
|
|
SYSCALL_NX_PROC_CREATE = 0x0201,
|
|
SYSCALL_NX_PROC_SIGNAL_SEND = 0x0202,
|
|
SYSCALL_NX_PROC_SIGNAL_SET_HANDLER = 0x0203,
|
|
SYSCALL_NX_PROC_THREAD_CREATE = 0x0204,
|
|
SYSCALL_NX_PROC_THREAD_START = 0x0205,
|
|
SYSCALL_NX_PROC_THREAD_PAUSE = 0x0206,
|
|
SYSCALL_NX_PROC_THREAD_KILL = 0x0207,
|
|
|
|
SYSCALL_NX_DRV_REGISTER = 0x0301,
|
|
|
|
SYSCALL_NX_KERNEL_SCHEDULER_START = 0xFF00,
|
|
SYSCALL_NX_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
|