start.S revision 139738
11541Srgrimes/*-
21541Srgrimes * Copyright (c) 2003 Marcel Moolenaar
31541Srgrimes * All rights reserved.
41541Srgrimes *
51541Srgrimes * Redistribution and use in source and binary forms, with or without
61541Srgrimes * modification, are permitted provided that the following conditions
71541Srgrimes * are met:
81541Srgrimes *
91541Srgrimes * 1. Redistributions of source code must retain the above copyright
101541Srgrimes *    notice, this list of conditions and the following disclaimer.
111541Srgrimes * 2. Redistributions in binary form must reproduce the above copyright
121541Srgrimes *    notice, this list of conditions and the following disclaimer in the
131541Srgrimes *    documentation and/or other materials provided with the distribution.
141541Srgrimes *
151541Srgrimes * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
161541Srgrimes * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
171541Srgrimes * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
181541Srgrimes * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
191541Srgrimes * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
201541Srgrimes * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
211541Srgrimes * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
221541Srgrimes * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
231541Srgrimes * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
241541Srgrimes * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
251541Srgrimes *
261541Srgrimes * $FreeBSD: head/sys/boot/ia64/ski/start.S 139738 2005-01-05 22:16:58Z imp $
271541Srgrimes */
281541Srgrimes
291541Srgrimes#define	STACKSIZE	16384
3050477Speter#define	FPSR_DEFAULT	0x0009804c0270033f
311541Srgrimes
321541Srgrimes	.text
335283Sbde	.global		_start
345283Sbde	.proc		_start
352177Spaul_start:
36255732Sneel{	.mlx
371541Srgrimes	mov		ar.rsc=0
381541Srgrimes	movl		gp=__gp
391541Srgrimes	;;
40254025Sjeff}
411541Srgrimes{	.mlx
4255206Speter	add		r2=@gprel(stack),gp
43283998Sjhb	movl		r14=FPSR_DEFAULT
44283998Sjhb	;;
457090Sbde}
46254025Sjeff{	.mib
47254025Sjeff	mov		ar.bspstore=r2
48254025Sjeff	add		r12=STACKSIZE-16,r2
49254025Sjeff	bsw.1
50254025Sjeff	;;
51254025Sjeff}
52254025Sjeff{	.mmb
53254025Sjeff	mov		ar.rsc=3
54254025Sjeff	mov		ar.fpsr=r14
55254025Sjeff	br.sptk		ski_main
56206409Salc	;;
57254025Sjeff}
58226928Salc	.endp		_start
59226891Salc
60254025Sjeff	.data
61254025Sjeff	.align		16
62254025Sjeffstack:	.skip		STACKSIZE
63254025Sjeff