crtsavres.S 10.8 KB
Newer Older
1 2 3 4 5 6 7 8
/*
 * Special support for eabi and SVR4
 *
 *   Copyright (C) 1995, 1996, 1998, 2000, 2001 Free Software Foundation, Inc.
 *   Copyright 2008 Freescale Semiconductor, Inc.
 *   Written By Michael Meissner
 *
 * Based on gcc/config/rs6000/crtsavres.asm from gcc
9
 * 64 bit additions from reading the PPC elf64abi document.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
 *
 * This file is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation; either version 2, or (at your option) any
 * later version.
 *
 * In addition to the permissions in the GNU General Public License, the
 * Free Software Foundation gives you unlimited permission to link the
 * compiled version of this file with other programs, and to distribute
 * those programs without any restriction coming from the use of this
 * file.  (The General Public License restrictions do apply in other
 * respects; for example, they cover modification of the file, and
 * distribution when not linked into another program.)
 *
 * This file is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; see the file COPYING.  If not, write to
 * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 *
 *    As a special exception, if you link this library with files
 *    compiled with GCC to produce an executable, this does not cause
 *    the resulting executable to be covered by the GNU General Public License.
 *    This exception does not however invalidate any other reasons why
 *    the executable file might be covered by the GNU General Public License.
 */

#include <asm/ppc_asm.h>

	.file	"crtsavres.S"

#ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE

47 48
#ifndef CONFIG_PPC64

49 50
	.section ".text"

51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232
/* Routines for saving integer registers, called by the compiler.  */
/* Called with r11 pointing to the stack header word of the caller of the */
/* function, just beyond the end of the integer save area.  */

_GLOBAL(_savegpr_14)
_GLOBAL(_save32gpr_14)
	stw	14,-72(11)	/* save gp registers */
_GLOBAL(_savegpr_15)
_GLOBAL(_save32gpr_15)
	stw	15,-68(11)
_GLOBAL(_savegpr_16)
_GLOBAL(_save32gpr_16)
	stw	16,-64(11)
_GLOBAL(_savegpr_17)
_GLOBAL(_save32gpr_17)
	stw	17,-60(11)
_GLOBAL(_savegpr_18)
_GLOBAL(_save32gpr_18)
	stw	18,-56(11)
_GLOBAL(_savegpr_19)
_GLOBAL(_save32gpr_19)
	stw	19,-52(11)
_GLOBAL(_savegpr_20)
_GLOBAL(_save32gpr_20)
	stw	20,-48(11)
_GLOBAL(_savegpr_21)
_GLOBAL(_save32gpr_21)
	stw	21,-44(11)
_GLOBAL(_savegpr_22)
_GLOBAL(_save32gpr_22)
	stw	22,-40(11)
_GLOBAL(_savegpr_23)
_GLOBAL(_save32gpr_23)
	stw	23,-36(11)
_GLOBAL(_savegpr_24)
_GLOBAL(_save32gpr_24)
	stw	24,-32(11)
_GLOBAL(_savegpr_25)
_GLOBAL(_save32gpr_25)
	stw	25,-28(11)
_GLOBAL(_savegpr_26)
_GLOBAL(_save32gpr_26)
	stw	26,-24(11)
_GLOBAL(_savegpr_27)
_GLOBAL(_save32gpr_27)
	stw	27,-20(11)
_GLOBAL(_savegpr_28)
_GLOBAL(_save32gpr_28)
	stw	28,-16(11)
_GLOBAL(_savegpr_29)
_GLOBAL(_save32gpr_29)
	stw	29,-12(11)
_GLOBAL(_savegpr_30)
_GLOBAL(_save32gpr_30)
	stw	30,-8(11)
_GLOBAL(_savegpr_31)
_GLOBAL(_save32gpr_31)
	stw	31,-4(11)
	blr

/* Routines for restoring integer registers, called by the compiler.  */
/* Called with r11 pointing to the stack header word of the caller of the */
/* function, just beyond the end of the integer restore area.  */

_GLOBAL(_restgpr_14)
_GLOBAL(_rest32gpr_14)
	lwz	14,-72(11)	/* restore gp registers */
_GLOBAL(_restgpr_15)
_GLOBAL(_rest32gpr_15)
	lwz	15,-68(11)
_GLOBAL(_restgpr_16)
_GLOBAL(_rest32gpr_16)
	lwz	16,-64(11)
_GLOBAL(_restgpr_17)
_GLOBAL(_rest32gpr_17)
	lwz	17,-60(11)
_GLOBAL(_restgpr_18)
_GLOBAL(_rest32gpr_18)
	lwz	18,-56(11)
_GLOBAL(_restgpr_19)
_GLOBAL(_rest32gpr_19)
	lwz	19,-52(11)
_GLOBAL(_restgpr_20)
_GLOBAL(_rest32gpr_20)
	lwz	20,-48(11)
_GLOBAL(_restgpr_21)
_GLOBAL(_rest32gpr_21)
	lwz	21,-44(11)
_GLOBAL(_restgpr_22)
_GLOBAL(_rest32gpr_22)
	lwz	22,-40(11)
_GLOBAL(_restgpr_23)
_GLOBAL(_rest32gpr_23)
	lwz	23,-36(11)
_GLOBAL(_restgpr_24)
_GLOBAL(_rest32gpr_24)
	lwz	24,-32(11)
_GLOBAL(_restgpr_25)
_GLOBAL(_rest32gpr_25)
	lwz	25,-28(11)
_GLOBAL(_restgpr_26)
_GLOBAL(_rest32gpr_26)
	lwz	26,-24(11)
_GLOBAL(_restgpr_27)
_GLOBAL(_rest32gpr_27)
	lwz	27,-20(11)
_GLOBAL(_restgpr_28)
_GLOBAL(_rest32gpr_28)
	lwz	28,-16(11)
_GLOBAL(_restgpr_29)
_GLOBAL(_rest32gpr_29)
	lwz	29,-12(11)
_GLOBAL(_restgpr_30)
_GLOBAL(_rest32gpr_30)
	lwz	30,-8(11)
_GLOBAL(_restgpr_31)
_GLOBAL(_rest32gpr_31)
	lwz	31,-4(11)
	blr

/* Routines for restoring integer registers, called by the compiler.  */
/* Called with r11 pointing to the stack header word of the caller of the */
/* function, just beyond the end of the integer restore area.  */

_GLOBAL(_restgpr_14_x)
_GLOBAL(_rest32gpr_14_x)
	lwz	14,-72(11)	/* restore gp registers */
_GLOBAL(_restgpr_15_x)
_GLOBAL(_rest32gpr_15_x)
	lwz	15,-68(11)
_GLOBAL(_restgpr_16_x)
_GLOBAL(_rest32gpr_16_x)
	lwz	16,-64(11)
_GLOBAL(_restgpr_17_x)
_GLOBAL(_rest32gpr_17_x)
	lwz	17,-60(11)
_GLOBAL(_restgpr_18_x)
_GLOBAL(_rest32gpr_18_x)
	lwz	18,-56(11)
_GLOBAL(_restgpr_19_x)
_GLOBAL(_rest32gpr_19_x)
	lwz	19,-52(11)
_GLOBAL(_restgpr_20_x)
_GLOBAL(_rest32gpr_20_x)
	lwz	20,-48(11)
_GLOBAL(_restgpr_21_x)
_GLOBAL(_rest32gpr_21_x)
	lwz	21,-44(11)
_GLOBAL(_restgpr_22_x)
_GLOBAL(_rest32gpr_22_x)
	lwz	22,-40(11)
_GLOBAL(_restgpr_23_x)
_GLOBAL(_rest32gpr_23_x)
	lwz	23,-36(11)
_GLOBAL(_restgpr_24_x)
_GLOBAL(_rest32gpr_24_x)
	lwz	24,-32(11)
_GLOBAL(_restgpr_25_x)
_GLOBAL(_rest32gpr_25_x)
	lwz	25,-28(11)
_GLOBAL(_restgpr_26_x)
_GLOBAL(_rest32gpr_26_x)
	lwz	26,-24(11)
_GLOBAL(_restgpr_27_x)
_GLOBAL(_rest32gpr_27_x)
	lwz	27,-20(11)
_GLOBAL(_restgpr_28_x)
_GLOBAL(_rest32gpr_28_x)
	lwz	28,-16(11)
_GLOBAL(_restgpr_29_x)
_GLOBAL(_rest32gpr_29_x)
	lwz	29,-12(11)
_GLOBAL(_restgpr_30_x)
_GLOBAL(_rest32gpr_30_x)
	lwz	30,-8(11)
_GLOBAL(_restgpr_31_x)
_GLOBAL(_rest32gpr_31_x)
	lwz	0,4(11)
	lwz	31,-4(11)
	mtlr	0
	mr	1,11
	blr
233

234 235 236 237 238
#ifdef CONFIG_ALTIVEC
/* Called with r0 pointing just beyond the end of the vector save area.  */

_GLOBAL(_savevr_20)
	li	r11,-192
239
	stvx	v20,r11,r0
240 241
_GLOBAL(_savevr_21)
	li	r11,-176
242
	stvx	v21,r11,r0
243 244
_GLOBAL(_savevr_22)
	li	r11,-160
245
	stvx	v22,r11,r0
246 247
_GLOBAL(_savevr_23)
	li	r11,-144
248
	stvx	v23,r11,r0
249 250
_GLOBAL(_savevr_24)
	li	r11,-128
251
	stvx	v24,r11,r0
252 253
_GLOBAL(_savevr_25)
	li	r11,-112
254
	stvx	v25,r11,r0
255 256
_GLOBAL(_savevr_26)
	li	r11,-96
257
	stvx	v26,r11,r0
258 259
_GLOBAL(_savevr_27)
	li	r11,-80
260
	stvx	v27,r11,r0
261 262
_GLOBAL(_savevr_28)
	li	r11,-64
263
	stvx	v28,r11,r0
264 265
_GLOBAL(_savevr_29)
	li	r11,-48
266
	stvx	v29,r11,r0
267 268
_GLOBAL(_savevr_30)
	li	r11,-32
269
	stvx	v30,r11,r0
270 271
_GLOBAL(_savevr_31)
	li	r11,-16
272
	stvx	v31,r11,r0
273 274 275 276
	blr

_GLOBAL(_restvr_20)
	li	r11,-192
277
	lvx	v20,r11,r0
278 279
_GLOBAL(_restvr_21)
	li	r11,-176
280
	lvx	v21,r11,r0
281 282
_GLOBAL(_restvr_22)
	li	r11,-160
283
	lvx	v22,r11,r0
284 285
_GLOBAL(_restvr_23)
	li	r11,-144
286
	lvx	v23,r11,r0
287 288
_GLOBAL(_restvr_24)
	li	r11,-128
289
	lvx	v24,r11,r0
290 291
_GLOBAL(_restvr_25)
	li	r11,-112
292
	lvx	v25,r11,r0
293 294
_GLOBAL(_restvr_26)
	li	r11,-96
295
	lvx	v26,r11,r0
296 297
_GLOBAL(_restvr_27)
	li	r11,-80
298
	lvx	v27,r11,r0
299 300
_GLOBAL(_restvr_28)
	li	r11,-64
301
	lvx	v28,r11,r0
302 303
_GLOBAL(_restvr_29)
	li	r11,-48
304
	lvx	v29,r11,r0
305 306
_GLOBAL(_restvr_30)
	li	r11,-32
307
	lvx	v30,r11,r0
308 309
_GLOBAL(_restvr_31)
	li	r11,-16
310
	lvx	v31,r11,r0
311 312 313 314
	blr

#endif /* CONFIG_ALTIVEC */

315 316
#else /* CONFIG_PPC64 */

317 318
	.section ".text.save.restore","ax",@progbits

319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439
.globl	_savegpr0_14
_savegpr0_14:
	std	r14,-144(r1)
.globl	_savegpr0_15
_savegpr0_15:
	std	r15,-136(r1)
.globl	_savegpr0_16
_savegpr0_16:
	std	r16,-128(r1)
.globl	_savegpr0_17
_savegpr0_17:
	std	r17,-120(r1)
.globl	_savegpr0_18
_savegpr0_18:
	std	r18,-112(r1)
.globl	_savegpr0_19
_savegpr0_19:
	std	r19,-104(r1)
.globl	_savegpr0_20
_savegpr0_20:
	std	r20,-96(r1)
.globl	_savegpr0_21
_savegpr0_21:
	std	r21,-88(r1)
.globl	_savegpr0_22
_savegpr0_22:
	std	r22,-80(r1)
.globl	_savegpr0_23
_savegpr0_23:
	std	r23,-72(r1)
.globl	_savegpr0_24
_savegpr0_24:
	std	r24,-64(r1)
.globl	_savegpr0_25
_savegpr0_25:
	std	r25,-56(r1)
.globl	_savegpr0_26
_savegpr0_26:
	std	r26,-48(r1)
.globl	_savegpr0_27
_savegpr0_27:
	std	r27,-40(r1)
.globl	_savegpr0_28
_savegpr0_28:
	std	r28,-32(r1)
.globl	_savegpr0_29
_savegpr0_29:
	std	r29,-24(r1)
.globl	_savegpr0_30
_savegpr0_30:
	std	r30,-16(r1)
.globl	_savegpr0_31
_savegpr0_31:
	std	r31,-8(r1)
	std	r0,16(r1)
	blr

.globl	_restgpr0_14
_restgpr0_14:
	ld	r14,-144(r1)
.globl	_restgpr0_15
_restgpr0_15:
	ld	r15,-136(r1)
.globl	_restgpr0_16
_restgpr0_16:
	ld	r16,-128(r1)
.globl	_restgpr0_17
_restgpr0_17:
	ld	r17,-120(r1)
.globl	_restgpr0_18
_restgpr0_18:
	ld	r18,-112(r1)
.globl	_restgpr0_19
_restgpr0_19:
	ld	r19,-104(r1)
.globl	_restgpr0_20
_restgpr0_20:
	ld	r20,-96(r1)
.globl	_restgpr0_21
_restgpr0_21:
	ld	r21,-88(r1)
.globl	_restgpr0_22
_restgpr0_22:
	ld	r22,-80(r1)
.globl	_restgpr0_23
_restgpr0_23:
	ld	r23,-72(r1)
.globl	_restgpr0_24
_restgpr0_24:
	ld	r24,-64(r1)
.globl	_restgpr0_25
_restgpr0_25:
	ld	r25,-56(r1)
.globl	_restgpr0_26
_restgpr0_26:
	ld	r26,-48(r1)
.globl	_restgpr0_27
_restgpr0_27:
	ld	r27,-40(r1)
.globl	_restgpr0_28
_restgpr0_28:
	ld	r28,-32(r1)
.globl	_restgpr0_29
_restgpr0_29:
	ld	r0,16(r1)
	ld	r29,-24(r1)
	mtlr	r0
	ld	r30,-16(r1)
	ld	r31,-8(r1)
	blr

.globl	_restgpr0_30
_restgpr0_30:
	ld	r30,-16(r1)
.globl	_restgpr0_31
_restgpr0_31:
	ld	r0,16(r1)
	ld	r31,-8(r1)
	mtlr	r0
	blr

440 441 442 443 444 445
#ifdef CONFIG_ALTIVEC
/* Called with r0 pointing just beyond the end of the vector save area.  */

.globl	_savevr_20
_savevr_20:
	li	r12,-192
446
	stvx	v20,r12,r0
447 448 449
.globl	_savevr_21
_savevr_21:
	li	r12,-176
450
	stvx	v21,r12,r0
451 452 453
.globl	_savevr_22
_savevr_22:
	li	r12,-160
454
	stvx	v22,r12,r0
455 456 457
.globl	_savevr_23
_savevr_23:
	li	r12,-144
458
	stvx	v23,r12,r0
459 460 461
.globl	_savevr_24
_savevr_24:
	li	r12,-128
462
	stvx	v24,r12,r0
463 464 465
.globl	_savevr_25
_savevr_25:
	li	r12,-112
466
	stvx	v25,r12,r0
467 468 469
.globl	_savevr_26
_savevr_26:
	li	r12,-96
470
	stvx	v26,r12,r0
471 472 473
.globl	_savevr_27
_savevr_27:
	li	r12,-80
474
	stvx	v27,r12,r0
475 476 477
.globl	_savevr_28
_savevr_28:
	li	r12,-64
478
	stvx	v28,r12,r0
479 480 481
.globl	_savevr_29
_savevr_29:
	li	r12,-48
482
	stvx	v29,r12,r0
483 484 485
.globl	_savevr_30
_savevr_30:
	li	r12,-32
486
	stvx	v30,r12,r0
487 488 489
.globl	_savevr_31
_savevr_31:
	li	r12,-16
490
	stvx	v31,r12,r0
491 492 493 494 495
	blr

.globl	_restvr_20
_restvr_20:
	li	r12,-192
496
	lvx	v20,r12,r0
497 498 499
.globl	_restvr_21
_restvr_21:
	li	r12,-176
500
	lvx	v21,r12,r0
501 502 503
.globl	_restvr_22
_restvr_22:
	li	r12,-160
504
	lvx	v22,r12,r0
505 506 507
.globl	_restvr_23
_restvr_23:
	li	r12,-144
508
	lvx	v23,r12,r0
509 510 511
.globl	_restvr_24
_restvr_24:
	li	r12,-128
512
	lvx	v24,r12,r0
513 514 515
.globl	_restvr_25
_restvr_25:
	li	r12,-112
516
	lvx	v25,r12,r0
517 518 519
.globl	_restvr_26
_restvr_26:
	li	r12,-96
520
	lvx	v26,r12,r0
521 522 523
.globl	_restvr_27
_restvr_27:
	li	r12,-80
524
	lvx	v27,r12,r0
525 526 527
.globl	_restvr_28
_restvr_28:
	li	r12,-64
528
	lvx	v28,r12,r0
529 530 531
.globl	_restvr_29
_restvr_29:
	li	r12,-48
532
	lvx	v29,r12,r0
533 534 535
.globl	_restvr_30
_restvr_30:
	li	r12,-32
536
	lvx	v30,r12,r0
537 538 539
.globl	_restvr_31
_restvr_31:
	li	r12,-16
540
	lvx	v31,r12,r0
541 542 543 544
	blr

#endif /* CONFIG_ALTIVEC */

545 546
#endif /* CONFIG_PPC64 */

547
#endif
反馈
建议
客服 返回
顶部