IntrOS
Loading...
Searching...
No Matches
Signal

signals with protection mask More...

Macros

#define SIGSET(signo)
 signal mask from the given signal number
#define sigAny   ( 0U )
 signal mask for any signal
#define sigAll   ( 0U-1 )
 signal mask for all signals
#define OS_SIG(sig)
 define and initialize a signal object
#define static_SIG(sig)
 static alias of OS_SIG()
#define SIG_INIT()
 create and initialize a signal object
#define SIG_CREATE()
 create and initialize a signal object
#define SIG_NEW   SIG_CREATE
 alias of SIG_CREATE()

Functions

void sig_init (sig_t *sig)
 initialize a signal object
void sig_reset (sig_t *sig)
 reset the signal object and wake up all waiting tasks with 'E_STOPPED' event value
void sig_kill (sig_t *sig)
 alias of sig_reset()
int sig_take (sig_t *sig, unsigned sigset, unsigned *signo)
 check signal object for a given set of signals and return the lowest one in the 'signo' variable
int sig_tryWait (sig_t *sig, unsigned sigset, unsigned *signo)
 alias of sig_take()
int sig_waitFor (sig_t *sig, unsigned sigset, unsigned *signo, cnt_t delay)
 wait for a signal from the given set of signals for given duration of time and return the lowest one in the 'signo' variable
int sig_waitUntil (sig_t *sig, unsigned sigset, unsigned *signo, cnt_t time)
 wait for a signal from the given set of signals until given timepoint and return the lowest one in the 'signo' variable
int sig_wait (sig_t *sig, unsigned sigset, unsigned *signo)
 wait indefinitely for a signal from the given set of signals and return the lowest one in the 'signo' variable
void sig_give (sig_t *sig, unsigned signo)
 set given signal in the signal object
void sig_set (sig_t *sig, unsigned signo)
 alias of sig_give()
void sig_clear (sig_t *sig, unsigned signo)
 reset given signal in the signal object

Detailed Description

signals with protection mask

Macro Definition Documentation

◆ SIGSET

#define SIGSET ( signo)
Value:
(((signo) < (SIG_LIMIT)) ? 1U << (signo) : 0U)

signal mask from the given signal number

◆ OS_SIG

#define OS_SIG ( sig)
Value:
sig_t sig[] = { _SIG_INIT() }

define and initialize a signal object

Parameters
signame of a pointer to signal object

◆ static_SIG

#define static_SIG ( sig)
Value:
static sig_t sig[] = { _SIG_INIT() }

static alias of OS_SIG()

◆ SIG_INIT

#define SIG_INIT ( )
Value:
_SIG_INIT()

create and initialize a signal object

Returns
signal object
Note
use only in 'C' code

◆ SIG_CREATE

#define SIG_CREATE ( )
Value:
{ SIG_INIT () }
#define SIG_INIT()
create and initialize a signal object
Definition ossignal.h:104

create and initialize a signal object

Returns
signal object as array (id)
Note
use only in 'C' code

Function Documentation

◆ sig_init()

void sig_init ( sig_t * sig)

initialize a signal object

Parameters
sigpointer to signal object

◆ sig_reset()

void sig_reset ( sig_t * sig)

reset the signal object and wake up all waiting tasks with 'E_STOPPED' event value

Parameters
sigpointer to signal object
Note
use only in thread mode

◆ sig_take()

int sig_take ( sig_t * sig,
unsigned sigset,
unsigned * signo )

check signal object for a given set of signals and return the lowest one in the 'signo' variable

Parameters
sigpointer to signal object
sigsetset of expected signals
signopointer to the variable getting signal number
Return values
E_SUCCESSvariable 'singno' contains the lowest number of expected signal from the set of all pending signals
E_TIMEOUTno expected signal has been set, try again

◆ sig_waitFor()

int sig_waitFor ( sig_t * sig,
unsigned sigset,
unsigned * signo,
cnt_t delay )

wait for a signal from the given set of signals for given duration of time and return the lowest one in the 'signo' variable

Parameters
sigpointer to signal object
sigsetset of expected signals
signopointer to the variable getting signal number
delayduration of time (maximum number of ticks to wait for release the signal object)
  • IMMEDIATE: don't wait until the signal object has been released
  • INFINITE: wait indefinitely until the signal object has been released
Return values
E_SUCCESSvariable 'singno' contains the lowest number of expected signal from the set of all pending signals
E_STOPPEDsignal object was reseted before the specified timeout expired
E_TIMEOUTno expected signal has been set before the specified timeout expired

◆ sig_waitUntil()

int sig_waitUntil ( sig_t * sig,
unsigned sigset,
unsigned * signo,
cnt_t time )

wait for a signal from the given set of signals until given timepoint and return the lowest one in the 'signo' variable

Parameters
sigpointer to signal object
sigsetset of expected signals
signopointer to the variable getting signal number
timetimepoint value
Return values
E_SUCCESSvariable 'singno' contains the lowest number of expected signal from the set of all pending signals
E_STOPPEDsignal object was reseted before the specified timeout expired
E_TIMEOUTno expected signal has been set before the specified timeout expired

◆ sig_wait()

int sig_wait ( sig_t * sig,
unsigned sigset,
unsigned * signo )
inline

wait indefinitely for a signal from the given set of signals and return the lowest one in the 'signo' variable

Parameters
sigpointer to signal object
sigsetset of expected signals
signopointer to the variable getting signal number
Return values
E_SUCCESSvariable 'singno' contains the lowest number of expected signal from the set of all pending signals
E_STOPPEDsignal object was reseted

◆ sig_give()

void sig_give ( sig_t * sig,
unsigned signo )

set given signal in the signal object

Parameters
sigpointer to signal object
signosignal number to set signo >= SIG_LIMIT: no signal is set, but the tasks waiting for any signal (sigAny) are woken up and get this number in the 'signo' variable

◆ sig_clear()

void sig_clear ( sig_t * sig,
unsigned signo )

reset given signal in the signal object

Parameters
sigpointer to signal object
signosignal number to clear