2022-09-29 19:17:43 +02:00
|
|
|
#pragma once
|
|
|
|
#include "interrupts/Context.h"
|
|
|
|
#include <stddef.h>
|
2022-10-27 07:52:57 +02:00
|
|
|
#include <sys/types.h>
|
2022-09-29 19:17:43 +02:00
|
|
|
|
|
|
|
#define SYS_exit 0
|
|
|
|
#define SYS_yield 1
|
|
|
|
#define SYS_sleep 2
|
|
|
|
#define SYS_write 3
|
2022-11-02 20:35:06 +01:00
|
|
|
#define SYS_getprocid 4
|
|
|
|
#define SYS_mmap 5
|
|
|
|
#define SYS_munmap 6
|
|
|
|
#define SYS_open 7
|
|
|
|
#define SYS_read 8
|
|
|
|
#define SYS_close 9
|
|
|
|
#define SYS_seek 10
|
|
|
|
#define SYS_execv 11
|
|
|
|
#define SYS_fcntl 12
|
|
|
|
#define SYS_mprotect 13
|
|
|
|
#define SYS_clock_gettime 14
|
|
|
|
#define SYS_mkdir 15
|
|
|
|
#define SYS_fork 16
|
|
|
|
#define SYS_waitpid 17
|
|
|
|
#define SYS_access 18
|
|
|
|
#define SYS_fstat 19
|
|
|
|
#define SYS_pstat 20
|
|
|
|
#define SYS_getdents 21
|
|
|
|
#define SYS_stat 22
|
|
|
|
#define SYS_dup2 23
|
|
|
|
#define SYS_setuid 24
|
|
|
|
#define SYS_setgid 25
|
|
|
|
#define SYS_umask 26
|
2022-11-02 20:59:42 +01:00
|
|
|
#define SYS_ioctl 27
|
2022-11-09 09:54:07 +01:00
|
|
|
#define SYS_seteuid 28
|
|
|
|
#define SYS_setegid 29
|
2022-10-21 18:31:09 +02:00
|
|
|
|
|
|
|
struct stat;
|
2022-10-22 14:26:29 +02:00
|
|
|
struct pstat;
|
2022-10-23 14:03:46 +02:00
|
|
|
struct luna_dirent;
|
2022-10-30 09:07:59 +01:00
|
|
|
struct timespec;
|
2022-09-29 19:17:43 +02:00
|
|
|
|
|
|
|
namespace Syscall
|
|
|
|
{
|
|
|
|
void entry(Context* context);
|
|
|
|
}
|
|
|
|
|
2022-10-08 17:56:40 +02:00
|
|
|
void sys_exit(Context* context, int status);
|
2022-09-29 19:17:43 +02:00
|
|
|
void sys_yield(Context* context);
|
|
|
|
void sys_sleep(Context* context, uint64_t ms);
|
2022-10-11 21:06:12 +02:00
|
|
|
void sys_write(Context* context, int fd, size_t size, const char* addr);
|
2022-10-18 17:36:17 +02:00
|
|
|
void sys_getprocid(Context* context, int field);
|
2022-11-02 20:24:07 +01:00
|
|
|
void sys_mmap(Context* context, void* address, size_t size, int prot, int fd, off_t offset);
|
2022-10-10 20:21:39 +02:00
|
|
|
void sys_munmap(Context* context, void* address, size_t size);
|
2022-10-27 07:52:57 +02:00
|
|
|
void sys_open(Context* context, const char* filename, int flags, mode_t mode);
|
2022-10-10 20:21:39 +02:00
|
|
|
void sys_read(Context* context, int fd, size_t size, char* buffer);
|
2022-10-12 15:28:52 +02:00
|
|
|
void sys_close(Context* context, int fd);
|
2022-10-12 17:42:01 +02:00
|
|
|
void sys_seek(Context* context, int fd, long offset, int whence);
|
2022-10-26 18:57:06 +02:00
|
|
|
void sys_execv(Context* context, const char* pathname, char** argv);
|
2022-10-15 12:57:14 +02:00
|
|
|
void sys_fcntl(Context* context, int fd, int command, uintptr_t arg);
|
2022-10-15 13:17:26 +02:00
|
|
|
void sys_mprotect(Context* context, void* address, size_t size, int prot);
|
2022-10-30 09:07:59 +01:00
|
|
|
void sys_clock_gettime(Context* context, int clock_id, struct timespec* tp);
|
2022-10-28 17:11:35 +02:00
|
|
|
void sys_mkdir(Context* context, const char* filename, mode_t mode);
|
2022-10-18 21:30:52 +02:00
|
|
|
void sys_fork(Context* context);
|
2022-10-20 19:03:24 +02:00
|
|
|
void sys_waitpid(Context* context, long pid, int* wstatus, int options);
|
2022-10-21 18:31:09 +02:00
|
|
|
void sys_access(Context* context, const char* path, int amode);
|
|
|
|
void sys_fstat(Context* context, int fd, struct stat* buf);
|
2022-10-22 14:26:29 +02:00
|
|
|
void sys_pstat(Context* context, long pid, struct pstat* buf);
|
2022-10-23 18:35:32 +02:00
|
|
|
void sys_getdents(Context* context, int fd, struct luna_dirent* buf, size_t count);
|
2022-10-25 18:58:06 +02:00
|
|
|
void sys_stat(Context* context, const char* path, struct stat* buf);
|
2022-10-28 17:19:26 +02:00
|
|
|
void sys_dup2(Context* context, int fd, int fd2);
|
2022-11-09 09:54:07 +01:00
|
|
|
void sys_setuid(Context* context, uid_t uid);
|
|
|
|
void sys_setgid(Context* context, gid_t gid);
|
2022-11-02 20:59:42 +01:00
|
|
|
void sys_umask(Context* context, mode_t cmask);
|
2022-11-09 09:54:07 +01:00
|
|
|
void sys_ioctl(Context* context, int fd, int request, uintptr_t arg);
|
|
|
|
void sys_seteuid(Context* context, uid_t euid);
|
|
|
|
void sys_setegid(Context* context, gid_t egid);
|