1139738Simp/*-
284996Srobert * Initial implementation:
384996Srobert * Copyright (c) 2001 Robert Drehmel
484996Srobert * All rights reserved.
584996Srobert *
684996Srobert * As long as the above copyright statement and this notice remain
7181398Smarius * unchanged, you can do what ever you want with this file.
884996Srobert */
991139Sjake
10181398Smarius#include <machine/asm.h>
11181398Smarius__FBSDID("$FreeBSD$");
12181398Smarius
1391139Sjake#define	LOCORE
1491139Sjake
15181398Smarius#include <machine/frame.h>
16181398Smarius#include <machine/fsr.h>
17181398Smarius#include <machine/intr_machdep.h>
1884996Srobert#include <machine/pstate.h>
1984996Srobert
2091109Sjake#define	PAGE_SIZE	8192
2191109Sjake#define	PAGE_SHIFT	13
2291109Sjake
2385718Sjake#define	STACK_SIZE	(2 * PAGE_SIZE)
2484996Srobert
2585718SjakeENTRY(_start)
26181398Smarius	/* Limit interrupts. */
27181398Smarius	wrpr	%g0, PIL_TICK - 1, %pil
2884996Srobert
2984996Srobert	/*
3084996Srobert	 * PSTATE: privileged, interrupts enabled, floating point
3184996Srobert	 * unit enabled
3284996Srobert	 */
33181398Smarius	wrpr	%g0, PSTATE_PRIV | PSTATE_IE | PSTATE_PEF, %pstate
34181398Smarius	wr	%g0, FPRS_FEF, %fprs
3584996Srobert
3691109Sjake	setx	stack + STACK_SIZE - SPOFF - CCFSZ, %l7, %l6
3785718Sjake	mov	%l6, %sp
3884996Srobert	call	main
3985718Sjake	 mov	%o4, %o0
4091139Sjake	sir
4184996Srobert
4285718Sjake	.comm	stack, STACK_SIZE, 32
43