diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2004-05-25 20:44:51 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2004-05-25 20:44:51 +0000 |
commit | 4e42a38c60be0f12430f398e67faf0835ffcde9c (patch) | |
tree | 37b34165392d7f981b4a34f433c496f12b65f06e /lib | |
parent | 96e577cbbba94b53c4e78078d48ac90b9049af68 (diff) |
PICy stuff
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/arch/hppa/Makefile.inc | 7 | ||||
-rw-r--r-- | lib/libc/arch/hppa/SYS.h | 14 | ||||
-rw-r--r-- | lib/libc/arch/hppa/sys/Ovfork.S | 13 | ||||
-rw-r--r-- | lib/libc/arch/hppa/sys/brk.S | 17 | ||||
-rw-r--r-- | lib/libc/arch/hppa/sys/cerror.S | 46 | ||||
-rw-r--r-- | lib/libc/arch/hppa/sys/sbrk.S | 20 |
6 files changed, 86 insertions, 31 deletions
diff --git a/lib/libc/arch/hppa/Makefile.inc b/lib/libc/arch/hppa/Makefile.inc index 59409a4ff12..3d2e80e9c1c 100644 --- a/lib/libc/arch/hppa/Makefile.inc +++ b/lib/libc/arch/hppa/Makefile.inc @@ -1,9 +1,4 @@ -# $OpenBSD: Makefile.inc,v 1.6 2002/09/10 03:42:25 mickey Exp $ +# $OpenBSD: Makefile.inc,v 1.7 2004/05/25 20:44:50 mickey Exp $ KMINCLUDES= arch/hppa/DEFS.h arch/hppa/SYS.h prefix.h KMSRCS= - -CLEANFILES+= cerror.S - -cerror.S: - @echo > cerror.S diff --git a/lib/libc/arch/hppa/SYS.h b/lib/libc/arch/hppa/SYS.h index 803d6efd9ae..f7685ebcd37 100644 --- a/lib/libc/arch/hppa/SYS.h +++ b/lib/libc/arch/hppa/SYS.h @@ -1,4 +1,4 @@ -/* $OpenBSD: SYS.h,v 1.13 2003/06/02 20:28:04 mickey Exp $ */ +/* $OpenBSD: SYS.h,v 1.14 2004/05/25 20:44:50 mickey Exp $ */ /* * Copyright (c) 1998-2002 Michael Shalayeff @@ -44,15 +44,9 @@ EXIT(__CONCAT(_thread_sys_,x)) ldil L%SYSCALLGATE, r1 !\ ble 4(sr7, r1) !\ ldi __CONCAT(SYS_,x), t1 !\ - ldw HPPA_FRAME_ERP(sr0,sp), rp !\ - comb,=,n r0, t1, __CONCAT(x,$noerr) !\ - .import errno, data !\ - ldil L%errno, r1 !\ - stw t1, R%errno(r1) !\ - ldi -1, ret0 !\ - bv r0(rp) !\ - ldi -1, ret1 !\ - .label __CONCAT(x,$noerr) + .import __cerror, code !\ + comb,<> r0, t1, __cerror !\ + ldw HPPA_FRAME_ERP(sr0,sp), rp #define PSEUDO(x,y) !\ SYSENTRY(x,0) !\ diff --git a/lib/libc/arch/hppa/sys/Ovfork.S b/lib/libc/arch/hppa/sys/Ovfork.S index c2816401f93..13515e9de17 100644 --- a/lib/libc/arch/hppa/sys/Ovfork.S +++ b/lib/libc/arch/hppa/sys/Ovfork.S @@ -1,4 +1,4 @@ -/* $OpenBSD: Ovfork.S,v 1.10 2003/06/02 20:28:04 mickey Exp $ */ +/* $OpenBSD: Ovfork.S,v 1.11 2004/05/25 20:44:50 mickey Exp $ */ /* * Copyright (c) 1999,2002 Michael Shalayeff @@ -30,7 +30,7 @@ #ifdef SYSLIBC_SCCS .text - .asciz "$OpenBSD: Ovfork.S,v 1.10 2003/06/02 20:28:04 mickey Exp $" + .asciz "$OpenBSD: Ovfork.S,v 1.11 2004/05/25 20:44:50 mickey Exp $" .align 4 #endif @@ -40,14 +40,9 @@ SYSENTRY(vfork,0) ldil L%SYSCALLGATE, r1 ble 4(sr7, r1) ldi __CONCAT(SYS_,vfork), t1 + .import __cerror, code + comb,<> r0, t1, __cerror copy t4, rp - comb,=,n r0, t1, __CONCAT(x,$noerr) - ldil L%errno, r1 - stw t1, R%errno(r1) - ldi -1, ret0 - bv r0(rp) - ldi -1, ret1 - .label __CONCAT(x,$noerr) addi -1, ret1, ret1 bv r0(rp) and ret1, ret0, ret0 diff --git a/lib/libc/arch/hppa/sys/brk.S b/lib/libc/arch/hppa/sys/brk.S index 770ffe11e56..7781d3edccb 100644 --- a/lib/libc/arch/hppa/sys/brk.S +++ b/lib/libc/arch/hppa/sys/brk.S @@ -1,4 +1,4 @@ -/* $OpenBSD: brk.S,v 1.11 2003/06/02 20:28:04 mickey Exp $ */ +/* $OpenBSD: brk.S,v 1.12 2004/05/25 20:44:50 mickey Exp $ */ /* * Copyright (c) 1999 Michael Shalayeff @@ -30,7 +30,7 @@ #ifdef SYSLIBC_SCCS .text - .asciz "$OpenBSD: brk.S,v 1.11 2003/06/02 20:28:04 mickey Exp $" + .asciz "$OpenBSD: brk.S,v 1.12 2004/05/25 20:44:50 mickey Exp $" .align 4 #endif @@ -43,8 +43,14 @@ minbrk .long end SYSENTRY(brk,0) +#ifdef PIC + addil LT%minbrk, r19 + ldw RT%minbrk(r1), t1 + ldw 0(t1), t2 +#else ldil L%minbrk, t1 ldw R%minbrk(t1), t2 +#endif sub,<< t2, arg0, r0 copy t2, arg0 stw arg0, HPPA_FRAME_ARG(0)(sp) @@ -52,9 +58,16 @@ SYSENTRY(brk,0) SYSCALL(break) ldw HPPA_FRAME_ARG(0)(sp), arg0 +#ifdef PIC + addil LT%__curbrk, r19 + ldw RT%__curbrk(r1), t1 + bv r0(rp) + stw arg0, 0(t1) +#else ldil L%__curbrk, t1 bv r0(rp) stw arg0, R%__curbrk(t1) +#endif SYSEXIT(brk) .end diff --git a/lib/libc/arch/hppa/sys/cerror.S b/lib/libc/arch/hppa/sys/cerror.S new file mode 100644 index 00000000000..76b47bfa7fa --- /dev/null +++ b/lib/libc/arch/hppa/sys/cerror.S @@ -0,0 +1,46 @@ +/* $OpenBSD: cerror.S,v 1.3 2004/05/25 20:44:50 mickey Exp $ */ + +/* + * Copyright (c) 2004 Michael Shalayeff + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include <machine/asm.h> + + .import errno, data +ENTRY(__cerror,0) +#ifdef PIC + addil LT%errno, r19 + ldw RT%errno(r1), r1 + stw t1, 0(r1) +#else + ldil L%errno, r1 + stw t1, R%errno(r1) +#endif + ldi -1, ret0 + bv r0(rp) + ldi -1, ret1 +EXIT(__cerror) + + .end diff --git a/lib/libc/arch/hppa/sys/sbrk.S b/lib/libc/arch/hppa/sys/sbrk.S index 6e08c7f91a7..790239a6a5f 100644 --- a/lib/libc/arch/hppa/sys/sbrk.S +++ b/lib/libc/arch/hppa/sys/sbrk.S @@ -1,4 +1,4 @@ -/* $OpenBSD: sbrk.S,v 1.10 2003/06/02 20:28:04 mickey Exp $ */ +/* $OpenBSD: sbrk.S,v 1.11 2004/05/25 20:44:50 mickey Exp $ */ /* * Copyright (c) 1999 Michael Shalayeff @@ -30,7 +30,7 @@ #ifdef SYSLIBC_SCCS .text - .asciz "$OpenBSD: sbrk.S,v 1.10 2003/06/02 20:28:04 mickey Exp $" + .asciz "$OpenBSD: sbrk.S,v 1.11 2004/05/25 20:44:50 mickey Exp $" .align 4 #endif @@ -42,18 +42,30 @@ __curbrk .long end SYSENTRY(sbrk,0) +#ifdef PIC + addil LT%__curbrk, r19 + ldw RT%__curbrk(r1), t1 + ldw 0(t1), t2 +#else ldil L%__curbrk, t1 ldw R%__curbrk(t1), t2 +#endif add arg0, t2, arg0 stw arg0, HPPA_FRAME_ARG(0)(sp) SYSCALL(break) +#ifdef PIC + addil LT%__curbrk, r19 + ldw RT%__curbrk(r1), t1 +#else ldil L%__curbrk, t1 - ldw R%__curbrk(t1), ret0 + ldo R%__curbrk(t1), t1 +#endif ldw HPPA_FRAME_ARG(0)(sp), arg0 + ldw 0(t1), ret0 bv r0(rp) - stw arg0, R%__curbrk(t1) + stw arg0, 0(t1) SYSEXIT(sbrk) |