Changeset 9f9d725 in mainline
- Timestamp:
- 2013-11-05T11:56:00Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- dbf4417
- Parents:
- 3f596c9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc32/src/trap_table.S
r3f596c9 r9f9d725 83 83 /* Save next window to kernel stack or UWB */ 84 84 .macro inline_save_kernel 85 set 0x80000100, %g2 86 set 'k', %g1 87 sta %g1, [%g2] 0x1c 85 mov %wim, %g2 86 mov %g0, %wim 88 87 save 89 88 std %l0, [%sp + 0] … … 96 95 std %i6, [%sp + 56] 97 96 restore 97 mov %g2, %wim 98 98 .endm 99 99 100 100 .macro inline_save_uspace uwb 101 set 0x80000100, %g2 102 set 'u', %g1 103 sta %g1, [%g2] 0x1c 101 mov %wim, %g2 102 mov %g0, %wim 104 103 save 105 ld [\uwb], %g1 106 std %l0, [%g1 + 0] 107 std %l2, [%g1 + 8] 108 std %l4, [%g1 + 16] 109 std %l6, [%g1 + 24] 110 std %i0, [%g1 + 32] 111 std %i2, [%g1 + 40] 112 std %i4, [%g1 + 48] 113 std %i6, [%g1 + 56] 104 std %l0, [\uwb + 0] 105 std %l2, [\uwb + 8] 106 std %l4, [\uwb + 16] 107 std %l6, [\uwb + 24] 108 std %i0, [\uwb + 32] 109 std %i2, [\uwb + 40] 110 std %i4, [\uwb + 48] 111 std %i6, [\uwb + 56] 114 112 add \uwb, 64, \uwb 115 113 restore 114 mov %g2, %wim 116 115 .endm 117 116 118 117 /* Restore window from kernel stack or UWB */ 119 118 .macro inline_restore_kernel 120 save 119 mov %wim, %l3 120 sll %l3, 7, %l4 121 srl %l3, 1, %l3 122 or %l3, %l4, %l3 123 and %l3, 0xff, %l3 124 125 mov %g0, %wim 126 restore 127 mov %l5, %g5 128 mov %l6, %g6 129 mov %l7, %g7 130 restore 131 mov %g5, %l5 132 mov %g6, %l6 133 mov %g7, %l7 134 save 135 121 136 ldd [%sp + 0], %l0 122 137 ldd [%sp + 8], %l2 … … 127 142 ldd [%sp + 48], %i4 128 143 ldd [%sp + 56], %i6 129 restore 144 save 145 146 mov %l3, %wim 130 147 .endm 131 148 132 149 .macro inline_restore_uspace uwb 150 mov %wim, %l3 151 sll %l3, 7, %l4 152 srl %l3, 1, %l3 153 or %l3, %l4, %l3 154 and %l3, 0xff, %l3 155 156 mov %g0, %wim 157 restore 158 mov %l5, %g5 159 mov %l6, %g6 160 mov %l7, %g7 161 restore 162 mov %g5, %l5 163 mov %g6, %l6 164 mov %g7, %l7 165 save 166 167 ldd [\uwb + 0], %l0 168 ldd [\uwb + 8], %l2 169 ldd [\uwb + 16], %l4 170 ldd [\uwb + 24], %l6 171 ldd [\uwb + 32], %i0 172 ldd [\uwb + 40], %i2 173 ldd [\uwb + 48], %i4 174 ldd [\uwb + 56], %i6 175 sub \uwb, 64, \uwb 133 176 save 134 ld [\uwb], %g1 135 std %l0, [%g1 + 0] 136 std %l2, [%g1 + 8] 137 std %l4, [%g1 + 16] 138 std %l6, [%g1 + 24] 139 std %i0, [%g1 + 32] 140 std %i2, [%g1 + 40] 141 std %i4, [%g1 + 48] 142 std %i6, [%g1 + 56] 143 sub \uwb, 64, \uwb 144 restore 177 178 mov %l3, %wim 145 179 .endm 146 180 … … 404 438 nop 405 439 406 /* If trap originated from uspace, clear uspace window mark */440 /* If trap originated from uspace, clear uspace window mark and save uwb address for future use */ 407 441 if_from_kernel 6f 408 442 switch_to_invalid %g5, %g6 409 443 clr %l7 444 mov %l6, %g7 410 445 switch_back %g5, %g6 411 412 6: jmp %l1 446 mov %g7, %g1 447 448 /* If next window is invalid, do inline restore */ 449 6: get_wim_number %g6 450 get_cwp %g7 451 inc %g7 452 cmp %g6, %g7 453 bne 8f 454 455 if_from_kernel 7f 456 457 inline_restore_uspace %g1 458 b 8f 459 nop 460 461 7: inline_restore_kernel 462 463 8: jmp %l1 413 464 rett %l2 414 465
Note:
See TracChangeset
for help on using the changeset viewer.