diff options
Diffstat (limited to 'arch/sparc/kernel/wuf.S')
-rw-r--r-- | arch/sparc/kernel/wuf.S | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/arch/sparc/kernel/wuf.S b/arch/sparc/kernel/wuf.S index 9fde91a249e0..2c21cc59683e 100644 --- a/arch/sparc/kernel/wuf.S +++ b/arch/sparc/kernel/wuf.S | |||
@@ -254,16 +254,19 @@ srmmu_fwin_stackchk: | |||
254 | mov AC_M_SFSR, %l4 | 254 | mov AC_M_SFSR, %l4 |
255 | cmp %l5, %sp | 255 | cmp %l5, %sp |
256 | bleu fwin_user_stack_is_bolixed | 256 | bleu fwin_user_stack_is_bolixed |
257 | lda [%l4] ASI_M_MMUREGS, %g0 ! clear fault status | 257 | LEON_PI( lda [%l4] ASI_LEON_MMUREGS, %g0) ! clear fault status |
258 | SUN_PI_( lda [%l4] ASI_M_MMUREGS, %g0) ! clear fault status | ||
258 | 259 | ||
259 | /* The technique is, turn off faults on this processor, | 260 | /* The technique is, turn off faults on this processor, |
260 | * just let the load rip, then check the sfsr to see if | 261 | * just let the load rip, then check the sfsr to see if |
261 | * a fault did occur. Then we turn on fault traps again | 262 | * a fault did occur. Then we turn on fault traps again |
262 | * and branch conditionally based upon what happened. | 263 | * and branch conditionally based upon what happened. |
263 | */ | 264 | */ |
264 | lda [%g0] ASI_M_MMUREGS, %l5 ! read mmu-ctrl reg | 265 | LEON_PI(lda [%g0] ASI_LEON_MMUREGS, %l5) ! read mmu-ctrl reg |
266 | SUN_PI_(lda [%g0] ASI_M_MMUREGS, %l5) ! read mmu-ctrl reg | ||
265 | or %l5, 0x2, %l5 ! turn on no-fault bit | 267 | or %l5, 0x2, %l5 ! turn on no-fault bit |
266 | sta %l5, [%g0] ASI_M_MMUREGS ! store it | 268 | LEON_PI(sta %l5, [%g0] ASI_LEON_MMUREGS) ! store it |
269 | SUN_PI_(sta %l5, [%g0] ASI_M_MMUREGS) ! store it | ||
267 | 270 | ||
268 | /* Cross fingers and go for it. */ | 271 | /* Cross fingers and go for it. */ |
269 | LOAD_WINDOW(sp) | 272 | LOAD_WINDOW(sp) |
@@ -275,18 +278,22 @@ srmmu_fwin_stackchk: | |||
275 | 278 | ||
276 | /* LOCATION: Window 'T' */ | 279 | /* LOCATION: Window 'T' */ |
277 | 280 | ||
278 | lda [%g0] ASI_M_MMUREGS, %twin_tmp1 ! load mmu-ctrl again | 281 | LEON_PI(lda [%g0] ASI_LEON_MMUREGS, %twin_tmp1) ! load mmu-ctrl again |
279 | andn %twin_tmp1, 0x2, %twin_tmp1 ! clear no-fault bit | 282 | SUN_PI_(lda [%g0] ASI_M_MMUREGS, %twin_tmp1) ! load mmu-ctrl again |
280 | sta %twin_tmp1, [%g0] ASI_M_MMUREGS ! store it | 283 | andn %twin_tmp1, 0x2, %twin_tmp1 ! clear no-fault bit |
284 | LEON_PI(sta %twin_tmp1, [%g0] ASI_LEON_MMUREGS) ! store it | ||
285 | SUN_PI_(sta %twin_tmp1, [%g0] ASI_M_MMUREGS) ! store it | ||
281 | 286 | ||
282 | mov AC_M_SFAR, %twin_tmp2 | 287 | mov AC_M_SFAR, %twin_tmp2 |
283 | lda [%twin_tmp2] ASI_M_MMUREGS, %g0 ! read fault address | 288 | LEON_PI(lda [%twin_tmp2] ASI_LEON_MMUREGS, %g0) ! read fault address |
289 | SUN_PI_(lda [%twin_tmp2] ASI_M_MMUREGS, %g0) ! read fault address | ||
284 | 290 | ||
285 | mov AC_M_SFSR, %twin_tmp2 | 291 | mov AC_M_SFSR, %twin_tmp2 |
286 | lda [%twin_tmp2] ASI_M_MMUREGS, %twin_tmp2 ! read fault status | 292 | LEON_PI(lda [%twin_tmp2] ASI_LEON_MMUREGS, %twin_tmp2) ! read fault status |
287 | andcc %twin_tmp2, 0x2, %g0 ! did fault occur? | 293 | SUN_PI_(lda [%twin_tmp2] ASI_M_MMUREGS, %twin_tmp2) ! read fault status |
294 | andcc %twin_tmp2, 0x2, %g0 ! did fault occur? | ||
288 | 295 | ||
289 | bne 1f ! yep, cleanup | 296 | bne 1f ! yep, cleanup |
290 | nop | 297 | nop |
291 | 298 | ||
292 | wr %t_psr, 0x0, %psr | 299 | wr %t_psr, 0x0, %psr |