xref: /csrg-svn/lib/libc/mips/sys/brk.s (revision 61146)
152723Sbostic/*-
2*61146Sbostic * Copyright (c) 1991, 1993
3*61146Sbostic *	The Regents of the University of California.  All rights reserved.
452723Sbostic *
552723Sbostic * This code is derived from software contributed to Berkeley by
652723Sbostic * Ralph Campbell.
752723Sbostic *
852723Sbostic * %sccs.include.redist.c%
952723Sbostic */
1052723Sbostic
1152723Sbostic#include "SYS.h"
1252723Sbostic
1352723Sbostic#if defined(LIBC_SCCS) && !defined(lint)
14*61146Sbostic	ASMSTR("@(#)brk.s	8.1 (Berkeley) 06/04/93")
1552723Sbostic#endif /* LIBC_SCCS and not lint */
1652723Sbostic
1752723Sbostic#define	SYS_brk		17
1852723Sbostic
1952723SbosticLEAF(brk)
2058280Sralph	lw	v0, minbrk
2152723Sbostic	bgeu	a0, v0, _brk
2257858Sralph	move	a0, v0		# dont allow break < minbrk
2352723SbosticALEAF(_brk)
2452723Sbostic	li	v0, SYS_brk
2552723Sbostic	syscall
2652723Sbostic	bne	a3, zero, 1f
2758280Sralph	sw	a0, curbrk
2852723Sbostic	move	v0, zero
2952723Sbostic	j	ra
3052723Sbostic1:
3152723Sbostic	j	_cerror
3252723SbosticEND(brk)
33