Hardware Reference
In-Depth Information
10.4.3
GLOBAL CONSTANTS
In order to clarify the description of the source code, a number of global constants
are defined here. Typically, they define the maximum size of the main kernel data
structures, such as the maximum number of processes and semaphores, the maximum
length of a process name, the number of priority levels, the maximum deadline, and so
on. Other global constants encode process classes, states, and error messages. They
are listed below:
#define MAXLEN
12
/* max string length
*/
#define MAXPROC
32
/* max number of tasks
*/
#define MAXSEM
32
/* max No of semaphores */
#define MAXDLINE
0x7FFFFFFF
/* max deadline
*/
#define PRT LEV
255
/* priority levels
*/
#define NIL
-1
/* null pointer
*/
#define TRUE
1
#define FALSE
0
#define LIFETIME
MAXDLINE - PRT LEV
/*-----------------------------------------------------------*/
/* Task types */
/*-----------------------------------------------------------*/
#define HARD 1 /* critical task */
#define NRT 2 /* non real-time task */
/*-----------------------------------------------------------*/
/* Task states */
/*-----------------------------------------------------------*/
#define FREE
0
/* TCB not allocated
*/
#define READY
1
/* ready state
*/
#define EXE
2
/* running state
*/
#define SLEEP
3
/* sleep state
*/
#define IDLE
4
/* idle state
*/
#define WAIT
5
/* wait state
*/
#define ZOMBIE
6
/* zombie state
*/
Search WWH ::




Custom Search