|
SuperTinyKernel™ RTOS 1.08.x
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
|
Interface for a platform driver. More...
#include <stk_common.h>
Classes | |
| class | IEventHandler |
| Interface for a back-end event handler. More... | |
| class | IEventOverrider |
| Interface for a platform event overrider. More... | |
Public Member Functions | |
| virtual void | Initialize (IEventHandler *event_handler, IKernelService *service, uint32_t resolution_us, Stack *exit_trap)=0 |
| Initialize scheduler's context. | |
| virtual void | Start ()=0 |
| Start scheduling. | |
| virtual void | Stop ()=0 |
| Stop scheduling. | |
| virtual void | InitStack (EStackType stack_type, Stack *stack, IStackMemory *stack_memory, ITask *user_task)=0 |
| Initialize stack memory of the user task. | |
| virtual uint32_t | GetTickResolution () const =0 |
| Get resolution of the system tick timer in microseconds. Resolution means a number of microseconds between system tick timer ISRs. | |
| virtual Cycles | GetSysTimerCount () const =0 |
| Get system timer count value. | |
| virtual uint32_t | GetSysTimerFrequency () const =0 |
| Get system timer frequency. | |
| virtual void | ForceContextSwitch (TId id)=0 |
| Force context switch. | |
| virtual void | ProcessTick ()=0 |
| Process one tick. | |
| virtual void | ProcessHardFault ()=0 |
| Cause a hard fault of the system. | |
| virtual void | SetEventOverrider (IEventOverrider *overrider, bool non_secure=false)=0 |
| Set platform event overrider. | |
| virtual Word | GetCallerSP () const =0 |
| Get caller's Stack Pointer (SP). | |
| virtual TId | GetTid () const =0 |
| Get thread Id. | |
| virtual Timeout | Suspend ()=0 |
| Suspend scheduling. | |
| virtual void | Resume (Timeout elapsed_ticks)=0 |
| Resume scheduling after a prior Suspend() call. | |
| virtual void | SetCpuFrequency (uint8_t core_id, uint32_t frequency)=0 |
| Notify the scheduler of a CPU core's operating frequency. | |
Protected Member Functions | |
| ~IPlatform ()=default | |
| Destructor. | |
Interface for a platform driver.
Platform driver represents an underlying hardware and implements the following logic:
All functions are called by the kernel implementation.
Definition at line 1133 of file stk_common.h.
|
protecteddefault |
Destructor.
|
pure virtual |
Force context switch.
Implemented in stk::PlatformArmCortexM, stk::PlatformRiscV, and stk::PlatformX86Win32.
|
pure virtual |
Get caller's Stack Pointer (SP).
Implemented in stk::PlatformArmCortexM, stk::PlatformRiscV, and stk::PlatformX86Win32.
|
pure virtual |
Get system timer count value.
Implemented in stk::PlatformArmCortexM, stk::PlatformRiscV, and stk::PlatformX86Win32.
|
pure virtual |
Get system timer frequency.
Implemented in stk::PlatformArmCortexM, stk::PlatformRiscV, and stk::PlatformX86Win32.
|
pure virtual |
Get resolution of the system tick timer in microseconds. Resolution means a number of microseconds between system tick timer ISRs.
Implemented in stk::PlatformArmCortexM, stk::PlatformRiscV, and stk::PlatformX86Win32.
|
pure virtual |
Get thread Id.
Implemented in stk::PlatformArmCortexM, stk::PlatformRiscV, and stk::PlatformX86Win32.
|
pure virtual |
Initialize scheduler's context.
| [in] | event_handler | Event handler. |
| [in] | service | Kernel service. |
| [in] | resolution_us | Tick resolution in microseconds (for example 1000 equals to 1 millisecond resolution). |
| [in] | exit_trap | Stack of the Exit trap (optional, provided if kernel is operating in KERNEL_DYNAMIC mode). |
Implemented in stk::PlatformArmCortexM, stk::PlatformRiscV, and stk::PlatformX86Win32.
|
pure virtual |
Initialize stack memory of the user task.
| [in] | stack_type | Stack type. |
| [in] | stack | Stack descriptor. |
| [in] | stack_memory | Stack memory. |
| [in] | user_task | User task to which Stack belongs. |
Implemented in stk::PlatformArmCortexM, stk::PlatformRiscV, and stk::PlatformX86Win32.
|
pure virtual |
Cause a hard fault of the system.
Implemented in stk::PlatformArmCortexM, stk::PlatformRiscV, and stk::PlatformX86Win32.
Referenced by stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelTask::HrtHardFailDeadline().
|
pure virtual |
Process one tick.
Implemented in stk::PlatformArmCortexM, stk::PlatformRiscV, and stk::PlatformX86Win32.
|
pure virtual |
Resume scheduling after a prior Suspend() call.
| [in] | elapsed_ticks | Number of ticks that elapsed during the suspended period. The kernel uses this value to advance internal time counters. |
Implemented in stk::PlatformArmCortexM, stk::PlatformRiscV, and stk::PlatformX86Win32.
|
pure virtual |
Notify the scheduler of a CPU core's operating frequency.
| [in] | core_id | Target CPU core ID, or 0xFF to set the frequency for all cores. |
| [in] | frequency | CPU core frequency in Hz. |
Implemented in stk::PlatformArmCortexM, stk::PlatformRiscV, and stk::PlatformX86Win32.
|
pure virtual |
Set platform event overrider.
| [in] | overrider | Platform event overrider. |
| [in] | non_secure | True if instance comes from a Non-Secure binary (TrustZone only). |
Implemented in stk::PlatformArmCortexM, stk::PlatformRiscV, and stk::PlatformX86Win32.
Referenced by CreateKernel(), CreateKernel(), and RunExample().
|
pure virtual |
Start scheduling.
Implemented in stk::PlatformArmCortexM, stk::PlatformRiscV, and stk::PlatformX86Win32.
|
pure virtual |
Stop scheduling.
Implemented in stk::PlatformArmCortexM, stk::PlatformRiscV, and stk::PlatformX86Win32.
|
pure virtual |
Suspend scheduling.
Implemented in stk::PlatformArmCortexM, stk::PlatformRiscV, and stk::PlatformX86Win32.