summaryrefslogtreecommitdiffstats
path: root/sys/boot/sparc64/loader/locore.S
blob: a73f5bfa7f980aae8f5d01f5a589229cfa1c1c3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*-
 * Initial implementation:
 * Copyright (c) 2001 Robert Drehmel
 * All rights reserved.
 *
 * As long as the above copyright statement and this notice remain
 * unchanged, you can do what ever you want with this file.
 */

#include <machine/asm.h>
__FBSDID("$FreeBSD$");

#define	LOCORE

#include <machine/frame.h>
#include <machine/fsr.h>
#include <machine/intr_machdep.h>
#include <machine/pstate.h>

#define	PAGE_SIZE	8192
#define	PAGE_SHIFT	13

#define	STACK_SIZE	(2 * PAGE_SIZE)

ENTRY(_start)
	/* Limit interrupts. */
	wrpr	%g0, PIL_TICK - 1, %pil

	/*
	 * PSTATE: privileged, interrupts enabled, floating point
	 * unit enabled
	 */
	wrpr	%g0, PSTATE_PRIV | PSTATE_IE | PSTATE_PEF, %pstate
	wr	%g0, FPRS_FEF, %fprs

	setx	stack + STACK_SIZE - SPOFF - CCFSZ, %l7, %l6
	mov	%l6, %sp
	call	main
	 mov	%o4, %o0
	sir

	.comm	stack, STACK_SIZE, 32
OpenPOWER on IntegriCloud