GNU Linux-libre 4.19.314-gnu1
[releases.git] / arch / arc / include / asm / linkage.h
1 /*
2  * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  */
8
9 #ifndef __ASM_LINKAGE_H
10 #define __ASM_LINKAGE_H
11
12 #include <asm/dwarf.h>
13
14 #define ASM_NL           `      /* use '`' to mark new line in macro */
15 #define __ALIGN         .align 4
16 #define __ALIGN_STR     __stringify(__ALIGN)
17
18 #ifdef __ASSEMBLY__
19
20 .macro ST2 e, o, off
21 #ifdef CONFIG_ARC_HAS_LL64
22         std     \e, [sp, \off]
23 #else
24         st      \e, [sp, \off]
25         st      \o, [sp, \off+4]
26 #endif
27 .endm
28
29 .macro LD2 e, o, off
30 #ifdef CONFIG_ARC_HAS_LL64
31         ldd     \e, [sp, \off]
32 #else
33         ld      \e, [sp, \off]
34         ld      \o, [sp, \off+4]
35 #endif
36 .endm
37
38 /* annotation for data we want in DCCM - if enabled in .config */
39 .macro ARCFP_DATA nm
40 #ifdef CONFIG_ARC_HAS_DCCM
41         .section .data.arcfp
42 #else
43         .section .data
44 #endif
45         .global \nm
46 .endm
47
48 /* annotation for data we want in DCCM - if enabled in .config */
49 .macro ARCFP_CODE
50 #ifdef CONFIG_ARC_HAS_ICCM
51         .section .text.arcfp, "ax",@progbits
52 #else
53         .section .text, "ax",@progbits
54 #endif
55 .endm
56
57 #define ENTRY_CFI(name)         \
58         .globl name ASM_NL      \
59         ALIGN ASM_NL            \
60         name: ASM_NL            \
61         CFI_STARTPROC ASM_NL
62
63 #define END_CFI(name)           \
64         CFI_ENDPROC ASM_NL      \
65         .size name, .-name
66
67 #else   /* !__ASSEMBLY__ */
68
69 #ifdef CONFIG_ARC_HAS_ICCM
70 #define __arcfp_code __attribute__((__section__(".text.arcfp")))
71 #else
72 #define __arcfp_code __attribute__((__section__(".text")))
73 #endif
74
75 #ifdef CONFIG_ARC_HAS_DCCM
76 #define __arcfp_data __attribute__((__section__(".data.arcfp")))
77 #else
78 #define __arcfp_data __attribute__((__section__(".data")))
79 #endif
80
81 #endif /* __ASSEMBLY__ */
82
83 #endif