Turnstone Operating System
|
64-bit system call support. More...
#include <apic.h>
#include <cpu.h>
#include <cpu/syscall.h>
#include <cpu/smp.h>
#include <logging.h>
#include <memory.h>
Macros | |
#define | SYSCALL_TABLE_SIZE (sizeof(SYSCALL_TABLE) / sizeof(SYSCALL_TABLE[0])) |
Typedefs | |
typedef int64_t(* | syscall_f) (uint64_t arg1, uint64_t arg2, uint64_t arg3, uint64_t arg4, uint64_t arg5, uint64_t arg6) |
System call function type. More... | |
Functions | |
MODULE ("turnstone.kernel.cpu.syscall") | |
uint64_t | syscall_handler_create_stack (uint64_t old_stack) |
creates stack for system call handler. More... | |
int64_t | syscall_handler_null_handler_error (uint64_t handler_no, uint64_t syscall_handler_offset) |
null handler error. when system call handler is null, this function is called. prints error message about null handler and returns -1. More... | |
int64_t | syscall_handler_notfound_error (uint64_t syscall_no) |
not found error. when system call handler is not found, this function is called. prints error message about not found handler and returns -1. More... | |
int64_t | syscall_function_hlt (uint64_t arg1, uint64_t arg2, uint64_t arg3, uint64_t arg4, uint64_t arg5, uint64_t arg6) |
cpu halt system call handler. More... | |
int64_t | syscall_function_cli_and_hlt (uint64_t arg1, uint64_t arg2, uint64_t arg3, uint64_t arg4, uint64_t arg5, uint64_t arg6) |
cpu cli and hlt system call handler. after this system call, cpu is halted forever. More... | |
void | syscall_init (void) |
void | syscall_handler (void) |
syscall handler. | |
Variables | |
const syscall_f | SYSCALL_TABLE [] |
system call table. More... | |
64-bit system call support.
This work is licensed under TURNSTONE OS Public License. Please read and understand latest version of Licence.
#define SYSCALL_TABLE_SIZE (sizeof(SYSCALL_TABLE) / sizeof(SYSCALL_TABLE[0])) |
system call table size
syscall_f |
System call function type.
[in] | arg1 | Argument 1. |
[in] | arg2 | Argument 2. |
[in] | arg3 | Argument 3. |
[in] | arg4 | Argument 4. |
[in] | arg5 | Argument 5. |
[in] | arg6 | Argument 6. |
MODULE | ( | "turnstone.kernel.cpu.syscall" | ) |
module name
int64_t syscall_function_cli_and_hlt | ( | uint64_t | arg1, |
uint64_t | arg2, | ||
uint64_t | arg3, | ||
uint64_t | arg4, | ||
uint64_t | arg5, | ||
uint64_t | arg6 | ||
) |
cpu cli and hlt system call handler. after this system call, cpu is halted forever.
[in] | arg1 | Argument 1. (not used) |
[in] | arg2 | Argument 2. (not used) |
[in] | arg3 | Argument 3. (not used) |
[in] | arg4 | Argument 4. (not used) |
[in] | arg5 | Argument 5. (not used) |
[in] | arg6 | Argument 6. (not used) |
int64_t syscall_function_hlt | ( | uint64_t | arg1, |
uint64_t | arg2, | ||
uint64_t | arg3, | ||
uint64_t | arg4, | ||
uint64_t | arg5, | ||
uint64_t | arg6 | ||
) |
cpu halt system call handler.
[in] | arg1 | Argument 1. (not used) |
[in] | arg2 | Argument 2. (not used) |
[in] | arg3 | Argument 3. (not used) |
[in] | arg4 | Argument 4. (not used) |
[in] | arg5 | Argument 5. (not used) |
[in] | arg6 | Argument 6. (not used) |
creates stack for system call handler.
[in] | old_stack | Old stack pointer. |
not found error. when system call handler is not found, this function is called. prints error message about not found handler and returns -1.
[in] | syscall_no | System call number. |
null handler error. when system call handler is null, this function is called. prints error message about null handler and returns -1.
[in] | handler_no | Handler number. |
[in] | syscall_handler_offset | System call handler offset. |
const syscall_f SYSCALL_TABLE[] |
system call table.