sbrk.S revision 67117
150397Sobrien/* $FreeBSD: head/lib/libc/ia64/sys/sbrk.S 67117 2000-10-14 17:01:12Z dfr $ */
250397Sobrien/*	$NetBSD: sbrk.S,v 1.4 1996/10/17 03:08:20 cgd Exp $	*/
350397Sobrien
450397Sobrien/*
550397Sobrien * Copyright (c) 1994, 1995 Carnegie-Mellon University.
650397Sobrien * All rights reserved.
750397Sobrien *
850397Sobrien * Author: Chris G. Demetriou
950397Sobrien *
1050397Sobrien * Permission to use, copy, modify and distribute this software and
1150397Sobrien * its documentation is hereby granted, provided that both the copyright
1250397Sobrien * notice and this permission notice appear in all copies of the
1390075Sobrien * software, derivative works or modified versions, and any portions
1450397Sobrien * thereof, and that both notices appear in supporting documentation.
1550397Sobrien *
1650397Sobrien * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
1750397Sobrien * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
1850397Sobrien * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
1950397Sobrien *
2050397Sobrien * Carnegie Mellon requests users of this software to return to
2150397Sobrien *
2250397Sobrien *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
2350397Sobrien *  School of Computer Science
2450397Sobrien *  Carnegie Mellon University
2550397Sobrien *  Pittsburgh PA 15213-3890
2650397Sobrien *
2750397Sobrien * any improvements or extensions that they make and grant Carnegie the
2850397Sobrien * rights to redistribute these changes.
2950397Sobrien */
3050397Sobrien
31117395Skan#include "SYS.h"
3250397Sobrien
3350397Sobrien	.globl	_end
3450397Sobrien
35132718Skan	.data
36132718SkanEXPORT(curbrk)
37132718Skan	.quad	_end
38132718Skan
39132718Skan	.text
4050397SobrienENTRY(sbrk, 1)
4150397Sobrien	alloc	r14=ar.pfs,1,2,0,0
4250397Sobrien
4350397Sobrien	add	loc0=@gprel(curbrk),gp ;;
4450397Sobrien	ld8	loc1=[loc0]
4550397Sobrien	cmp.eq	p6,p0=in0,r0
4650397Sobrien(p6)	br.dpnt.few 1f
4750397Sobrien	add	in0=r14,in0
4850397Sobrien	CALLSYS_ERROR(break)
4950397Sobrien	st8	[loc0]=in0
5050397Sobrien1:	mov	ret0=loc1
5150397Sobrien	br.ret.sptk.few rp
5250397SobrienEND(sbrk)
5350397Sobrien