Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a9ea0017 authored by Mark Rutland's avatar Mark Rutland Committed by Catalin Marinas
Browse files

arm64: factor out current_stack_pointer



We define current_stack_pointer in <asm/thread_info.h>, though other
files and header relying upon it do not have this necessary include, and
are thus fragile to changes in the header soup.

Subsequent patches will affect the header soup such that directly
including <asm/thread_info.h> may result in a circular header include in
some of these cases, so we can't simply include <asm/thread_info.h>.

Instead, factor current_thread_info into its own header, and have all
existing users include this explicitly.

Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
Tested-by: default avatarLaura Abbott <labbott@redhat.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
parent 3fe12da4
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -16,6 +16,8 @@
#ifndef __ASM_PERCPU_H
#ifndef __ASM_PERCPU_H
#define __ASM_PERCPU_H
#define __ASM_PERCPU_H


#include <asm/stack_pointer.h>

static inline void set_my_cpu_offset(unsigned long off)
static inline void set_my_cpu_offset(unsigned long off)
{
{
	asm volatile("msr tpidr_el1, %0" :: "r" (off) : "memory");
	asm volatile("msr tpidr_el1, %0" :: "r" (off) : "memory");
+2 −0
Original line number Original line Diff line number Diff line
@@ -17,6 +17,8 @@
#ifndef __ASM_PERF_EVENT_H
#ifndef __ASM_PERF_EVENT_H
#define __ASM_PERF_EVENT_H
#define __ASM_PERF_EVENT_H


#include <asm/stack_pointer.h>

#define	ARMV8_PMU_MAX_COUNTERS	32
#define	ARMV8_PMU_MAX_COUNTERS	32
#define	ARMV8_PMU_COUNTER_MASK	(ARMV8_PMU_MAX_COUNTERS - 1)
#define	ARMV8_PMU_COUNTER_MASK	(ARMV8_PMU_MAX_COUNTERS - 1)


+9 −0
Original line number Original line Diff line number Diff line
#ifndef __ASM_STACK_POINTER_H
#define __ASM_STACK_POINTER_H

/*
 * how to get the current stack pointer from C
 */
register unsigned long current_stack_pointer asm ("sp");

#endif /* __ASM_STACK_POINTER_H */
+1 −5
Original line number Original line Diff line number Diff line
@@ -36,6 +36,7 @@


struct task_struct;
struct task_struct;


#include <asm/stack_pointer.h>
#include <asm/types.h>
#include <asm/types.h>


typedef unsigned long mm_segment_t;
typedef unsigned long mm_segment_t;
@@ -61,11 +62,6 @@ struct thread_info {


#define init_stack		(init_thread_union.stack)
#define init_stack		(init_thread_union.stack)


/*
 * how to get the current stack pointer from C
 */
register unsigned long current_stack_pointer asm ("sp");

/*
/*
 * how to get the thread information struct from C
 * how to get the thread information struct from C
 */
 */
+1 −0
Original line number Original line Diff line number Diff line
@@ -12,6 +12,7 @@
#include <linux/export.h>
#include <linux/export.h>
#include <linux/ftrace.h>
#include <linux/ftrace.h>


#include <asm/stack_pointer.h>
#include <asm/stacktrace.h>
#include <asm/stacktrace.h>


struct return_address_data {
struct return_address_data {
Loading