aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sparc64/cpudata.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2006-02-10 18:39:51 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-03-20 04:12:15 -0500
commit12eaa328f9fb2d3fcb5afb682c762690d05a3cd8 (patch)
treecce4e68b971757010a3e0bbf035fc65a381a3cd4 /include/asm-sparc64/cpudata.h
parent18397944642cbca7fcd4a109b43ed5b4652e95b9 (diff)
[SPARC64]: Use ASI_SCRATCHPAD address 0x0 properly.
This is where the virtual address of the fault status area belongs. To set it up we don't make a hypervisor call, instead we call OBP's SUNW,set-trap-table with the real address of the fault status area as the second argument. And right before that call we write the virtual address into ASI_SCRATCHPAD vaddr 0x0. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/asm-sparc64/cpudata.h')
-rw-r--r--include/asm-sparc64/cpudata.h26
1 files changed, 13 insertions, 13 deletions
diff --git a/include/asm-sparc64/cpudata.h b/include/asm-sparc64/cpudata.h
index 338b0ca5b519..5a970f5ed9bd 100644
--- a/include/asm-sparc64/cpudata.h
+++ b/include/asm-sparc64/cpudata.h
@@ -156,13 +156,16 @@ extern struct sun4v_2insn_patch_entry __sun4v_2insn_patch,
156 nop; \ 156 nop; \
157 .previous; 157 .previous;
158 158
159/* Clobbers TMP, current address space PGD phys address into DEST. */ 159#define TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \
160#define TRAP_LOAD_PGD_PHYS(DEST, TMP) \
161 __GET_CPUID(TMP) \ 160 __GET_CPUID(TMP) \
162 sethi %hi(trap_block), DEST; \ 161 sethi %hi(trap_block), DEST; \
163 sllx TMP, TRAP_BLOCK_SZ_SHIFT, TMP; \ 162 sllx TMP, TRAP_BLOCK_SZ_SHIFT, TMP; \
164 or DEST, %lo(trap_block), DEST; \ 163 or DEST, %lo(trap_block), DEST; \
165 add DEST, TMP, DEST; \ 164 add DEST, TMP, DEST; \
165
166/* Clobbers TMP, current address space PGD phys address into DEST. */
167#define TRAP_LOAD_PGD_PHYS(DEST, TMP) \
168 TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \
166 ldx [DEST + TRAP_PER_CPU_PGD_PADDR], DEST; 169 ldx [DEST + TRAP_PER_CPU_PGD_PADDR], DEST;
167 170
168/* Clobbers TMP, loads local processor's IRQ work area into DEST. */ 171/* Clobbers TMP, loads local processor's IRQ work area into DEST. */
@@ -175,11 +178,8 @@ extern struct sun4v_2insn_patch_entry __sun4v_2insn_patch,
175 178
176/* Clobbers TMP, loads DEST with current thread info pointer. */ 179/* Clobbers TMP, loads DEST with current thread info pointer. */
177#define TRAP_LOAD_THREAD_REG(DEST, TMP) \ 180#define TRAP_LOAD_THREAD_REG(DEST, TMP) \
178 __GET_CPUID(TMP) \ 181 TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \
179 sethi %hi(trap_block), DEST; \ 182 ldx [DEST + TRAP_PER_CPU_THREAD], DEST;
180 sllx TMP, TRAP_BLOCK_SZ_SHIFT, TMP; \
181 or DEST, %lo(trap_block), DEST; \
182 ldx [DEST + TMP], DEST;
183 183
184/* Given the current thread info pointer in THR, load the per-cpu 184/* Given the current thread info pointer in THR, load the per-cpu
185 * area base of the current processor into DEST. REG1, REG2, and REG3 are 185 * area base of the current processor into DEST. REG1, REG2, and REG3 are
@@ -201,13 +201,13 @@ extern struct sun4v_2insn_patch_entry __sun4v_2insn_patch,
201 201
202#else 202#else
203 203
204#define __GET_CPUID(REG) \ 204#define TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \
205 mov 0, REG; 205 sethi %hi(trap_block), DEST; \
206 or DEST, %lo(trap_block), DEST; \
206 207
207/* Uniprocessor versions, we know the cpuid is zero. */ 208/* Uniprocessor versions, we know the cpuid is zero. */
208#define TRAP_LOAD_PGD_PHYS(DEST, TMP) \ 209#define TRAP_LOAD_PGD_PHYS(DEST, TMP) \
209 sethi %hi(trap_block), DEST; \ 210 TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \
210 or DEST, %lo(trap_block), DEST; \
211 ldx [DEST + TRAP_PER_CPU_PGD_PADDR], DEST; 211 ldx [DEST + TRAP_PER_CPU_PGD_PADDR], DEST;
212 212
213#define TRAP_LOAD_IRQ_WORK(DEST, TMP) \ 213#define TRAP_LOAD_IRQ_WORK(DEST, TMP) \
@@ -215,8 +215,8 @@ extern struct sun4v_2insn_patch_entry __sun4v_2insn_patch,
215 or DEST, %lo(__irq_work), DEST; 215 or DEST, %lo(__irq_work), DEST;
216 216
217#define TRAP_LOAD_THREAD_REG(DEST, TMP) \ 217#define TRAP_LOAD_THREAD_REG(DEST, TMP) \
218 sethi %hi(trap_block), DEST; \ 218 TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \
219 ldx [DEST + %lo(trap_block)], DEST; 219 ldx [DEST + TRAP_PER_CPU_THREAD], DEST;
220 220
221/* No per-cpu areas on uniprocessor, so no need to load DEST. */ 221/* No per-cpu areas on uniprocessor, so no need to load DEST. */
222#define LOAD_PER_CPU_BASE(DEST, THR, REG1, REG2, REG3) 222#define LOAD_PER_CPU_BASE(DEST, THR, REG1, REG2, REG3)