aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/linkage.h
diff options
context:
space:
mode:
authorMark Rutland <mark.rutland@arm.com>2018-11-15 22:41:58 +0000
committerWill Deacon <will.deacon@arm.com>2018-11-30 13:29:04 +0000
commitad697a1aecac19ec351063b5d8e6fc9d4bca7ee5 (patch)
treee28084d194f86a5b54b12b93c4b9abe22c4c53e8 /include/linux/linkage.h
parentarm64: drop linker script hack to hide __efistub_ symbols (diff)
downloadwireguard-linux-ad697a1aecac19ec351063b5d8e6fc9d4bca7ee5.tar.xz
wireguard-linux-ad697a1aecac19ec351063b5d8e6fc9d4bca7ee5.zip
linkage: add generic GLOBAL() macro
Declaring a global symbol in assembly is tedious, error-prone, and painful to read. While ENTRY() exists, this is supposed to be used for function entry points, and this affects alignment in a potentially undesireable manner. Instead, let's add a generic GLOBAL() macro for this, as x86 added locally in commit: 95695547a7db44b8 ("x86: asm linkage - introduce GLOBAL macro") ... thus allowing us to use this more freely in the kernel. Signed-off-by: Mark Rutland <mark.rutland@arm.com> Cc: AKASHI Takahiro <takahiro.akashi@linaro.org> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Torsten Duwe <duwe@suse.de> Cc: Will Deacon <will.deacon@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'include/linux/linkage.h')
-rw-r--r--include/linux/linkage.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/linkage.h b/include/linux/linkage.h
index 7c47b1a471d4..7e020782ade2 100644
--- a/include/linux/linkage.h
+++ b/include/linux/linkage.h
@@ -79,6 +79,12 @@
#define ALIGN __ALIGN
#define ALIGN_STR __ALIGN_STR
+#ifndef GLOBAL
+#define GLOBAL(name) \
+ .globl name ASM_NL \
+ name:
+#endif
+
#ifndef ENTRY
#define ENTRY(name) \
.globl name ASM_NL \