sbrk.S revision 1.2
11.2Scherry/*	$NetBSD: sbrk.S,v 1.2 2006/09/23 17:39:34 cherry Exp $	*/
21.2Scherry
31.2Scherry/*
41.2Scherry * Copyright (c) 1994, 1995 Carnegie-Mellon University.
51.2Scherry * All rights reserved.
61.2Scherry *
71.2Scherry * Author: Chris G. Demetriou
81.2Scherry *
91.2Scherry * Permission to use, copy, modify and distribute this software and
101.2Scherry * its documentation is hereby granted, provided that both the copyright
111.2Scherry * notice and this permission notice appear in all copies of the
121.2Scherry * software, derivative works or modified versions, and any portions
131.2Scherry * thereof, and that both notices appear in supporting documentation.
141.2Scherry *
151.2Scherry * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
161.2Scherry * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
171.2Scherry * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
181.2Scherry *
191.2Scherry * Carnegie Mellon requests users of this software to return to
201.2Scherry *
211.2Scherry *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
221.2Scherry *  School of Computer Science
231.2Scherry *  Carnegie Mellon University
241.2Scherry *  Pittsburgh PA 15213-3890
251.2Scherry *
261.2Scherry * any improvements or extensions that they make and grant Carnegie the
271.2Scherry * rights to redistribute these changes.
281.2Scherry */
291.2Scherry
301.2Scherry#include <machine/asm.h>
311.2Scherry/* __FBSDID("$FreeBSD: src/lib/libc/ia64/sys/sbrk.S,v 1.5 2003/05/16 21:26:39 marcel Exp $"); */
321.2Scherry
331.2Scherry#include "SYS.h"
341.2Scherry
351.2Scherry	.globl	_end
361.2Scherry
371.2Scherry	.data
381.2ScherryEXPORT(__curbrk)
391.2Scherry	.quad	_end
401.2Scherry
411.2Scherry	.text
421.2ScherryENTRY(_sbrk, 1)
431.2Scherry	add	r14 = @ltoff(__curbrk), gp
441.2Scherry	;;
451.2Scherry	ld8	r14 = [r14]
461.2Scherry	cmp.eq	p6, p0 = r32, r0
471.2Scherry	;;
481.2Scherry	ld8	ret0 = [r14]
491.2Scherry(p6)	br.ret.sptk.few	rp
501.2Scherry	;;
511.2Scherry	add	r32 = ret0, r32
521.2Scherry	;;
531.2Scherry	st8	[sp] = r32
541.2Scherry	CALLSYS_ERROR(break)
551.2Scherry	ld8	r15 = [sp]
561.2Scherry	add	r14 = @ltoff(__curbrk), gp
571.2Scherry	;;
581.2Scherry	ld8	r14 = [r14]
591.2Scherry	;;
601.2Scherry	ld8	ret0 = [r14]
611.2Scherry	st8	[r14] = r15
621.2Scherry	br.ret.sptk.few	rp
631.2ScherryEND(_sbrk)
64