summaryrefslogtreecommitdiff
path: root/lib/libc/arch/mips/sys/brk.S
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/arch/mips/sys/brk.S')
-rw-r--r--lib/libc/arch/mips/sys/brk.S24
1 files changed, 15 insertions, 9 deletions
diff --git a/lib/libc/arch/mips/sys/brk.S b/lib/libc/arch/mips/sys/brk.S
index 797a798c7ae..357baaacc98 100644
--- a/lib/libc/arch/mips/sys/brk.S
+++ b/lib/libc/arch/mips/sys/brk.S
@@ -1,3 +1,4 @@
+/* $OpenBSD: brk.S,v 1.3 1996/07/30 20:27:57 pefo Exp $ */
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
@@ -38,12 +39,9 @@
#if defined(LIBC_SCCS) && !defined(lint)
ASMSTR("from: @(#)brk.s 8.1 (Berkeley) 6/4/93")
- ASMSTR("$Id: brk.S,v 1.2 1996/05/16 11:16:08 pefo Exp $")
+ ASMSTR("$Id: brk.S,v 1.3 1996/07/30 20:27:57 pefo Exp $")
#endif /* LIBC_SCCS and not lint */
-#ifdef ABICALLS
- .abicalls
-#endif
.globl minbrk
.globl curbrk
@@ -53,15 +51,23 @@ minbrk: .word _C_LABEL(end)
.text
LEAF(brk)
-#ifdef ABICALLS
- .set noreorder
- .cpload t9
.set reorder
-#endif
lw v0, minbrk
bgeu a0, v0, _C_LABEL(_brk)
move a0, v0 # dont allow break < minbrk
-ALEAF(_brk)
+ li v0, SYS_break
+ syscall
+ bne a3, zero, 1f
+ sw a0, curbrk
+ move v0, zero
+ j ra
+1:
+ la t9, _C_LABEL(cerror)
+ jr t9
+END(brk)
+
+LEAF(_brk)
+ .set reorder
li v0, SYS_break
syscall
bne a3, zero, 1f