]> rtime.felk.cvut.cz Git - rtems-pluggable-edf.git/blob - src/edf/edf_types.h
38dc0ecc8c72957ca9b25521d02ed13b1fc70477
[rtems-pluggable-edf.git] / src / edf / edf_types.h
1 #ifndef __EDF_TYPES_h
2 #define __EDF_TYPES_h
3
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7
8 #include <rtems/system.h>
9 #include <rtems/score/types.h>
10 #include <rtems/score/thread.h>
11
12
13 typedef uint32_t Deadline_Control;
14
15 #define EDF_BYTES_FOR_TIME 4    // It is uint32_t
16 //#define EDF_TIME_RANGE 0xffffffff
17
18
19 #define EDF_PRIORITY_MAX 255
20
21 /** 
22  * The scheduler has two separete policies for for tasks using deadlines 
23  * tasks using priorities. The priority driven tasks are always scheduled as less 
24  * important than the deadline driven ones.
25  * We can distinguish them by looking at the MSB of their priority. Priority diven
26  * have 1 and deadline driven have 0.
27  */
28 #define EDF_HYBRID_MASK 0x80000000 //This is MSB
29 //#define EDF_ABS_DEADLINE_MAX (EDF_HYBRID_MASK - 1)
30
31 typedef enum node_color_struct { N_RED, N_BLACK } Node_Color;
32 typedef Thread_Control EDF_Node;
33
34 typedef struct {
35         EDF_Node   *root;   // root of tree
36         EDF_Node   *first;  // first task in queue
37 } EDF_Chain_Control; 
38
39 #ifdef __cplusplus
40 }
41 #endif
42
43 #endif /*__EDF_TYPES_h*/