From: arighi Date: Mon, 7 Mar 2011 18:33:59 +0000 (+0000) Subject: signal: split user and system signals in two distinct intervals X-Git-Tag: 2.7.0~210 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=60be066461df6017db78ae92c41d8cc8340070e7;p=bertos.git signal: split user and system signals in two distinct intervals Reorganize the bits of sigmask_t so that signals that can be used by drivers or user applications and signals reserved for internal system use are placed in two distinct intervals: * * * . . . . . |_|_|_|_|_|_|_|_| 7 6 5 4 3 2 1 0 sigmask_t bits (*) bits [5-7] are reserved for internal system usage (SIG_TIMEOUT, etc.) (.) bits [0-4] are available for driver and user applications usage This makes easier to allocate a range of contiguous signals. This can be used for example to wait the occurrence of multiple events, multiplexing them with multiple signal bits. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4756 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/bertos/kern/signal.h b/bertos/kern/signal.h index 70506fe1..a5d5e8d3 100644 --- a/bertos/kern/signal.h +++ b/bertos/kern/signal.h @@ -117,10 +117,15 @@ int signal_testTearDown(void); #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 */ +#define SIG_SINGLE BV(4) /**< Used to wait for a single event */ +#define SIG_SYSTEM5 BV(5) /**< Reserved for internal system use */ +#define SIG_SYSTEM6 BV(6) /**< Reserved for internal system use */ +#define SIG_TIMEOUT BV(7) /**< Reserved for timeout use */ + +/** + * Max number of signals that can be used by drivers or user applications. + */ +#define SIG_USER_MAX SIG_SINGLE /*\}*/ /* \} */ //defgroup kern_signal