ChibiOS/RT
2.5.1
chsem.h File Reference

Detailed Description

Semaphores macros and structures.

Definition in file chsem.h.

Go to the source code of this file.

Data Structures

struct  Semaphore
 Semaphore structure. More...

Functions

void chSemInit (Semaphore *sp, cnt_t n)
 Initializes a semaphore with the specified counter value.
void chSemReset (Semaphore *sp, cnt_t n)
 Performs a reset operation on the semaphore.
void chSemResetI (Semaphore *sp, cnt_t n)
 Performs a reset operation on the semaphore.
msg_t chSemWait (Semaphore *sp)
 Performs a wait operation on a semaphore.
msg_t chSemWaitS (Semaphore *sp)
 Performs a wait operation on a semaphore.
msg_t chSemWaitTimeout (Semaphore *sp, systime_t time)
 Performs a wait operation on a semaphore with timeout specification.
msg_t chSemWaitTimeoutS (Semaphore *sp, systime_t time)
 Performs a wait operation on a semaphore with timeout specification.
void chSemSignal (Semaphore *sp)
 Performs a signal operation on a semaphore.
void chSemSignalI (Semaphore *sp)
 Performs a signal operation on a semaphore.
void chSemAddCounterI (Semaphore *sp, cnt_t n)
 Adds the specified value to the semaphore counter.
msg_t chSemSignalWait (Semaphore *sps, Semaphore *spw)
 Performs atomic signal and wait operations on two semaphores.

Defines

#define _SEMAPHORE_DATA(name, n)   {_THREADSQUEUE_DATA(name.s_queue), n}
 Data part of a static semaphore initializer.
#define SEMAPHORE_DECL(name, n)   Semaphore name = _SEMAPHORE_DATA(name, n)
 Static semaphore initializer.
Macro Functions
#define chSemFastWaitI(sp)   ((sp)->s_cnt--)
 Decreases the semaphore counter.
#define chSemFastSignalI(sp)   ((sp)->s_cnt++)
 Increases the semaphore counter.
#define chSemGetCounterI(sp)   ((sp)->s_cnt)
 Returns the semaphore counter current value.

Typedefs

typedef struct Semaphore Semaphore
 Semaphore structure.