Merge branch 'master' of git://www.denx.de/git/u-boot-cfi-flash
[platform/kernel/u-boot.git] / include / linux / linkage.h
1 /*
2  * U-boot - linkage.h
3  *
4  * Copyright (c) 2005-2007 Analog Devices Inc.
5  *
6  * SPDX-License-Identifier:     GPL-2.0+
7  */
8
9 #ifndef _LINUX_LINKAGE_H
10 #define _LINUX_LINKAGE_H
11
12 #include <asm/linkage.h>
13 #include <linux/config.h>
14
15 #ifdef __cplusplus
16 #define CPP_ASMLINKAGE          extern "C"
17 #else
18 #define CPP_ASMLINKAGE
19 #endif
20
21 #define asmlinkage CPP_ASMLINKAGE
22
23 #define SYMBOL_NAME_STR(X)      #X
24 #define SYMBOL_NAME(X)          X
25 #ifdef __STDC__
26 #define SYMBOL_NAME_LABEL(X)    X##:
27 #else
28 #define SYMBOL_NAME_LABEL(X)    X:
29 #endif
30
31 #ifndef __ALIGN
32 #define __ALIGN .align          4
33 #endif
34
35 #ifndef __ALIGN_STR
36 #define __ALIGN_STR             ".align 4"
37 #endif
38
39 #ifdef __ASSEMBLY__
40
41 #define ALIGN                   __ALIGN
42 #define ALIGN_STR               __ALIGN_STR
43
44 #define LENTRY(name) \
45         ALIGN; \
46         SYMBOL_NAME_LABEL(name)
47
48 #define ENTRY(name) \
49         .globl SYMBOL_NAME(name); \
50         LENTRY(name)
51
52 #ifndef END
53 #define END(name) \
54         .size name, .-name
55 #endif
56
57 #ifndef ENDPROC
58 #define ENDPROC(name) \
59         .type name STT_FUNC; \
60         END(name)
61 #endif
62
63 #endif
64
65 #endif