2 * Special support for eabi and SVR4
4 * Copyright (C) 1995, 1996, 1998, 2000, 2001 Free Software Foundation, Inc.
5 * Copyright 2008 Freescale Semiconductor, Inc.
6 * Written By Michael Meissner
8 * Based on gcc/config/rs6000/crtsavres.asm from gcc
9 * 64 bit additions from reading the PPC elf64abi document.
11 * This file is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by the
13 * Free Software Foundation; either version 2, or (at your option) any
16 * In addition to the permissions in the GNU General Public License, the
17 * Free Software Foundation gives you unlimited permission to link the
18 * compiled version of this file with other programs, and to distribute
19 * those programs without any restriction coming from the use of this
20 * file. (The General Public License restrictions do apply in other
21 * respects; for example, they cover modification of the file, and
22 * distribution when not linked into another program.)
24 * This file is distributed in the hope that it will be useful, but
25 * WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27 * General Public License for more details.
29 * You should have received a copy of the GNU General Public License
30 * along with this program; see the file COPYING. If not, write to
31 * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
32 * Boston, MA 02110-1301, USA.
34 * As a special exception, if you link this library with files
35 * compiled with GCC to produce an executable, this does not cause
36 * the resulting executable to be covered by the GNU General Public License.
37 * This exception does not however invalidate any other reasons why
38 * the executable file might be covered by the GNU General Public License.
41 #include <asm/ppc_asm.h>
45 #ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
51 /* Routines for saving integer registers, called by the compiler. */
52 /* Called with r11 pointing to the stack header word of the caller of the */
53 /* function, just beyond the end of the integer save area. */
56 _GLOBAL(_save32gpr_14)
57 stw 14,-72(11) /* save gp registers */
59 _GLOBAL(_save32gpr_15)
62 _GLOBAL(_save32gpr_16)
65 _GLOBAL(_save32gpr_17)
68 _GLOBAL(_save32gpr_18)
71 _GLOBAL(_save32gpr_19)
74 _GLOBAL(_save32gpr_20)
77 _GLOBAL(_save32gpr_21)
80 _GLOBAL(_save32gpr_22)
83 _GLOBAL(_save32gpr_23)
86 _GLOBAL(_save32gpr_24)
89 _GLOBAL(_save32gpr_25)
92 _GLOBAL(_save32gpr_26)
95 _GLOBAL(_save32gpr_27)
98 _GLOBAL(_save32gpr_28)
101 _GLOBAL(_save32gpr_29)
104 _GLOBAL(_save32gpr_30)
107 _GLOBAL(_save32gpr_31)
111 /* Routines for restoring integer registers, called by the compiler. */
112 /* Called with r11 pointing to the stack header word of the caller of the */
113 /* function, just beyond the end of the integer restore area. */
116 _GLOBAL(_rest32gpr_14)
117 lwz 14,-72(11) /* restore gp registers */
119 _GLOBAL(_rest32gpr_15)
122 _GLOBAL(_rest32gpr_16)
125 _GLOBAL(_rest32gpr_17)
128 _GLOBAL(_rest32gpr_18)
131 _GLOBAL(_rest32gpr_19)
134 _GLOBAL(_rest32gpr_20)
137 _GLOBAL(_rest32gpr_21)
140 _GLOBAL(_rest32gpr_22)
143 _GLOBAL(_rest32gpr_23)
146 _GLOBAL(_rest32gpr_24)
149 _GLOBAL(_rest32gpr_25)
152 _GLOBAL(_rest32gpr_26)
155 _GLOBAL(_rest32gpr_27)
158 _GLOBAL(_rest32gpr_28)
161 _GLOBAL(_rest32gpr_29)
164 _GLOBAL(_rest32gpr_30)
167 _GLOBAL(_rest32gpr_31)
171 /* Routines for restoring integer registers, called by the compiler. */
172 /* Called with r11 pointing to the stack header word of the caller of the */
173 /* function, just beyond the end of the integer restore area. */
175 _GLOBAL(_restgpr_14_x)
176 _GLOBAL(_rest32gpr_14_x)
177 lwz 14,-72(11) /* restore gp registers */
178 _GLOBAL(_restgpr_15_x)
179 _GLOBAL(_rest32gpr_15_x)
181 _GLOBAL(_restgpr_16_x)
182 _GLOBAL(_rest32gpr_16_x)
184 _GLOBAL(_restgpr_17_x)
185 _GLOBAL(_rest32gpr_17_x)
187 _GLOBAL(_restgpr_18_x)
188 _GLOBAL(_rest32gpr_18_x)
190 _GLOBAL(_restgpr_19_x)
191 _GLOBAL(_rest32gpr_19_x)
193 _GLOBAL(_restgpr_20_x)
194 _GLOBAL(_rest32gpr_20_x)
196 _GLOBAL(_restgpr_21_x)
197 _GLOBAL(_rest32gpr_21_x)
199 _GLOBAL(_restgpr_22_x)
200 _GLOBAL(_rest32gpr_22_x)
202 _GLOBAL(_restgpr_23_x)
203 _GLOBAL(_rest32gpr_23_x)
205 _GLOBAL(_restgpr_24_x)
206 _GLOBAL(_rest32gpr_24_x)
208 _GLOBAL(_restgpr_25_x)
209 _GLOBAL(_rest32gpr_25_x)
211 _GLOBAL(_restgpr_26_x)
212 _GLOBAL(_rest32gpr_26_x)
214 _GLOBAL(_restgpr_27_x)
215 _GLOBAL(_rest32gpr_27_x)
217 _GLOBAL(_restgpr_28_x)
218 _GLOBAL(_rest32gpr_28_x)
220 _GLOBAL(_restgpr_29_x)
221 _GLOBAL(_rest32gpr_29_x)
223 _GLOBAL(_restgpr_30_x)
224 _GLOBAL(_rest32gpr_30_x)
226 _GLOBAL(_restgpr_31_x)
227 _GLOBAL(_rest32gpr_31_x)
234 #ifdef CONFIG_ALTIVEC
235 /* Called with r0 pointing just beyond the end of the vector save area. */
313 #endif /* CONFIG_ALTIVEC */
315 #else /* CONFIG_PPC64 */
438 #ifdef CONFIG_ALTIVEC
439 /* Called with r0 pointing just beyond the end of the vector save area. */
541 #endif /* CONFIG_ALTIVEC */
543 #endif /* CONFIG_PPC64 */