aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2006-02-03 00:55:10 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-03-20 04:11:35 -0500
commitffe483d55229fadbaf4cc7316d47024a24ecd1a2 (patch)
tree70bdb6c94d5b3512a7b2a3ff06979ac2e4e869bf /arch/sparc64
parent92704a1c63c3b481870d02636d0b5a70c7e21cd1 (diff)
[SPARC64]: Add explicit register args to trap state loading macros.
This, as well as making the code cleaner, allows a simplification in the TSB miss handling path. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64')
-rw-r--r--arch/sparc64/kernel/entry.S8
-rw-r--r--arch/sparc64/kernel/etrap.S10
-rw-r--r--arch/sparc64/kernel/rtrap.S2
-rw-r--r--arch/sparc64/kernel/tsb.S9
-rw-r--r--arch/sparc64/kernel/winfixup.S18
5 files changed, 20 insertions, 27 deletions
diff --git a/arch/sparc64/kernel/entry.S b/arch/sparc64/kernel/entry.S
index b3511ff5d04a..4ca3ea0beaf9 100644
--- a/arch/sparc64/kernel/entry.S
+++ b/arch/sparc64/kernel/entry.S
@@ -50,7 +50,7 @@ do_fpdis:
50 add %g0, %g0, %g0 50 add %g0, %g0, %g0
51 ba,a,pt %xcc, rtrap_clr_l6 51 ba,a,pt %xcc, rtrap_clr_l6
52 52
531: TRAP_LOAD_THREAD_REG 531: TRAP_LOAD_THREAD_REG(%g6, %g1)
54 ldub [%g6 + TI_FPSAVED], %g5 54 ldub [%g6 + TI_FPSAVED], %g5
55 wr %g0, FPRS_FEF, %fprs 55 wr %g0, FPRS_FEF, %fprs
56 andcc %g5, FPRS_FEF, %g0 56 andcc %g5, FPRS_FEF, %g0
@@ -190,7 +190,7 @@ fp_other_bounce:
190 .globl do_fpother_check_fitos 190 .globl do_fpother_check_fitos
191 .align 32 191 .align 32
192do_fpother_check_fitos: 192do_fpother_check_fitos:
193 TRAP_LOAD_THREAD_REG 193 TRAP_LOAD_THREAD_REG(%g6, %g1)
194 sethi %hi(fp_other_bounce - 4), %g7 194 sethi %hi(fp_other_bounce - 4), %g7
195 or %g7, %lo(fp_other_bounce - 4), %g7 195 or %g7, %lo(fp_other_bounce - 4), %g7
196 196
@@ -378,7 +378,7 @@ do_ivec:
378 sllx %g2, %g4, %g2 378 sllx %g2, %g4, %g2
379 sllx %g4, 2, %g4 379 sllx %g4, 2, %g4
380 380
381 TRAP_LOAD_IRQ_WORK 381 TRAP_LOAD_IRQ_WORK(%g6, %g1)
382 382
383 lduw [%g6 + %g4], %g5 /* g5 = irq_work(cpu, pil) */ 383 lduw [%g6 + %g4], %g5 /* g5 = irq_work(cpu, pil) */
384 stw %g5, [%g3 + 0x00] /* bucket->irq_chain = g5 */ 384 stw %g5, [%g3 + 0x00] /* bucket->irq_chain = g5 */
@@ -422,7 +422,7 @@ setcc:
422 422
423 .globl utrap_trap 423 .globl utrap_trap
424utrap_trap: /* %g3=handler,%g4=level */ 424utrap_trap: /* %g3=handler,%g4=level */
425 TRAP_LOAD_THREAD_REG 425 TRAP_LOAD_THREAD_REG(%g6, %g1)
426 ldx [%g6 + TI_UTRAPS], %g1 426 ldx [%g6 + TI_UTRAPS], %g1
427 brnz,pt %g1, invoke_utrap 427 brnz,pt %g1, invoke_utrap
428 nop 428 nop
diff --git a/arch/sparc64/kernel/etrap.S b/arch/sparc64/kernel/etrap.S
index d974d18b15be..b5f6bc52d917 100644
--- a/arch/sparc64/kernel/etrap.S
+++ b/arch/sparc64/kernel/etrap.S
@@ -31,7 +31,7 @@
31 .globl etrap, etrap_irq, etraptl1 31 .globl etrap, etrap_irq, etraptl1
32etrap: rdpr %pil, %g2 32etrap: rdpr %pil, %g2
33etrap_irq: 33etrap_irq:
34 TRAP_LOAD_THREAD_REG 34 TRAP_LOAD_THREAD_REG(%g6, %g1)
35 rdpr %tstate, %g1 35 rdpr %tstate, %g1
36 sllx %g2, 20, %g3 36 sllx %g2, 20, %g3
37 andcc %g1, TSTATE_PRIV, %g0 37 andcc %g1, TSTATE_PRIV, %g0
@@ -100,7 +100,7 @@ etrap_irq:
100 stx %i7, [%sp + PTREGS_OFF + PT_V9_I7] 100 stx %i7, [%sp + PTREGS_OFF + PT_V9_I7]
101 wrpr %g0, ETRAP_PSTATE2, %pstate 101 wrpr %g0, ETRAP_PSTATE2, %pstate
102 mov %l6, %g6 102 mov %l6, %g6
103 LOAD_PER_CPU_BASE(%g4, %g3, %l1) 103 LOAD_PER_CPU_BASE(%g5, %g6, %g4, %g3, %l1)
104 jmpl %l2 + 0x4, %g0 104 jmpl %l2 + 0x4, %g0
105 ldx [%g6 + TI_TASK], %g4 105 ldx [%g6 + TI_TASK], %g4
106 106
@@ -124,7 +124,7 @@ etraptl1: /* Save tstate/tpc/tnpc of TL 1-->4 and the tl register itself.
124 * 0x58 TL4's TT 124 * 0x58 TL4's TT
125 * 0x60 TL 125 * 0x60 TL
126 */ 126 */
127 TRAP_LOAD_THREAD_REG 127 TRAP_LOAD_THREAD_REG(%g6, %g1)
128 sub %sp, ((4 * 8) * 4) + 8, %g2 128 sub %sp, ((4 * 8) * 4) + 8, %g2
129 rdpr %tl, %g1 129 rdpr %tl, %g1
130 130
@@ -179,7 +179,7 @@ etraptl1: /* Save tstate/tpc/tnpc of TL 1-->4 and the tl register itself.
179 .align 64 179 .align 64
180 .globl scetrap 180 .globl scetrap
181scetrap: 181scetrap:
182 TRAP_LOAD_THREAD_REG 182 TRAP_LOAD_THREAD_REG(%g6, %g1)
183 rdpr %pil, %g2 183 rdpr %pil, %g2
184 rdpr %tstate, %g1 184 rdpr %tstate, %g1
185 sllx %g2, 20, %g3 185 sllx %g2, 20, %g3
@@ -250,7 +250,7 @@ scetrap:
250 stx %i6, [%sp + PTREGS_OFF + PT_V9_I6] 250 stx %i6, [%sp + PTREGS_OFF + PT_V9_I6]
251 mov %l6, %g6 251 mov %l6, %g6
252 stx %i7, [%sp + PTREGS_OFF + PT_V9_I7] 252 stx %i7, [%sp + PTREGS_OFF + PT_V9_I7]
253 LOAD_PER_CPU_BASE(%g4, %g3, %l1) 253 LOAD_PER_CPU_BASE(%g5, %g6, %g4, %g3, %l1)
254 ldx [%g6 + TI_TASK], %g4 254 ldx [%g6 + TI_TASK], %g4
255 done 255 done
256 256
diff --git a/arch/sparc64/kernel/rtrap.S b/arch/sparc64/kernel/rtrap.S
index 64bc03610bc6..61bd45e7697e 100644
--- a/arch/sparc64/kernel/rtrap.S
+++ b/arch/sparc64/kernel/rtrap.S
@@ -226,7 +226,7 @@ rt_continue: ldx [%sp + PTREGS_OFF + PT_V9_G1], %g1
226 brz,pt %l3, 1f 226 brz,pt %l3, 1f
227 nop 227 nop
228 /* Must do this before thread reg is clobbered below. */ 228 /* Must do this before thread reg is clobbered below. */
229 LOAD_PER_CPU_BASE(%i0, %i1, %i2) 229 LOAD_PER_CPU_BASE(%g5, %g6, %i0, %i1, %i2)
2301: 2301:
231 ldx [%sp + PTREGS_OFF + PT_V9_G6], %g6 231 ldx [%sp + PTREGS_OFF + PT_V9_G6], %g6
232 ldx [%sp + PTREGS_OFF + PT_V9_G7], %g7 232 ldx [%sp + PTREGS_OFF + PT_V9_G7], %g7
diff --git a/arch/sparc64/kernel/tsb.S b/arch/sparc64/kernel/tsb.S
index ff6a79beb98d..28e38b168dda 100644
--- a/arch/sparc64/kernel/tsb.S
+++ b/arch/sparc64/kernel/tsb.S
@@ -36,14 +36,7 @@ tsb_miss_itlb:
36 nop 36 nop
37 37
38tsb_miss_page_table_walk: 38tsb_miss_page_table_walk:
39 /* This clobbers %g1 and %g6, preserve them... */ 39 TRAP_LOAD_PGD_PHYS(%g7, %g5)
40 mov %g1, %g5
41 mov %g6, %g2
42
43 TRAP_LOAD_PGD_PHYS
44
45 mov %g2, %g6
46 mov %g5, %g1
47 40
48 USER_PGTABLE_WALK_TL1(%g4, %g7, %g5, %g2, tsb_do_fault) 41 USER_PGTABLE_WALK_TL1(%g4, %g7, %g5, %g2, tsb_do_fault)
49 42
diff --git a/arch/sparc64/kernel/winfixup.S b/arch/sparc64/kernel/winfixup.S
index 320a762d0519..211021ae6e8a 100644
--- a/arch/sparc64/kernel/winfixup.S
+++ b/arch/sparc64/kernel/winfixup.S
@@ -40,7 +40,7 @@ set_pcontext:
40 */ 40 */
41 .globl fill_fixup, spill_fixup 41 .globl fill_fixup, spill_fixup
42fill_fixup: 42fill_fixup:
43 TRAP_LOAD_THREAD_REG 43 TRAP_LOAD_THREAD_REG(%g6, %g1)
44 rdpr %tstate, %g1 44 rdpr %tstate, %g1
45 andcc %g1, TSTATE_PRIV, %g0 45 andcc %g1, TSTATE_PRIV, %g0
46 or %g4, FAULT_CODE_WINFIXUP, %g4 46 or %g4, FAULT_CODE_WINFIXUP, %g4
@@ -86,7 +86,7 @@ fill_fixup:
86 wrpr %l1, (PSTATE_IE | PSTATE_AG | PSTATE_RMO), %pstate 86 wrpr %l1, (PSTATE_IE | PSTATE_AG | PSTATE_RMO), %pstate
87 mov %o7, %g6 87 mov %o7, %g6
88 ldx [%g6 + TI_TASK], %g4 88 ldx [%g6 + TI_TASK], %g4
89 LOAD_PER_CPU_BASE(%g1, %g2, %g3) 89 LOAD_PER_CPU_BASE(%g5, %g6, %g1, %g2, %g3)
90 90
91 /* This is the same as below, except we handle this a bit special 91 /* This is the same as below, except we handle this a bit special
92 * since we must preserve %l5 and %l6, see comment above. 92 * since we must preserve %l5 and %l6, see comment above.
@@ -105,7 +105,7 @@ fill_fixup:
105 * do not touch %g7 or %g2 so we handle the two cases fine. 105 * do not touch %g7 or %g2 so we handle the two cases fine.
106 */ 106 */
107spill_fixup: 107spill_fixup:
108 TRAP_LOAD_THREAD_REG 108 TRAP_LOAD_THREAD_REG(%g6, %g1)
109 ldx [%g6 + TI_FLAGS], %g1 109 ldx [%g6 + TI_FLAGS], %g1
110 andcc %g1, _TIF_32BIT, %g0 110 andcc %g1, _TIF_32BIT, %g0
111 ldub [%g6 + TI_WSAVED], %g1 111 ldub [%g6 + TI_WSAVED], %g1
@@ -181,7 +181,7 @@ winfix_mna:
181 wrpr %g3, %tnpc 181 wrpr %g3, %tnpc
182 done 182 done
183fill_fixup_mna: 183fill_fixup_mna:
184 TRAP_LOAD_THREAD_REG 184 TRAP_LOAD_THREAD_REG(%g6, %g1)
185 rdpr %tstate, %g1 185 rdpr %tstate, %g1
186 andcc %g1, TSTATE_PRIV, %g0 186 andcc %g1, TSTATE_PRIV, %g0
187 be,pt %xcc, window_mna_from_user_common 187 be,pt %xcc, window_mna_from_user_common
@@ -209,14 +209,14 @@ fill_fixup_mna:
209 wrpr %l1, (PSTATE_IE | PSTATE_AG | PSTATE_RMO), %pstate 209 wrpr %l1, (PSTATE_IE | PSTATE_AG | PSTATE_RMO), %pstate
210 mov %o7, %g6 ! Get current back. 210 mov %o7, %g6 ! Get current back.
211 ldx [%g6 + TI_TASK], %g4 ! Finish it. 211 ldx [%g6 + TI_TASK], %g4 ! Finish it.
212 LOAD_PER_CPU_BASE(%g1, %g2, %g3) 212 LOAD_PER_CPU_BASE(%g5, %g6, %g1, %g2, %g3)
213 call mem_address_unaligned 213 call mem_address_unaligned
214 add %sp, PTREGS_OFF, %o0 214 add %sp, PTREGS_OFF, %o0
215 215
216 b,pt %xcc, rtrap 216 b,pt %xcc, rtrap
217 nop ! yes, the nop is correct 217 nop ! yes, the nop is correct
218spill_fixup_mna: 218spill_fixup_mna:
219 TRAP_LOAD_THREAD_REG 219 TRAP_LOAD_THREAD_REG(%g6, %g1)
220 ldx [%g6 + TI_FLAGS], %g1 220 ldx [%g6 + TI_FLAGS], %g1
221 andcc %g1, _TIF_32BIT, %g0 221 andcc %g1, _TIF_32BIT, %g0
222 ldub [%g6 + TI_WSAVED], %g1 222 ldub [%g6 + TI_WSAVED], %g1
@@ -284,7 +284,7 @@ winfix_dax:
284 wrpr %g3, %tnpc 284 wrpr %g3, %tnpc
285 done 285 done
286fill_fixup_dax: 286fill_fixup_dax:
287 TRAP_LOAD_THREAD_REG 287 TRAP_LOAD_THREAD_REG(%g6, %g1)
288 rdpr %tstate, %g1 288 rdpr %tstate, %g1
289 andcc %g1, TSTATE_PRIV, %g0 289 andcc %g1, TSTATE_PRIV, %g0
290 be,pt %xcc, window_dax_from_user_common 290 be,pt %xcc, window_dax_from_user_common
@@ -312,14 +312,14 @@ fill_fixup_dax:
312 wrpr %l1, (PSTATE_IE | PSTATE_AG | PSTATE_RMO), %pstate 312 wrpr %l1, (PSTATE_IE | PSTATE_AG | PSTATE_RMO), %pstate
313 mov %o7, %g6 ! Get current back. 313 mov %o7, %g6 ! Get current back.
314 ldx [%g6 + TI_TASK], %g4 ! Finish it. 314 ldx [%g6 + TI_TASK], %g4 ! Finish it.
315 LOAD_PER_CPU_BASE(%g1, %g2, %g3) 315 LOAD_PER_CPU_BASE(%g5, %g6, %g1, %g2, %g3)
316 call spitfire_data_access_exception 316 call spitfire_data_access_exception
317 add %sp, PTREGS_OFF, %o0 317 add %sp, PTREGS_OFF, %o0
318 318
319 b,pt %xcc, rtrap 319 b,pt %xcc, rtrap
320 nop ! yes, the nop is correct 320 nop ! yes, the nop is correct
321spill_fixup_dax: 321spill_fixup_dax:
322 TRAP_LOAD_THREAD_REG 322 TRAP_LOAD_THREAD_REG(%g6, %g1)
323 ldx [%g6 + TI_FLAGS], %g1 323 ldx [%g6 + TI_FLAGS], %g1
324 andcc %g1, _TIF_32BIT, %g0 324 andcc %g1, _TIF_32BIT, %g0
325 ldub [%g6 + TI_WSAVED], %g1 325 ldub [%g6 + TI_WSAVED], %g1