1 1.2 cherry /* $NetBSD: brk.S,v 1.2 2006/09/23 17:39:34 cherry Exp $ */ 2 1.2 cherry 3 1.2 cherry /* 4 1.2 cherry * Copyright (c) 1994, 1995 Carnegie-Mellon University. 5 1.2 cherry * All rights reserved. 6 1.2 cherry * 7 1.2 cherry * Author: Chris G. Demetriou 8 1.2 cherry * 9 1.2 cherry * Permission to use, copy, modify and distribute this software and 10 1.2 cherry * its documentation is hereby granted, provided that both the copyright 11 1.2 cherry * notice and this permission notice appear in all copies of the 12 1.2 cherry * software, derivative works or modified versions, and any portions 13 1.2 cherry * thereof, and that both notices appear in supporting documentation. 14 1.2 cherry * 15 1.2 cherry * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 16 1.2 cherry * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND 17 1.2 cherry * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 18 1.2 cherry * 19 1.2 cherry * Carnegie Mellon requests users of this software to return to 20 1.2 cherry * 21 1.2 cherry * Software Distribution Coordinator or Software.Distribution (at) CS.CMU.EDU 22 1.2 cherry * School of Computer Science 23 1.2 cherry * Carnegie Mellon University 24 1.2 cherry * Pittsburgh PA 15213-3890 25 1.2 cherry * 26 1.2 cherry * any improvements or extensions that they make and grant Carnegie the 27 1.2 cherry * rights to redistribute these changes. 28 1.2 cherry */ 29 1.2 cherry 30 1.2 cherry #include <machine/asm.h> 31 1.2 cherry /* __FBSDID("$FreeBSD: src/lib/libc/ia64/sys/brk.S,v 1.4 2003/05/16 21:26:39 marcel Exp $"); */ 32 1.2 cherry 33 1.2 cherry #include "SYS.h" 34 1.2 cherry 35 1.2 cherry .globl _end 36 1.2 cherry IMPORT(__curbrk, 8) 37 1.2 cherry 38 1.2 cherry .data 39 1.2 cherry EXPORT(__minbrk) 40 1.2 cherry .quad _end 41 1.2 cherry 42 1.2 cherry .text 43 1.2 cherry ENTRY(_brk, 1) 44 1.2 cherry add r14=@ltoff(__minbrk),gp ;; 45 1.2 cherry ld8 r14=[r14] ;; 46 1.2 cherry ld8 r14=[r14] ;; 47 1.2 cherry cmp.ltu p6,p0=r32,r14 ;; 48 1.2 cherry (p6) mov r32=r14 ;; 49 1.2 cherry st8 [sp]=r32 50 1.2 cherry CALLSYS_ERROR(break) 51 1.2 cherry ld8 r15=[sp] 52 1.2 cherry add r14=@ltoff(__curbrk),gp ;; 53 1.2 cherry ld8 r14=[r14] ;; 54 1.2 cherry st8 [r14]=r15 55 1.2 cherry mov ret0=0 56 1.2 cherry br.ret.sptk.few rp 57 1.2 cherry END(_brk) 58