Portable parts of system call machinery. More...
Portable parts of system call machinery.
Kernel contains mechanism of using kernel services.
This mechanism (commonly known as system calls, or syscalls) can be used to call system services only from userspace code running in thread context. It is not possible to call these services from within ISR context.
| #define ___SVC | ( | no | ) |
| #define __SVC | ( | no, | |
| ... | |||
| ) | ___SVC(no) |
Perform syscall.
| no | number of syscall. |
| #define __SYSCALL __attribute__((naked)) __attribute__((noinline)) |
Mark function as syscall entrypoint in userspace.
This gives the function some common attributes. Currently syscall entrypoint are short functions which never get inlined and don't construct stack frame. This is the most efficient method of calling syscalls right now.
| #define SYSCALL_DEFINITION __attribute__((section(".syscall"), used)) const |
Attribute used to publish syscall definitions in a way that os_syscall can process them.
| typedef int(* Syscall_Handler_t) (unsigned long, unsigned long, unsigned long, unsigned long) |
| enum eSysCalls |
List of known syscall IDs.
These syscall IDs are known and can be used to call services.
| int os_system_call | ( | unsigned long | arg0, |
| unsigned long | arg1, | ||
| unsigned long | arg2, | ||
| unsigned long | arg3, | ||
| uint8_t | syscall_id | ||
| ) |
Find and execute a system call.
Execution of system call is a portable action. It translates into calling a function determined by checking the syscall table. This function will call the syscall and return the return value it provided.
| arg0 | 1st argument to the syscall routine |
| arg1 | 2nd argument to the syscall routine |
| arg2 | 3rd argument to the syscall routine |
| arg3 | 4th argument to the syscall routine |
| syscall_id | the ID of system call routine that has to be called |