![]() |
SuperTinyKernel™ RTOS 1.05.3
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
|
IKernelService mock. More...
#include <stktest.h>
Public Member Functions | |
| KernelServiceMock () | |
| virtual | ~KernelServiceMock () |
| size_t | GetTid () const |
| Get thread Id of the currently running task. | |
| int64_t | GetTicks () const |
| Get number of ticks elapsed since kernel start. | |
| uint32_t | GetTickResolution () const |
| Get number of microseconds in one tick. | |
| Cycles | GetSysTimerCount () const |
| Get system timer count value. | |
| uint32_t | GetSysTimerFrequency () const |
| Get system timer frequency. | |
| void | Delay (Timeout ticks) |
| Delay calling process. | |
| void | Sleep (Timeout ticks) |
| Put calling process into a sleep state. | |
| void | SleepUntil (Ticks timestamp) |
| Put calling process into a sleep state until the specified timestamp. | |
| void | SwitchToNext () |
| Notify scheduler to switch to the next task (yield). | |
| IWaitObject * | Wait (ISyncObject *sobj, IMutex *mutex, Timeout timeout) |
| Put calling process into a waiting state until synchronization object is signaled or timeout occurs. | |
| Timeout | Suspend () |
| Suspend scheduling. | |
| void | Resume (Timeout elapsed_ticks) |
| Resume scheduling after a prior Suspend() call. | |
Static Public Member Functions | |
| static IKernelService * | GetInstance () |
| Get CPU-local instance of the kernel service. | |
Public Attributes | |
| bool | m_inc_ticks |
| bool | m_switch_to_next |
| int64_t | m_ticks |
| int32_t | m_resolution |
| size_t | m_tid |
| uint64_t | m_systimer_count |
| uint32_t | m_systimer_freq |
IKernelService mock.
|
inline |
Definition at line 289 of file stktest.h.
References m_inc_ticks, m_resolution, m_switch_to_next, m_systimer_count, m_systimer_freq, m_ticks, and m_tid.
|
inlinevirtual |
|
inlinevirtual |
Delay calling process.
| [in] | ticks | Delay time (ticks). |
Implements stk::IKernelService.
Definition at line 330 of file stktest.h.
|
staticinherited |
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::GetSysTimerCount(), stk::GetSysTimerFrequency(), stk::GetTickResolution(), stk::GetTicks(), stk::GetTid(), stk::GetTimeNowMs(), osKernelResume(), osKernelSuspend(), 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(), 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().
|
inlinevirtual |
Get system timer count value.
Implements stk::IKernelService.
Definition at line 320 of file stktest.h.
References m_systimer_count.
|
inlinevirtual |
Get system timer frequency.
Implements stk::IKernelService.
Definition at line 325 of file stktest.h.
References m_systimer_freq.
|
inlinevirtual |
Get number of microseconds in one tick.
Implements stk::IKernelService.
Definition at line 315 of file stktest.h.
References m_resolution.
Referenced by stk::test::TEST().
|
inlinevirtual |
Get number of ticks elapsed since kernel start.
Implements stk::IKernelService.
Definition at line 307 of file stktest.h.
References m_inc_ticks, and m_ticks.
|
inlinevirtual |
|
inlinevirtual |
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 and wake tasks whose sleep deadlines have expired. |
Implements stk::IKernelService.
Definition at line 363 of file stktest.h.
|
inlinevirtual |
Put calling process into a sleep state.
| [in] | ticks | Sleep time (ticks). |
Implements stk::IKernelService.
Definition at line 335 of file stktest.h.
|
inlinevirtual |
Put calling process into a sleep state until the specified timestamp.
| [in] | timestamp | Absolute timestamp (ticks). |
Implements stk::IKernelService.
Definition at line 340 of file stktest.h.
|
inlinevirtual |
Suspend scheduling.
Implements stk::IKernelService.
Definition at line 358 of file stktest.h.
|
inlinevirtual |
Notify scheduler to switch to the next task (yield).
Implements stk::IKernelService.
Definition at line 345 of file stktest.h.
References m_switch_to_next.
|
inlinevirtual |
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. |
Implements stk::IKernelService.
Definition at line 350 of file stktest.h.
| bool stk::test::KernelServiceMock::m_inc_ticks |
Definition at line 368 of file stktest.h.
Referenced by GetTicks(), and KernelServiceMock().
| int32_t stk::test::KernelServiceMock::m_resolution |
Definition at line 371 of file stktest.h.
Referenced by GetTickResolution(), KernelServiceMock(), and stk::test::TEST().
| bool stk::test::KernelServiceMock::m_switch_to_next |
Definition at line 369 of file stktest.h.
Referenced by KernelServiceMock(), and SwitchToNext().
| uint64_t stk::test::KernelServiceMock::m_systimer_count |
Definition at line 373 of file stktest.h.
Referenced by GetSysTimerCount(), and KernelServiceMock().
| uint32_t stk::test::KernelServiceMock::m_systimer_freq |
Definition at line 374 of file stktest.h.
Referenced by GetSysTimerFrequency(), and KernelServiceMock().
| int64_t stk::test::KernelServiceMock::m_ticks |
Definition at line 370 of file stktest.h.
Referenced by GetTicks(), KernelServiceMock(), and stk::test::TEST().
| size_t stk::test::KernelServiceMock::m_tid |
Definition at line 372 of file stktest.h.
Referenced by GetTid(), and KernelServiceMock().