diff options
Diffstat (limited to 'include/linux/frame.h')
-rw-r--r-- | include/linux/frame.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/include/linux/frame.h b/include/linux/frame.h new file mode 100644 index 000000000000..e6baaba3f1ae --- /dev/null +++ b/include/linux/frame.h | |||
@@ -0,0 +1,23 @@ | |||
1 | #ifndef _LINUX_FRAME_H | ||
2 | #define _LINUX_FRAME_H | ||
3 | |||
4 | #ifdef CONFIG_STACK_VALIDATION | ||
5 | /* | ||
6 | * This macro marks the given function's stack frame as "non-standard", which | ||
7 | * tells objtool to ignore the function when doing stack metadata validation. | ||
8 | * It should only be used in special cases where you're 100% sure it won't | ||
9 | * affect the reliability of frame pointers and kernel stack traces. | ||
10 | * | ||
11 | * For more information, see tools/objtool/Documentation/stack-validation.txt. | ||
12 | */ | ||
13 | #define STACK_FRAME_NON_STANDARD(func) \ | ||
14 | static void __used __section(__func_stack_frame_non_standard) \ | ||
15 | *__func_stack_frame_non_standard_##func = func | ||
16 | |||
17 | #else /* !CONFIG_STACK_VALIDATION */ | ||
18 | |||
19 | #define STACK_FRAME_NON_STANDARD(func) | ||
20 | |||
21 | #endif /* CONFIG_STACK_VALIDATION */ | ||
22 | |||
23 | #endif /* _LINUX_FRAME_H */ | ||