From 6d7d422e656b57d1f70b412f730458f46c68ef2f Mon Sep 17 00:00:00 2001 From: Per Fogelstrom Date: Tue, 7 Sep 2004 13:48:28 +0000 Subject: 32 -> 64 bit cleanups but no optimizations yet --- lib/libc/arch/mips64/SYS.h | 4 ++-- lib/libc/arch/mips64/gen/setjmp.S | 16 ++++++++++------ lib/libc/arch/mips64/gen/sigsetjmp.S | 10 +++++----- lib/libc/arch/mips64/sys/brk.S | 18 +++++++++--------- lib/libc/arch/mips64/sys/exect.S | 4 ++-- lib/libc/arch/mips64/sys/fork.S | 4 ++-- lib/libc/arch/mips64/sys/rfork.S | 4 ++-- lib/libc/arch/mips64/sys/sbrk.S | 12 ++++++------ lib/libc/arch/mips64/sys/setlogin.S | 5 +++-- lib/libc/arch/mips64/sys/sigpending.S | 4 ++-- lib/libc/arch/mips64/sys/sigprocmask.S | 4 ++-- lib/libc/arch/mips64/sys/sigsuspend.S | 4 ++-- 12 files changed, 47 insertions(+), 42 deletions(-) diff --git a/lib/libc/arch/mips64/SYS.h b/lib/libc/arch/mips64/SYS.h index 284e9fb4152..084dff105cf 100644 --- a/lib/libc/arch/mips64/SYS.h +++ b/lib/libc/arch/mips64/SYS.h @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $OpenBSD: SYS.h,v 1.1 2004/08/11 17:30:59 pefo Exp $ + * $OpenBSD: SYS.h,v 1.2 2004/09/07 13:48:26 pefo Exp $ */ #include @@ -70,7 +70,7 @@ __DO_SYSCALL(y); \ bne a3,zero,err; \ j ra; \ - err: la t9,_C_LABEL(cerror); \ + err: LA t9,_C_LABEL(cerror); \ jr t9; \ __END2(p,x) diff --git a/lib/libc/arch/mips64/gen/setjmp.S b/lib/libc/arch/mips64/gen/setjmp.S index ca714f49537..613159bc58c 100644 --- a/lib/libc/arch/mips64/gen/setjmp.S +++ b/lib/libc/arch/mips64/gen/setjmp.S @@ -1,4 +1,4 @@ -/* $OpenBSD: setjmp.S,v 1.1 2004/08/11 17:30:59 pefo Exp $ */ +/* $OpenBSD: setjmp.S,v 1.2 2004/09/07 13:48:26 pefo Exp $ */ /* * Copyright (c) 2001-2002 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -36,7 +36,7 @@ #if defined(LIBC_SCCS) .text - .asciz "$OpenBSD: setjmp.S,v 1.1 2004/08/11 17:30:59 pefo Exp $" + .asciz "$OpenBSD: setjmp.S,v 1.2 2004/09/07 13:48:26 pefo Exp $" #endif /* LIBC_SCCS */ /* @@ -45,7 +45,7 @@ * */ -#define SETJMP_FRAMESZ (FRAMESZ(CF_SZ) + 4 * REGSZ) +#define SETJMP_FRAMESZ (FRAMESZ(CF_SZ) + 6 * REGSZ) NON_LEAF(setjmp, SETJMP_FRAMESZ, ra) .mask 0x80000000, (CF_RA_OFFS - FRAMESZ(CF_SZ)) @@ -55,15 +55,19 @@ NON_LEAF(setjmp, SETJMP_FRAMESZ, ra) #endif .set reorder REG_S ra, CF_RA_OFFS(sp) # save state - REG_S a0, SETJMP_FRAMESZ(sp) + REG_S a0, SETJMP_FRAMESZ-REGSZ(sp) + move a0, zero # get current signal mask jal sigblock - REG_L v1, SETJMP_FRAMESZ(sp) # v1 = jmpbuf + + REG_L v1, SETJMP_FRAMESZ-REGSZ(sp) # v1 = jmpbuf REG_S v0, SC_MASK(v1) # save sc_mask = sigblock(0) + move a0, zero PTR_ADD a1, sp, FRAMESZ(CF_SZ) # pointer to struct sigaltstack jal _thread_sys_sigaltstack - REG_L a0, SETJMP_FRAMESZ(sp) # restore jmpbuf + + REG_L a0, SETJMP_FRAMESZ-REGSZ(sp) # restore jmpbuf lw v1, FRAMESZ(CF_SZ)+REGSZ+4(sp) # get old ss_onstack and v1, v1, 1 # extract onstack flag REG_S v1, SC_ONSTACK(a0) # save it in sc_onstack diff --git a/lib/libc/arch/mips64/gen/sigsetjmp.S b/lib/libc/arch/mips64/gen/sigsetjmp.S index 414681506d2..06a842e89f8 100644 --- a/lib/libc/arch/mips64/gen/sigsetjmp.S +++ b/lib/libc/arch/mips64/gen/sigsetjmp.S @@ -36,7 +36,7 @@ #if defined(LIBC_SCCS) .text - .asciz "$OpenBSD: sigsetjmp.S,v 1.1 2004/08/11 17:30:59 pefo Exp $" + .asciz "$OpenBSD: sigsetjmp.S,v 1.2 2004/09/07 13:48:26 pefo Exp $" #endif /* LIBC_SCCS */ /* @@ -47,10 +47,10 @@ LEAF(sigsetjmp) .set reorder REG_S a1, (_JBLEN*REGSZ)(a0) # save "savemask" bne a1, 0x0, 1f # do saving of signal mask? - la t9, _setjmp + LA t9, _setjmp jr t9 -1: la t9, setjmp +1: LA t9, setjmp jr t9 END(sigsetjmp) @@ -58,8 +58,8 @@ LEAF(siglongjmp) .set reorder REG_L t0, (_JBLEN*REGSZ)(a0) # get "savemask" bne t0, 0x0, 1f # restore signal mask? - la t9, _longjmp + LA t9, _longjmp jr t9 -1: la t9, longjmp +1: LA t9, longjmp jr t9 END(siglongjmp) diff --git a/lib/libc/arch/mips64/sys/brk.S b/lib/libc/arch/mips64/sys/brk.S index 68ae6837876..6449e49aa72 100644 --- a/lib/libc/arch/mips64/sys/brk.S +++ b/lib/libc/arch/mips64/sys/brk.S @@ -34,32 +34,32 @@ #if defined(SYSLIBC_SCCS) .text - .asciz "$OpenBSD: brk.S,v 1.1 2004/08/11 17:30:59 pefo Exp $" + .asciz "$OpenBSD: brk.S,v 1.2 2004/09/07 13:48:27 pefo Exp $" #endif /* SYSLIBC_SCCS */ .globl minbrk .globl curbrk .data -minbrk: .word _C_LABEL(end) +minbrk: PTR_VAL _C_LABEL(end) .text LEAF(brk) .set reorder - lw v0, minbrk + PTR_L v0, minbrk bltu a0, v0, 1f - la t9, _brk + LA t9, _brk jr t9 1: move a0, v0 # dont allow break < minbrk li v0, SYS_break syscall bne a3, zero, 2f - sw a0, curbrk + PTR_S a0, curbrk move v0, zero j ra 2: - la t9, _C_LABEL(cerror) + LA t9, _C_LABEL(cerror) jr t9 END(brk) @@ -68,10 +68,10 @@ LEAF(_brk) li v0, SYS_break syscall bne a3, zero, 1f - sw a0, curbrk + PTR_S a0, curbrk move v0, zero j ra 1: - la t9, _C_LABEL(cerror) + LA t9, _C_LABEL(cerror) jr t9 -END(brk) +END(_brk) diff --git a/lib/libc/arch/mips64/sys/exect.S b/lib/libc/arch/mips64/sys/exect.S index 014b6a98348..d5ebb39e073 100644 --- a/lib/libc/arch/mips64/sys/exect.S +++ b/lib/libc/arch/mips64/sys/exect.S @@ -34,7 +34,7 @@ #if defined(SYSLIBC_SCCS) .text - .asciz "$OpenBSD: exect.S,v 1.1 2004/08/11 17:30:59 pefo Exp $" + .asciz "$OpenBSD: exect.S,v 1.2 2004/09/07 13:48:27 pefo Exp $" #endif /* SYSLIBC_SCCS */ SYSLEAF(exect) @@ -44,6 +44,6 @@ SYSLEAF(exect) bne a3, zero, 1f j ra 1: - la t9, _C_LABEL(cerror) + LA t9, _C_LABEL(cerror) jr t9 SYSEND(exect) diff --git a/lib/libc/arch/mips64/sys/fork.S b/lib/libc/arch/mips64/sys/fork.S index 9ade3e1631d..ba682e49bf5 100644 --- a/lib/libc/arch/mips64/sys/fork.S +++ b/lib/libc/arch/mips64/sys/fork.S @@ -34,7 +34,7 @@ #if defined(SYSLIBC_SCCS) .text - .asciz "$OpenBSD: fork.S,v 1.1 2004/08/11 17:30:59 pefo Exp $" + .asciz "$OpenBSD: fork.S,v 1.2 2004/09/07 13:48:27 pefo Exp $" #endif /* SYSLIBC_SCCS */ SYSLEAF(fork) @@ -47,6 +47,6 @@ SYSLEAF(fork) 1: j ra 2: - la t9, _C_LABEL(cerror) + LA t9, _C_LABEL(cerror) jr t9 SYSEND(fork) diff --git a/lib/libc/arch/mips64/sys/rfork.S b/lib/libc/arch/mips64/sys/rfork.S index 89aa36b787c..490f88e3a76 100644 --- a/lib/libc/arch/mips64/sys/rfork.S +++ b/lib/libc/arch/mips64/sys/rfork.S @@ -34,7 +34,7 @@ #if defined(SYSLIBC_SCCS) .text - .asciz "$OpenBSD: rfork.S,v 1.1 2004/08/11 17:31:00 pefo Exp $" + .asciz "$OpenBSD: rfork.S,v 1.2 2004/09/07 13:48:27 pefo Exp $" #endif /* SYSLIBC_SCCS */ SYSLEAF(rfork) @@ -47,6 +47,6 @@ SYSLEAF(rfork) 1: j ra 2: - la t9, _C_LABEL(cerror) + LA t9, _C_LABEL(cerror) jr t9 SYSEND(rfork) diff --git a/lib/libc/arch/mips64/sys/sbrk.S b/lib/libc/arch/mips64/sys/sbrk.S index ed93eea811b..c5c279eedb9 100644 --- a/lib/libc/arch/mips64/sys/sbrk.S +++ b/lib/libc/arch/mips64/sys/sbrk.S @@ -34,27 +34,27 @@ #if defined(SYSLIBC_SCCS) .text - .asciz "$OpenBSD: sbrk.S,v 1.1 2004/08/11 17:31:00 pefo Exp $" + .asciz "$OpenBSD: sbrk.S,v 1.2 2004/09/07 13:48:27 pefo Exp $" #endif /* SYSLIBC_SCCS */ .globl curbrk .data -curbrk: .word _C_LABEL(end) +curbrk: PTR_VAL _C_LABEL(end) .text LEAF(sbrk) .set reorder - lw v1, curbrk + PTR_L v1, curbrk li v0, SYS_break - addu a0, a0, v1 # compute current break + PTR_ADDU a0, a0, v1 # compute current break syscall bne a3, zero, 1f move v0, v1 # return old val of curbrk from above - sw a0, curbrk # save current val of curbrk from above + PTR_S a0, curbrk # save current val of curbrk from above j ra 1: - la t9, _C_LABEL(cerror) + LA t9, _C_LABEL(cerror) jr t9 END(sbrk) diff --git a/lib/libc/arch/mips64/sys/setlogin.S b/lib/libc/arch/mips64/sys/setlogin.S index 74ccd79fe1b..0318a9052b2 100644 --- a/lib/libc/arch/mips64/sys/setlogin.S +++ b/lib/libc/arch/mips64/sys/setlogin.S @@ -31,10 +31,11 @@ */ #include "SYS.h" +#error not used!! #if defined(SYSLIBC_SCCS) .text - .asciz "$OpenBSD: setlogin.S,v 1.1 2004/08/11 17:31:00 pefo Exp $" + .asciz "$OpenBSD: setlogin.S,v 1.2 2004/09/07 13:48:27 pefo Exp $" #endif /* SYSLIBC_SCCS */ LEAF(setlogin) @@ -46,6 +47,6 @@ LEAF(setlogin) sw zero, _C_LABEL(__logname_valid) # in getlogin() j ra 1: - la t9, _C_LABEL(cerror) + LA t9, _C_LABEL(cerror) jr t9 END(setlogin) diff --git a/lib/libc/arch/mips64/sys/sigpending.S b/lib/libc/arch/mips64/sys/sigpending.S index 117312df7d5..8c9a9897b95 100644 --- a/lib/libc/arch/mips64/sys/sigpending.S +++ b/lib/libc/arch/mips64/sys/sigpending.S @@ -34,7 +34,7 @@ #if defined(SYSLIBC_SCCS) .text - .asciz "$OpenBSD: sigpending.S,v 1.1 2004/08/11 17:31:00 pefo Exp $" + .asciz "$OpenBSD: sigpending.S,v 1.2 2004/09/07 13:48:27 pefo Exp $" #endif /* SYSLIBC_SCCS */ SYSLEAF(sigpending) @@ -46,6 +46,6 @@ SYSLEAF(sigpending) move v0, zero j ra 1: - la t9, _C_LABEL(cerror) + LA t9, _C_LABEL(cerror) jr t9 SYSEND(sigpending) diff --git a/lib/libc/arch/mips64/sys/sigprocmask.S b/lib/libc/arch/mips64/sys/sigprocmask.S index b42bfe33dee..6e2998b1486 100644 --- a/lib/libc/arch/mips64/sys/sigprocmask.S +++ b/lib/libc/arch/mips64/sys/sigprocmask.S @@ -34,7 +34,7 @@ #if defined(SYSLIBC_SCCS) .text - .asciz "$OpenBSD: sigprocmask.S,v 1.1 2004/08/11 17:31:00 pefo Exp $" + .asciz "$OpenBSD: sigprocmask.S,v 1.2 2004/09/07 13:48:27 pefo Exp $" #endif /* SYSLIBC_SCCS */ SYSLEAF(sigprocmask) # sigprocmask(how, new, old) sigset_t *new, *old; @@ -54,6 +54,6 @@ out: move v0, zero j ra err: - la t9, _C_LABEL(cerror) + LA t9, _C_LABEL(cerror) jr t9 SYSEND(sigprocmask) diff --git a/lib/libc/arch/mips64/sys/sigsuspend.S b/lib/libc/arch/mips64/sys/sigsuspend.S index 2b6ff2f08bf..5643ce2b073 100644 --- a/lib/libc/arch/mips64/sys/sigsuspend.S +++ b/lib/libc/arch/mips64/sys/sigsuspend.S @@ -34,7 +34,7 @@ #if defined(SYSLIBC_SCCS) .text - .asciz "$OpenBSD: sigsuspend.S,v 1.1 2004/08/11 17:31:00 pefo Exp $" + .asciz "$OpenBSD: sigsuspend.S,v 1.2 2004/09/07 13:48:27 pefo Exp $" #endif /* SYSLIBC_SCCS */ SYSLEAF(sigsuspend) @@ -46,6 +46,6 @@ SYSLEAF(sigsuspend) move v0, zero # should not happen j ra 1: - la t9, _C_LABEL(cerror) + LA t9, _C_LABEL(cerror) jr t9 SYSEND(sigsuspend) -- cgit v1.2.3