1 /* Assembler macros for ARM.
2 Copyright (C) 1997-2013 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library. If not, see
17 <http://www.gnu.org/licenses/>. */
19 #include <sysdeps/generic/sysdep.h>
22 #if (!defined (__ARM_ARCH_2__) && !defined (__ARM_ARCH_3__) \
23 && !defined (__ARM_ARCH_3M__) && !defined (__ARM_ARCH_4__))
29 /* Syntactic details of assembler. */
31 #define ALIGNARG(log2) log2
32 #define ASM_SIZE_DIRECTIVE(name) .size name,.-name
34 #define PLTJMP(_x) _x##(PLT)
36 /* APCS-32 doesn't preserve the condition codes across function call. */
38 #define LOADREGS(cond, base, reglist...)\
39 ldm##cond base,reglist
41 #define RETINSTR(cond, reg) \
43 #define DO_RET(_reg) \
46 #define RETINSTR(cond, reg) \
48 #define DO_RET(_reg) \
52 #define LOADREGS(cond, base, reglist...)\
53 ldm##cond base,reglist^
54 #define RETINSTR(cond, reg) \
56 #define DO_RET(_reg) \
60 /* Define an entry point visible from C. */
62 .globl C_SYMBOL_NAME(name); \
63 .type C_SYMBOL_NAME(name),%function; \
70 #define CFI_SECTIONS \
71 .cfi_sections .debug_frame
76 ASM_SIZE_DIRECTIVE(name)
78 /* If compiled for profiling, call `mcount' at the start of each function. */
80 /* Call __gnu_mcount_nc if GCC >= 4.4. */
81 #if __GNUC_PREREQ(4,4)
84 cfi_adjust_cfa_offset (4); \
85 cfi_rel_offset (lr, 0); \
87 cfi_adjust_cfa_offset (-4); \
89 #else /* else call _mcount */
92 cfi_adjust_cfa_offset (4); \
93 cfi_rel_offset (lr, 0); \
96 cfi_adjust_cfa_offset (-4); \
100 #define CALL_MCOUNT /* Do nothing. */
103 /* Since C identifiers are not normally prefixed with an underscore
104 on this system, the asm identifier `syscall_error' intrudes on the
105 C name space. Make sure we use an innocuous name. */
106 #define syscall_error __syscall_error
107 #if __GNUC_PREREQ(4,4)
108 #define mcount __gnu_mcount_nc
110 #define mcount _mcount
113 /* Tag_ABI_align8_preserved: This code preserves 8-byte
114 alignment in any callee. */
115 .eabi_attribute
25, 1
116 /* Tag_ABI_align8_needed: This code may require 8-byte alignment from
118 .eabi_attribute
24, 1
120 #endif /* __ASSEMBLER__ */