2005-01-05 22:16:58 +00:00
|
|
|
/*-
|
2001-10-15 14:35:39 +00:00
|
|
|
* Initial implementation:
|
|
|
|
* Copyright (c) 2001 Robert Drehmel
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* As long as the above copyright statement and this notice remain
|
2008-08-07 22:46:25 +00:00
|
|
|
* unchanged, you can do what ever you want with this file.
|
2001-10-15 14:35:39 +00:00
|
|
|
*/
|
2002-02-23 11:06:37 +00:00
|
|
|
|
2008-08-07 22:46:25 +00:00
|
|
|
#include <machine/asm.h>
|
|
|
|
__FBSDID("$FreeBSD$");
|
|
|
|
|
2002-02-23 11:06:37 +00:00
|
|
|
#define LOCORE
|
|
|
|
|
2008-08-07 22:46:25 +00:00
|
|
|
#include <machine/frame.h>
|
|
|
|
#include <machine/fsr.h>
|
|
|
|
#include <machine/intr_machdep.h>
|
2001-10-15 14:35:39 +00:00
|
|
|
#include <machine/pstate.h>
|
2002-02-23 03:38:18 +00:00
|
|
|
|
|
|
|
#define PAGE_SIZE 8192
|
|
|
|
#define PAGE_SHIFT 13
|
2001-10-15 14:35:39 +00:00
|
|
|
|
2001-10-30 06:27:34 +00:00
|
|
|
#define STACK_SIZE (2 * PAGE_SIZE)
|
2001-10-15 14:35:39 +00:00
|
|
|
|
2001-10-30 06:27:34 +00:00
|
|
|
ENTRY(_start)
|
2008-08-07 22:46:25 +00:00
|
|
|
/* Limit interrupts. */
|
|
|
|
wrpr %g0, PIL_TICK - 1, %pil
|
2001-10-15 14:35:39 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* PSTATE: privileged, interrupts enabled, floating point
|
|
|
|
* unit enabled
|
|
|
|
*/
|
2008-08-07 22:46:25 +00:00
|
|
|
wrpr %g0, PSTATE_PRIV | PSTATE_IE | PSTATE_PEF, %pstate
|
|
|
|
wr %g0, FPRS_FEF, %fprs
|
2001-10-15 14:35:39 +00:00
|
|
|
|
2002-02-23 03:38:18 +00:00
|
|
|
setx stack + STACK_SIZE - SPOFF - CCFSZ, %l7, %l6
|
2001-10-30 06:27:34 +00:00
|
|
|
mov %l6, %sp
|
2001-10-15 14:35:39 +00:00
|
|
|
call main
|
2001-10-30 06:27:34 +00:00
|
|
|
mov %o4, %o0
|
2002-02-23 11:06:37 +00:00
|
|
|
sir
|
2001-10-15 14:35:39 +00:00
|
|
|
|
2001-10-30 06:27:34 +00:00
|
|
|
.comm stack, STACK_SIZE, 32
|