summaryrefslogtreecommitdiffstats
path: root/sys/boot/sparc64/loader/locore.S
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2008-08-07 22:46:25 +0000
committermarius <marius@FreeBSD.org>2008-08-07 22:46:25 +0000
commitd335d6871aeb19ec02d0484ca3608820b06af7ab (patch)
tree5b357a34d4393b5feca4fe437362997ea3f19820 /sys/boot/sparc64/loader/locore.S
parent714809ddf1353c47264bfd10532b75cd8ad00375 (diff)
downloadFreeBSD-src-d335d6871aeb19ec02d0484ca3608820b06af7ab.zip
FreeBSD-src-d335d6871aeb19ec02d0484ca3608820b06af7ab.tar.gz
- Reimplement {d,i}tlb_enter() and {d,i}tlb_va_to_pa() in C. There's
no particular reason for them to be implemented in assembler and having them in C allows easier extension as well as using more C macros and {d,i}tlb_slot_max rather than hard-coding magic (and actually spitfire-only) values. - Fix the compilation of pmap_print_tte(). - Change pmap_print_tlb() to use ldxa() rather than re-rolling it inline as well as TLB_DAR_SLOT and {d,i}tlb_slot_max rather than hardcoding magic (and actually spitfire-only) values. - While at it, suffix the above mentioned functions with "_sun4u" to underline they're architecture-specific. - Use __FBSDID and macros instead of magic values in locore.S. - Remove unused includes and smp_stack in locore.S.
Diffstat (limited to 'sys/boot/sparc64/loader/locore.S')
-rw-r--r--sys/boot/sparc64/loader/locore.S93
1 files changed, 11 insertions, 82 deletions
diff --git a/sys/boot/sparc64/loader/locore.S b/sys/boot/sparc64/loader/locore.S
index 5eb6935..a73f5bf 100644
--- a/sys/boot/sparc64/loader/locore.S
+++ b/sys/boot/sparc64/loader/locore.S
@@ -4,35 +4,34 @@
* 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.
- *
- * $FreeBSD$
+ * unchanged, you can do what ever you want with this file.
*/
+#include <machine/asm.h>
+__FBSDID("$FreeBSD$");
+
#define LOCORE
-#include <machine/asi.h>
-#include <machine/asm.h>
+#include <machine/frame.h>
+#include <machine/fsr.h>
+#include <machine/intr_machdep.h>
#include <machine/pstate.h>
-#include <machine/smp.h>
-#include <machine/upa.h>
#define PAGE_SIZE 8192
#define PAGE_SHIFT 13
-#define SPOFF 2047
#define STACK_SIZE (2 * PAGE_SIZE)
ENTRY(_start)
- /* limit interrupts */
- wrpr %g0, 13, %pil
+ /* 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, 0x4, %fprs
+ 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
@@ -40,74 +39,4 @@ ENTRY(_start)
mov %o4, %o0
sir
-/*
- * %o0 input VA constant
- * %o1 current iTLB offset
- * %o2 current iTLB TTE tag
- */
-ENTRY(itlb_va_to_pa)
- clr %o1
-0: ldxa [%o1] ASI_ITLB_TAG_READ_REG, %o2
- cmp %o2, %o0
- bne,a %xcc, 1f
- nop
- /* return PA of matching entry */
- ldxa [%o1] ASI_ITLB_DATA_ACCESS_REG, %o0
- sllx %o0, 23, %o0
- srlx %o0, PAGE_SHIFT+23, %o0
- sllx %o0, PAGE_SHIFT, %o0
- retl
- mov %o0, %o1
-1: cmp %o1, 63<<3
- blu %xcc, 0b
- add %o1, 8, %o1
- clr %o0
- retl
- not %o0
-
-ENTRY(dtlb_va_to_pa)
- clr %o1
-0: ldxa [%o1] ASI_DTLB_TAG_READ_REG, %o2
- cmp %o2, %o0
- bne,a %xcc, 1f
- nop
- /* return PA of matching entry */
- ldxa [%o1] ASI_DTLB_DATA_ACCESS_REG, %o0
- sllx %o0, 23, %o0
- srlx %o0, PAGE_SHIFT+23, %o0
- sllx %o0, PAGE_SHIFT, %o0
- retl
- mov %o0, %o1
-1: cmp %o1, 63<<3
- blu %xcc, 0b
- add %o1, 8, %o1
- clr %o0
- retl
- not %o0
-
-/*
- * %o0 = vpn
- * %o1 = tte data
- */
-ENTRY(itlb_enter)
- rdpr %pstate, %o4
- wrpr %o4, PSTATE_IE, %pstate
- mov AA_IMMU_TAR, %o3
- stxa %o0, [%o3] ASI_IMMU
- stxa %o1, [%g0] ASI_ITLB_DATA_IN_REG
- membar #Sync
- retl
- wrpr %o4, 0, %pstate
-
-ENTRY(dtlb_enter)
- rdpr %pstate, %o4
- wrpr %o4, PSTATE_IE, %pstate
- mov AA_DMMU_TAR, %o3
- stxa %o0, [%o3] ASI_DMMU
- stxa %o1, [%g0] ASI_DTLB_DATA_IN_REG
- membar #Sync
- retl
- wrpr %o4, 0, %pstate
-
.comm stack, STACK_SIZE, 32
- .comm smp_stack, STACK_SIZE, 32
OpenPOWER on IntegriCloud