diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2007-12-14 00:07:46 -0500 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2007-12-14 00:07:46 -0500 |
commit | a1035dd13b32bf6dee0794309007eb2582921d24 (patch) | |
tree | a596b377062cec4400da0dadff8d61abd68af0ce /include/litmus.h | |
parent | cc26855dba560c64dbcdd56fea4385daea2d4826 (diff) |
ICS nesting support structures
Diffstat (limited to 'include/litmus.h')
-rw-r--r-- | include/litmus.h | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/include/litmus.h b/include/litmus.h index 94e4b6a..06f84bb 100644 --- a/include/litmus.h +++ b/include/litmus.h | |||
@@ -104,14 +104,29 @@ int sleep_next_period(void); | |||
104 | 104 | ||
105 | /* interruptible critical section support */ | 105 | /* interruptible critical section support */ |
106 | #define MAX_ICS_NESTING 16 | 106 | #define MAX_ICS_NESTING 16 |
107 | #define ICS_END_OF_STACK (-2) | 107 | #define ICS_STACK_EMPTY (-1) |
108 | |||
109 | struct ics_descriptor { | ||
110 | /* ICS id, only read by kernel */ | ||
111 | int id; | ||
112 | /* rollback program counter, only read by kernel */ | ||
113 | void* pc; | ||
114 | /* rollback stack pointer, not used by kernel */ | ||
115 | void* sp; | ||
116 | /* retry flag, not used by kernel */ | ||
117 | int* retry; | ||
118 | }; | ||
108 | 119 | ||
109 | /* ICS control block */ | 120 | /* ICS control block */ |
110 | struct ics_cb { | 121 | struct ics_cb { |
111 | void* rollback_eip; | 122 | /* Points to the top-most valid entry. |
112 | void* rollback_esp; | 123 | * -1 indicates an empty stack. |
113 | int ics_stack[MAX_ICS_NESTING]; | 124 | * Read and written by kernel. |
125 | */ | ||
126 | int top; | ||
127 | struct ics_descriptor ics_stack[MAX_ICS_NESTING]; | ||
114 | }; | 128 | }; |
129 | |||
115 | int reg_ics_cb(struct ics_cb* ics_cb); | 130 | int reg_ics_cb(struct ics_cb* ics_cb); |
116 | int start_wcs(int od); | 131 | int start_wcs(int od); |
117 | 132 | ||