]> rtime.felk.cvut.cz Git - rtems-pluggable-edf.git/blob - src/edf/edf_types.h
edf: add late unblock protocol defines for temporal isolation
[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 /// Unblock rule for temporal isolation included
14 #define EDF_LATE_UNBLOCK        1       
15
16 typedef uint32_t Deadline_Control;
17
18 #define EDF_BYTES_FOR_TIME 4    // It is uint32_t
19 //#define EDF_TIME_RANGE 0xffffffff
20
21
22 #define EDF_PRIORITY_MAX 255
23
24 /** 
25  * The scheduler has two separete policies for for tasks using deadlines 
26  * tasks using priorities. The priority driven tasks are always scheduled as less 
27  * important than the deadline driven ones.
28  * We can distinguish them by looking at the MSB of their priority. Priority diven
29  * have 1 and deadline driven have 0.
30  */
31 #define EDF_HYBRID_MASK 0x80000000 //This is MSB
32 //#define EDF_ABS_DEADLINE_MAX (EDF_HYBRID_MASK - 1)
33
34 typedef enum node_color_struct { N_RED, N_BLACK } Node_Color;
35 typedef Thread_Control EDF_Node;
36
37 typedef struct {
38         EDF_Node   *root;   // root of tree
39         EDF_Node   *first;  // first task in queue
40 } EDF_Chain_Control; 
41
42 #ifdef __cplusplus
43 }
44 #endif
45
46 #endif /*__EDF_TYPES_h*/