Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

kernel.h: split out instruction pointer accessors

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.

Link: https://lkml.kernel.org/r/20211028161248.45232-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Stephen Rothwell and committed by
Linus Torvalds
e52340de b4b87651

+10 -4
+1 -1
include/linux/bottom_half.h
··· 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)
+8
include/linux/instruction_pointer.h
··· 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 */
+1 -3
include/linux/kernel.h
··· 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 52 (void __user *)(uintptr_t)(x); \ 54 53 } \ 55 54 ) 56 - 57 - #define _RET_IP_ (unsigned long)__builtin_return_address(0) 58 - #define _THIS_IP_ ({ __label__ __here; __here: (unsigned long)&&__here; }) 59 55 60 56 /** 61 57 * upper_32_bits - return bits 32-63 of a number