summaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/vdso
diff options
context:
space:
mode:
authorVincenzo Frascino <vincenzo.frascino@arm.com>2020-03-20 15:53:48 +0100
committerThomas Gleixner <tglx@linutronix.de>2020-03-21 15:24:02 +0100
commitabc22418db02b986fc5623c035507b6357e191ed (patch)
treefb42adafbef17a09024d7f7494e34930d0b3bb77 /arch/x86/include/asm/vdso
parentmips: vdso: Enable mips to use common headers (diff)
downloadlinux-abc22418db02b986fc5623c035507b6357e191ed.tar.xz
linux-abc22418db02b986fc5623c035507b6357e191ed.zip
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 <vincenzo.frascino@arm.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lkml.kernel.org/r/20200320145351.32292-24-vincenzo.frascino@arm.com
Diffstat (limited to 'arch/x86/include/asm/vdso')
-rw-r--r--arch/x86/include/asm/vdso/processor.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/x86/include/asm/vdso/processor.h b/arch/x86/include/asm/vdso/processor.h
new file mode 100644
index 000000000000..57b1a7034c64
--- /dev/null
+++ b/arch/x86/include/asm/vdso/processor.h
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (C) 2020 ARM Ltd.
+ */
+#ifndef __ASM_VDSO_PROCESSOR_H
+#define __ASM_VDSO_PROCESSOR_H
+
+#ifndef __ASSEMBLY__
+
+/* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */
+static __always_inline void rep_nop(void)
+{
+ asm volatile("rep; nop" ::: "memory");
+}
+
+static __always_inline void cpu_relax(void)
+{
+ rep_nop();
+}
+
+#endif /* __ASSEMBLY__ */
+
+#endif /* __ASM_VDSO_PROCESSOR_H */