RTEMS CPU Kit with SuperCore  4.11.3
Macros | Functions | Variables
semimpl.h File Reference

Classic Semaphores Implementation. More...

#include <rtems/rtems/sem.h>
#include <rtems/score/coremuteximpl.h>
#include <rtems/score/coresemimpl.h>
#include <rtems/score/mrspimpl.h>
Include dependency graph for semimpl.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define RTEMS_SEM_EXTERN   extern
 Instantiate Semaphore Data. More...
 

Functions

void _Semaphore_Manager_initialization (void)
 Semaphore Manager Initialization. More...
 
RTEMS_INLINE_ROUTINE rtems_status_code _Semaphore_Translate_core_mutex_return_code (uint32_t status)
 Semaphore Translate Core Mutex Return Code. More...
 
RTEMS_INLINE_ROUTINE rtems_status_code _Semaphore_Translate_core_semaphore_return_code (uint32_t status)
 Semaphore Translate Core Semaphore Return Code. More...
 
RTEMS_INLINE_ROUTINE Semaphore_Control_Semaphore_Allocate (void)
 Allocates a semaphore control block from the inactive chain of free semaphore control blocks. More...
 
RTEMS_INLINE_ROUTINE void _Semaphore_Free (Semaphore_Control *the_semaphore)
 Frees a semaphore control block to the inactive chain of free semaphore control blocks. More...
 
RTEMS_INLINE_ROUTINE Semaphore_Control_Semaphore_Get (Objects_Id id, Objects_Locations *location)
 Maps semaphore IDs to semaphore control blocks. More...
 
RTEMS_INLINE_ROUTINE Semaphore_Control_Semaphore_Get_interrupt_disable (Objects_Id id, Objects_Locations *location, ISR_lock_Context *lock_context)
 Maps semaphore IDs to semaphore control blocks. More...
 

Variables

RTEMS_SEM_EXTERN Objects_Information _Semaphore_Information
 The following defines the information control block used to manage this class of objects.
 
const rtems_status_code _Semaphore_Translate_core_mutex_return_code_ []
 
const rtems_status_code _Semaphore_Translate_core_semaphore_return_code_ []
 

Detailed Description

Classic Semaphores Implementation.

Macro Definition Documentation

◆ RTEMS_SEM_EXTERN

#define RTEMS_SEM_EXTERN   extern

Instantiate Semaphore Data.

Semaphore Manager – Data Instantiation

This constant is defined to extern most of the time when using this header file. However by defining it to nothing, the data declared in this header file can be instantiated. This is done in a single per manager file.

Function Documentation

◆ _Semaphore_Allocate()

RTEMS_INLINE_ROUTINE Semaphore_Control* _Semaphore_Allocate ( void  )

Allocates a semaphore control block from the inactive chain of free semaphore control blocks.

This function allocates a semaphore control block from the inactive chain of free semaphore control blocks.

References _Objects_Allocate().

Referenced by rtems_semaphore_create().

◆ _Semaphore_Free()

RTEMS_INLINE_ROUTINE void _Semaphore_Free ( Semaphore_Control the_semaphore)

Frees a semaphore control block to the inactive chain of free semaphore control blocks.

This routine frees a semaphore control block to the inactive chain of free semaphore control blocks.

References _Objects_Free(), and Semaphore_Control::Object.

Referenced by rtems_semaphore_create().

◆ _Semaphore_Get()

RTEMS_INLINE_ROUTINE Semaphore_Control* _Semaphore_Get ( Objects_Id  id,
Objects_Locations location 
)

Maps semaphore IDs to semaphore control blocks.

This function maps semaphore IDs to semaphore control blocks. If ID corresponds to a local semaphore, then it returns the_semaphore control pointer which maps to ID and location is set to OBJECTS_LOCAL. if the semaphore ID is global and resides on a remote node, then location is set to OBJECTS_REMOTE, and the_semaphore is undefined. Otherwise, location is set to OBJECTS_ERROR and the_semaphore is undefined.

References _Objects_Get().

Referenced by rtems_semaphore_delete(), and rtems_semaphore_flush().

◆ _Semaphore_Get_interrupt_disable()

RTEMS_INLINE_ROUTINE Semaphore_Control* _Semaphore_Get_interrupt_disable ( Objects_Id  id,
Objects_Locations location,
ISR_lock_Context lock_context 
)

Maps semaphore IDs to semaphore control blocks.

This function maps semaphore IDs to semaphore control blocks. If ID corresponds to a local semaphore, then it returns the_semaphore control pointer which maps to ID and location is set to OBJECTS_LOCAL. if the semaphore ID is global and resides on a remote node, then location is set to OBJECTS_REMOTE, and the_semaphore is undefined. Otherwise, location is set to OBJECTS_ERROR and the_semaphore is undefined.

References _Objects_Get_isr_disable().

Referenced by rtems_semaphore_release().

◆ _Semaphore_Manager_initialization()

void _Semaphore_Manager_initialization ( void  )

Semaphore Manager Initialization.

This routine performs the initialization necessary for this manager.

References _Objects_Initialize_information(), and _Semaphore_Information.

◆ _Semaphore_Translate_core_mutex_return_code()

RTEMS_INLINE_ROUTINE rtems_status_code _Semaphore_Translate_core_mutex_return_code ( uint32_t  status)

Semaphore Translate Core Mutex Return Code.

This function returns a RTEMS status code based on the mutex status code specified.

Parameters
[in]statusis the mutex status code to translate
Return values
translatedRTEMS status code

◆ _Semaphore_Translate_core_semaphore_return_code()

RTEMS_INLINE_ROUTINE rtems_status_code _Semaphore_Translate_core_semaphore_return_code ( uint32_t  status)

Semaphore Translate Core Semaphore Return Code.

This function returns a RTEMS status code based on the semaphore status code specified.

Parameters
[in]statusis the semaphore status code to translate
Return values
translatedRTEMS status code