.. | .. |
---|
8 | 8 | EI_ETYPE_NULL, /* Return NULL if failure */ |
---|
9 | 9 | EI_ETYPE_ERRNO, /* Return -ERRNO if failure */ |
---|
10 | 10 | EI_ETYPE_ERRNO_NULL, /* Return -ERRNO or NULL if failure */ |
---|
| 11 | + EI_ETYPE_TRUE, /* Return true if failure */ |
---|
11 | 12 | }; |
---|
12 | 13 | |
---|
13 | 14 | struct error_injection_entry { |
---|
14 | 15 | unsigned long addr; |
---|
15 | 16 | int etype; |
---|
16 | 17 | }; |
---|
| 18 | + |
---|
| 19 | +struct pt_regs; |
---|
17 | 20 | |
---|
18 | 21 | #ifdef CONFIG_FUNCTION_ERROR_INJECTION |
---|
19 | 22 | /* |
---|
.. | .. |
---|
22 | 25 | */ |
---|
23 | 26 | #define ALLOW_ERROR_INJECTION(fname, _etype) \ |
---|
24 | 27 | static struct error_injection_entry __used \ |
---|
25 | | - __attribute__((__section__("_error_injection_whitelist"))) \ |
---|
| 28 | + __section("_error_injection_whitelist") \ |
---|
26 | 29 | _eil_addr_##fname = { \ |
---|
27 | 30 | .addr = (unsigned long)fname, \ |
---|
28 | 31 | .etype = EI_ETYPE_##_etype, \ |
---|
29 | 32 | }; |
---|
| 33 | + |
---|
| 34 | +void override_function_with_return(struct pt_regs *regs); |
---|
30 | 35 | #else |
---|
31 | 36 | #define ALLOW_ERROR_INJECTION(fname, _etype) |
---|
| 37 | + |
---|
| 38 | +static inline void override_function_with_return(struct pt_regs *regs) { } |
---|
32 | 39 | #endif |
---|
33 | 40 | #endif |
---|
34 | 41 | |
---|