Fully synchronize sys/boot from FreeBSD-5.x, but add / to the module path
[dragonfly.git] / sys / boot / alpha / libalpha / start.S
CommitLineData
984263bc 1/*
984263bc 2 * From: $NetBSD: start.S,v 1.4 1998/03/28 00:54:15 cgd Exp $
5ee58eed
MD
3 * $FreeBSD: src/sys/boot/alpha/libalpha/start.S,v 1.9 2001/03/04 04:38:14 obrien Exp $
4 * $DragonFly: src/sys/boot/alpha/libalpha/Attic/start.S,v 1.3 2003/11/10 06:08:30 dillon Exp $
984263bc
MD
5 */
6
7/*
8 * Mach Operating System
9 * Copyright (c) 1992 Carnegie Mellon University
10 * All Rights Reserved.
11 *
12 * Permission to use, copy, modify and distribute this software and its
13 * documentation is hereby granted, provided that both the copyright
14 * notice and this permission notice appear in all copies of the
15 * software, derivative works or modified versions, and any portions
16 * thereof, and that both notices appear in supporting documentation.
17 *
18 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
19 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
20 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
21 *
22 * Carnegie Mellon requests users of this software to return to
23 *
24 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
25 * School of Computer Science
26 * Carnegie Mellon University
27 * Pittsburgh PA 15213-3890
28 *
29 * any improvements or extensions that they make and grant Carnegie Mellon
30 * the rights to redistribute these changes.
31 */
32
33#include <machine/asm.h>
34
35/*
36 * start --
37 * Entry point for boot/standalone programs.
38 *
39 * Arguments:
40 * a0 long (first free physical page)
41 *
42 * This is where the prom comes to. Leaves all exception and interrupts
43 * to prom, runs off prom's stack too. No return values.
44 */
45 .text
46 .set noreorder /* don't reorder instructions */
47
48#define ENTRY_FRAME 32
49#define STACK_SIZE 12288
50
51NESTED(start, 1, ENTRY_FRAME, ra, 0, 0)
52 br pv,Lstartgp
53Lstartgp:
54 LDGP(pv)
55
56#ifndef BOOT1
57 CALL(extend_heap)
58#endif
59
60 lda a0,_edata
61 lda a1,_end
62 subq a1,a0,a1
63 CALL(bzero)
64
65#ifndef BOOT1
66 lda sp,stackbase + STACK_SIZE - ENTRY_FRAME
67#endif
68
69 CALL(main) /* transfer to C */
70
71XLEAF(_rtt, 0)
72XLEAF(halt, 0)
73 call_pal PAL_halt /* halt if we ever return */
74END(start)
75
76/*
77 * Dummy routine for GCC2.
78 */
79LEAF(__main,0)
80 RET
81END(__main)
82
83/*
84 * cpu_number
85 * Return the cpu number, using the whami instruction.
86 */
87LEAF(cpu_number, 0)
88 call_pal PAL_VMS_mfpr_whami
89 RET
90END(cpu_number)
91
92#ifndef BOOT1
93BSS(stackbase, STACK_SIZE)
94#endif