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
|
|
|
|
#define SYS_rand 5
|
2022-10-02 15:25:56 +00:00
|
|
|
#define SYS_getversion 6
|
2022-10-01 15:30:31 +00:00
|
|
|
#define SYS_gettid 7
|
2022-10-02 18:45:04 +00:00
|
|
|
#define SYS_mmap 8
|
|
|
|
#define SYS_munmap 9
|
2022-10-10 18:21:39 +00:00
|
|
|
#define SYS_open 10
|
|
|
|
#define SYS_read 11
|
|
|
|
#define SYS_close 12
|
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-09-29 18:06:18 +00:00
|
|
|
void sys_write(Context* context, const char* addr, size_t size);
|
|
|
|
void sys_paint(Context* context, uint64_t x, uint64_t y, uint64_t w, uint64_t h, uint64_t col);
|
2022-10-01 15:30:31 +00:00
|
|
|
void sys_rand(Context* context);
|
2022-10-02 15:25:56 +00:00
|
|
|
void sys_getversion(Context* context, char* buffer, size_t max);
|
2022-10-02 18:45:04 +00:00
|
|
|
void sys_gettid(Context* context);
|
|
|
|
void sys_mmap(Context* context, void* address, size_t size, int flags);
|
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);
|
|
|
|
void sys_close(Context* context, int fd);
|