196263Sobrien/*
296263Sobrien * Special support for eabi and SVR4
396263Sobrien *
496263Sobrien *   Copyright (C) 1995, 1996, 1998, 2000, 2001 Free Software Foundation, Inc.
596263Sobrien *   Written By Michael Meissner
696263Sobrien *   64-bit support written by David Edelsohn
796263Sobrien * 
896263Sobrien * This file is free software; you can redistribute it and/or modify it
996263Sobrien * under the terms of the GNU General Public License as published by the
1096263Sobrien * Free Software Foundation; either version 2, or (at your option) any
1196263Sobrien * later version.
1296263Sobrien * 
1396263Sobrien * In addition to the permissions in the GNU General Public License, the
1496263Sobrien * Free Software Foundation gives you unlimited permission to link the
1596263Sobrien * compiled version of this file with other programs, and to distribute
1696263Sobrien * those programs without any restriction coming from the use of this
1796263Sobrien * file.  (The General Public License restrictions do apply in other
1896263Sobrien * respects; for example, they cover modification of the file, and
1996263Sobrien * distribution when not linked into another program.)
2096263Sobrien * 
2196263Sobrien * This file is distributed in the hope that it will be useful, but
2296263Sobrien * WITHOUT ANY WARRANTY; without even the implied warranty of
2396263Sobrien * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
2496263Sobrien * General Public License for more details.
2596263Sobrien * 
2696263Sobrien * You should have received a copy of the GNU General Public License
2796263Sobrien * along with this program; see the file COPYING.  If not, write to
28169689Skan * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
29169689Skan * Boston, MA 02110-1301, USA.
3096263Sobrien * 
3196263Sobrien *    As a special exception, if you link this library with files
3296263Sobrien *    compiled with GCC to produce an executable, this does not cause
3396263Sobrien *    the resulting executable to be covered by the GNU General Public License.
3496263Sobrien *    This exception does not however invalidate any other reasons why
3596263Sobrien *    the executable file might be covered by the GNU General Public License.
3696263Sobrien */ 
3796263Sobrien
3896263Sobrien/* Do any initializations needed for the eabi environment */
3996263Sobrien
4096263Sobrien	.file	"crtsavres.asm"
4196263Sobrien	.section ".text"
4296263Sobrien	#include "ppc-asm.h"
4396263Sobrien
44132718Skan/* On PowerPC64 Linux, these functions are provided by the linker.  */
4596263Sobrien#ifndef __powerpc64__
4696263Sobrien
4796263Sobrien/* Routines for saving floating point registers, called by the compiler.  */
4896263Sobrien/* Called with r11 pointing to the stack header word of the caller of the */
4996263Sobrien/* function, just beyond the end of the floating point save area.  */
5096263Sobrien
5196263SobrienFUNC_START(_savefpr_14)	stfd	14,-144(11)	/* save fp registers */
5296263SobrienFUNC_START(_savefpr_15)	stfd	15,-136(11)
5396263SobrienFUNC_START(_savefpr_16)	stfd	16,-128(11)
5496263SobrienFUNC_START(_savefpr_17)	stfd	17,-120(11)
5596263SobrienFUNC_START(_savefpr_18)	stfd	18,-112(11)
5696263SobrienFUNC_START(_savefpr_19)	stfd	19,-104(11)
5796263SobrienFUNC_START(_savefpr_20)	stfd	20,-96(11)
5896263SobrienFUNC_START(_savefpr_21)	stfd	21,-88(11)
5996263SobrienFUNC_START(_savefpr_22)	stfd	22,-80(11)
6096263SobrienFUNC_START(_savefpr_23)	stfd	23,-72(11)
6196263SobrienFUNC_START(_savefpr_24)	stfd	24,-64(11)
6296263SobrienFUNC_START(_savefpr_25)	stfd	25,-56(11)
6396263SobrienFUNC_START(_savefpr_26)	stfd	26,-48(11)
6496263SobrienFUNC_START(_savefpr_27)	stfd	27,-40(11)
6596263SobrienFUNC_START(_savefpr_28)	stfd	28,-32(11)
6696263SobrienFUNC_START(_savefpr_29)	stfd	29,-24(11)
6796263SobrienFUNC_START(_savefpr_30)	stfd	30,-16(11)
6896263SobrienFUNC_START(_savefpr_31)	stfd	31,-8(11)
6996263Sobrien			blr
7096263SobrienFUNC_END(_savefpr_31)
7196263SobrienFUNC_END(_savefpr_30)
7296263SobrienFUNC_END(_savefpr_29)
7396263SobrienFUNC_END(_savefpr_28)
7496263SobrienFUNC_END(_savefpr_27)
7596263SobrienFUNC_END(_savefpr_26)
7696263SobrienFUNC_END(_savefpr_25)
7796263SobrienFUNC_END(_savefpr_24)
7896263SobrienFUNC_END(_savefpr_23)
7996263SobrienFUNC_END(_savefpr_22)
8096263SobrienFUNC_END(_savefpr_21)
8196263SobrienFUNC_END(_savefpr_20)
8296263SobrienFUNC_END(_savefpr_19)
8396263SobrienFUNC_END(_savefpr_18)
8496263SobrienFUNC_END(_savefpr_17)
8596263SobrienFUNC_END(_savefpr_16)
8696263SobrienFUNC_END(_savefpr_15)
8796263SobrienFUNC_END(_savefpr_14)
8896263Sobrien
8996263Sobrien/* Routines for saving integer registers, called by the compiler.  */
9096263Sobrien/* Called with r11 pointing to the stack header word of the caller of the */
9196263Sobrien/* function, just beyond the end of the integer save area.  */
9296263Sobrien
9396263SobrienFUNC_START(_savegpr_14)	stw	14,-72(11)	/* save gp registers */
9496263SobrienFUNC_START(_savegpr_15)	stw	15,-68(11)
9596263SobrienFUNC_START(_savegpr_16)	stw	16,-64(11)
9696263SobrienFUNC_START(_savegpr_17)	stw	17,-60(11)
9796263SobrienFUNC_START(_savegpr_18)	stw	18,-56(11)
9896263SobrienFUNC_START(_savegpr_19)	stw	19,-52(11)
9996263SobrienFUNC_START(_savegpr_20)	stw	20,-48(11)
10096263SobrienFUNC_START(_savegpr_21)	stw	21,-44(11)
10196263SobrienFUNC_START(_savegpr_22)	stw	22,-40(11)
10296263SobrienFUNC_START(_savegpr_23)	stw	23,-36(11)
10396263SobrienFUNC_START(_savegpr_24)	stw	24,-32(11)
10496263SobrienFUNC_START(_savegpr_25)	stw	25,-28(11)
10596263SobrienFUNC_START(_savegpr_26)	stw	26,-24(11)
10696263SobrienFUNC_START(_savegpr_27)	stw	27,-20(11)
10796263SobrienFUNC_START(_savegpr_28)	stw	28,-16(11)
10896263SobrienFUNC_START(_savegpr_29)	stw	29,-12(11)
10996263SobrienFUNC_START(_savegpr_30)	stw	30,-8(11)
11096263SobrienFUNC_START(_savegpr_31)	stw	31,-4(11)
11196263Sobrien			blr
11296263SobrienFUNC_END(_savegpr_31)
11396263SobrienFUNC_END(_savegpr_30)
11496263SobrienFUNC_END(_savegpr_29)
11596263SobrienFUNC_END(_savegpr_28)
11696263SobrienFUNC_END(_savegpr_27)
11796263SobrienFUNC_END(_savegpr_26)
11896263SobrienFUNC_END(_savegpr_25)
11996263SobrienFUNC_END(_savegpr_24)
12096263SobrienFUNC_END(_savegpr_23)
12196263SobrienFUNC_END(_savegpr_22)
12296263SobrienFUNC_END(_savegpr_21)
12396263SobrienFUNC_END(_savegpr_20)
12496263SobrienFUNC_END(_savegpr_19)
12596263SobrienFUNC_END(_savegpr_18)
12696263SobrienFUNC_END(_savegpr_17)
12796263SobrienFUNC_END(_savegpr_16)
12896263SobrienFUNC_END(_savegpr_15)
12996263SobrienFUNC_END(_savegpr_14)
13096263Sobrien
13196263Sobrien/* Routines for restoring floating point registers, called by the compiler.  */
13296263Sobrien/* Called with r11 pointing to the stack header word of the caller of the */
13396263Sobrien/* function, just beyond the end of the floating point save area.  */
13496263Sobrien
13596263SobrienFUNC_START(_restfpr_14)	lfd	14,-144(11)	/* restore fp registers */
13696263SobrienFUNC_START(_restfpr_15)	lfd	15,-136(11)
13796263SobrienFUNC_START(_restfpr_16)	lfd	16,-128(11)
13896263SobrienFUNC_START(_restfpr_17)	lfd	17,-120(11)
13996263SobrienFUNC_START(_restfpr_18)	lfd	18,-112(11)
14096263SobrienFUNC_START(_restfpr_19)	lfd	19,-104(11)
14196263SobrienFUNC_START(_restfpr_20)	lfd	20,-96(11)
14296263SobrienFUNC_START(_restfpr_21)	lfd	21,-88(11)
14396263SobrienFUNC_START(_restfpr_22)	lfd	22,-80(11)
14496263SobrienFUNC_START(_restfpr_23)	lfd	23,-72(11)
14596263SobrienFUNC_START(_restfpr_24)	lfd	24,-64(11)
14696263SobrienFUNC_START(_restfpr_25)	lfd	25,-56(11)
14796263SobrienFUNC_START(_restfpr_26)	lfd	26,-48(11)
14896263SobrienFUNC_START(_restfpr_27)	lfd	27,-40(11)
14996263SobrienFUNC_START(_restfpr_28)	lfd	28,-32(11)
15096263SobrienFUNC_START(_restfpr_29)	lfd	29,-24(11)
15196263SobrienFUNC_START(_restfpr_30)	lfd	30,-16(11)
15296263SobrienFUNC_START(_restfpr_31)	lfd	31,-8(11)
15396263Sobrien			blr
15496263SobrienFUNC_END(_restfpr_31)
15596263SobrienFUNC_END(_restfpr_30)
15696263SobrienFUNC_END(_restfpr_29)
15796263SobrienFUNC_END(_restfpr_28)
15896263SobrienFUNC_END(_restfpr_27)
15996263SobrienFUNC_END(_restfpr_26)
16096263SobrienFUNC_END(_restfpr_25)
16196263SobrienFUNC_END(_restfpr_24)
16296263SobrienFUNC_END(_restfpr_23)
16396263SobrienFUNC_END(_restfpr_22)
16496263SobrienFUNC_END(_restfpr_21)
16596263SobrienFUNC_END(_restfpr_20)
16696263SobrienFUNC_END(_restfpr_19)
16796263SobrienFUNC_END(_restfpr_18)
16896263SobrienFUNC_END(_restfpr_17)
16996263SobrienFUNC_END(_restfpr_16)
17096263SobrienFUNC_END(_restfpr_15)
17196263SobrienFUNC_END(_restfpr_14)
17296263Sobrien
17396263Sobrien/* Routines for restoring integer registers, called by the compiler.  */
17496263Sobrien/* Called with r11 pointing to the stack header word of the caller of the */
17596263Sobrien/* function, just beyond the end of the integer restore area.  */
17696263Sobrien
17796263SobrienFUNC_START(_restgpr_14)	lwz	14,-72(11)	/* restore gp registers */
17896263SobrienFUNC_START(_restgpr_15)	lwz	15,-68(11)
17996263SobrienFUNC_START(_restgpr_16)	lwz	16,-64(11)
18096263SobrienFUNC_START(_restgpr_17)	lwz	17,-60(11)
18196263SobrienFUNC_START(_restgpr_18)	lwz	18,-56(11)
18296263SobrienFUNC_START(_restgpr_19)	lwz	19,-52(11)
18396263SobrienFUNC_START(_restgpr_20)	lwz	20,-48(11)
18496263SobrienFUNC_START(_restgpr_21)	lwz	21,-44(11)
18596263SobrienFUNC_START(_restgpr_22)	lwz	22,-40(11)
18696263SobrienFUNC_START(_restgpr_23)	lwz	23,-36(11)
18796263SobrienFUNC_START(_restgpr_24)	lwz	24,-32(11)
18896263SobrienFUNC_START(_restgpr_25)	lwz	25,-28(11)
18996263SobrienFUNC_START(_restgpr_26)	lwz	26,-24(11)
19096263SobrienFUNC_START(_restgpr_27)	lwz	27,-20(11)
19196263SobrienFUNC_START(_restgpr_28)	lwz	28,-16(11)
19296263SobrienFUNC_START(_restgpr_29)	lwz	29,-12(11)
19396263SobrienFUNC_START(_restgpr_30)	lwz	30,-8(11)
19496263SobrienFUNC_START(_restgpr_31)	lwz	31,-4(11)
19596263Sobrien			blr
19696263SobrienFUNC_END(_restgpr_31)
19796263SobrienFUNC_END(_restgpr_30)
19896263SobrienFUNC_END(_restgpr_29)
19996263SobrienFUNC_END(_restgpr_28)
20096263SobrienFUNC_END(_restgpr_27)
20196263SobrienFUNC_END(_restgpr_26)
20296263SobrienFUNC_END(_restgpr_25)
20396263SobrienFUNC_END(_restgpr_24)
20496263SobrienFUNC_END(_restgpr_23)
20596263SobrienFUNC_END(_restgpr_22)
20696263SobrienFUNC_END(_restgpr_21)
20796263SobrienFUNC_END(_restgpr_20)
20896263SobrienFUNC_END(_restgpr_19)
20996263SobrienFUNC_END(_restgpr_18)
21096263SobrienFUNC_END(_restgpr_17)
21196263SobrienFUNC_END(_restgpr_16)
21296263SobrienFUNC_END(_restgpr_15)
21396263SobrienFUNC_END(_restgpr_14)
21496263Sobrien
21596263Sobrien/* Routines for restoring floating point registers, called by the compiler.  */
21696263Sobrien/* Called with r11 pointing to the stack header word of the caller of the */
21796263Sobrien/* function, just beyond the end of the floating point save area.  */
21896263Sobrien/* In addition to restoring the fp registers, it will return to the caller's */
21996263Sobrien/* caller */
22096263Sobrien
22196263SobrienFUNC_START(_restfpr_14_x)	lfd	14,-144(11)	/* restore fp registers */
22296263SobrienFUNC_START(_restfpr_15_x)	lfd	15,-136(11)
22396263SobrienFUNC_START(_restfpr_16_x)	lfd	16,-128(11)
22496263SobrienFUNC_START(_restfpr_17_x)	lfd	17,-120(11)
22596263SobrienFUNC_START(_restfpr_18_x)	lfd	18,-112(11)
22696263SobrienFUNC_START(_restfpr_19_x)	lfd	19,-104(11)
22796263SobrienFUNC_START(_restfpr_20_x)	lfd	20,-96(11)
22896263SobrienFUNC_START(_restfpr_21_x)	lfd	21,-88(11)
22996263SobrienFUNC_START(_restfpr_22_x)	lfd	22,-80(11)
23096263SobrienFUNC_START(_restfpr_23_x)	lfd	23,-72(11)
23196263SobrienFUNC_START(_restfpr_24_x)	lfd	24,-64(11)
23296263SobrienFUNC_START(_restfpr_25_x)	lfd	25,-56(11)
23396263SobrienFUNC_START(_restfpr_26_x)	lfd	26,-48(11)
23496263SobrienFUNC_START(_restfpr_27_x)	lfd	27,-40(11)
23596263SobrienFUNC_START(_restfpr_28_x)	lfd	28,-32(11)
23696263SobrienFUNC_START(_restfpr_29_x)	lfd	29,-24(11)
23796263SobrienFUNC_START(_restfpr_30_x)	lfd	30,-16(11)
23896263SobrienFUNC_START(_restfpr_31_x)	lwz	0,4(11)
23996263Sobrien				lfd	31,-8(11)
24096263Sobrien				mtlr	0
24196263Sobrien				mr	1,11
24296263Sobrien				blr
24396263SobrienFUNC_END(_restfpr_31_x)
24496263SobrienFUNC_END(_restfpr_30_x)
24596263SobrienFUNC_END(_restfpr_29_x)
24696263SobrienFUNC_END(_restfpr_28_x)
24796263SobrienFUNC_END(_restfpr_27_x)
24896263SobrienFUNC_END(_restfpr_26_x)
24996263SobrienFUNC_END(_restfpr_25_x)
25096263SobrienFUNC_END(_restfpr_24_x)
25196263SobrienFUNC_END(_restfpr_23_x)
25296263SobrienFUNC_END(_restfpr_22_x)
25396263SobrienFUNC_END(_restfpr_21_x)
25496263SobrienFUNC_END(_restfpr_20_x)
25596263SobrienFUNC_END(_restfpr_19_x)
25696263SobrienFUNC_END(_restfpr_18_x)
25796263SobrienFUNC_END(_restfpr_17_x)
25896263SobrienFUNC_END(_restfpr_16_x)
25996263SobrienFUNC_END(_restfpr_15_x)
26096263SobrienFUNC_END(_restfpr_14_x)
26196263Sobrien
26296263Sobrien/* Routines for restoring integer registers, called by the compiler.  */
26396263Sobrien/* Called with r11 pointing to the stack header word of the caller of the */
26496263Sobrien/* function, just beyond the end of the integer restore area.  */
26596263Sobrien
26696263SobrienFUNC_START(_restgpr_14_x)	lwz	14,-72(11)	/* restore gp registers */
26796263SobrienFUNC_START(_restgpr_15_x)	lwz	15,-68(11)
26896263SobrienFUNC_START(_restgpr_16_x)	lwz	16,-64(11)
26996263SobrienFUNC_START(_restgpr_17_x)	lwz	17,-60(11)
27096263SobrienFUNC_START(_restgpr_18_x)	lwz	18,-56(11)
27196263SobrienFUNC_START(_restgpr_19_x)	lwz	19,-52(11)
27296263SobrienFUNC_START(_restgpr_20_x)	lwz	20,-48(11)
27396263SobrienFUNC_START(_restgpr_21_x)	lwz	21,-44(11)
27496263SobrienFUNC_START(_restgpr_22_x)	lwz	22,-40(11)
27596263SobrienFUNC_START(_restgpr_23_x)	lwz	23,-36(11)
27696263SobrienFUNC_START(_restgpr_24_x)	lwz	24,-32(11)
27796263SobrienFUNC_START(_restgpr_25_x)	lwz	25,-28(11)
27896263SobrienFUNC_START(_restgpr_26_x)	lwz	26,-24(11)
27996263SobrienFUNC_START(_restgpr_27_x)	lwz	27,-20(11)
28096263SobrienFUNC_START(_restgpr_28_x)	lwz	28,-16(11)
28196263SobrienFUNC_START(_restgpr_29_x)	lwz	29,-12(11)
28296263SobrienFUNC_START(_restgpr_30_x)	lwz	30,-8(11)
28396263SobrienFUNC_START(_restgpr_31_x)	lwz	0,4(11)
28496263Sobrien				lwz	31,-4(11)
28596263Sobrien				mtlr	0
28696263Sobrien				mr	1,11
28796263Sobrien				blr
28896263SobrienFUNC_END(_restgpr_31_x)
28996263SobrienFUNC_END(_restgpr_30_x)
29096263SobrienFUNC_END(_restgpr_29_x)
29196263SobrienFUNC_END(_restgpr_28_x)
29296263SobrienFUNC_END(_restgpr_27_x)
29396263SobrienFUNC_END(_restgpr_26_x)
29496263SobrienFUNC_END(_restgpr_25_x)
29596263SobrienFUNC_END(_restgpr_24_x)
29696263SobrienFUNC_END(_restgpr_23_x)
29796263SobrienFUNC_END(_restgpr_22_x)
29896263SobrienFUNC_END(_restgpr_21_x)
29996263SobrienFUNC_END(_restgpr_20_x)
30096263SobrienFUNC_END(_restgpr_19_x)
30196263SobrienFUNC_END(_restgpr_18_x)
30296263SobrienFUNC_END(_restgpr_17_x)
30396263SobrienFUNC_END(_restgpr_16_x)
30496263SobrienFUNC_END(_restgpr_15_x)
30596263SobrienFUNC_END(_restgpr_14_x)
30696263Sobrien
30796263Sobrien#endif
308217396Skib
309217396Skib	.section .note.GNU-stack,"",%progbits
310