xref: /csrg-svn/lib/libc/tahoe/sys/brk.s (revision 34389)
129444Ssam/*
229444Ssam * Copyright (c) 1983 Regents of the University of California.
3*34389Sbostic * All rights reserved.
4*34389Sbostic *
5*34389Sbostic * Redistribution and use in source and binary forms are permitted
6*34389Sbostic * provided that this notice is preserved and that due credit is given
7*34389Sbostic * to the University of California at Berkeley. The name of the University
8*34389Sbostic * may not be used to endorse or promote products derived from this
9*34389Sbostic * software without specific written prior permission. This software
10*34389Sbostic * is provided ``as is'' without express or implied warranty.
1129444Ssam */
1229444Ssam
13*34389Sbostic#if defined(SYSLIBC_SCCS) && !defined(lint)
14*34389Sbostic_sccsid:.asciz	"@(#)brk.s	5.2 (Berkeley) 05/20/88"
15*34389Sbostic#endif /* SYSLIBC_SCCS and not lint */
1629444Ssam
1729444Ssam#include "SYS.h"
1829444Ssam
1929444Ssam#define	SYS_brk		17
2029444Ssam
2129444Ssam	.globl	curbrk
2229444Ssam	.globl	minbrk
2329444Ssam
2429444SsamENTRY(brk)
2529444Ssam	cmpl	4(fp),minbrk
2629444Ssam	bgeq	ok
2729444Ssam	movl	minbrk,4(fp)
2829444Ssamok:
2929444Ssam	kcall	$SYS_brk
3029444Ssam	jcs	err
3129444Ssam	movl	4(fp),curbrk
3229444Ssam	clrl	r0
3329444Ssam	ret
3429444Ssamerr:
3529444Ssam	jmp	cerror
36