diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2003-12-25 18:49:08 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2003-12-25 18:49:08 +0000 |
commit | f5ed6cfbe9243478083b3bb09f752e09bb2ed562 (patch) | |
tree | aa67729250fc5180774828e3477318e41ff010be | |
parent | 8e9c251b291097cf3ef82e6e25a5a1639b51f5b1 (diff) |
Use an unsigned comparison against minbrk.
ok deraadt@
-rw-r--r-- | lib/libc/arch/m68k/sys/brk.S | 4 | ||||
-rw-r--r-- | lib/libc/arch/m88k/sys/brk.S | 13 | ||||
-rw-r--r-- | lib/libc/arch/sparc/sys/brk.S | 6 | ||||
-rw-r--r-- | lib/libc/arch/sparc64/sys/brk.S | 6 | ||||
-rw-r--r-- | lib/libc/arch/vax/sys/brk.S | 9 |
5 files changed, 17 insertions, 21 deletions
diff --git a/lib/libc/arch/m68k/sys/brk.S b/lib/libc/arch/m68k/sys/brk.S index 0121ffa1ba1..f27abeae773 100644 --- a/lib/libc/arch/m68k/sys/brk.S +++ b/lib/libc/arch/m68k/sys/brk.S @@ -33,7 +33,7 @@ #if defined(SYSLIBC_SCCS) .text - .asciz "$OpenBSD: brk.S,v 1.4 2003/06/02 20:18:31 millert Exp $" + .asciz "$OpenBSD: brk.S,v 1.5 2003/12/25 18:49:04 miod Exp $" #endif /* SYSLIBC_SCCS */ #include "SYS.h" @@ -56,7 +56,7 @@ ENTRY(brk) movl minbrk,d0 #endif cmpl sp@(4),d0 - jle ok + jls ok movl d0,sp@(4) ok: movl #SYS_break,d0 diff --git a/lib/libc/arch/m88k/sys/brk.S b/lib/libc/arch/m88k/sys/brk.S index 08f4d345728..7bb6155cd4e 100644 --- a/lib/libc/arch/m88k/sys/brk.S +++ b/lib/libc/arch/m88k/sys/brk.S @@ -1,4 +1,4 @@ -/* $OpenBSD: brk.S,v 1.6 2003/06/02 20:18:31 millert Exp $ */ +/* $OpenBSD: brk.S,v 1.7 2003/12/25 18:49:06 miod Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -35,29 +35,28 @@ #if defined(LIBC_SCCS) .data - .string "$OpenBSD: brk.S,v 1.6 2003/06/02 20:18:31 millert Exp $" + .string "$OpenBSD: brk.S,v 1.7 2003/12/25 18:49:06 miod Exp $" #endif /* LIBC_SCCS */ #include "SYS.h" .globl _end - .globl minbrk .globl __curbrk .data .align 8 -minbrk: .long _end - .text +ASGLOBAL(minbrk) + .long _end ENTRY(brk) or.u r5,r0,hi16(minbrk) ld r5,r5,lo16(minbrk) cmp r3,r5,r2 - bb1 le,r3,1f /* r2 should be > minbrk; can't go below end */ + bb1 ls,r3,1f /* r2 should be > minbrk; can't go below end */ or r2,r5,0 /* otherwise, set r2 to minbrk */ 1: or r4,r2,0 - or r13,r0,SYS_break + or r13,r0,__SYSCALLNAME(SYS_,break) tb0 0,r0,128 br __cerror or.u r5,r0,hi16(__curbrk) diff --git a/lib/libc/arch/sparc/sys/brk.S b/lib/libc/arch/sparc/sys/brk.S index 183502716de..d533f767283 100644 --- a/lib/libc/arch/sparc/sys/brk.S +++ b/lib/libc/arch/sparc/sys/brk.S @@ -33,7 +33,7 @@ #if defined(SYSLIBC_SCCS) .text - .asciz "$OpenBSD: brk.S,v 1.4 2003/06/02 20:18:32 millert Exp $" + .asciz "$OpenBSD: brk.S,v 1.5 2003/12/25 18:49:07 miod Exp $" #endif /* SYSLIBC_SCCS */ #include "SYS.h" @@ -51,7 +51,7 @@ ENTRY(brk) ld [%o5 + minbrk], %o4 ld [%o4], %o1 ! %o1 = minbrk cmp %o1, %o0 ! if (minbrk > %o0) - bg,a 0f + bgu,a 0f mov %o1, %o0 ! %o0 = minbrk 0: mov %o0, %o2 ! save argument to syscall @@ -68,7 +68,7 @@ ENTRY(brk) sethi %hi(minbrk), %o1 ! %o1 = minbrk ld [%o1 + %lo(minbrk)], %o1 cmp %o1, %o0 ! if (minbrk > %o0) - bg,a 0f + bgu,a 0f mov %o1, %o0 ! %o0 = minbrk 0: mov %o0, %o2 ! save argument to syscall diff --git a/lib/libc/arch/sparc64/sys/brk.S b/lib/libc/arch/sparc64/sys/brk.S index b0e63917f04..e1e22500577 100644 --- a/lib/libc/arch/sparc64/sys/brk.S +++ b/lib/libc/arch/sparc64/sys/brk.S @@ -1,4 +1,4 @@ -/* $OpenBSD: brk.S,v 1.3 2003/06/02 20:18:33 millert Exp $ */ +/* $OpenBSD: brk.S,v 1.4 2003/12/25 18:49:07 miod Exp $ */ /* $NetBSD: brk.S,v 1.9 2000/07/25 20:15:40 mycroft Exp $ */ /* @@ -59,7 +59,7 @@ ENTRY(_brk) ldx [%o5 + %o4], %o4 ldx [%o4], %o1 /* %o1 = minbrk */ cmp %o1, %o0 /* if (minbrk > %o0) */ - movg %xcc, %o1, %o0 /* %o0 = minbrk */ + movgu %xcc, %o1, %o0 /* %o0 = minbrk */ mov %o0, %o2 /* save argument to syscall */ mov SYS_break, %g1 t ST_SYSCALL @@ -74,7 +74,7 @@ ENTRY(_brk) sethi %hi(_C_LABEL(minbrk)), %o1 /* %o1 = minbrk */ ldx [%o1 + %lo(_C_LABEL(minbrk))], %o1 cmp %o1, %o0 /* if (minbrk > %o0) */ - movg %xcc, %o1, %o0 /* %o0 = minbrk */ + movgu %xcc, %o1, %o0 /* %o0 = minbrk */ mov %o0, %o2 /* save argument to syscall */ mov SYS_break, %g1 t ST_SYSCALL diff --git a/lib/libc/arch/vax/sys/brk.S b/lib/libc/arch/vax/sys/brk.S index 06307e871dd..d210617e095 100644 --- a/lib/libc/arch/vax/sys/brk.S +++ b/lib/libc/arch/vax/sys/brk.S @@ -29,19 +29,16 @@ #if defined(SYSLIBC_SCCS) .text - .asciz "$OpenBSD: brk.S,v 1.5 2003/06/02 20:18:33 millert Exp $" + .asciz "$OpenBSD: brk.S,v 1.6 2003/12/25 18:49:07 miod Exp $" #endif /* SYSLIBC_SCCS */ #include "SYS.h" .globl __curbrk .globl minbrk -ENTRY(_brk, 0) - jbr ok - ENTRY(brk, 0) - cmpl 4(ap),minbrk - bgeq ok + cmpl minbrk,4(ap) + blequ ok movl minbrk,4(ap) ok: chmk $ SYS_break |