28 #ifndef CMSIS_PLUS_RTOS_OS_SCHED_H_ 29 #define CMSIS_PLUS_RTOS_OS_SCHED_H_ 33 #if defined(__cplusplus) 54 extern bool is_started_;
56 #if !defined(OS_USE_RTOS_PORT_SCHEDULER) 57 extern bool is_preemptive_;
58 extern thread*
volatile current_thread_;
59 extern internal::ready_threads_list ready_threads_list_;
62 extern internal::terminated_threads_list terminated_threads_list_;
159 internal_switch_threads (
void);
336 lockable (
const lockable&) =
delete;
337 lockable (lockable&&) =
delete;
339 operator= (
const lockable&) =
delete;
341 operator= (lockable&&) =
delete;
428 #if defined(OS_INCLUDE_RTOS_STATISTICS_THREAD_CONTEXT_SWITCHES) 449 #if defined(OS_INCLUDE_RTOS_STATISTICS_THREAD_CPU_CYCLES) 726 lockable (
const lockable&) =
delete;
727 lockable (lockable&&) =
delete;
729 operator= (
const lockable&) =
delete;
731 operator= (lockable&&) =
delete;
841 #if !defined(OS_USE_RTOS_PORT_SCHEDULER) 842 return is_preemptive_;
914 #if defined(OS_TRACE_RTOS_SCHEDULER) 929 #if defined(OS_TRACE_RTOS_SCHEDULER) 945 #if defined(OS_TRACE_RTOS_SCHEDULER) 960 #if defined(OS_TRACE_RTOS_SCHEDULER) 973 state_ (port::scheduler::state::init)
1025 namespace statistics
1027 #if defined(OS_INCLUDE_RTOS_STATISTICS_THREAD_CONTEXT_SWITCHES) 1046 return context_switches_;
1051 #if defined(OS_INCLUDE_RTOS_STATISTICS_THREAD_CPU_CYCLES) 1082 namespace interrupts
1090 __attribute__((always_inline))
1102 __attribute__((always_inline))
1115 __attribute__((always_inline))
1127 __attribute__((always_inline))
1139 __attribute__((always_inline))
1153 __attribute__((always_inline))
1166 __attribute__((always_inline))
1178 __attribute__((always_inline))
1179 uncritical_section::enter (
void)
1190 __attribute__((always_inline))
1205 state_ (port::interrupts::state::init)
1216 __attribute__((always_inline))
1228 __attribute__((always_inline))
1242 __attribute__((always_inline))
1255 __attribute__((always_inline))
Scheduler standard locker.
port::scheduler::state_t locked(port::scheduler::state_t state)
Lock/unlock the scheduler.
port::scheduler::state_t unlock(void)
Unlock the scheduler.
constexpr lockable()
Construct a lockable object instance.
Scheduler uncritical section RAII helper.
port::clock::timestamp_t timestamp_t
Type of variables holding clock time stamps.
bool in_handler_mode(void)
Check if the CPU is in handler mode.
uncritical_section()
Enter a critical section.
port::scheduler::state_t lock(void)
Lock the scheduler.
state_t locked(state_t state)
Lock/unlock the scheduler.
void lock(void)
Lock the scheduler.
Interrupts standard locker.
~uncritical_section()
Exit a critical section.
Interrupts critical section RAII helper.
bool try_lock(void)
Try to lock the interrupts.
static rtos::interrupts::state_t enter(void)
~lockable()
Destruct the lockable object instance.
void lock(void)
Lock the interrupts.
port::interrupts::state_t state_t
Type of variables holding interrupts statu codes.
static void exit(rtos::interrupts::state_t state)
Scheduler critical section RAII helper.
void start(void)
Start the RTOS scheduler.
static void exit(rtos::interrupts::state_t state)
void unlock(void)
Unlock the interrupts.
bool started(void)
Check if the scheduler was started.
static rtos::interrupts::state_t enter(void)
void unlock(void)
Unlock the scheduler.
port::scheduler::state_t state_t
Type of variables holding scheduler state codes.
rtos::statistics::counter_t context_switches(void)
Get the total number of context switches.
bool preemptive(void)
Check if the scheduler is in preemptive mode.
int printf(const char *format,...)
Write a formatted string to the trace device.
bool preemptive(void)
Check if the scheduler is in preemptive mode.
static state_t enter(void)
Enter an interrupts critical section.
bool try_lock(void)
Try to lock the scheduler.
state_t lock(void)
Lock the scheduler.
state_t unlock(void)
Unlock the scheduler.
static void exit(state_t state)
Exit the interrupts critical section.
uint64_t counter_t
Type of variables holding context switches counters.
uint32_t result_t
Type of values returned by RTOS functions.
result_t initialize(void)
Initialise the RTOS scheduler.
critical_section()
Enter a critical section.
~critical_section()
Exit a critical section.
Interrupts critical section RAII helper.
uint64_t duration_t
Type of variables holding durations in CPU cycles.
bool in_handler_mode(void)
Check if the CPU is in handler mode.
rtos::statistics::duration_t cpu_cycles(void)
Get the total duration of all threads.