RTEMS
Files | Classes | Macros | Functions
Multiprocessor Resource Sharing Protocol Handler

Multiprocessor Resource Sharing Protocol (MrsP). More...

Files

file  mrsp.h
 Definitions for Multiprocessor Resource Sharing Protocol (MrsP).
 
file  mrspimpl.h
 Definitions for Multiprocessor Resource Sharing Protocol (MrsP) Implementation.
 

Classes

struct  MRSP_Control
 MrsP control block. More...
 

Macros

#define MRSP_TQ_OPERATIONS   &_Thread_queue_Operations_priority_inherit
 

Functions

static __inline__ void _MRSP_Acquire_critical (MRSP_Control *mrsp, Thread_queue_Context *queue_context)
 Acquires critical accordingt to MrsP. More...
 
static __inline__ void _MRSP_Release (MRSP_Control *mrsp, Thread_queue_Context *queue_context)
 Releases according to MrsP. More...
 
static __inline__ Thread_Control_MRSP_Get_owner (const MRSP_Control *mrsp)
 Gets owner of the MrsP control. More...
 
static __inline__ void _MRSP_Set_owner (MRSP_Control *mrsp, Thread_Control *owner)
 Sets owner of the MrsP control. More...
 
static __inline__ Priority_Control _MRSP_Get_priority (const MRSP_Control *mrsp, const Scheduler_Control *scheduler)
 Gets priority of the MrsP control. More...
 
static __inline__ void _MRSP_Set_priority (MRSP_Control *mrsp, const Scheduler_Control *scheduler, Priority_Control new_priority)
 Sets priority of the MrsP control. More...
 
static __inline__ Status_Control _MRSP_Raise_priority (MRSP_Control *mrsp, Thread_Control *thread, Priority_Node *priority_node, Thread_queue_Context *queue_context)
 Adds the priority to the given thread. More...
 
static __inline__ void _MRSP_Remove_priority (Thread_Control *thread, Priority_Node *priority_node, Thread_queue_Context *queue_context)
 Removes the priority from the given thread. More...
 
static __inline__ void _MRSP_Replace_priority (MRSP_Control *mrsp, Thread_Control *thread, Priority_Node *ceiling_priority)
 Replaces the given priority node with the ceiling priority of the MrsP control. More...
 
static __inline__ Status_Control _MRSP_Claim_ownership (MRSP_Control *mrsp, Thread_Control *executing, Thread_queue_Context *queue_context)
 Claims ownership of the MrsP control. More...
 
static __inline__ Status_Control _MRSP_Initialize (MRSP_Control *mrsp, const Scheduler_Control *scheduler, Priority_Control ceiling_priority, Thread_Control *executing, bool initially_locked)
 Initializes a MrsP control. More...
 
static __inline__ Status_Control _MRSP_Wait_for_ownership (MRSP_Control *mrsp, Thread_Control *executing, Thread_queue_Context *queue_context)
 Waits for the ownership of the MrsP control. More...
 
static __inline__ Status_Control _MRSP_Seize (MRSP_Control *mrsp, Thread_Control *executing, bool wait, Thread_queue_Context *queue_context)
 Seizes the MrsP control. More...
 
static __inline__ Status_Control _MRSP_Surrender (MRSP_Control *mrsp, Thread_Control *executing, Thread_queue_Context *queue_context)
 Surrenders the MrsP control. More...
 
static __inline__ Status_Control _MRSP_Can_destroy (MRSP_Control *mrsp)
 Checks if the MrsP control can be destroyed. More...
 
static __inline__ void _MRSP_Destroy (MRSP_Control *mrsp, Thread_queue_Context *queue_context)
 Destroys the MrsP control. More...
 

Detailed Description

Multiprocessor Resource Sharing Protocol (MrsP).

The Multiprocessor Resource Sharing Protocol (MrsP) is defined in A. Burns and A.J. Wellings, A Schedulability Compatible Multiprocessor Resource Sharing Protocol - MrsP, Proceedings of the 25th Euromicro Conference on Real-Time Systems (ECRTS 2013), July 2013. It is a generalization of the Priority Ceiling Protocol to SMP systems. Each MrsP semaphore uses a ceiling priority per scheduler instance. A task obtaining or owning a MrsP semaphore will execute with the ceiling priority for its scheduler instance as specified by the MrsP semaphore object. Tasks waiting to get ownership of a MrsP semaphore will not relinquish the processor voluntarily. In case the owner of a MrsP semaphore gets preempted it can ask all tasks waiting for this semaphore to help out and temporarily borrow the right to execute on one of their assigned processors.

Function Documentation

◆ _MRSP_Acquire_critical()

static __inline__ void _MRSP_Acquire_critical ( MRSP_Control mrsp,
Thread_queue_Context queue_context 
)
static

Acquires critical accordingt to MrsP.

Parameters
mrspThe MrsP control for the operation.
queue_contextThe thread queue context.

Definition at line 53 of file mrspimpl.h.

◆ _MRSP_Can_destroy()

static __inline__ Status_Control _MRSP_Can_destroy ( MRSP_Control mrsp)
static

Checks if the MrsP control can be destroyed.

Parameters
mrspThe MrsP control for the operation.
Return values
STATUS_SUCCESSFULThe MrsP is currently not used and can be destroyed.
STATUS_RESOURCE_IN_USEThe MrsP control is in use, it cannot be destroyed.

Definition at line 497 of file mrspimpl.h.

◆ _MRSP_Claim_ownership()

static __inline__ Status_Control _MRSP_Claim_ownership ( MRSP_Control mrsp,
Thread_Control executing,
Thread_queue_Context queue_context 
)
static

Claims ownership of the MrsP control.

Parameters
mrspThe MrsP control to claim the ownership of.
[in,out]executingThe currently executing thread.
queue_contextThe thread queue context.
Return values
STATUS_SUCCESSFULThe operation succeeded.
STATUS_MUTEX_CEILING_VIOLATEDThe wait priority of the executing thread exceeds the ceiling priority.

Definition at line 246 of file mrspimpl.h.

◆ _MRSP_Destroy()

static __inline__ void _MRSP_Destroy ( MRSP_Control mrsp,
Thread_queue_Context queue_context 
)
static

Destroys the MrsP control.

Parameters
[in,out]Themrsp that is about to be destroyed.
queue_contextThe thread queue context.

Definition at line 512 of file mrspimpl.h.

◆ _MRSP_Get_owner()

static __inline__ Thread_Control* _MRSP_Get_owner ( const MRSP_Control mrsp)
static

Gets owner of the MrsP control.

Parameters
mrspThe MrsP control to get the owner from.
Returns
The owner of the Mrsp control.

Definition at line 82 of file mrspimpl.h.

◆ _MRSP_Get_priority()

static __inline__ Priority_Control _MRSP_Get_priority ( const MRSP_Control mrsp,
const Scheduler_Control scheduler 
)
static

Gets priority of the MrsP control.

Parameters
mrspThe mrsp to get the priority from.
schedulerThe corresponding scheduler.
Returns
The priority of the MrsP control.

Definition at line 111 of file mrspimpl.h.

◆ _MRSP_Initialize()

static __inline__ Status_Control _MRSP_Initialize ( MRSP_Control mrsp,
const Scheduler_Control scheduler,
Priority_Control  ceiling_priority,
Thread_Control executing,
bool  initially_locked 
)
static

Initializes a MrsP control.

Parameters
[out]mrspThe MrsP control that is initialized.
schedulerThe scheduler for the operation.
ceiling_priority
executingThe currently executing thread. Ignored in this method.
initially_lockedIndicates whether the MrsP control shall be initally locked. If it is initially locked, this method returns STATUS_INVALID_NUMBER.
Return values
STATUS_SUCCESSFULThe operation succeeded.
STATUS_INVALID_NUMBERThe MrsP control is initially locked.
STATUS_NO_MEMORYThere is not enough memory to allocate.

Definition at line 289 of file mrspimpl.h.

◆ _MRSP_Raise_priority()

static __inline__ Status_Control _MRSP_Raise_priority ( MRSP_Control mrsp,
Thread_Control thread,
Priority_Node priority_node,
Thread_queue_Context queue_context 
)
static

Adds the priority to the given thread.

Parameters
mrspThe MrsP control for the operation.
[in,out]threadThe thread to add the priority node to.
[out]priority_nodeThe priority node to initialize and add to the thread.
queue_contextThe thread queue context.
Return values
STATUS_SUCCESSFULThe operation succeeded.
STATUS_MUTEX_CEILING_VIOLATEDThe wait priority of the thread exceeds the ceiling priority.

Definition at line 154 of file mrspimpl.h.

◆ _MRSP_Release()

static __inline__ void _MRSP_Release ( MRSP_Control mrsp,
Thread_queue_Context queue_context 
)
static

Releases according to MrsP.

Parameters
mrspThe MrsP control for the operation.
queue_contextThe thread queue context.

Definition at line 67 of file mrspimpl.h.

◆ _MRSP_Remove_priority()

static __inline__ void _MRSP_Remove_priority ( Thread_Control thread,
Priority_Node priority_node,
Thread_queue_Context queue_context 
)
static

Removes the priority from the given thread.

Parameters
[in,out]Thethread to remove the priority from.
priority_nodeThe priority node to remove from the thread
queue_contextThe thread queue context.

Definition at line 196 of file mrspimpl.h.

◆ _MRSP_Replace_priority()

static __inline__ void _MRSP_Replace_priority ( MRSP_Control mrsp,
Thread_Control thread,
Priority_Node ceiling_priority 
)
static

Replaces the given priority node with the ceiling priority of the MrsP control.

Parameters
mrspThe mrsp control for the operation.
[out]threadThe thread to replace the priorities.
ceiling_priorityThe node to be replaced.

Definition at line 218 of file mrspimpl.h.

◆ _MRSP_Seize()

static __inline__ Status_Control _MRSP_Seize ( MRSP_Control mrsp,
Thread_Control executing,
bool  wait,
Thread_queue_Context queue_context 
)
static

Seizes the MrsP control.

Parameters
[in,out]mrspThe MrsP control to seize the control of.
[in,out]executingThe currently executing thread.
waitIndicates whether the calling thread is willing to wait.
queue_contextThe thread queue context.
Return values
STATUS_SUCCESSFULThe operation succeeded.
STATUS_MUTEX_CEILING_VIOLATEDThe wait priority of the executing thread exceeds the ceiling priority.
STATUS_UNAVAILABLEThe executing thread is already the owner of the MrsP control. Seizing it is not possible.

Definition at line 406 of file mrspimpl.h.

◆ _MRSP_Set_owner()

static __inline__ void _MRSP_Set_owner ( MRSP_Control mrsp,
Thread_Control owner 
)
static

Sets owner of the MrsP control.

Parameters
[out]mrspThe MrsP control to set the owner of.
ownerThe desired new owner for mrsp.

Definition at line 95 of file mrspimpl.h.

◆ _MRSP_Set_priority()

static __inline__ void _MRSP_Set_priority ( MRSP_Control mrsp,
const Scheduler_Control scheduler,
Priority_Control  new_priority 
)
static

Sets priority of the MrsP control.

Parameters
[out]mrspThe MrsP control to set the priority of.
schedulgerThe corresponding scheduler.
new_priorityThe new priority for the MrsP control

Definition at line 129 of file mrspimpl.h.

◆ _MRSP_Surrender()

static __inline__ Status_Control _MRSP_Surrender ( MRSP_Control mrsp,
Thread_Control executing,
Thread_queue_Context queue_context 
)
static

Surrenders the MrsP control.

Parameters
[in,out]mrspThe MrsP control to surrender the control of.
[in,out]executingThe currently executing thread.
queue_contextThe thread queue context.
Return values
STATUS_SUCCESSFULThe operation succeeded.
STATUS_NOT_OWNERThe executing thread does not own the MrsP control.

Definition at line 445 of file mrspimpl.h.

◆ _MRSP_Wait_for_ownership()

static __inline__ Status_Control _MRSP_Wait_for_ownership ( MRSP_Control mrsp,
Thread_Control executing,
Thread_queue_Context queue_context 
)
static

Waits for the ownership of the MrsP control.

Parameters
[in,out]mrspThe MrsP control to get the ownership of.
[in,out]executingThe currently executing thread.
queue_contextthe thread queue context.
Return values
STATUS_SUCCESSFULThe operation succeeded.
STATUS_MUTEX_CEILING_VIOLATEDThe wait priority of the currently executing thread exceeds the ceiling priority.
STATUS_DEADLOCKA deadlock occured.
STATUS_TIMEOUTA timeout occured.

Definition at line 334 of file mrspimpl.h.