2 * Initial implementation:
3 * Copyright (c) 2001 Robert Drehmel
6 * As long as the above copyright statement and this notice remain
7 * unchanged, you can do what ever you want with this file.
9 * $FreeBSD: src/sys/boot/sparc64/loader/locore.S,v 1.6 2002/05/29 05:49:58 jake Exp $
10 * $DragonFly: src/sys/boot/sparc64/loader/locore.S,v 1.1 2003/11/10 06:08:40 dillon Exp $
15 #include <machine/asi.h>
16 #include <machine/asm.h>
17 #include <machine/pstate.h>
18 #include <machine/smp.h>
19 #include <machine/upa.h>
21 #define PAGE_SIZE 8192
25 #define STACK_SIZE (2 * PAGE_SIZE)
28 /* limit interrupts */
32 * PSTATE: privileged, interrupts enabled, floating point
35 wrpr %g0, PSTATE_PRIV|PSTATE_IE|PSTATE_PEF, %pstate
38 setx stack + STACK_SIZE - SPOFF - CCFSZ, %l7, %l6
45 * %o0 input VA constant
46 * %o1 current iTLB offset
47 * %o2 current iTLB TTE tag
51 0: ldxa [%o1] ASI_ITLB_TAG_READ_REG, %o2
55 /* return PA of matching entry */
56 ldxa [%o1] ASI_ITLB_DATA_ACCESS_REG, %o0
58 srlx %o0, PAGE_SHIFT+23, %o0
59 sllx %o0, PAGE_SHIFT, %o0
71 0: ldxa [%o1] ASI_DTLB_TAG_READ_REG, %o2
75 /* return PA of matching entry */
76 ldxa [%o1] ASI_DTLB_DATA_ACCESS_REG, %o0
78 srlx %o0, PAGE_SHIFT+23, %o0
79 sllx %o0, PAGE_SHIFT, %o0
95 wrpr %o4, PSTATE_IE, %pstate
97 stxa %o0, [%o3] ASI_IMMU
98 stxa %o1, [%g0] ASI_ITLB_DATA_IN_REG
105 wrpr %o4, PSTATE_IE, %pstate
107 stxa %o0, [%o3] ASI_DMMU
108 stxa %o1, [%g0] ASI_DTLB_DATA_IN_REG
113 .comm stack, STACK_SIZE, 32
114 .comm smp_stack, STACK_SIZE, 32