History

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.

Stephen Rothwell committed 5 years ago

Commit e52340d1 parent b4b87653 files · +10 −4Browse files

Unified · Split

3 files
  1. include/linux/bottom_half.h +1 −1
  2. include/linux/instruction_pointer.h +8 −0
  3. include/linux/kernel.h +1 −3
include/linux/bottom_half.h+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
22 #ifndef _LINUX_BH_H
33 #define _LINUX_BH_H
44
5−#include <linux/kernel.h>
5+#include <linux/instruction_pointer.h>
66 #include <linux/preempt.h>
77
88 #if defined(CONFIG_PREEMPT_RT) || defined(CONFIG_TRACE_IRQFLAGS)
include/linux/instruction_pointer.h+8−0
@@ -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 */
include/linux/kernel.h+1−3
@@ -20,6 +20,7 @@ · 19 unmodified lines
2020 #include <linux/printk.h>
2121 #include <linux/build_bug.h>
2222 #include <linux/static_call_types.h>
23+#include <linux/instruction_pointer.h>
2324 #include <asm/byteorder.h>
2425
2526 #include <uapi/linux/kernel.h>
@@ -53,9 +54,6 @@ · 27 unmodified lines
5354 } \
5455 )
5556
56−#define _RET_IP_ (unsigned long)__builtin_return_address(0)
57−#define _THIS_IP_ ({ __label__ __here; __here: (unsigned long)&&__here; })
58−
5957 /**
6058 * upper_32_bits - return bits 32-63 of a number
6159 * @n: the number we're accessing

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t