hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/include/asm-generic/error-injection.h
....@@ -8,12 +8,15 @@
88 EI_ETYPE_NULL, /* Return NULL if failure */
99 EI_ETYPE_ERRNO, /* Return -ERRNO if failure */
1010 EI_ETYPE_ERRNO_NULL, /* Return -ERRNO or NULL if failure */
11
+ EI_ETYPE_TRUE, /* Return true if failure */
1112 };
1213
1314 struct error_injection_entry {
1415 unsigned long addr;
1516 int etype;
1617 };
18
+
19
+struct pt_regs;
1720
1821 #ifdef CONFIG_FUNCTION_ERROR_INJECTION
1922 /*
....@@ -22,13 +25,17 @@
2225 */
2326 #define ALLOW_ERROR_INJECTION(fname, _etype) \
2427 static struct error_injection_entry __used \
25
- __attribute__((__section__("_error_injection_whitelist"))) \
28
+ __section("_error_injection_whitelist") \
2629 _eil_addr_##fname = { \
2730 .addr = (unsigned long)fname, \
2831 .etype = EI_ETYPE_##_etype, \
2932 };
33
+
34
+void override_function_with_return(struct pt_regs *regs);
3035 #else
3136 #define ALLOW_ERROR_INJECTION(fname, _etype)
37
+
38
+static inline void override_function_with_return(struct pt_regs *regs) { }
3239 #endif
3340 #endif
3441