|
16 | 16 | #include <linux/bug.h> |
17 | 17 | #include <linux/sched.h> |
18 | 18 |
|
19 | | -#ifdef CONFIG_RV_REACTORS |
20 | | - |
21 | | -#define DECLARE_RV_REACTING_HELPERS(name, type) \ |
22 | | -static void cond_react_##name(type curr_state, type event) \ |
23 | | -{ \ |
24 | | - if (!rv_reacting_on() || !rv_##name.react) \ |
25 | | - return; \ |
26 | | - rv_##name.react("rv: monitor %s does not allow event %s on state %s\n", \ |
27 | | - #name, \ |
28 | | - model_get_event_name_##name(event), \ |
29 | | - model_get_state_name_##name(curr_state)); \ |
30 | | -} |
31 | | - |
32 | | -#else /* CONFIG_RV_REACTOR */ |
33 | | - |
34 | | -#define DECLARE_RV_REACTING_HELPERS(name, type) \ |
35 | | -static void cond_react_##name(type curr_state, type event) \ |
36 | | -{ \ |
37 | | - return; \ |
38 | | -} |
39 | | -#endif |
40 | | - |
41 | 19 | /* |
42 | 20 | * Generic helpers for all types of deterministic automata monitors. |
43 | 21 | */ |
44 | 22 | #define DECLARE_DA_MON_GENERIC_HELPERS(name, type) \ |
45 | 23 | \ |
46 | | -DECLARE_RV_REACTING_HELPERS(name, type) \ |
| 24 | +static void react_##name(type curr_state, type event) \ |
| 25 | +{ \ |
| 26 | + rv_react(&rv_##name, \ |
| 27 | + "rv: monitor %s does not allow event %s on state %s\n", \ |
| 28 | + #name, \ |
| 29 | + model_get_event_name_##name(event), \ |
| 30 | + model_get_state_name_##name(curr_state)); \ |
| 31 | +} \ |
47 | 32 | \ |
48 | 33 | /* \ |
49 | 34 | * da_monitor_reset_##name - reset a monitor and setting it to init state \ |
@@ -126,7 +111,7 @@ da_event_##name(struct da_monitor *da_mon, enum events_##name event) \ |
126 | 111 | for (int i = 0; i < MAX_DA_RETRY_RACING_EVENTS; i++) { \ |
127 | 112 | next_state = model_get_next_state_##name(curr_state, event); \ |
128 | 113 | if (next_state == INVALID_STATE) { \ |
129 | | - cond_react_##name(curr_state, event); \ |
| 114 | + react_##name(curr_state, event); \ |
130 | 115 | trace_error_##name(model_get_state_name_##name(curr_state), \ |
131 | 116 | model_get_event_name_##name(event)); \ |
132 | 117 | return false; \ |
@@ -165,7 +150,7 @@ static inline bool da_event_##name(struct da_monitor *da_mon, struct task_struct |
165 | 150 | for (int i = 0; i < MAX_DA_RETRY_RACING_EVENTS; i++) { \ |
166 | 151 | next_state = model_get_next_state_##name(curr_state, event); \ |
167 | 152 | if (next_state == INVALID_STATE) { \ |
168 | | - cond_react_##name(curr_state, event); \ |
| 153 | + react_##name(curr_state, event); \ |
169 | 154 | trace_error_##name(tsk->pid, \ |
170 | 155 | model_get_state_name_##name(curr_state), \ |
171 | 156 | model_get_event_name_##name(event)); \ |
|
0 commit comments