xref: /csrg-svn/lib/libc/vax/sys/sbrk.s (revision 61222)
121864Sdist/*
2*61222Sbostic * Copyright (c) 1983, 1993
3*61222Sbostic *	The Regents of the University of California.  All rights reserved.
434391Sbostic *
542642Sbostic * %sccs.include.redist.c%
621864Sdist */
79423Smckusick
834391Sbostic#if defined(SYSLIBC_SCCS) && !defined(lint)
9*61222Sbostic	.asciz "@(#)sbrk.s	8.1 (Berkeley) 06/04/93"
1034391Sbostic#endif /* SYSLIBC_SCCS and not lint */
1121864Sdist
129423Smckusick#include "SYS.h"
139423Smckusick
149423Smckusick#define	SYS_brk		17
159423Smckusick
169423Smckusick	.globl	_end
1714126Smckusick	.globl	minbrk
189423Smckusick	.globl	curbrk
199423Smckusick
209423Smckusick	.data
2114126Smckusickminbrk: .long	_end
229423Smckusickcurbrk:	.long	_end
239423Smckusick	.text
249423Smckusick
259423SmckusickENTRY(sbrk)
269423Smckusick	addl3	curbrk,4(ap),-(sp)
279423Smckusick	pushl	$1
289423Smckusick	movl	ap,r3
299423Smckusick	movl	sp,ap
309423Smckusick	chmk	$SYS_brk
319423Smckusick	jcs 	err
329423Smckusick	movl	curbrk,r0
339423Smckusick	addl2	4(r3),curbrk
349423Smckusick	ret
359423Smckusickerr:
369423Smckusick	jmp	cerror
37