10#ifndef STK_ARCH_ARM_CORTEX_M_H_
11#define STK_ARCH_ARM_CORTEX_M_H_
61 __asm
volatile(
"MOV %0, r9" :
"=r"(tp) : : );
71 __asm
volatile(
"MOV r9, %0" : :
"r"(tp) : );
75#define _STK_INLINE_TLS_DEFINED 1
82#define __stk_dmb() __asm volatile("dmb sy" ::: "memory")
Contains interface definitions of the library.
#define __stk_forceinline
Forces compiler to always inline the decorated function, regardless of optimisation level.
Namespace of STK package.
uintptr_t Word
Native processor word type.
int64_t Ticks
Ticks value.
int32_t Timeout
Timeout time (ticks).
void SetTls(Word tp)
Set thread-local storage (TLS).
Word GetTls()
Get thread-local storage (TLS).
PlatformArmCortexM PlatformDefault
Default platform implementation.
Concrete implementation of IPlatform driver for the Arm Cortex-M0, M3, M4, M7 processors.
void SleepUntil(Ticks timestamp)
Put calling process into a sleep state until the specified timestamp.
uint32_t GetTickResolution() const
Get resolution of the system tick timer in microseconds. Resolution means a number of microseconds be...
void ProcessTick()
Process one tick.
void Initialize(IEventHandler *event_handler, IKernelService *service, uint32_t resolution_us, Stack *exit_trap)
Initialize scheduler's context.
TId GetTid() const
Get thread Id.
void Sleep(Timeout ticks)
Put calling process into a sleep state.
Word GetCallerSP() const
Get caller's Stack Pointer (SP).
void Start()
Start scheduling.
void SwitchToNext()
Switch to a next task.
~PlatformArmCortexM()
Destructor.
void Stop()
Stop scheduling.
bool InitStack(EStackType stack_type, Stack *stack, IStackMemory *stack_memory, ITask *user_task)
Initialize stack memory of the user task.
void SetEventOverrider(IEventOverrider *overrider)
Set platform event overrider.
IWaitObject * Wait(ISyncObject *sync_obj, IMutex *mutex, Timeout timeout)
void ProcessHardFault()
Cause a hard fault of the system.
Interface for a stack memory region.
Interface for mutex synchronization primitive.
Interface for a user task.
Interface for a platform driver.
Interface for a back-end event handler.
Interface for a platform event overrider.
Interface for the kernel services exposed to the user processes during run-time when Kernel started s...