RTEMS: Simple Priority Scheduler

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
Files | Data Structures | Macros | Functions
Simple Priority Scheduler
Internal » SuperCore » Scheduler Handler

Simple Priority Scheduler. More...

## Files
file | schedulersimple.h
| Manipulation of Threads Simple-Priority-Based Ready Queue.
file | schedulersimpleimpl.h
| Inlined Routines Associated with the Manipulation of the Priority-Based Scheduling Structures.

## Data Structures
struct | Scheduler_simple_Context
| Simple scheduler context. More...

## Macros
#define | SCHEDULER_SIMPLE_MAXIMUM_PRIORITY 255
#define | SCHEDULER_SIMPLE_ENTRY_POINTS

## Functions
void | _Scheduler_simple_Initialize (const Scheduler_Control *scheduler)
| Initializes simple scheduler.
void | _Scheduler_simple_Schedule (const Scheduler_Control *scheduler, Thread_Control *the_thread)
| Schedules threads.
void | _Scheduler_simple_Yield (const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
| Performs the yield of a thread.
void | _Scheduler_simple_Block (const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
| Blocks the thread.
void | _Scheduler_simple_Unblock (const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
| Unblocks the thread.
void | _Scheduler_simple_Update_priority (const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
| Updates the priority of the node.
RTEMS_INLINE_ROUTINE Scheduler_simple_Context * | _Scheduler_simple_Get_context (const Scheduler_Control *scheduler)
| Gets context of the scheduler.
RTEMS_INLINE_ROUTINE bool | _Scheduler_simple_Priority_less_equal (const void *to_insert, const Chain_Node *next)
| Checks if the priority is less or equal than the priority of the node.
RTEMS_INLINE_ROUTINE void | _Scheduler_simple_Insert (Chain_Control *chain, Thread_Control *to_insert, unsigned int insert_priority)
| Inserts the thread control with the given priority into the chain.
RTEMS_INLINE_ROUTINE void | _Scheduler_simple_Extract (const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
| Extracts the threads node.
RTEMS_INLINE_ROUTINE void | _Scheduler_simple_Schedule_body (const Scheduler_Control *scheduler, Thread_Control *the_thread, bool force_dispatch)
| Scheduling decision logic.

## Detailed Description

Simple Priority Scheduler.

## Macro Definition Documentation

## ◆ SCHEDULER_SIMPLE_ENTRY_POINTS

#define SCHEDULER_SIMPLE_ENTRY_POINTS

Value:
{ \
_Scheduler_simple_Initialize, /* initialize entry point */ \
_Scheduler_simple_Schedule, /* schedule entry point */ \
_Scheduler_simple_Yield, /* yield entry point */ \
_Scheduler_simple_Block, /* block entry point */ \
_Scheduler_simple_Unblock, /* unblock entry point */ \
_Scheduler_simple_Update_priority, /* update priority entry point */ \
_Scheduler_default_Map_priority, /* map priority entry point */ \
_Scheduler_default_Unmap_priority, /* unmap priority entry point */ \
SCHEDULER_OPERATION_DEFAULT_ASK_FOR_HELP \
_Scheduler_default_Node_initialize, /* node initialize entry point */ \
_Scheduler_default_Node_destroy, /* node destroy entry point */ \
_Scheduler_default_Release_job, /* new period of task */ \
_Scheduler_default_Cancel_job, /* cancel period of task */ \
_Scheduler_default_Tick, /* tick entry point */ \
_Scheduler_default_Start_idle /* start idle entry point */ \
SCHEDULER_OPERATION_DEFAULT_GET_SET_AFFINITY \
}
_Scheduler_simple_Initialize
void _Scheduler_simple_Initialize(const Scheduler_Control *scheduler)
Initializes simple scheduler.
Definition: schedulersimple.c:25
_Scheduler_simple_Block
void _Scheduler_simple_Block(const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
Blocks the thread.
Definition: schedulersimpleblock.c:24
_Scheduler_simple_Unblock
void _Scheduler_simple_Unblock(const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
Unblocks the thread.
Definition: schedulersimpleunblock.c:25
_Scheduler_simple_Schedule
void _Scheduler_simple_Schedule(const Scheduler_Control *scheduler, Thread_Control *the_thread)
Schedules threads.
Definition: schedulersimpleschedule.c:24
_Scheduler_simple_Update_priority
void _Scheduler_simple_Update_priority(const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
Updates the priority of the node.
Definition: schedulersimplechangepriority.c:24
_Scheduler_simple_Yield
void _Scheduler_simple_Yield(const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
Performs the yield of a thread.
Definition: schedulersimpleyield.c:24
_Scheduler_default_Tick
void _Scheduler_default_Tick(const Scheduler_Control *scheduler, Thread_Control *executing)
Performs tick operations depending on the CPU budget algorithm for each executing thread.
Definition: schedulerdefaulttick.c:27
_Scheduler_default_Release_job
void _Scheduler_default_Release_job(const Scheduler_Control *scheduler, Thread_Control *the_thread, Priority_Node *priority_node, uint64_t deadline, Thread_queue_Context *queue_context)
Does nothing.
Definition: schedulerdefaultreleasejob.c:24
_Scheduler_default_Node_destroy
void _Scheduler_default_Node_destroy(const Scheduler_Control *scheduler, Scheduler_Node *node)
Does nothing.
Definition: schedulerdefaultnodedestroy.c:24
_Scheduler_default_Map_priority
Priority_Control _Scheduler_default_Map_priority(const Scheduler_Control *scheduler, Priority_Control priority)
Returns the scheduler internal thread priority mapped by SCHEDULER_PRIORITY_MAP().
Definition: schedulerdefaultmappriority.c:15
_Scheduler_default_Unmap_priority
Priority_Control _Scheduler_default_Unmap_priority(const Scheduler_Control *scheduler, Priority_Control priority)
Returns the user visible thread priority unmapped by SCHEDULER_PRIORITY_UNMAP().
Definition: schedulerdefaultmappriority.c:23
_Scheduler_default_Cancel_job
void _Scheduler_default_Cancel_job(const Scheduler_Control *scheduler, Thread_Control *the_thread, Priority_Node *priority_node, Thread_queue_Context *queue_context)
Does nothing.
Definition: schedulerdefaultreleasejob.c:39
_Scheduler_default_Start_idle
void _Scheduler_default_Start_idle(const Scheduler_Control *scheduler, Thread_Control *the_thread, struct Per_CPU_Control *cpu)
Starts an idle thread.
Definition: schedulerdefaultstartidle.c:15

Entry points for Scheduler Simple

## Function Documentation

## ◆ _Scheduler_simple_Block()

void _Scheduler_simple_Block | ( | const Scheduler_Control * | scheduler,
|  | Thread_Control * | the_thread,
|  | Scheduler_Node * | node
| ) |  |

Blocks the thread.

Parameters

  | scheduler | The scheduler instance.
  [in,out] | the_thread | The thread to block.
  [in,out] | node | The thread's scheduler node.

## ◆ _Scheduler_simple_Extract()

RTEMS_INLINE_ROUTINE void _Scheduler_simple_Extract | ( | const Scheduler_Control * | scheduler,
|  | Thread_Control * | the_thread,
|  | Scheduler_Node * | node
| ) |  |

Extracts the threads node.

Parameters

  | scheduler | This parameter is unused.
  [in,out] | the_thread | The thread of which to extract the node out of its chain.
  | node | This parameter is unused.

## ◆ _Scheduler_simple_Get_context()

RTEMS_INLINE_ROUTINE Scheduler_simple_Context * _Scheduler_simple_Get_context | ( | const Scheduler_Control * | scheduler | ) |

Gets context of the scheduler.

Parameters

  scheduler | The scheduler instance to get the context of.

Returns
  The context of scheduler.

## ◆ _Scheduler_simple_Initialize()

void _Scheduler_simple_Initialize | ( | const Scheduler_Control * | scheduler | ) |

Initializes simple scheduler.

This routine initializes the simple scheduler.

Parameters

  scheduler | The scheduler to be initialized.

## ◆ _Scheduler_simple_Insert()

RTEMS_INLINE_ROUTINE void _Scheduler_simple_Insert | ( | Chain_Control * | chain,
|  | Thread_Control * | to_insert,
|  | unsigned int | insert_priority
| ) |  |

Inserts the thread control with the given priority into the chain.

Parameters

  [in,out] | chain | The chain to insert to_insert in.
  [in,out] | to_insert | The node to insert into chain.
  | insert_priority | The priority to insert to_insert with.

## ◆ _Scheduler_simple_Priority_less_equal()

RTEMS_INLINE_ROUTINE bool _Scheduler_simple_Priority_less_equal | ( | const void * | to_insert,
|  | const Chain_Node * | next
| ) |  |

Checks if the priority is less or equal than the priority of the node.

Parameters

  to_insert | The priority to check whether it is less or equal than next.
  next | The Chain node to compare the priority of.

Return values

  true | to_insert is smaller or equal than the priority of next.
  false | to_insert is greater than the priority of next.

## ◆ _Scheduler_simple_Schedule()

void _Scheduler_simple_Schedule | ( | const Scheduler_Control * | scheduler,
|  | Thread_Control * | the_thread
| ) |  |

Schedules threads.

This routine sets the heir thread to be the next ready thread on the ready queue by getting the first node in the scheduler information.

Parameters

  scheduler | The scheduler instance.
  the_thread | causing the scheduling operation.

## ◆ _Scheduler_simple_Schedule_body()

RTEMS_INLINE_ROUTINE void _Scheduler_simple_Schedule_body | ( | const Scheduler_Control * | scheduler,
|  | Thread_Control * | the_thread,
|  | bool | force_dispatch
| ) |  |

Scheduling decision logic.

This kernel routine implements scheduling decision logic for the simple scheduler.

Parameters

  [in,out] | scheduler | The scheduler instance.
  | the_thread | This parameter is unused.
  | force_dispatch | Indicates whether the dispatch happens also if the currently executing thread is set as not preemptible.

## ◆ _Scheduler_simple_Unblock()

void _Scheduler_simple_Unblock | ( | const Scheduler_Control * | scheduler,
|  | Thread_Control * | the_thread,
|  | Scheduler_Node * | node
| ) |  |

Unblocks the thread.

Parameters

  | scheduler | The scheduler instance.
  [in,out] | the_thread | The thread to unblock.
  [in,out] | node | The thread's scheduler node.

## ◆ _Scheduler_simple_Update_priority()

void _Scheduler_simple_Update_priority | ( | const Scheduler_Control * | scheduler,
|  | Thread_Control * | the_thread,
|  | Scheduler_Node * | node
| ) |  |

Updates the priority of the node.

Parameters

  scheduler | The scheduler instance.
  the_thread | The thread for the operation.
  node | The thread's scheduler node.

## ◆ _Scheduler_simple_Yield()

void _Scheduler_simple_Yield | ( | const Scheduler_Control * | scheduler,
|  | Thread_Control * | the_thread,
|  | Scheduler_Node * | node
| ) |  |

Performs the yield of a thread.

Parameters

  | scheduler | The scheduler instance.
  [in,out] | the_thread | The thread that performed the yield operation.
  | node | The scheduler node of the_thread.