Go to the documentation of this file. 1 #ifndef _SPARC_TRAP_BLOCK_H
2 #define _SPARC_TRAP_BLOCK_H
4 #include <asm/hypervisor.h>
86 #define TRAP_PER_CPU_THREAD 0x00
87 #define TRAP_PER_CPU_PGD_PADDR 0x08
88 #define TRAP_PER_CPU_CPU_MONDO_PA 0x10
89 #define TRAP_PER_CPU_DEV_MONDO_PA 0x18
90 #define TRAP_PER_CPU_RESUM_MONDO_PA 0x20
91 #define TRAP_PER_CPU_RESUM_KBUF_PA 0x28
92 #define TRAP_PER_CPU_NONRESUM_MONDO_PA 0x30
93 #define TRAP_PER_CPU_NONRESUM_KBUF_PA 0x38
94 #define TRAP_PER_CPU_FAULT_INFO 0x40
95 #define TRAP_PER_CPU_CPU_MONDO_BLOCK_PA 0xc0
96 #define TRAP_PER_CPU_CPU_LIST_PA 0xc8
97 #define TRAP_PER_CPU_TSB_HUGE 0xd0
98 #define TRAP_PER_CPU_TSB_HUGE_TEMP 0xd8
99 #define TRAP_PER_CPU_IRQ_WORKLIST_PA 0xe0
100 #define TRAP_PER_CPU_CPU_MONDO_QMASK 0xe8
101 #define TRAP_PER_CPU_DEV_MONDO_QMASK 0xec
102 #define TRAP_PER_CPU_RESUM_QMASK 0xf0
103 #define TRAP_PER_CPU_NONRESUM_QMASK 0xf4
104 #define TRAP_PER_CPU_PER_CPU_BASE 0xf8
106 #define TRAP_BLOCK_SZ_SHIFT 8
110 #define __GET_CPUID(REG) \
112 661: ldxa [%g0] ASI_UPA_CONFIG, REG; \
114 and REG, 0x1f, REG; \
116 .section .cpuid_patch, "ax"; \
120 ldxa [%g0] ASI_SAFARI_CONFIG, REG; \
122 and REG, 0x3ff, REG; \
125 ldxa [%g0] ASI_JBUS_CONFIG, REG; \
127 and REG, 0x1f, REG; \
130 sethi %hi(0x1fff40000d0 >> 9), REG; \
133 lduwa [REG] ASI_PHYS_BYPASS_EC_E, REG;\
135 mov SCRATCHPAD_CPUID, REG; \
136 ldxa [REG] ASI_SCRATCHPAD, REG; \
143 #define TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \
145 sethi %hi(trap_block), DEST; \
146 sllx TMP, TRAP_BLOCK_SZ_SHIFT, TMP; \
147 or DEST, %lo(trap_block), DEST; \
148 add DEST, TMP, DEST; \
151 #define TRAP_LOAD_PGD_PHYS(DEST, TMP) \
152 TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \
153 ldx [DEST + TRAP_PER_CPU_PGD_PADDR], DEST;
156 #define TRAP_LOAD_IRQ_WORK_PA(DEST, TMP) \
157 TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \
158 add DEST, TRAP_PER_CPU_IRQ_WORKLIST_PA, DEST;
161 #define TRAP_LOAD_THREAD_REG(DEST, TMP) \
162 TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \
163 ldx [DEST + TRAP_PER_CPU_THREAD], DEST;
174 #define LOAD_PER_CPU_BASE(DEST, THR, REG1, REG2, REG3) \
175 lduh [THR + TI_CPU], REG1; \
176 sethi %hi(trap_block), REG2; \
177 sllx REG1, TRAP_BLOCK_SZ_SHIFT, REG1; \
178 or REG2, %lo(trap_block), REG2; \
179 add REG2, REG1, REG2; \
180 ldx [REG2 + TRAP_PER_CPU_PER_CPU_BASE], DEST;
184 #define TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \
185 sethi %hi(trap_block), DEST; \
186 or DEST, %lo(trap_block), DEST; \
189 #define TRAP_LOAD_PGD_PHYS(DEST, TMP) \
190 TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \
191 ldx [DEST + TRAP_PER_CPU_PGD_PADDR], DEST;
194 #define TRAP_LOAD_IRQ_WORK_PA(DEST, TMP) \
195 TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \
196 add DEST, TRAP_PER_CPU_IRQ_WORKLIST_PA, DEST;
198 #define TRAP_LOAD_THREAD_REG(DEST, TMP) \
199 TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \
200 ldx [DEST + TRAP_PER_CPU_THREAD], DEST;
203 #define LOAD_PER_CPU_BASE(DEST, THR, REG1, REG2, REG3)