67 static void _Rate_monotonic_Release_postponed_job(
86 _Rate_monotonic_Release( the_period, lock_context );
91 static void _Rate_monotonic_Release_job(
116 _Rate_monotonic_Release( the_period, lock_context );
121 void _Rate_monotonic_Restart(
133 _Rate_monotonic_Release_job(
141 static void _Rate_monotonic_Update_statistics(
221 _Rate_monotonic_Restart( the_period, executing, lock_context );
238 _Rate_monotonic_Update_statistics( the_period );
250 _Rate_monotonic_Release( the_period, lock_context );
256 RATE_MONOTONIC_INTEND_TO_BLOCK,
257 RATE_MONOTONIC_BLOCKED
291 _Rate_monotonic_Update_statistics( the_period );
296 _Rate_monotonic_Release_postponed_job(
316 the_period = _Rate_monotonic_Get(
id, &lock_context );
317 if ( the_period == NULL ) {
321 executing = _Thread_Executing;
322 if ( executing != the_period->
owner ) {
327 _Rate_monotonic_Acquire_critical( the_period, &lock_context );
329 state = the_period->
state;
332 status = _Rate_monotonic_Get_status_for_state( state );
333 _Rate_monotonic_Release( the_period, &lock_context );
347 status = _Rate_monotonic_Block_while_expired(
358 status = _Rate_monotonic_Block_while_active(
367 status = _Rate_monotonic_Activate(
384 status = _Rate_monotonic_Block_while_expired(
static __inline__ void _Thread_Unblock(Thread_Control *the_thread)
Unblocks the thread.
Timestamp_Control max_wall_time
void _Thread_Get_CPU_time_used(Thread_Control *the_thread, Timestamp_Control *cpu_time_used)
Gets the used cpu time of the thread and stores it in the given Timestamp_Control.
static void _TOD_Get_uptime(Timestamp_Control *time)
Gets the system uptime with potential accuracy to the nanosecond.
int64_t Timestamp_Control
Timestamp_Control min_cpu_time
Thread_Wait_information Wait
Thread queue context for the thread queue methods.
void _Thread_Dispatch_direct(Per_CPU_Control *cpu_self)
Directly do a thread dispatch.
static __inline__ bool _Timestamp_Less_than(const Timestamp_Control *_lhs, const Timestamp_Control *_rhs)
Checks if the left hand side timestamp is less than the right one.
Watchdog_Control Timer
Protects the rate monotonic period state.
#define RTEMS_PERIOD_STATUS
This constant is the interval passed to the rtems_rate_monotonic_period() directive to obtain status ...
Inlined Routines Associated with the Manipulation of the Scheduler.
static __inline__ bool _Thread_Wait_flags_try_change_acquire(Thread_Control *the_thread, Thread_Wait_flags expected_flags, Thread_Wait_flags desired_flags)
Tries to change the thread wait flags with acquire semantics.
#define _ISR_lock_ISR_enable(_context)
Restores the saved interrupt state of the ISR lock context.
#define STATES_WAITING_FOR_PERIOD
static __inline__ Thread_Wait_flags _Thread_Wait_flags_get(const Thread_Control *the_thread)
Gets the thread's wait flags according to the ATOMIC_ORDER_RELAXED.
static __inline__ bool _Timestamp_Greater_than(const Timestamp_Control *_lhs, const Timestamp_Control *_rhs)
Checks if the left hand side timestamp is greater than the right one.
rtems_status_code rtems_rate_monotonic_period(rtems_id id, rtems_interval length)
%
This status code indicates successful completion.
static __inline__ void _Timestamp_Subtract(const Timestamp_Control *_start, const Timestamp_Control *_end, Timestamp_Control *_result)
Subtracts two timestamps.
static __inline__ Per_CPU_Control * _Thread_Dispatch_disable_critical(const ISR_lock_Context *lock_context)
Disables thread dispatching inside a critical section (interrupts disabled).
Timestamp_Control total_wall_time
static __inline__ void _Thread_Wait_flags_set(Thread_Control *the_thread, Thread_Wait_flags flags)
Sets the thread's wait flags.
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
Timestamp_Control min_wall_time
bool _Rate_monotonic_Get_status(const Rate_monotonic_Control *the_period, Timestamp_Control *wall_since_last_period, Timestamp_Control *cpu_since_last_period)
_Rate_monotonic_Get_status(
static __inline__ void _Timestamp_Add_to(Timestamp_Control *_time, const Timestamp_Control *_add)
Adds two timestamps.
Rate_monotonic_Statistics Statistics
static __inline__ uint64_t _Watchdog_Per_CPU_insert_ticks(Watchdog_Control *the_watchdog, Per_CPU_Control *cpu, Watchdog_Interval ticks)
Sets the watchdog's cpu to the given instance and sets its expiration time to the watchdog expiration...
void _Thread_Priority_update(Thread_queue_Context *queue_context)
Updates the priority of all threads in the set.
rtems_rate_monotonic_period_states state
Timestamp_Control total_cpu_time
void _Thread_Dispatch_enable(Per_CPU_Control *cpu_self)
Enables thread dispatching.
States_Control _Thread_Set_state(Thread_Control *the_thread, States_Control state)
Sets the specified thread state.
Timestamp_Control cpu_usage_period_initiated
The following structure defines the control block used to manage each period.
Watchdog_Interval rtems_interval
This type is used to represent clock tick intervals.
This status code indicates that the item has not been initialized.
This status code indicates that an object identifier was invalid.
This status code indicates that the caller was not the owner of the resource.
Objects_Id rtems_id
Values of this type identify an RTEMS object.
This status code indicates that a blocking directive timed out.
rtems_rate_monotonic_period_states
%
Timestamp_Control time_period_initiated
Classic Rate Monotonic Scheduler Implementation.
Local ISR lock context for acquire and release pairs.
Timestamp_Control max_cpu_time
static __inline__ void _Scheduler_Release_job(Thread_Control *the_thread, Priority_Node *priority_node, uint64_t deadline, Thread_queue_Context *queue_context)
Releases a job of a thread with respect to the scheduler.
Priority_Node Priority
A priority node for use by the scheduler job release and cancel operations.
#define _Assert(_e)
Assertion similar to assert() controlled via RTEMS_DEBUG instead of NDEBUG.