start.S revision 1.5 1 /* $NetBSD: start.S,v 1.5 1998/10/15 01:02:55 ross 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 #ifndef PRIMARY_BOOTBLOCK
52 lda sp,start /* start stack below text */
53 lda sp,-ENTRY_FRAME(sp)
54 #endif
55
56 or a0,zero,s0
57 lda a0,_edata
58 lda a1,_end
59 subq a1,a0,a1
60 CALL(bzero)
61 or s0,zero,a0
62
63
64 CALL(main) /* transfer to C */
65
66 XLEAF(_rtt, 0)
67 XLEAF(halt, 0)
68 call_pal PAL_halt /* halt if we ever return */
69 END(start)
70
71 /*
72 * Dummy routine for GCC2.
73 */
74 LEAF(__main,0)
75 RET
76 END(__main)
77
78 /*
79 * cpu_number
80 * Return the cpu number, using the whami instruction.
81 */
82 LEAF(cpu_number, 0)
83 call_pal PAL_VMS_mfpr_whami
84 RET
85 END(cpu_number)
86 /*
87 * Execute Instruction Memory Barrier operation from the Common
88 * Palcode Architecture. Establishes I-Cache coherency point.
89 */
90 LEAF(alpha_pal_imb, 0)
91 imb
92 RET
93 END(alpha_pal_imb);
94