xref: /original-bsd/lib/libc/tahoe/sys/brk.s (revision 540a81df)
1/*
2 * Copyright (c) 1983 Regents of the University of California.
3 * All rights reserved.
4 *
5 * %sccs.include.redist.c%
6 */
7
8#if defined(SYSLIBC_SCCS) && !defined(lint)
9	.asciz "@(#)brk.s	5.4 (Berkeley) 06/01/90"
10#endif /* SYSLIBC_SCCS and not lint */
11
12#include "SYS.h"
13
14#define	SYS_brk		17
15
16	.globl	curbrk
17	.globl	minbrk
18
19ENTRY(brk)
20	cmpl	4(fp),minbrk
21	bgeq	ok
22	movl	minbrk,4(fp)
23ok:
24	kcall	$SYS_brk
25	jcs	err
26	movl	4(fp),curbrk
27	clrl	r0
28	ret
29err:
30	jmp	cerror
31