R_RTOS  0.1
DistributedRealTimeOperatingSystemfortheARMCortexMArchitecture
R_RTOS_sem.c File Reference
#include "R_RTOS_sem.h"
#include "R_RTOS_task.h"
#include "R_RTOS_BitMagic.h"
#include "R_RTOS_memMngr.h"

Functions

RetCode sem_InitSems (void)
 Initialize the semaphore functionality. More...
 
static RetCode sem_InsertTskSemQ (PSem const pSem, const SemNr semNr, PTskTCB const pTskToIns)
 Insert the given Task into the Semaphore's wait queue. More...
 
static TskID sem_GetNextTskSemQ (PSem const pSem, const SemNr semNr)
 Retrieve the next Task from the Semaphore's wait queue. More...
 
RetCode sem_initBinSem (const SemNr semNr)
 Initialize the Semaphore corresponding to the given number as a Binary Semaphore. More...
 
RetCode sem_initCntSem (const SemNr semNr, const SemCntr ressourceCntr)
 Initialize the Semaphore corresponding to the given number as a counting Semaphore. More...
 
RetCode sem_wait (const SemNr semNr, PTskTCB const tsk, const SysTicks maxSysTicksToWait)
 Request access to the resource guarded by the Semaphore corresponding to the given number. More...
 
RetCode sem_Tsksignal (const SemNr semNr, PTskTCB const tsk)
 Signal the Semaphore from Task context. See sem_signal. More...
 
RetCode sem_signal (const SemNr semNr)
 Signal the Semaphore to make its resources available again. More...
 
RetCode sem_DeleteTskSemQ (PTskTCB const tsk)
 Delete a SemLst entry from the semaphore queue. More...
 

Variables

static Sem ar_Sems [AMOUNT_OF_SEMS]
 Contains all semaphores.
 
static volatile TskID ar_SemsWaitQueue [AMOUNT_OF_SEMS]
 Contains the TskID of the start of the respective semaphore's wait queue.
 
static volatile MemPoolID memPoolID_SEM
 ID of the memory pool memory allocation request of semaphores are served from.
 

Detailed Description