Convert to use register prefixes.

This commit is contained in:
kleink 2003-10-03 22:37:35 +00:00
parent d5c1c224c8
commit 09c5c31fc8
2 changed files with 24 additions and 24 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: swapcontext.S,v 1.2 2003/01/18 11:12:54 thorpej Exp $ */
/* $NetBSD: swapcontext.S,v 1.3 2003/10/03 22:37:35 kleink Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -40,27 +40,27 @@
#if defined(LIBC_SCCS) && !defined(lint)
.text
.asciz "$NetBSD: swapcontext.S,v 1.2 2003/01/18 11:12:54 thorpej Exp $"
.asciz "$NetBSD: swapcontext.S,v 1.3 2003/10/03 22:37:35 kleink Exp $"
#endif /* LIBC_SCCS && !lint */
ENTRY(swapcontext)
stwu 1, -16(1) # set up new stack frame
mflr 0
stw 0, 20(1) # save link register
stw 3, 8(1) # must save oucp
stw 4, 12(1) # must save ucp
stwu %r1,-16(%r1) # set up new stack frame
mflr %r0
stw %r0,20(%r1) # save link register
stw %r3,8(%r1) # must save oucp
stw %r4,12(%r1) # must save ucp
bl PIC_PLT(_C_LABEL(_getcontext)) # getcontext(oucp)
cmpwi 3, 0
cmpwi %r3,0
bne 1f
lwz 11, 8(1) # load oucp for adjustment
lwz 0, 20(1)
stw 0, (48 + 34 * 4)(11) # pc <- lr
la 0, 16(1)
stw 0, (48 + 1 * 4)(11) # adjust sp
lwz 3, 12(1) # load ucp
lwz %r11,8(%r1) # load oucp for adjustment
lwz %r0,20(%r1)
stw %r0,(48 + 34 * 4)(%r11) # pc <- lr
la %r0,16(%r1)
stw %r0,(48 + 1 * 4)(%r11) # adjust sp
lwz %r3,12(%r1) # load ucp
bl PIC_PLT(_C_LABEL(setcontext)) # setcontext(ucp)
1:
lwz 0, 20(1)
mtlr 0
la 1, 16(1)
lwz %r0,20(%r1)
mtlr %r0
la %r1,16(%r1)
blr

View File

@ -1,4 +1,4 @@
/* $NetBSD: getcontext.S,v 1.2 2003/01/18 11:12:55 thorpej Exp $ */
/* $NetBSD: getcontext.S,v 1.3 2003/10/03 22:37:35 kleink Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -40,7 +40,7 @@
#if defined(SYSLIBC_SCCS) && !defined(lint)
.text
.asciz "$NetBSD: getcontext.S,v 1.2 2003/01/18 11:12:55 thorpej Exp $"
.asciz "$NetBSD: getcontext.S,v 1.3 2003/10/03 22:37:35 kleink Exp $"
#endif /* SYSLIBC_SCCS && !lint */
#ifdef WEAK_ALIAS
@ -48,13 +48,13 @@ WEAK_ALIAS(getcontext, _getcontext)
#endif
ENTRY(_getcontext)
mr 5, 3 # must save pointer
li 0, SYS_getcontext
mr %r5,%r3 # must save pointer
li %r0,SYS_getcontext
sc
bso 1f
mflr 4
stw 4, (48 + 34 * 4)(5) # saved pc <- lr
stw 3, (48 + 3 * 4)(5) # arrange for return value 0
mflr %r4
stw %r4,(48 + 34 * 4)(%r5) # saved pc <- lr
stw %r3,(48 + 3 * 4)(%r5) # arrange for return value 0
blr
1:
b PIC_PLT(_C_LABEL(__cerror))