aboutsummaryrefslogtreecommitdiffstats
path: root/include/litmus/signal.h
blob: 38c3207951e08585209c4126746afe1bc2fc052f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef LITMUS_SIGNAL_H
#define LITMUS_SIGNAL_H

#ifdef __KERNEL__
#include <linux/signal.h>
#else
#include <signal.h>
#endif

/* Signals used by Litmus to asynchronously communicate events
 * to real-time tasks.
 *
 * Signal values overlap with [SIGRTMIN, SIGRTMAX], so beware of
 * application-level conflicts when dealing with COTS user-level
 * code.
 */

/* Sent to a Litmus task when all of the following conditions are true:
 * (1) The task has exhausted its budget.
 * (2) budget_signal_policy is QUANTUM_SIGNALS or PRECISE_SIGNALS.
 *
 * Note: If a task does not have a registered handler for SIG_BUDGET,
 * the signal will cause the task to terminate (default action).
 */

/* Assigned values start at SIGRTMAX and decrease, hopefully reducing
 * likelihood of user-level conflicts.
 */
#define SIG_BUDGET					(SIGRTMAX - 0)

/*
Future signals could include:

#define SIG_DEADLINE_MISS			(SIGRTMAX - 1)
#define SIG_CRIT_LEVEL_CHANGE		(SIGRTMAX - 2)
*/

#define SIGLITMUSMIN				SIG_BUDGET

#ifdef __KERNEL__
#if (SIGLITMUSMIN < SIGRTMIN)
/* no compile-time check in user-space since SIGRTMIN may be a variable. */
#error "Too many LITMUS^RT signals!"
#endif
#endif

#endif