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

Functions

uint32_t os_dispatch_system_call (uint32_t LR)
 ARM-specific entrypoint for system call handlers.
 
void SVC_Handler (void)
 
void os_core_sleep (void)
 Park current core This function is free to park current core in whatever way that will still allow the core to be woken up by external interrupts.
 
static unsigned os_exception_frame_size (bool fp_used)
 
ExceptionFramepush_exception_frame (ExceptionFrame *frame, unsigned args, bool fp_active)
 Duplicate exception frame on thread's stack.
 
ExceptionFrameshim_exception_frame (ExceptionFrame *frame, unsigned args, bool fp_active)
 Creates space for additional arguments under exception frame.
 
ExceptionFramepop_exception_frame (ExceptionFrame *frame, unsigned args, bool fp_active)
 Remove exception frame from thread's stack.
 

Variables

static SYSCALL_DEFINITION struct Syscall_Entry_t nvic_syscalls []
 

Detailed Description

Function Documentation

◆ os_core_sleep()

void os_core_sleep ( void  )

Park current core This function is free to park current core in whatever way that will still allow the core to be woken up by external interrupts.

◆ os_dispatch_system_call()

uint32_t os_dispatch_system_call ( uint32_t  LR)

ARM-specific entrypoint for system call handlers.

This routine is common entrypoint for all syscall routines. It decodes the syscall ID requested by userspace application and calls generic method to service the system call. It is callable by executing the SVC instruction. Code of SVC_Handler will retrieve the requested SVC ID and let generic machinery to execute specified system call.

◆ os_exception_frame_size()

static unsigned os_exception_frame_size ( bool  fp_used)
static

◆ pop_exception_frame()

ExceptionFrame * pop_exception_frame ( ExceptionFrame frame,
unsigned  args,
bool  fp_active 
)

Remove exception frame from thread's stack.

This function will revert effects of calling push_exception_frame. It will handle frame padding automatically.

Parameters
frameexception frame base address
argsnumber of function arguments passed onto stack (function args - 4)
fp_activeif true then floating point unit is actively used in the thread exception is for
Returns
new address of stack top after frame has been removed from it

◆ push_exception_frame()

ExceptionFrame * push_exception_frame ( ExceptionFrame frame,
unsigned  args,
bool  fp_active 
)

Duplicate exception frame on thread's stack.

Parameters
framepointer of frame currently residing on top of process' stack
argsamount of arguments pushed onto stack (first four come into R0-R3, fifth and following are pushed onto stack)
fp_activeif true then floating point unit is actively used in the thread exception is for
Returns
address of duplicated exception frame

◆ shim_exception_frame()

ExceptionFrame * shim_exception_frame ( ExceptionFrame frame,
unsigned  args,
bool  fp_active 
)

Creates space for additional arguments under exception frame.

This function will move exception frame content args * 4 bytes lower. If resulting address won't be 8-byt aligned, then additional alignment is applied to it. Content of exception frame is copied automatically.

Parameters
frameaddress of exception frame in memory
argsamount of additional arguments for which space should be created under exception frame
fp_activeif true then floating point unit is actively used in the thread exception is for
Returns
address of shimmed exception frame.

◆ SVC_Handler()

void SVC_Handler ( void  )

Variable Documentation

◆ nvic_syscalls

SYSCALL_DEFINITION struct Syscall_Entry_t nvic_syscalls[]
static
Initial value:
= {
}
int os_nvic_enable(uint32_t irq)
Implementation of irq_enable syscall for ARM Cortex-M See irq_enable for more details on arguments.
Definition cortex.c:30
int os_nvic_disable(uint32_t irq)
Implementation of irq_disable syscall for ARM Cortex-M See irq_disable for more details on arguments.
Definition cortex.c:36
int(* Syscall_Handler_t)(int, int, int, int)
Definition syscall.h:25
@ SYSCALL_DISABLE_IRQ
Definition syscalls.h:32
@ SYSCALL_ENABLE_IRQ
Definition syscalls.h:31