xref: /csrg-svn/lib/libc/tahoe/sys/sbrk.s (revision 34389)
129482Ssam/*
229482Ssam * 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.
1129482Ssam */
1229482Ssam
13*34389Sbostic#if defined(SYSLIBC_SCCS) && !defined(lint)
14*34389Sbostic_sccsid:.asciz	"@(#)sbrk.s	5.2 (Berkeley) 05/20/88"
15*34389Sbostic#endif /* SYSLIBC_SCCS and not lint */
1629482Ssam
1729482Ssam#include "SYS.h"
1829482Ssam
1929482Ssam#define	SYS_brk		17
2029482Ssam
2129482Ssam	.globl	_end
2229482Ssam	.globl	minbrk
2329482Ssam	.globl	curbrk
2429482Ssam
2529482Ssam	.data
2629482Ssamminbrk: .long	_end
2729482Ssamcurbrk:	.long	_end
2829482Ssam	.text
2929482Ssam
3029482SsamENTRY(sbrk)
3129482Ssam	addl3	curbrk,4(fp),-(sp)
3229482Ssam	pushl	$1
3329482Ssam	movl	fp,r3
3429482Ssam	moval	(sp),fp
3529482Ssam	kcall	$SYS_brk
3629482Ssam	jcs 	err
3729482Ssam	movl	curbrk,r0
3829482Ssam	addl2	4(r3),curbrk
3929482Ssam	movl	r3,fp
4029482Ssam	ret
4129482Ssamerr:
4229482Ssam	movl	r3,fp
4329482Ssam	jmp	cerror
44