mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00

While the GCC and Clang compilers already define __ASSEMBLER__ automatically when compiling assembly code, __ASSEMBLY__ is a macro that only gets defined by the Makefiles in the kernel. This can be very confusing when switching between userspace and kernelspace coding, or when dealing with uapi headers that rather should use __ASSEMBLER__ instead. So let's standardize on the __ASSEMBLER__ macro that is provided by the compilers now. This is mostly a completely mechanical patch (done with a simple "sed -i" statement), except for some manual tweaks in the files arch/parisc/include/asm/smp.h, arch/parisc/include/asm/signal.h, arch/parisc/include/asm/thread_info.h and arch/parisc/include/asm/vdso.h that had the macro spelled in a wrong way. Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com> Cc: Helge Deller <deller@gmx.de> Cc: linux-parisc@vger.kernel.org Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Helge Deller <deller@gmx.de>
48 lines
1.1 KiB
C
48 lines
1.1 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _ASM_PARISC_JUMP_LABEL_H
|
|
#define _ASM_PARISC_JUMP_LABEL_H
|
|
|
|
#ifndef __ASSEMBLER__
|
|
|
|
#include <linux/types.h>
|
|
#include <linux/stringify.h>
|
|
#include <asm/assembly.h>
|
|
|
|
#define JUMP_LABEL_NOP_SIZE 4
|
|
|
|
static __always_inline bool arch_static_branch(struct static_key *key, bool branch)
|
|
{
|
|
asm goto("1:\n\t"
|
|
"nop\n\t"
|
|
".pushsection __jump_table, \"aw\"\n\t"
|
|
".align %1\n\t"
|
|
".word 1b - ., %l[l_yes] - .\n\t"
|
|
__stringify(ASM_ULONG_INSN) " %c0 - .\n\t"
|
|
".popsection\n\t"
|
|
: : "i" (&((char *)key)[branch]), "i" (sizeof(long))
|
|
: : l_yes);
|
|
|
|
return false;
|
|
l_yes:
|
|
return true;
|
|
}
|
|
|
|
static __always_inline bool arch_static_branch_jump(struct static_key *key, bool branch)
|
|
{
|
|
asm goto("1:\n\t"
|
|
"b,n %l[l_yes]\n\t"
|
|
".pushsection __jump_table, \"aw\"\n\t"
|
|
".align %1\n\t"
|
|
".word 1b - ., %l[l_yes] - .\n\t"
|
|
__stringify(ASM_ULONG_INSN) " %c0 - .\n\t"
|
|
".popsection\n\t"
|
|
: : "i" (&((char *)key)[branch]), "i" (sizeof(long))
|
|
: : l_yes);
|
|
|
|
return false;
|
|
l_yes:
|
|
return true;
|
|
}
|
|
|
|
#endif /* __ASSEMBLER__ */
|
|
#endif
|