1 /* Assembly macros for 32-bit PowerPC.
2 Copyright (C) 1999, 2001, 2002, 2003 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., 59 Temple Place, Suite 330, 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
33 # define CALL_MCOUNT \
41 bl _GLOBAL_OFFSET_TABLE_@local-4; \
44 bl JUMPTARGET(_mcount);
46 # define CALL_MCOUNT \
55 bl JUMPTARGET(_mcount);
58 # define CALL_MCOUNT /* Do nothing. */
62 ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \
63 ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
68 #define EALIGN_W_0 /* No words to insert. */
69 #define EALIGN_W_1 nop
70 #define EALIGN_W_2 nop;nop
71 #define EALIGN_W_3 nop;nop;nop
72 #define EALIGN_W_4 EALIGN_W_3;nop
73 #define EALIGN_W_5 EALIGN_W_4;nop
74 #define EALIGN_W_6 EALIGN_W_5;nop
75 #define EALIGN_W_7 EALIGN_W_6;nop
77 /* EALIGN is like ENTRY, but does alignment to 'words'*4 bytes
78 past a 2^align boundary. */
80 # define EALIGN(name, alignt, words) \
81 ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \
82 ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
87 .align ALIGNARG(alignt); \
91 # define EALIGN(name, alignt, words) \
92 ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \
93 ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
94 .align ALIGNARG(alignt); \
101 ASM_SIZE_DIRECTIVE(name)
103 #define DO_CALL(syscall) \
109 # define JUMPTARGET(name) name##@plt
111 # define JUMPTARGET(name) name
114 #if defined SHARED && defined DO_VERSIONING && defined PIC \
115 && !defined HAVE_BROKEN_ALIAS_ATTRIBUTE && !defined NO_HIDDEN
116 # undef HIDDEN_JUMPTARGET
117 # define HIDDEN_JUMPTARGET(name) __GI_##name##@local
120 #define PSEUDO(name, syscall_name, args) \
123 DO_CALL (SYS_ify (syscall_name));
127 b JUMPTARGET(__syscall_error)
128 #define ret PSEUDO_RET
131 #define PSEUDO_END(name) \
134 #define PSEUDO_NOERRNO(name, syscall_name, args) \
137 DO_CALL (SYS_ify (syscall_name));
139 #define PSEUDO_RET_NOERRNO \
141 #define ret_NOERRNO PSEUDO_RET_NOERRNO
143 #undef PSEUDO_END_NOERRNO
144 #define PSEUDO_END_NOERRNO(name) \
147 #define PSEUDO_ERRVAL(name, syscall_name, args) \
150 DO_CALL (SYS_ify (syscall_name));
152 #define PSEUDO_RET_ERRVAL \
154 #define ret_ERRVAL PSEUDO_RET_ERRVAL
156 #undef PSEUDO_END_ERRVAL
157 #define PSEUDO_END_ERRVAL(name) \
160 /* Local labels stripped out by the linker. */
164 /* Label in text section. */
165 #define C_TEXT(name) name
169 #endif /* __ASSEMBLER__ */