start.S revision 1.9 1 /* $NetBSD: start.S,v 1.9 1999/03/31 16:12:52 cgd Exp $ */
2
3 /*
4 * Mach Operating System
5 * Copyright (c) 1992 Carnegie Mellon University
6 * All Rights Reserved.
7 *
8 * Permission to use, copy, modify and distribute this software and its
9 * documentation is hereby granted, provided that both the copyright
10 * notice and this permission notice appear in all copies of the
11 * software, derivative works or modified versions, and any portions
12 * thereof, and that both notices appear in supporting documentation.
13 *
14 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
15 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
16 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
17 *
18 * Carnegie Mellon requests users of this software to return to
19 *
20 * Software Distribution Coordinator or Software.Distribution (at) CS.CMU.EDU
21 * School of Computer Science
22 * Carnegie Mellon University
23 * Pittsburgh PA 15213-3890
24 *
25 * any improvements or extensions that they make and grant Carnegie Mellon
26 * the rights to redistribute these changes.
27 */
28
29 #include "include/asm.h"
30
31 /*
32 * start --
33 * Entry point for boot/standalone programs.
34 *
35 * Arguments:
36 * a0 long (first free physical page)
37 *
38 * This is where the prom comes to. Leaves all exception and interrupts
39 * to prom, runs off prom's stack too. No return values.
40 */
41 .text
42 .set noreorder /* don't reorder instructions */
43
44 #define ENTRY_FRAME 32
45
46 NESTED(start, 1, ENTRY_FRAME, ra, 0, 0)
47 br pv,Lstartgp
48 Lstartgp:
49 LDGP(pv)
50
51 #if !defined(PRIMARY_BOOTBLOCK) && !defined(UNIFIED_BOOTBLOCK)
52 lda sp,start /* start stack below text */
53 lda sp,-ENTRY_FRAME(sp)
54
55 or a0,zero,s0
56 #endif /* !defined(PRIMARY_BOOTBLOCK) && !defined(UNIFIED_BOOTBLOCK) */
57 lda a0,_edata
58 lda a1,_end
59 subq a1,a0,a1
60 CALL(bzero)
61 #if !defined(PRIMARY_BOOTBLOCK) && !defined(UNIFIED_BOOTBLOCK)
62 or s0,zero,a0
63 #endif /* !defined(PRIMARY_BOOTBLOCK) && !defined(UNIFIED_BOOTBLOCK) */
64
65 CALL(main) /* transfer to C */
66
67 XLEAF(_rtt, 0)
68 XLEAF(halt, 0)
69 call_pal PAL_halt /* halt if we ever return */
70 END(start)
71