C Microkernel Realtime eXecutive
Realtime Operating System for Cortex-M based microcontrollers
 
Loading...
Searching...
No Matches

Description

Kernel contains mechanism of using kernel services.

Portable parts of system call machinery.

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.

enum  eSysCalls {
  SYSCALL_GET_TID = 0 , SYSCALL_SCHED_YIELD , SYSCALL_THREAD_CREATE , SYSCALL_MUTEX_INIT ,
  SYSCALL_MUTEX_DESTROY , SYSCALL_MUTEX_UNLOCK , SYSCALL_MUTEX_TRYLOCK , SYSCALL_RPC_CALL ,
  SYSCALL_RPC_RETURN , SYSCALL_THREAD_JOIN , SYSCALL_THREAD_EXIT , SYSCALL_SETITIMER ,
  SYSCALL_USLEEP , SYSCALL_SIGNAL , SYSCALL_KILL , SYSCALL_SETPRIORITY ,
  SYSCALL_RESET , _SYSCALL_COUNT
}
 List of known syscall IDs. More...
 
typedef int(* Syscall_Handler_t) (int, int, int, int)
 
#define __SYSCALL   __attribute__((naked)) __attribute__((noinline))
 Mark function as syscall entrypoint in userspace.
 
#define ___SVC(no)
 
#define __SVC(no)   ___SVC(no)
 Perform syscall.
 

Macro Definition Documentation

◆ ___SVC

#define ___SVC (   no)
Value:
asm volatile(\
"SVC %[immediate]\n\t"\
"BX LR\n\t" : : [immediate] "I" (no))

◆ __SVC

#define __SVC (   no)    ___SVC(no)

Perform syscall.

Parameters
nonumber of syscall.

◆ __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.

Typedef Documentation

◆ Syscall_Handler_t

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

Enumeration Type Documentation

◆ eSysCalls

enum eSysCalls

List of known syscall IDs.

These syscall IDs are known and can be used to call services.

Enumerator
SYSCALL_GET_TID 
SYSCALL_SCHED_YIELD 
SYSCALL_THREAD_CREATE 
SYSCALL_MUTEX_INIT 
SYSCALL_MUTEX_DESTROY 
SYSCALL_MUTEX_UNLOCK 
SYSCALL_MUTEX_TRYLOCK 
SYSCALL_RPC_CALL 
SYSCALL_RPC_RETURN 
SYSCALL_THREAD_JOIN 
SYSCALL_THREAD_EXIT 
SYSCALL_SETITIMER 
SYSCALL_USLEEP 
SYSCALL_SIGNAL 
SYSCALL_KILL 
SYSCALL_SETPRIORITY 
SYSCALL_RESET 
_SYSCALL_COUNT