1 /* Assembly macros for 32-bit PowerPC.
2 Copyright (C) 1999, 2001, 2002 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
22 #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
41 bl _GLOBAL_OFFSET_TABLE_@local-4; \
44 bl JUMPTARGET(_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) \
108 #define JUMPTARGET(name) name##@plt
110 #define JUMPTARGET(name) name
113 #define PSEUDO(name, syscall_name, args) \
116 DO_CALL (SYS_ify (syscall_name));
120 b JUMPTARGET(__syscall_error)
121 #define ret PSEUDO_RET
124 #define PSEUDO_END(name) \
127 /* Local labels stripped out by the linker. */
131 /* Label in text section. */
132 #define C_TEXT(name) name
136 #endif /* __ASSEMBLER__ */