xref: /csrg-svn/lib/libc/hp300/sys/brk.s (revision 62566)
141843Sbostic/*-
2*62566Sbostic * Copyright (c) 1990, 1993
3*62566Sbostic *	The Regents of the University of California.  All rights reserved.
441843Sbostic *
541843Sbostic * This code is derived from software contributed to Berkeley by
641843Sbostic * the Systems Programming Group of the University of Utah Computer
741843Sbostic * Science Department.
841843Sbostic *
941843Sbostic * %sccs.include.redist.c%
1041843Sbostic */
1141843Sbostic
1241843Sbostic#if defined(LIBC_SCCS) && !defined(lint)
13*62566Sbostic	.asciz "@(#)brk.s	8.1 (Berkeley) 06/07/93"
1441843Sbostic#endif /* LIBC_SCCS and not lint */
1541843Sbostic
1641843Sbostic#include "SYS.h"
1741843Sbostic
1841843Sbostic#define	SYS_brk		17
1941843Sbostic
2041843Sbostic	.globl	curbrk
2141843Sbostic	.globl	minbrk
2241843SbosticENTRY(brk)
2341843Sbostic	movl	minbrk,d0
2441843Sbostic	cmpl	sp@(4),d0
2541843Sbostic	jle	ok
2641843Sbostic	movl	d0,sp@(4)
2741843Sbosticok:
2841843Sbostic	movl	#SYS_brk,d0
2941843Sbostic	trap	#0
3041843Sbostic	jcs	err
3141843Sbostic	movl	sp@(4),curbrk
3241843Sbostic	clrl	d0
3341843Sbostic	rts
3441843Sbosticerr:
3541843Sbostic	jmp	cerror
36