]>
Commit | Line | Data |
---|---|---|
83d290c5 | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
273d11ea | 2 | /* |
a187559e | 3 | * U-Boot - linkage.h |
273d11ea ML |
4 | * |
5 | * Copyright (c) 2005-2007 Analog Devices Inc. | |
273d11ea ML |
6 | */ |
7 | ||
8 | #ifndef _LINUX_LINKAGE_H | |
9 | #define _LINUX_LINKAGE_H | |
10 | ||
11 | #include <asm/linkage.h> | |
273d11ea | 12 | |
950cb9bb CG |
13 | /* Some toolchains use other characters (e.g. '`') to mark new line in macro */ |
14 | #ifndef ASM_NL | |
15 | #define ASM_NL ; | |
16 | #endif | |
17 | ||
273d11ea ML |
18 | #ifdef __cplusplus |
19 | #define CPP_ASMLINKAGE extern "C" | |
20 | #else | |
21 | #define CPP_ASMLINKAGE | |
22 | #endif | |
23 | ||
e6126a58 | 24 | #ifndef asmlinkage |
273d11ea | 25 | #define asmlinkage CPP_ASMLINKAGE |
e6126a58 | 26 | #endif |
273d11ea ML |
27 | |
28 | #define SYMBOL_NAME_STR(X) #X | |
29 | #define SYMBOL_NAME(X) X | |
30 | #ifdef __STDC__ | |
31 | #define SYMBOL_NAME_LABEL(X) X##: | |
32 | #else | |
33 | #define SYMBOL_NAME_LABEL(X) X: | |
34 | #endif | |
35 | ||
7245536d | 36 | #ifndef __ALIGN |
273d11ea | 37 | #define __ALIGN .align 4 |
7245536d A |
38 | #endif |
39 | ||
40 | #ifndef __ALIGN_STR | |
273d11ea | 41 | #define __ALIGN_STR ".align 4" |
7245536d | 42 | #endif |
273d11ea ML |
43 | |
44 | #ifdef __ASSEMBLY__ | |
45 | ||
46 | #define ALIGN __ALIGN | |
47 | #define ALIGN_STR __ALIGN_STR | |
48 | ||
49 | #define LENTRY(name) \ | |
950cb9bb | 50 | ALIGN ASM_NL \ |
273d11ea ML |
51 | SYMBOL_NAME_LABEL(name) |
52 | ||
53 | #define ENTRY(name) \ | |
950cb9bb | 54 | .globl SYMBOL_NAME(name) ASM_NL \ |
273d11ea ML |
55 | LENTRY(name) |
56 | ||
ec4fa567 | 57 | #define WEAK(name) \ |
950cb9bb | 58 | .weak SYMBOL_NAME(name) ASM_NL \ |
ec4fa567 DF |
59 | LENTRY(name) |
60 | ||
273d11ea ML |
61 | #ifndef END |
62 | #define END(name) \ | |
63 | .size name, .-name | |
64 | #endif | |
65 | ||
66 | #ifndef ENDPROC | |
67 | #define ENDPROC(name) \ | |
950cb9bb | 68 | .type name STT_FUNC ASM_NL \ |
273d11ea ML |
69 | END(name) |
70 | #endif | |
71 | ||
72 | #endif | |
73 | ||
74 | #endif |