SuperTinyKernel™ RTOS 1.08.x
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
Loading...
Searching...
No Matches
stk_common.h File Reference

Contains interface definitions of the library. More...

#include "stk_defs.h"
#include "stk_linked_list.h"
Include dependency graph for stk_common.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  stk::ArrayView< T >
 Lightweight, non-owning view over a contiguous sequence of elements. More...
class  stk::Stack
 Stack descriptor. More...
class  stk::IStackMemory
 Interface for a stack memory region. More...
class  stk::IWaitObject
 Wait object. More...
class  stk::ITraceable
 Traceable object. More...
class  stk::ISyncObject
 Synchronization object interface. More...
class  stk::IMutex
 Interface for mutex synchronization primitive. More...
class  stk::IMutex::ScopedLock
 Locks bound mutex within a scope of execution. Ensures the mutex is always unlocked when leaving the scope, even when exceptions are thrown. More...
class  stk::ITask
 Interface for a user task. More...
class  stk::IKernelTask
 Scheduling-strategy-facing interface for a kernel task slot. More...
class  stk::IPlatform
 Interface for a platform driver. More...
class  stk::IPlatform::IEventHandler
 Interface for a back-end event handler. More...
class  stk::IPlatform::IEventOverrider
 Interface for a platform event overrider. More...
class  stk::ITaskSwitchStrategy
 Interface for a task switching strategy implementation. More...
class  stk::IKernel
 Interface for the implementation of the kernel of the scheduler. It supports Soft and Hard Real-Time modes. More...
class  stk::IKernelService
 Interface for the kernel services exposed to the user processes during run-time when Kernel started scheduling the processes. More...

Namespaces

namespace  stk
 Namespace of STK package.
namespace  stk::tz
namespace  stk::tz::nsec
namespace  stk::tz::nsec::util

Typedefs

typedef uintptr_t stk::Word
 Native processor word type.
typedef Word stk::TId
 Task (thread) id.
typedef int32_t stk::Timeout
 Timeout time (ticks).
typedef int64_t stk::Ticks
 Ticks value.
typedef int64_t stk::Time
 Time value.
typedef uint64_t stk::Cycles
 Cycles value.
typedef int32_t stk::Weight
 Weight value (aka priority).

Enumerations

enum  stk::EAccessMode : uint32_t {
  stk::ACCESS_USER = 0 ,
  stk::ACCESS_PRIVILEGED = (1 << 0) ,
  stk::ACCESS_SECURE = (1 << 1)
}
 Hardware access modes by the task. More...
enum  stk::EKernelMode : uint8_t {
  stk::KERNEL_STATIC = (1 << 0) ,
  stk::KERNEL_DYNAMIC = (1 << 1) ,
  stk::KERNEL_HRT = (1 << 2) ,
  stk::KERNEL_SYNC = (1 << 3) ,
  stk::KERNEL_TICKLESS = (1 << 4)
}
 Kernel operating mode. More...
enum  stk::EKernelPanicId : uint8_t {
  stk::KERNEL_PANIC_NONE = 0U ,
  stk::KERNEL_PANIC_SPINLOCK_DEADLOCK = 1U ,
  stk::KERNEL_PANIC_STACK_CORRUPT = 2U ,
  stk::KERNEL_PANIC_ASSERT = 3U ,
  stk::KERNEL_PANIC_HRT_HARD_FAULT = 4U ,
  stk::KERNEL_PANIC_CPU_EXCEPTION = 5U ,
  stk::KERNEL_PANIC_CS_NESTING_OVERFLOW = 6U ,
  stk::KERNEL_PANIC_UNKNOWN_SVC = 7U ,
  stk::KERNEL_PANIC_BAD_STATE = 8U ,
  stk::KERNEL_PANIC_BAD_MODE = 9U ,
  stk::KERNEL_PANIC_BAD_STACK_TYPE = 10U ,
  stk::KERNEL_PANIC_NS_ACCESS = 11U ,
  stk::KERNEL_PANIC_BAD_MEMORY_REGION = 12U
}
 Identifies the source of a kernel panic. More...
enum  stk::EStackType : uint8_t {
  stk::STACK_USER_TASK = 0 ,
  stk::STACK_SLEEP_TRAP ,
  stk::STACK_EXIT_TRAP
}
 Stack type. More...
enum  stk::EConsts : uint32_t {
  stk::PERIODICITY_MAX = 99000 ,
  stk::PERIODICITY_DEFAULT = 1000 ,
  stk::STACK_SIZE_MIN = (32U)
}
 Constants. More...
enum  stk::ESystemTaskId : uint32_t {
  stk::SYS_TASK_ID_SLEEP = 0xFFFFFFFF ,
  stk::SYS_TASK_ID_EXIT = 0xFFFFFFFE
}
 System task id. More...
enum  stk::ETraceEventId : uint32_t {
  stk::TRACE_EVENT_UNKNOWN = 0 ,
  stk::TRACE_EVENT_SWITCH = 1000 + 0 ,
  stk::TRACE_EVENT_SLEEP = 1000 + 1 ,
  stk::TRACE_EVENT_WAIT = 1000 + 2 ,
  stk::TRACE_EVENT_SUSPEND = 1000 + 3
}
 Trace event identifiers for tracing task suspension and resume with debugging tools (e.g. SEGGER SystemView). More...
enum  stk::EWaitResult : int8_t {
  stk::WAIT_RESULT_FAIL = -1 ,
  stk::WAIT_RESULT_SIGNAL = 0 ,
  stk::WAIT_RESULT_TIMEOUT = 1
}
 Wait result (see IKernelService::Wait). More...
enum  stk::EHwException : int8_t {
  stk::HW_EXCEPT_FATAL = 0 ,
  stk::HW_EXCEPT_MEMACCESS = 1
}
 Hardware exception id (see IPlatform::IEventOverrider::OnException). More...

Functions

static bool stk::IsIsrTid (TId id)
 Test whether a task identifier represents an ISR context.

Variables

static constexpr TId stk::TID_ISR_N = static_cast<TId>(0xFFFFF000U)
 Bitmask sentinel for ISR-context task identifiers.
static constexpr TId stk::TID_NONE = static_cast<TId>(0U)
 Reserved task/thread id representing zero/none thread id.
static constexpr Timeout stk::WAIT_INFINITE = INT32_MAX
 Timeout value: block indefinitely until the synchronization object is signaled.
static constexpr Timeout stk::NO_WAIT = 0
 Timeout value: return immediately if the synchronization object is not yet signaled (non-blocking poll).
static constexpr Weight stk::NO_WEIGHT = -1
 Weight value: weight is not set.
static constexpr Weight stk::DEFAULT_WEIGHT = 1
 Weight value: default weight of value (1) (see SwitchStrategySmoothWeightedRoundRobin).

Detailed Description

Contains interface definitions of the library.

Definition in file stk_common.h.