Skip to content

Commit abc2241

Browse files
fvincenzoKAGA-KOKO
authored andcommitted
x86/vdso: Enable x86 to use common headers
Enable x86 to use only the common headers in the implementation of the vDSO library. Signed-off-by: Vincenzo Frascino <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent c135fc8 commit abc2241

File tree

2 files changed

+24
-11
lines changed

2 files changed

+24
-11
lines changed

arch/x86/include/asm/processor.h

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ struct vm86;
2626
#include <asm/fpu/types.h>
2727
#include <asm/unwind_hints.h>
2828
#include <asm/vmxfeatures.h>
29+
#include <asm/vdso/processor.h>
2930

3031
#include <linux/personality.h>
3132
#include <linux/cache.h>
@@ -677,17 +678,6 @@ static inline unsigned int cpuid_edx(unsigned int op)
677678
return edx;
678679
}
679680

680-
/* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */
681-
static __always_inline void rep_nop(void)
682-
{
683-
asm volatile("rep; nop" ::: "memory");
684-
}
685-
686-
static __always_inline void cpu_relax(void)
687-
{
688-
rep_nop();
689-
}
690-
691681
/*
692682
* This function forces the icache and prefetched instruction stream to
693683
* catch up with reality in two very specific cases:

arch/x86/include/asm/vdso/processor.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
/* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */
11+
static __always_inline void rep_nop(void)
12+
{
13+
asm volatile("rep; nop" ::: "memory");
14+
}
15+
16+
static __always_inline void cpu_relax(void)
17+
{
18+
rep_nop();
19+
}
20+
21+
#endif /* __ASSEMBLY__ */
22+
23+
#endif /* __ASM_VDSO_PROCESSOR_H */

0 commit comments

Comments
 (0)