bottom_half.h needs _THIS_IP_ to be standalone, so split that and _RET_IP_ out from kernel.h into the new instruction_pointer.h. kernel.h directly needs them, so include it there and replace the include of kernel.h with this new file in bottom_half.h.
Unified · Split
| @@ -2,7 +2,7 @@ · 1 unmodified line | ||
| 2 | 2 | #ifndef _LINUX_BH_H |
| 3 | 3 | #define _LINUX_BH_H |
| 4 | 4 | |
| 5 | −#include <linux/kernel.h> | |
| 5 | +#include <linux/instruction_pointer.h> | |
| 6 | 6 | #include <linux/preempt.h> |
| 7 | 7 | |
| 8 | 8 | #if defined(CONFIG_PREEMPT_RT) || defined(CONFIG_TRACE_IRQFLAGS) |
| @@ -0,0 +1,8 @@ | ||
| 1 | +/* SPDX-License-Identifier: GPL-2.0 */ | |
| 2 | +#ifndef _LINUX_INSTRUCTION_POINTER_H | |
| 3 | +#define _LINUX_INSTRUCTION_POINTER_H | |
| 4 | + | |
| 5 | +#define _RET_IP_ (unsigned long)__builtin_return_address(0) | |
| 6 | +#define _THIS_IP_ ({ __label__ __here; __here: (unsigned long)&&__here; }) | |
| 7 | + | |
| 8 | +#endif /* _LINUX_INSTRUCTION_POINTER_H */ | |
| @@ -20,6 +20,7 @@ · 19 unmodified lines | ||
| 20 | 20 | #include <linux/printk.h> |
| 21 | 21 | #include <linux/build_bug.h> |
| 22 | 22 | #include <linux/static_call_types.h> |
| 23 | +#include <linux/instruction_pointer.h> | |
| 23 | 24 | #include <asm/byteorder.h> |
| 24 | 25 | |
| 25 | 26 | #include <uapi/linux/kernel.h> |
| @@ -53,9 +54,6 @@ · 27 unmodified lines | ||
| 53 | 54 | } \ |
| 54 | 55 | ) |
| 55 | 56 | |
| 56 | −#define _RET_IP_ (unsigned long)__builtin_return_address(0) | |
| 57 | −#define _THIS_IP_ ({ __label__ __here; __here: (unsigned long)&&__here; }) | |
| 58 | − | |
| 59 | 57 | /** |
| 60 | 58 | * upper_32_bits - return bits 32-63 of a number |
| 61 | 59 | * @n: the number we're accessing |