xref: /csrg-svn/lib/libc/vax/sys/sbrk.s (revision 34391)
121864Sdist/*
221864Sdist * Copyright (c) 1983 Regents of the University of California.
3*34391Sbostic * All rights reserved.
4*34391Sbostic *
5*34391Sbostic * Redistribution and use in source and binary forms are permitted
6*34391Sbostic * provided that this notice is preserved and that due credit is given
7*34391Sbostic * to the University of California at Berkeley. The name of the University
8*34391Sbostic * may not be used to endorse or promote products derived from this
9*34391Sbostic * software without specific written prior permission. This software
10*34391Sbostic * is provided ``as is'' without express or implied warranty.
1121864Sdist */
129423Smckusick
13*34391Sbostic#if defined(SYSLIBC_SCCS) && !defined(lint)
14*34391Sbostic_sccsid:.asciz	"@(#)sbrk.s	5.4 (Berkeley) 05/20/88"
15*34391Sbostic#endif /* SYSLIBC_SCCS and not lint */
1621864Sdist
179423Smckusick#include "SYS.h"
189423Smckusick
199423Smckusick#define	SYS_brk		17
209423Smckusick
219423Smckusick	.globl	_end
2214126Smckusick	.globl	minbrk
239423Smckusick	.globl	curbrk
249423Smckusick
259423Smckusick	.data
2614126Smckusickminbrk: .long	_end
279423Smckusickcurbrk:	.long	_end
289423Smckusick	.text
299423Smckusick
309423SmckusickENTRY(sbrk)
319423Smckusick	addl3	curbrk,4(ap),-(sp)
329423Smckusick	pushl	$1
339423Smckusick	movl	ap,r3
349423Smckusick	movl	sp,ap
359423Smckusick	chmk	$SYS_brk
369423Smckusick	jcs 	err
379423Smckusick	movl	curbrk,r0
389423Smckusick	addl2	4(r3),curbrk
399423Smckusick	ret
409423Smckusickerr:
419423Smckusick	jmp	cerror
42