Skip to content

Commit f511e07

Browse files
fvincenzoKAGA-KOKO
authored andcommitted
arm64: Introduce asm/vdso/processor.h
The vDSO library should only include the necessary headers required for a userspace library (UAPI and a minimal set of kernel headers). To make this possible it is necessary to isolate from the kernel headers the common parts that are strictly necessary to build the library. Introduce asm/vdso/processor.h to contain all the arm64 specific functions that are suitable for vDSO inclusion. Signed-off-by: Vincenzo Frascino <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Catalin Marinas <[email protected]> Cc: Will Deacon <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 94d0f5b commit f511e07

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

arch/arm64/include/asm/processor.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
#include <linux/string.h>
2929
#include <linux/thread_info.h>
3030

31+
#include <vdso/processor.h>
32+
3133
#include <asm/alternative.h>
3234
#include <asm/cpufeature.h>
3335
#include <asm/hw_breakpoint.h>
@@ -256,11 +258,6 @@ extern void release_thread(struct task_struct *);
256258

257259
unsigned long get_wchan(struct task_struct *p);
258260

259-
static inline void cpu_relax(void)
260-
{
261-
asm volatile("yield" ::: "memory");
262-
}
263-
264261
/* Thread switching */
265262
extern struct task_struct *cpu_switch_to(struct task_struct *prev,
266263
struct task_struct *next);
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/* SPDX-License-Identifier: GPL-2.0-only */
2+
/*
3+
* Copyright (C) 2020 ARM Ltd.
4+
*/
5+
#ifndef __ASM_VDSO_PROCESSOR_H
6+
#define __ASM_VDSO_PROCESSOR_H
7+
8+
#ifndef __ASSEMBLY__
9+
10+
static inline void cpu_relax(void)
11+
{
12+
asm volatile("yield" ::: "memory");
13+
}
14+
15+
#endif /* __ASSEMBLY__ */
16+
17+
#endif /* __ASM_VDSO_PROCESSOR_H */

0 commit comments

Comments
 (0)