crt0.S revision 1.3 1 1.3 uwe /* $NetBSD: crt0.S,v 1.3 2012/01/29 23:27:24 uwe Exp $ */
2 1.1 joerg
3 1.1 joerg /*
4 1.1 joerg * Copyright (c) 1998 Christos Zoulas
5 1.1 joerg * Copyright (c) 1995 Christopher G. Demetriou
6 1.1 joerg * All rights reserved.
7 1.1 joerg *
8 1.1 joerg * Redistribution and use in source and binary forms, with or without
9 1.1 joerg * modification, are permitted provided that the following conditions
10 1.1 joerg * are met:
11 1.1 joerg * 1. Redistributions of source code must retain the above copyright
12 1.1 joerg * notice, this list of conditions and the following disclaimer.
13 1.1 joerg * 2. Redistributions in binary form must reproduce the above copyright
14 1.1 joerg * notice, this list of conditions and the following disclaimer in the
15 1.1 joerg * documentation and/or other materials provided with the distribution.
16 1.1 joerg * 3. All advertising materials mentioning features or use of this software
17 1.1 joerg * must display the following acknowledgement:
18 1.1 joerg * This product includes software developed for the
19 1.1 joerg * NetBSD Project. See http://www.NetBSD.org/ for
20 1.1 joerg * information about NetBSD.
21 1.1 joerg * 4. The name of the author may not be used to endorse or promote products
22 1.1 joerg * derived from this software without specific prior written permission.
23 1.1 joerg *
24 1.1 joerg * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
25 1.1 joerg * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
26 1.1 joerg * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
27 1.1 joerg * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
28 1.1 joerg * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
29 1.1 joerg * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30 1.1 joerg * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31 1.1 joerg * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32 1.1 joerg * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
33 1.1 joerg * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 1.1 joerg *
35 1.1 joerg * <<Id: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp>>
36 1.1 joerg */
37 1.1 joerg
38 1.1 joerg #include <machine/asm.h>
39 1.1 joerg
40 1.3 uwe RCSID("$NetBSD: crt0.S,v 1.3 2012/01/29 23:27:24 uwe Exp $")
41 1.1 joerg
42 1.1 joerg STRONG_ALIAS(_start,__start)
43 1.1 joerg
44 1.2 uwe /*
45 1.2 uwe * Kernel setregs() passes all arguments in registers to avoid
46 1.2 uwe * copyout. This trampoline pushes 5th and 6th arguments into stack,
47 1.2 uwe * where C ABI expects them to be, and calls the real startup code
48 1.2 uwe * written in C.
49 1.2 uwe */
50 1.1 joerg _ENTRY(__start)
51 1.3 uwe mov.l .L___start, r0
52 1.2 uwe mov.l r9, @-sp
53 1.3 uwe braf r0
54 1.2 uwe mov.l r8, @-sp
55 1.3 uwe
56 1.3 uwe .p2align 2
57 1.3 uwe .L___start: .long _C_LABEL(___start)
58