1 /* Assembly macros for 32-bit PowerPC.
2 Copyright (C) 1999, 2001, 2002, 2003, 2006 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, write to the Free
17 Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA
20 #include <sysdeps/powerpc/sysdep.h>
26 /* If compiled for profiling, call `_mcount' at the start of each
29 /* The mcount code relies on a the return address being on the stack
30 to locate our caller and so it can restore it; so store one just
32 # define CALL_MCOUNT \
36 bl JUMPTARGET(_mcount);
38 # define CALL_MCOUNT /* Do nothing. */
42 ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \
43 ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
49 #define EALIGN_W_0 /* No words to insert. */
50 #define EALIGN_W_1 nop
51 #define EALIGN_W_2 nop;nop
52 #define EALIGN_W_3 nop;nop;nop
53 #define EALIGN_W_4 EALIGN_W_3;nop
54 #define EALIGN_W_5 EALIGN_W_4;nop
55 #define EALIGN_W_6 EALIGN_W_5;nop
56 #define EALIGN_W_7 EALIGN_W_6;nop
58 /* EALIGN is like ENTRY, but does alignment to 'words'*4 bytes
59 past a 2^align boundary. */
61 # define EALIGN(name, alignt, words) \
62 ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \
63 ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
69 .align ALIGNARG(alignt); \
73 # define EALIGN(name, alignt, words) \
74 ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \
75 ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
76 .align ALIGNARG(alignt); \
85 ASM_SIZE_DIRECTIVE(name)
87 #define DO_CALL(syscall) \
93 # define JUMPTARGET(name) name##@plt
95 # define JUMPTARGET(name) name
98 #if defined SHARED && defined DO_VERSIONING && defined PIC \
100 # undef HIDDEN_JUMPTARGET
101 # define HIDDEN_JUMPTARGET(name) __GI_##name##@local
104 #define PSEUDO(name, syscall_name, args) \
107 DO_CALL (SYS_ify (syscall_name));
111 b __syscall_error@local
112 #define ret PSEUDO_RET
115 #define PSEUDO_END(name) \
118 #define PSEUDO_NOERRNO(name, syscall_name, args) \
121 DO_CALL (SYS_ify (syscall_name));
123 #define PSEUDO_RET_NOERRNO \
125 #define ret_NOERRNO PSEUDO_RET_NOERRNO
127 #undef PSEUDO_END_NOERRNO
128 #define PSEUDO_END_NOERRNO(name) \
131 #define PSEUDO_ERRVAL(name, syscall_name, args) \
134 DO_CALL (SYS_ify (syscall_name));
136 #define PSEUDO_RET_ERRVAL \
138 #define ret_ERRVAL PSEUDO_RET_ERRVAL
140 #undef PSEUDO_END_ERRVAL
141 #define PSEUDO_END_ERRVAL(name) \
144 /* Local labels stripped out by the linker. */
148 /* Label in text section. */
149 #define C_TEXT(name) name
153 #endif /* __ASSEMBLER__ */