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.
14 #include <machine/asi.h>
15 #include <machine/asm.h>
16 #include <machine/pstate.h>
17 #include <machine/smp.h>
18 #include <machine/upa.h>
20 #define PAGE_SIZE 8192
24 #define STACK_SIZE (2 * PAGE_SIZE)
27 /* limit interrupts */
31 * PSTATE: privileged, interrupts enabled, floating point
34 wrpr %g0, PSTATE_PRIV|PSTATE_IE|PSTATE_PEF, %pstate
37 setx stack + STACK_SIZE - SPOFF - CCFSZ, %l7, %l6
44 * %o0 input VA constant
45 * %o1 current iTLB offset
46 * %o2 current iTLB TTE tag
50 0: ldxa [%o1] ASI_ITLB_TAG_READ_REG, %o2
54 /* return PA of matching entry */
55 ldxa [%o1] ASI_ITLB_DATA_ACCESS_REG, %o0
57 srlx %o0, PAGE_SHIFT+23, %o0
58 sllx %o0, PAGE_SHIFT, %o0
70 0: ldxa [%o1] ASI_DTLB_TAG_READ_REG, %o2
74 /* return PA of matching entry */
75 ldxa [%o1] ASI_DTLB_DATA_ACCESS_REG, %o0
77 srlx %o0, PAGE_SHIFT+23, %o0
78 sllx %o0, PAGE_SHIFT, %o0
94 wrpr %o4, PSTATE_IE, %pstate
96 stxa %o0, [%o3] ASI_IMMU
97 stxa %o1, [%g0] ASI_ITLB_DATA_IN_REG
104 wrpr %o4, PSTATE_IE, %pstate
106 stxa %o0, [%o3] ASI_DMMU
107 stxa %o1, [%g0] ASI_DTLB_DATA_IN_REG
112 .comm stack, STACK_SIZE, 32
113 .comm smp_stack, STACK_SIZE, 32