2022-09-29 17:17:43 +00:00
|
|
|
#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
|
2022-09-29 18:06:18 +00:00
|
|
|
#define SYS_paint 4
|
2022-10-18 15:36:17 +00:00
|
|
|
#define SYS_getprocid 5
|
2022-10-15 11:04:48 +00:00
|
|
|
#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
|
2022-10-15 11:17:26 +00:00
|
|
|
#define SYS_clock 15
|
2022-10-17 17:55:01 +00:00
|
|
|
#define SYS_mkdir 16
|
|
|
|
#define SYS_fork 17
|
2022-10-18 19:30:52 +00:00
|
|
|
#define SYS_waitpid 18
|
2022-10-20 17:03:24 +00:00
|
|
|
#define SYS_access 19
|
2022-10-21 16:31:09 +00:00
|
|
|
#define SYS_fstat 20
|
2022-10-22 12:26:29 +00:00
|
|
|
#define SYS_pstat 21
|
2022-10-23 12:03:46 +00:00
|
|
|
#define SYS_getdents 22
|
2022-10-21 16:31:09 +00:00
|
|
|
|
|
|
|
struct stat;
|
2022-10-22 12:26:29 +00:00
|
|
|
struct pstat;
|
2022-10-23 12:03:46 +00:00
|
|
|
struct luna_dirent;
|
2022-09-29 17:17:43 +00:00
|
|
|
|
|
|
|
namespace Syscall
|
|
|
|
{
|
|
|
|
void entry(Context* context);
|
|
|
|
}
|
|
|
|
|
2022-10-08 15:56:40 +00:00
|
|
|
void sys_exit(Context* context, int status);
|
2022-09-29 17:17:43 +00:00
|
|
|
void sys_yield(Context* context);
|
|
|
|
void sys_sleep(Context* context, uint64_t ms);
|
2022-10-11 19:06:12 +00:00
|
|
|
void sys_write(Context* context, int fd, size_t size, const char* addr);
|
2022-09-29 18:06:18 +00:00
|
|
|
void sys_paint(Context* context, uint64_t x, uint64_t y, uint64_t w, uint64_t h, uint64_t col);
|
2022-10-18 15:36:17 +00:00
|
|
|
void sys_getprocid(Context* context, int field);
|
2022-10-15 10:57:14 +00:00
|
|
|
void sys_mmap(Context* context, void* address, size_t size, int prot);
|
2022-10-10 18:21:39 +00:00
|
|
|
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);
|
2022-10-12 13:28:52 +00:00
|
|
|
void sys_close(Context* context, int fd);
|
2022-10-12 15:42:01 +00:00
|
|
|
void sys_seek(Context* context, int fd, long offset, int whence);
|
2022-10-15 08:56:06 +00:00
|
|
|
void sys_exec(Context* context, const char* pathname);
|
2022-10-15 10:57:14 +00:00
|
|
|
void sys_fcntl(Context* context, int fd, int command, uintptr_t arg);
|
2022-10-15 11:17:26 +00:00
|
|
|
void sys_mprotect(Context* context, void* address, size_t size, int prot);
|
2022-10-16 15:22:12 +00:00
|
|
|
void sys_clock(Context* context);
|
2022-10-17 16:43:35 +00:00
|
|
|
void sys_mkdir(Context* context, const char* filename);
|
2022-10-18 19:30:52 +00:00
|
|
|
void sys_fork(Context* context);
|
2022-10-20 17:03:24 +00:00
|
|
|
void sys_waitpid(Context* context, long pid, int* wstatus, int options);
|
2022-10-21 16:31:09 +00:00
|
|
|
void sys_access(Context* context, const char* path, int amode);
|
|
|
|
void sys_fstat(Context* context, int fd, struct stat* buf);
|
2022-10-22 12:26:29 +00:00
|
|
|
void sys_pstat(Context* context, long pid, struct pstat* buf);
|
2022-10-23 12:03:46 +00:00
|
|
|
void sys_getdents(Context* context, int fd, struct luna_dirent* buf, size_t count);
|