Syscall Interface. More...
Functions | |
static void | syscall_exit (uint32_t return_value, uint32_t ecx, uint32_t edx, uint32_t esi, uint32_t edi, cpu_state_t **cpu) |
Exits the current task. More... | |
static uint32_t | syscall_getpid () |
Returns the current task's PID. More... | |
void | syscall_init () |
Initializes the syscall interface. | |
Syscall Interface.
This defines the syscall interface used in user-space to access kernel functions. Syscalls may have up to 5 arguments and a return value. They are called by firing a 0x30 interrupt with a syscall ID placed in EAX. Parameters are placed in general purpose registers, the return value in EAX.
|
static |
Exits the current task.
return_value | whether the task returned successfully (0) or not |
ecx | ignored |
edx | ignored |
esi | ignored |
edi | ignored |
cpu | the CPU state pointer so we can switch to the next task |
We tell the scheduler to not switch to this task again, so we can properly free it later in schedule_finalize_tasks(). We can't do that here because we are operating on this task's kernel stack which we cannot free while it is still in use.
Definition at line 29 of file syscall.c.