Date: Wed, 3 Mar 2010 21:59:23 +0000 (UTC) From: Warner Losh <imp@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r204674 - head/lib/csu/mips Message-ID: <201003032159.o23LxN9P077919@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: imp Date: Wed Mar 3 21:59:23 2010 New Revision: 204674 URL: http://svn.freebsd.org/changeset/base/204674 Log: Use ABI neutral macrosa Submitted by: jmallet Modified: head/lib/csu/mips/crti.S head/lib/csu/mips/crtn.S Modified: head/lib/csu/mips/crti.S ============================================================================== --- head/lib/csu/mips/crti.S Wed Mar 3 21:54:49 2010 (r204673) +++ head/lib/csu/mips/crti.S Wed Mar 3 21:59:23 2010 (r204674) @@ -6,32 +6,45 @@ __FBSDID("$FreeBSD$"); .globl _init .type _init,%function _init: -#ifdef __ABICALLS__ - .set noreorder - .cpload $25 - .set reorder - subu sp, sp, 32 - .cprestore 16 - sw ra, 28(sp) - + .set nreoorder +#if defined(__ABICALLS__) && (defined(__mips_o32) || defined(__mips_o64)) + SETUP_GP +#endif + PTR_ADDU sp, sp, -CALLFRAME_SIZ + REG_S ra, CALLFRAME_RA(sp) +#if defined(__ABICALLS__) +#if defined(__mips_o32) || defined(__mips_o64) + SAVE_GP(CALLFRAME_GP) #else - subu sp, sp, 32 - sw ra, 28(sp) + SETUP_GP64(CALLFRAME_GP, _init) +#endif +#else /* __ABICALLS__ */ +#if defined(__mips_n32) || defined(__mips_n64) + REG_S gp, CALLFRAME_GP(sp) +#endif #endif + .set reorder .section .fini,"ax",%progbits .align 4 .globl _fini .type _fini,%function _fini: -#ifdef __ABICALLS__ - .set noreorder - .cpload $25 - .set reorder - subu sp, sp, 32 - .cprestore 16 - sw ra, 28(sp) + .set noreorder +#if defined(__ABICALLS__) && (defined(__mips_o32) || defined(__mips_o64)) + SETUP_GP +#endif + PTR_ADDU sp, sp, -CALLFRAME_SIZ + REG_S ra, CALLFRAME_RA(sp) +#if defined(__ABICALLS__) +#if defined(__mips_o32) || defined(__mips_o64) + SAVE_GP(CALLFRAME_GP) #else - subu sp, sp, 32 - sw ra, 28(sp) + SETUP_GP64(CALLFRAME_GP, _fini) +#endif +#else /* __ABICALLS__ */ +#if defined(__mips_n32) || defined(__mips_n64) + REG_S gp, CALLFRAME_GP(sp) +#endif #endif + .set reorder Modified: head/lib/csu/mips/crtn.S ============================================================================== --- head/lib/csu/mips/crtn.S Wed Mar 3 21:54:49 2010 (r204673) +++ head/lib/csu/mips/crtn.S Wed Mar 3 21:59:23 2010 (r204674) @@ -1,15 +1,24 @@ #include <machine/asm.h> __FBSDID("$FreeBSD$"); + .section .init,"ax",%progbits - lw ra, 28(sp) - .set noreorder - j ra - addu sp, sp, 32 - .set reorder + .align 4 + .set noreorder +#if defined(__ABICALLS__) && (defined(__mips_n32) || defined(__mips_n64)) + REG_L gp, CALLFRAME_GP(sp) +#endif + REG_L ra, CALLFRAME_RA(sp) + jr ra + PTR_ADDU sp, sp, CALLFRAME_SIZ + .set reorder .section .fini,"ax",%progbits - lw ra, 28(sp) - .set noreorder - j ra - addu sp, sp, 32 - .set reorder + .align 4 + .set noreorder +#if defined(__ABICALLS__) && (defined(__mips_n32) || defined(__mips_n64)) + REG_L gp, CALLFRAME_GP(sp) +#endif + REG_L ra, CALLFRAME_RA(sp) + jr ra + PTR_ADDU sp, sp, CALLFRAME_SIZ + .set reorder
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201003032159.o23LxN9P077919>