Benchmarks Documentation Examples Repository Blog Contact

System calls

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.

Function-like Macros

Unknown member type eSysCalls

Function-like Macros

__SYSCALL

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.

___SVC(no)

__SVC(no)

  • no number of syscall.

Function-like Macros

SYSCALL_DEFINITION

Attribute used to publish syscall definitions in a way that os_syscall can process them.

typedef int(* Syscall_Handler_t) (int, int, int, int)

int os_system_call(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint32_t arg3, uint8_t syscall_id)

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 value provided by the system call routine, if routine with given syscall_id exists. Otherwise returns E_NOTAVAIL.

  • 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

Returns value provided by the system call routine, if routine with given syscall_id exists. Otherwise returns E_NOTAVAIL.

64kB of protected memory ought to be enough for everyone.