]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - sys/boot/sparc64/loader/locore.S
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / sys / boot / sparc64 / loader / locore.S
1 /*-
2  * Initial implementation:
3  * Copyright (c) 2001 Robert Drehmel
4  * All rights reserved.
5  *
6  * As long as the above copyright statement and this notice remain
7  * unchanged, you can do what ever you want with this file.
8  */
9
10 #include <machine/asm.h>
11 __FBSDID("$FreeBSD$");
12
13 #define LOCORE
14
15 #include <machine/frame.h>
16 #include <machine/fsr.h>
17 #include <machine/intr_machdep.h>
18 #include <machine/pstate.h>
19
20 #define PAGE_SIZE       8192
21 #define PAGE_SHIFT      13
22
23 #define STACK_SIZE      (2 * PAGE_SIZE)
24
25 ENTRY(_start)
26         /* Limit interrupts. */
27         wrpr    %g0, PIL_TICK - 1, %pil
28
29         /*
30          * PSTATE: privileged, interrupts enabled, floating point
31          * unit enabled
32          */
33         wrpr    %g0, PSTATE_PRIV | PSTATE_IE | PSTATE_PEF, %pstate
34         wr      %g0, FPRS_FEF, %fprs
35
36         setx    stack + STACK_SIZE - SPOFF - CCFSZ, %l7, %l6
37         mov     %l6, %sp
38         call    main
39          mov    %o4, %o0
40         sir
41
42         .comm   stack, STACK_SIZE, 32