mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-01-18 12:31:11 +00:00
While the GCC and Clang compilers already define __ASSEMBLER__ automatically when compiling assembler code, __ASSEMBLY__ is a macro that only gets defined by the Makefiles in the kernel. Defining such a macro was necessary in the early days of the kernel, since GCC only started providing __ASSEMBLER__ since version 3.0 in 2000 (see https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=f8f769ea4e69 ). However, having two macros can be very confusing nowadays for the developers when switching between userspace and kernelspace coding, or when dealing with uapi headers that should use __ASSEMBLER__ instead. So let's now standardize on the __ASSEMBLER__ macro that is provided by the compilers. This is almost a completely mechanical patch (done with a simple "sed -i" statement), with just one comment tweaked manually in arch/mips/include/asm/cpu.h (that was missing some underscores). Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Cc: linux-mips@vger.kernel.org Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Maciej W. Rozycki <macro@orcam.me.uk> Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
28 lines
747 B
C
28 lines
747 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Copyright (C) 2020 ARM Ltd.
|
|
*/
|
|
#ifndef __ASM_VDSO_PROCESSOR_H
|
|
#define __ASM_VDSO_PROCESSOR_H
|
|
|
|
#ifndef __ASSEMBLER__
|
|
|
|
#ifdef CONFIG_CPU_LOONGSON64
|
|
/*
|
|
* Loongson-3's SFB (Store-Fill-Buffer) may buffer writes indefinitely when a
|
|
* tight read loop is executed, because reads take priority over writes & the
|
|
* hardware (incorrectly) doesn't ensure that writes will eventually occur.
|
|
*
|
|
* Since spin loops of any kind should have a cpu_relax() in them, force an SFB
|
|
* flush from cpu_relax() such that any pending writes will become visible as
|
|
* expected.
|
|
*/
|
|
#define cpu_relax() smp_mb()
|
|
#else
|
|
#define cpu_relax() barrier()
|
|
#endif
|
|
|
|
#endif /* __ASSEMBLER__ */
|
|
|
|
#endif /* __ASM_VDSO_PROCESSOR_H */
|