Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Josh Poimboeuf | 9a99417 | 2016-02-28 22:22:35 -0600 | [diff] [blame] | 2 | #ifndef _LINUX_FRAME_H |
| 3 | #define _LINUX_FRAME_H |
| 4 | |
| 5 | #ifdef CONFIG_STACK_VALIDATION |
| 6 | /* |
| 7 | * This macro marks the given function's stack frame as "non-standard", which |
| 8 | * tells objtool to ignore the function when doing stack metadata validation. |
| 9 | * It should only be used in special cases where you're 100% sure it won't |
| 10 | * affect the reliability of frame pointers and kernel stack traces. |
| 11 | * |
| 12 | * For more information, see tools/objtool/Documentation/stack-validation.txt. |
| 13 | */ |
| 14 | #define STACK_FRAME_NON_STANDARD(func) \ |
Josh Poimboeuf | e390f9a | 2017-03-01 12:04:44 -0600 | [diff] [blame] | 15 | static void __used __section(.discard.func_stack_frame_non_standard) \ |
Josh Poimboeuf | 9a99417 | 2016-02-28 22:22:35 -0600 | [diff] [blame] | 16 | *__func_stack_frame_non_standard_##func = func |
| 17 | |
| 18 | #else /* !CONFIG_STACK_VALIDATION */ |
| 19 | |
| 20 | #define STACK_FRAME_NON_STANDARD(func) |
| 21 | |
| 22 | #endif /* CONFIG_STACK_VALIDATION */ |
| 23 | |
| 24 | #endif /* _LINUX_FRAME_H */ |