This source file includes following definitions.
- override_function_with_return
1
2 #ifndef _ASM_GENERIC_ERROR_INJECTION_H
3 #define _ASM_GENERIC_ERROR_INJECTION_H
4
5 #if defined(__KERNEL__) && !defined(__ASSEMBLY__)
6 enum {
7 EI_ETYPE_NONE,
8 EI_ETYPE_NULL,
9 EI_ETYPE_ERRNO,
10 EI_ETYPE_ERRNO_NULL,
11 EI_ETYPE_TRUE,
12 };
13
14 struct error_injection_entry {
15 unsigned long addr;
16 int etype;
17 };
18
19 struct pt_regs;
20
21 #ifdef CONFIG_FUNCTION_ERROR_INJECTION
22
23
24
25
26 #define ALLOW_ERROR_INJECTION(fname, _etype) \
27 static struct error_injection_entry __used \
28 __attribute__((__section__("_error_injection_whitelist"))) \
29 _eil_addr_##fname = { \
30 .addr = (unsigned long)fname, \
31 .etype = EI_ETYPE_##_etype, \
32 };
33
34 void override_function_with_return(struct pt_regs *regs);
35 #else
36 #define ALLOW_ERROR_INJECTION(fname, _etype)
37
38 static inline void override_function_with_return(struct pt_regs *regs) { }
39 #endif
40 #endif
41
42 #endif