1c1
< /* $NetBSD: cerror.S,v 1.13 2003/08/07 16:42:17 agc Exp $ */
---
> /* $NetBSD: cerror.S,v 1.14 2009/12/14 01:07:42 matt Exp $ */
36c36
< __FBSDID("$FreeBSD: head/lib/libc/mips/sys/cerror.S 178580 2008-04-26 12:08:02Z imp $");
---
> __FBSDID("$FreeBSD: head/lib/libc/mips/sys/cerror.S 209231 2010-06-16 12:55:14Z jchandra $");
40,41c40,44
< ASMSTR("from: @(#)cerror.s 8.1 (Berkeley) 6/16/93")
< ASMSTR("$NetBSD: cerror.S,v 1.13 2003/08/07 16:42:17 agc Exp $")
---
> #if 0
> RCSID("from: @(#)cerror.s 8.1 (Berkeley) 6/16/93")
> #else
> RCSID("$NetBSD: cerror.S,v 1.14 2009/12/14 01:07:42 matt Exp $")
> #endif
43a47,53
> .globl _C_LABEL(__error)
> NESTED_NOPROFILE(__cerror, CALLFRAME_SIZ, ra)
> .mask 0x80000000, (CALLFRAME_RA - CALLFRAME_SIZ)
> SETUP_GP
> PTR_SUBU sp, sp, CALLFRAME_SIZ
> SETUP_GP64(CALLFRAME_GP, __cerror)
> SAVE_GP(CALLFRAME_GP)
45,51c55,56
< /*
< * The __error() function is thread aware. For non-threaded
< * programs and the initial threaded in threaded programs,
< * it returns a pointer to the global errno variable.
< */
< .globl _C_LABEL(__error)
< .type _C_LABEL(__error),%function
---
> PTR_S ra, CALLFRAME_RA(sp)
> REG_S v0, CALLFRAME_S0(sp) # save errno value
53,59c58,59
< LEAF(__cerror)
< .frame sp, CALLFRAME_SIZ, ra
< PIC_PROLOGUE(__cerror, t9)
< subu sp, sp, CALLFRAME_SIZ
< .mask 0x80000000, (CALLFRAME_RA - CALLFRAME_SIZ)
< sw ra, CALLFRAME_RA(sp)
< sw v0, 12(sp) # save errno value
---
> PTR_LA t9, _C_LABEL(__error) # locate address of errno
> jalr t9
61,62c61,63
< la t9, _C_LABEL(__error) # locate address of errno
< jalr t9
---
> REG_L t0, CALLFRAME_S0(sp)
> PTR_L ra, CALLFRAME_RA(sp)
> INT_S t0, 0(v0) # update errno value
64,70c65,71
< lw t0, 12(sp)
< lw ra, CALLFRAME_RA(sp)
< sw t0, 0(v0) # update errno value
< addiu sp, sp, CALLFRAME_SIZ
< li v0, -1
< li v1, -1
< j ra
---
> RESTORE_GP64
> PTR_ADDU sp, sp, CALLFRAME_SIZ
>
> li v0, -1
> li v1, -1
>
> j ra
< /* $NetBSD: cerror.S,v 1.13 2003/08/07 16:42:17 agc Exp $ */
---
> /* $NetBSD: cerror.S,v 1.14 2009/12/14 01:07:42 matt Exp $ */
36c36
< __FBSDID("$FreeBSD: head/lib/libc/mips/sys/cerror.S 178580 2008-04-26 12:08:02Z imp $");
---
> __FBSDID("$FreeBSD: head/lib/libc/mips/sys/cerror.S 209231 2010-06-16 12:55:14Z jchandra $");
40,41c40,44
< ASMSTR("from: @(#)cerror.s 8.1 (Berkeley) 6/16/93")
< ASMSTR("$NetBSD: cerror.S,v 1.13 2003/08/07 16:42:17 agc Exp $")
---
> #if 0
> RCSID("from: @(#)cerror.s 8.1 (Berkeley) 6/16/93")
> #else
> RCSID("$NetBSD: cerror.S,v 1.14 2009/12/14 01:07:42 matt Exp $")
> #endif
43a47,53
> .globl _C_LABEL(__error)
> NESTED_NOPROFILE(__cerror, CALLFRAME_SIZ, ra)
> .mask 0x80000000, (CALLFRAME_RA - CALLFRAME_SIZ)
> SETUP_GP
> PTR_SUBU sp, sp, CALLFRAME_SIZ
> SETUP_GP64(CALLFRAME_GP, __cerror)
> SAVE_GP(CALLFRAME_GP)
45,51c55,56
< /*
< * The __error() function is thread aware. For non-threaded
< * programs and the initial threaded in threaded programs,
< * it returns a pointer to the global errno variable.
< */
< .globl _C_LABEL(__error)
< .type _C_LABEL(__error),%function
---
> PTR_S ra, CALLFRAME_RA(sp)
> REG_S v0, CALLFRAME_S0(sp) # save errno value
53,59c58,59
< LEAF(__cerror)
< .frame sp, CALLFRAME_SIZ, ra
< PIC_PROLOGUE(__cerror, t9)
< subu sp, sp, CALLFRAME_SIZ
< .mask 0x80000000, (CALLFRAME_RA - CALLFRAME_SIZ)
< sw ra, CALLFRAME_RA(sp)
< sw v0, 12(sp) # save errno value
---
> PTR_LA t9, _C_LABEL(__error) # locate address of errno
> jalr t9
61,62c61,63
< la t9, _C_LABEL(__error) # locate address of errno
< jalr t9
---
> REG_L t0, CALLFRAME_S0(sp)
> PTR_L ra, CALLFRAME_RA(sp)
> INT_S t0, 0(v0) # update errno value
64,70c65,71
< lw t0, 12(sp)
< lw ra, CALLFRAME_RA(sp)
< sw t0, 0(v0) # update errno value
< addiu sp, sp, CALLFRAME_SIZ
< li v0, -1
< li v1, -1
< j ra
---
> RESTORE_GP64
> PTR_ADDU sp, sp, CALLFRAME_SIZ
>
> li v0, -1
> li v1, -1
>
> j ra