signal.h File Reference

Signal module for IPC. More...

#include <cfg/compiler.h>

Go to the source code of this file.


Defines

Signal definitions
#define SIG_USER0   BV(0)
 Free for user usage.
#define SIG_USER1   BV(1)
 Free for user usage.
#define SIG_USER2   BV(2)
 Free for user usage.
#define SIG_USER3   BV(3)
 Free for user usage.
#define SIG_TIMEOUT   BV(4)
 Reserved for timeout use.
#define SIG_SYSTEM5   BV(5)
 Reserved for system use.
#define SIG_SYSTEM6   BV(6)
 Reserved for system use.
#define SIG_SINGLE   BV(7)
 Used to wait for a single event.

Functions

sigmask_t sig_check (sigmask_t sigs)
 Check if any of the signals in sigs has occurred and clear them.
void sig_signal (struct Process *proc, sigmask_t sig)
 Send the signals sigs to the process proc.
sigmask_t sig_wait (sigmask_t sigs)
 Sleep until any of the signals in sigs occurs.
sigmask_t sig_waitTimeout (sigmask_t sigs, ticks_t timeout)
 Sleep until any of the signals in sigs or timeout ticks elapse.

Detailed Description

Signal module for IPC.

Version:
Id
signal.h 2665 2009-04-24 16:39:09Z batt

Author:
Bernie Innocenti <bernie@codewiz.org>

Definition in file signal.h.


Function Documentation

sigmask_t sig_check ( sigmask_t  sigs  ) 

Check if any of the signals in sigs has occurred and clear them.

Returns:
the signals that have occurred.

Definition at line 122 of file signal.c.

void sig_signal ( Process *  proc,
sigmask_t  sigs 
)

Send the signals sigs to the process proc.

The process will be awoken if it was waiting for any of them.

Note:
This call is interrupt safe.

Definition at line 239 of file signal.c.

sigmask_t sig_wait ( sigmask_t  sigs  ) 

Sleep until any of the signals in sigs occurs.

Returns:
the signal(s) that have awoken the process.

Definition at line 140 of file signal.c.

sigmask_t sig_waitTimeout ( sigmask_t  sigs,
ticks_t  timeout 
)

Sleep until any of the signals in sigs or timeout ticks elapse.

If the timeout elapse a SIG_TIMEOUT is added to the received signal(s).

Returns:
the signal(s) that have awoken the process.
Note:
Caller must check return value to check which signal awoke the process.

Definition at line 206 of file signal.c.