60 lines
2.0 KiB
C++
60 lines
2.0 KiB
C++
#pragma once
|
|
#include "interrupts/Context.h"
|
|
#include <stddef.h>
|
|
|
|
#define SYS_exit 0
|
|
#define SYS_yield 1
|
|
#define SYS_sleep 2
|
|
#define SYS_write 3
|
|
#define SYS_paint 4
|
|
#define SYS_getprocid 5
|
|
#define SYS_mmap 6
|
|
#define SYS_munmap 7
|
|
#define SYS_open 8
|
|
#define SYS_read 9
|
|
#define SYS_close 10
|
|
#define SYS_seek 11
|
|
#define SYS_exec 12
|
|
#define SYS_fcntl 13
|
|
#define SYS_mprotect 14
|
|
#define SYS_clock 15
|
|
#define SYS_mkdir 16
|
|
#define SYS_fork 17
|
|
#define SYS_waitpid 18
|
|
#define SYS_access 19
|
|
#define SYS_fstat 20
|
|
#define SYS_pstat 21
|
|
#define SYS_getdents 22
|
|
|
|
struct stat;
|
|
struct pstat;
|
|
struct luna_dirent;
|
|
|
|
namespace Syscall
|
|
{
|
|
void entry(Context* context);
|
|
}
|
|
|
|
void sys_exit(Context* context, int status);
|
|
void sys_yield(Context* context);
|
|
void sys_sleep(Context* context, uint64_t ms);
|
|
void sys_write(Context* context, int fd, size_t size, const char* addr);
|
|
void sys_paint(Context* context, uint64_t x, uint64_t y, uint64_t w, uint64_t h, uint64_t col);
|
|
void sys_getprocid(Context* context, int field);
|
|
void sys_mmap(Context* context, void* address, size_t size, int prot);
|
|
void sys_munmap(Context* context, void* address, size_t size);
|
|
void sys_open(Context* context, const char* filename, int flags);
|
|
void sys_read(Context* context, int fd, size_t size, char* buffer);
|
|
void sys_close(Context* context, int fd);
|
|
void sys_seek(Context* context, int fd, long offset, int whence);
|
|
void sys_exec(Context* context, const char* pathname);
|
|
void sys_fcntl(Context* context, int fd, int command, uintptr_t arg);
|
|
void sys_mprotect(Context* context, void* address, size_t size, int prot);
|
|
void sys_clock(Context* context);
|
|
void sys_mkdir(Context* context, const char* filename);
|
|
void sys_fork(Context* context);
|
|
void sys_waitpid(Context* context, long pid, int* wstatus, int options);
|
|
void sys_access(Context* context, const char* path, int amode);
|
|
void sys_fstat(Context* context, int fd, struct stat* buf);
|
|
void sys_pstat(Context* context, long pid, struct pstat* buf);
|
|
void sys_getdents(Context* context, int fd, struct luna_dirent* buf, size_t count); |