Changeset bbb94545 in mainline for kernel/arch/sparc32/src/trap_table.S
- Timestamp:
- 2013-11-01T20:28:13Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3f596c9
- Parents:
- e6a3bfee
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc32/src/trap_table.S
re6a3bfee rbbb94545 59 59 60 60 .macro switch_to_invalid saved_wim, saved_psr 61 get_wim_number % g661 get_wim_number %l3 62 62 mov %wim, \saved_wim ! save WIM 63 63 mov %g0, %wim ! clear WIM 64 64 mov %psr, \saved_psr ! read PSR 65 and \saved_psr, 0xfffffff0, %l 066 or %l 0, %g6, %g6! set CWP67 mov % g6, %psr ! write PSR65 and \saved_psr, 0xfffffff0, %l4 66 or %l4, %l3, %l3 ! set CWP 67 mov %l3, %psr ! write PSR 68 68 nop 69 69 nop … … 230 230 /* dump registers to uwb */ 231 231 2: save 232 std %l0, [%g 4+ 0]233 std %l2, [%g 4+ 8]234 std %l4, [%g 4+ 16]235 std %l6, [%g 4+ 24]236 std %i0, [%g 4+ 32]237 std %i2, [%g 4+ 40]238 std %i4, [%g 4+ 48]239 std %i6, [%g 4+ 56]232 std %l0, [%g6 + 0] 233 std %l2, [%g6 + 8] 234 std %l4, [%g6 + 16] 235 std %l6, [%g6 + 24] 236 std %i0, [%g6 + 32] 237 std %i2, [%g6 + 40] 238 std %i4, [%g6 + 48] 239 std %i6, [%g6 + 56] 240 240 add %g4, 64, %g4 241 241 … … 276 276 restore 277 277 restore 278 /* Save invalid window data */ 279 mov %l5, %g5 ! kernel stack pointer 280 mov %l6, %g6 ! kernel wbuf 281 mov %l7, %g7 282 283 /* we should check whether window needs to be saved 284 * to kernel stack or uwb 285 */ 286 cmp %g7, 0 287 bne 3f 288 nop 289 278 290 ldd [%sp + 0], %l0 279 291 ldd [%sp + 8], %l2 … … 290 302 1: restore 291 303 restore 292 set uspace_wbuf, %g2 293 ld [%g2], %g1 294 ldd [%g1 + 0], %l0 295 ldd [%g1 + 8], %l2 296 ldd [%g1 + 16], %l4 297 ldd [%g1 + 24], %l6 298 ldd [%g1 + 32], %i0 299 ldd [%g1 + 40], %i2 300 ldd [%g1 + 48], %i4 301 ldd [%g1 + 56], %i6 302 sub %g1, 64, %g1 303 st %g1, [%g2] 304 305 2: /* Save invalid window data */ 304 /* Save invalid window data */ 306 305 mov %l5, %g5 ! kernel stack pointer 307 306 mov %l6, %g6 ! kernel wbuf 308 307 mov %l7, %g7 309 save 310 save 311 312 /* Restore invalid window data */ 308 3: sub %g6, 64, %g6 309 ldd [%g6 + 0], %l0 310 ldd [%g6 + 8], %l2 311 ldd [%g6 + 16], %l4 312 ldd [%g6 + 24], %l6 313 ldd [%g6 + 32], %i0 314 ldd [%g6 + 40], %i2 315 ldd [%g6 + 48], %i4 316 ldd [%g6 + 56], %i6 317 318 2: /* Restore invalid window data */ 319 restore 313 320 mov %g5, %l5 314 321 mov %g6, %l6 315 322 mov %g7, %l7 323 save 324 save 325 save 316 326 317 327 /* Set new value of window */ … … 351 361 /* Load kernel stack pointer from invalid window */ 352 362 switch_to_invalid %g5, %g6 353 save354 363 /* set uspace window mark */ 355 364 mov %psr, %l7 … … 475 484 /* Load kernel stack pointer from invalid window */ 476 485 switch_to_invalid %g5, %g6 477 save486 restore 478 487 mov %l5, %g7 ! stack pointer 479 488 switch_back %g5, %g6
Note:
See TracChangeset
for help on using the changeset viewer.