Expand description
Implementation of syscalls
The single entry point to all system calls, syscall(), is called
whenever userspace wishes to perform a system call using the ecall
instruction. In this case, the processor raises an ‘Environment call from
U-mode’ exception, which is handled as one of the cases in
crate::trap::trap_handler.
For clarity, each single syscall is implemented as its own function, named
sys_ then the name of the syscall. You can find functions like this in
submodules, and you should also implement syscalls this way.
Modules§
Constants§
- close syscall
- condvar_create syscall
- condvar_signal syscall
- condvar_wait syscallca
- dup syscall
- enable deadlock detect syscall
- exec syscall
- exit syscall
- fork syscall
- fstat syscall
- getpid syscall
- gettid syscall
- gettimeofday syscall
- kill syscall
- linkat syscall
- mmap syscall
- munmap syscall
- mutex_create syscall
- mutex_lock syscall
- mutex_unlock syscall
- openat syscall
- pipe syscall
- read syscall
- semaphore_create syscall
- semaphore_down syscall
- semaphore_up syscall
- set priority syscall
- sleep syscall
- spawn syscall
- thread_create syscall
- unlinkat syscall
- waitpid syscall
- waittid syscall
- write syscall
- yield syscall
Functions§
- handle syscall exception with
syscall_idand other arguments