@@ -16,6 +16,8 @@
#ifndef _ASM_ARM_PERCPU_H_
#define _ASM_ARM_PERCPU_H_
+#include <asm/stack_pointer.h>
+
/*
* Same as asm-generic/percpu.h, except that we store the per cpu offset
* in the TPIDRPRW. TPIDRPRW only exists on V6K and V7
new file mode 100644
@@ -0,0 +1,9 @@
+#ifndef __ASM_STACK_POINTER_H
+#define __ASM_STACK_POINTER_H
+
+/*
+ * how to get the current stack pointer in C
+ */
+register unsigned long current_stack_pointer asm ("sp");
+
+#endif
@@ -25,6 +25,7 @@
struct task_struct;
#include <asm/types.h>
+#include <asm/stack_pointer.h>
typedef unsigned long mm_segment_t;
@@ -75,12 +76,6 @@ struct thread_info {
.addr_limit = KERNEL_DS, \
}
-/*
- * how to get the current stack pointer in C
- */
-register unsigned long current_stack_pointer asm ("sp");
-
-
/*
* how to get the thread information struct from C
*/
@@ -14,6 +14,7 @@
#if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND)
#include <linux/sched.h>
+#include <asm/stack_pointer.h>
#include <asm/stacktrace.h>
struct return_address_data {
@@ -4,6 +4,7 @@
#include <linux/stacktrace.h>
#include <asm/sections.h>
+#include <asm/stack_pointer.h>
#include <asm/stacktrace.h>
#include <asm/traps.h>
@@ -45,6 +45,7 @@
#include <linux/spinlock.h>
#include <linux/list.h>
+#include <asm/stack_pointer.h>
#include <asm/stacktrace.h>
#include <asm/traps.h>
#include <asm/unwind.h>
Multiple header files that rely on current_stack_pointer do not have the necessary include <asm/thread_info.h>, and are thus fragile to changes in the header soup. Subsequent patches will affect the header soup such that including <asm/thread_info.h> will result in a circular header include. Factor current_stack_pointer into its own header and have all the users include this header explicitly. Signed-off-by: Zubin Mithra <zsm@chromium.org> --- arch/arm/include/asm/percpu.h | 2 ++ arch/arm/include/asm/stack_pointer.h | 9 +++++++++ arch/arm/include/asm/thread_info.h | 7 +------ arch/arm/kernel/return_address.c | 1 + arch/arm/kernel/stacktrace.c | 1 + arch/arm/kernel/unwind.c | 1 + 6 files changed, 15 insertions(+), 6 deletions(-) create mode 100644 arch/arm/include/asm/stack_pointer.h