![]() |
SuperTinyKernel™ RTOS 1.05.3
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
|
Interface for the kernel services exposed to the user processes during run-time when Kernel started scheduling the processes. More...
#include <stk_common.h>
Public Member Functions | |
| virtual TId | GetTid () const =0 |
| Get thread Id of the currently running task. | |
| virtual Ticks | GetTicks () const =0 |
| Get number of ticks elapsed since kernel start. | |
| virtual int32_t | GetTickResolution () const =0 |
| Get number of microseconds in one tick. | |
| virtual void | Delay (Timeout ticks)=0 |
| Delay calling process. | |
| virtual void | Sleep (Timeout ticks)=0 |
| Put calling process into a sleep state. | |
| virtual void | SleepUntil (Ticks timestamp)=0 |
| Put calling process into a sleep state until the specified timestamp. | |
| virtual void | SwitchToNext ()=0 |
| Notify scheduler to switch to the next task (yield). | |
| virtual IWaitObject * | Wait (ISyncObject *sobj, IMutex *mutex, Timeout timeout)=0 |
| Put calling process into a waiting state until synchronization object is signaled or timeout occurs. | |
Static Public Member Functions | |
| static IKernelService * | GetInstance () |
| Get CPU-local instance of the kernel service. | |
Interface for the kernel services exposed to the user processes during run-time when Kernel started scheduling the processes.
Definition at line 928 of file stk_common.h.
|
pure virtual |
Delay calling process.
| [in] | ticks | Delay time (ticks). |
Implemented in stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelService, stk::test::KernelServiceMock, and stk::test::stk::KernelServiceMock.
Referenced by stk::Delay().
|
static |
Get CPU-local instance of the kernel service.
Definition at line 69 of file stktest.cpp.
References stk::test::g_KernelService.
Referenced by stk::Delay(), stk::GetTickResolution(), stk::GetTicks(), stk::GetTid(), stk::GetTimeNowMs(), stk::Sleep(), stk::SleepUntil(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::Test_SyncWait(), stk::sync::Mutex::TimedLock(), stk::sync::ConditionVariable::Wait(), stk::sync::Event::Wait(), stk::sync::Semaphore::Wait(), and stk::Yield().
|
pure virtual |
Get number of microseconds in one tick.
Implemented in stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelService, stk::test::KernelServiceMock, and stk::test::stk::KernelServiceMock.
Referenced by stk::GetTickResolution(), and stk::GetTimeNowMs().
|
pure virtual |
Get number of ticks elapsed since kernel start.
Implemented in stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelService, stk::test::KernelServiceMock, and stk::test::stk::KernelServiceMock.
Referenced by stk::GetTicks(), and stk::GetTimeNowMs().
|
pure virtual |
Get thread Id of the currently running task.
Implemented in stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelService, stk::test::KernelServiceMock, and stk::test::stk::KernelServiceMock.
Referenced by stk::GetTid(), and stk::sync::Mutex::TimedLock().
|
pure virtual |
Put calling process into a sleep state.
| [in] | ticks | Sleep time (ticks). |
Implemented in stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelService, stk::test::KernelServiceMock, and stk::test::stk::KernelServiceMock.
Referenced by stk::Sleep().
|
pure virtual |
Put calling process into a sleep state until the specified timestamp.
| [in] | timestamp | Absolute timestamp (ticks). |
Implemented in stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelService, stk::test::KernelServiceMock, and stk::test::stk::KernelServiceMock.
Referenced by stk::SleepUntil().
|
pure virtual |
Notify scheduler to switch to the next task (yield).
Implemented in stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelService, stk::test::KernelServiceMock, and stk::test::stk::KernelServiceMock.
Referenced by stk::Yield().
|
pure virtual |
Put calling process into a waiting state until synchronization object is signaled or timeout occurs.
| [in] | sobj | Synchronization object to wait on. |
| [in] | mutex | Mutex protecting the state of the synchronization object. |
| [in] | timeout | Maximum wait time (ticks). Use WAIT_INFINITE to block indefinitely, use NO_WAIT to poll without blocking. |
Implemented in stk::Kernel< TMode, TSize, TStrategy, TPlatform >::KernelService, stk::test::KernelServiceMock, and stk::test::stk::KernelServiceMock.
Referenced by stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::TEST(), stk::test::Test_SyncWait(), stk::sync::Mutex::TimedLock(), stk::sync::ConditionVariable::Wait(), stk::sync::Event::Wait(), and stk::sync::Semaphore::Wait().