xref: /minix3/lib/csu/arch/sparc64/crt0.S (revision 84d9c625bfea59e274550651111ae9edfdc40fbd)
1*84d9c625SLionel Sambuc/* $NetBSD: crt0.S,v 1.1 2013/07/11 06:57:15 martin Exp $ */
2*84d9c625SLionel Sambuc
3*84d9c625SLionel Sambuc/*
4*84d9c625SLionel Sambuc * Copyright (c) 1998 Christos Zoulas
5*84d9c625SLionel Sambuc * Copyright (c) 1995 Christopher G. Demetriou
6*84d9c625SLionel Sambuc * All rights reserved.
7*84d9c625SLionel Sambuc *
8*84d9c625SLionel Sambuc * Redistribution and use in source and binary forms, with or without
9*84d9c625SLionel Sambuc * modification, are permitted provided that the following conditions
10*84d9c625SLionel Sambuc * are met:
11*84d9c625SLionel Sambuc * 1. Redistributions of source code must retain the above copyright
12*84d9c625SLionel Sambuc *    notice, this list of conditions and the following disclaimer.
13*84d9c625SLionel Sambuc * 2. Redistributions in binary form must reproduce the above copyright
14*84d9c625SLionel Sambuc *    notice, this list of conditions and the following disclaimer in the
15*84d9c625SLionel Sambuc *    documentation and/or other materials provided with the distribution.
16*84d9c625SLionel Sambuc * 3. All advertising materials mentioning features or use of this software
17*84d9c625SLionel Sambuc *    must display the following acknowledgement:
18*84d9c625SLionel Sambuc *          This product includes software developed for the
19*84d9c625SLionel Sambuc *          NetBSD Project.  See http://www.NetBSD.org/ for
20*84d9c625SLionel Sambuc *          information about NetBSD.
21*84d9c625SLionel Sambuc * 4. The name of the author may not be used to endorse or promote products
22*84d9c625SLionel Sambuc *    derived from this software without specific prior written permission.
23*84d9c625SLionel Sambuc *
24*84d9c625SLionel Sambuc * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
25*84d9c625SLionel Sambuc * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
26*84d9c625SLionel Sambuc * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
27*84d9c625SLionel Sambuc * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
28*84d9c625SLionel Sambuc * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
29*84d9c625SLionel Sambuc * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30*84d9c625SLionel Sambuc * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31*84d9c625SLionel Sambuc * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32*84d9c625SLionel Sambuc * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
33*84d9c625SLionel Sambuc * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34*84d9c625SLionel Sambuc *
35*84d9c625SLionel Sambuc * <<Id: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp>>
36*84d9c625SLionel Sambuc */
37*84d9c625SLionel Sambuc
38*84d9c625SLionel Sambuc#include <machine/asm.h>
39*84d9c625SLionel Sambuc
40*84d9c625SLionel SambucRCSID("$NetBSD: crt0.S,v 1.1 2013/07/11 06:57:15 martin Exp $")
41*84d9c625SLionel Sambuc
42*84d9c625SLionel SambucSTRONG_ALIAS(_start,__start)
43*84d9c625SLionel Sambuc
44*84d9c625SLionel Sambuc	.align 4
45*84d9c625SLionel Sambuc	.register %g3,#scratch
46*84d9c625SLionel Sambuc	.register %g2,#scratch
47*84d9c625SLionel Sambuc
48*84d9c625SLionel Sambuc	! called with:
49*84d9c625SLionel Sambuc	!  %g3 = cleanup
50*84d9c625SLionel Sambuc	!  %g2 = obj
51*84d9c625SLionel Sambuc	!  %g1 = ps_strings
52*84d9c625SLionel Sambuc	! call: ___start(cleanup, obj, ps_strings)
53*84d9c625SLionel Sambuc_ENTRY(__start)
54*84d9c625SLionel Sambuc	clr	%fp
55*84d9c625SLionel Sambuc	clr	%g4			! data base for some memory models
56*84d9c625SLionel Sambuc	mov	%g3, %o0
57*84d9c625SLionel Sambuc	mov	%g2, %o1
58*84d9c625SLionel Sambuc	ba,pt	%icc,___start
59*84d9c625SLionel Sambuc	 mov	%g1, %o2
60*84d9c625SLionel Sambuc
61