apio
f83a6ace51
The exit() libc function already accepted an integer, but didn't pass it on to the kernel since we had no mechanism for it to do that. Now, the kernel stores a task's exit status to display it later (and in the future, return it to userspace via wait()/waitpid())
30 lines
882 B
C++
30 lines
882 B
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_rand 5
|
|
#define SYS_getversion 6
|
|
#define SYS_gettid 7
|
|
#define SYS_mmap 8
|
|
#define SYS_munmap 9
|
|
|
|
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, 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);
|
|
void sys_rand(Context* context);
|
|
void sys_getversion(Context* context, char* buffer, size_t max);
|
|
void sys_gettid(Context* context);
|
|
void sys_mmap(Context* context, void* address, size_t size, int flags);
|
|
void sys_munmap(Context* context, void* address, size_t size); |