Changeset 457 for trunk/hal/tsar_mips32/core/hal_switch.S
- Timestamp:
- Aug 2, 2018, 11:47:13 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/tsar_mips32/core/hal_switch.S
r408 r457 26 26 .global hal_do_cpu_switch 27 27 .global hal_do_cpu_save 28 .global hal_do_cpu_restore 28 29 29 30 .set noat … … 90 91 sw $27, 33*4($26) /* save c2_mode to slot 33 */ 91 92 93 sync 94 92 95 /* restore new thread context */ 93 96 … … 144 147 mtc2 $27, $1 /* restore c2_mode from slot 33 */ 145 148 mtc0 $26, $12 /* restore c0_sr from slot 34 */ 146 147 sync148 149 149 150 jr $31 /* return to caller */ … … 211 212 nop 212 213 214 #--------------------------------------------------------------------------------- 215 # The hal_do_cpu_restore()function makes the following assumption: 216 # - register $4 contains a pointer on the target thread context. 217 #--------------------------------------------------------------------------------- 218 hal_do_cpu_restore: 219 220 move $26, $4 /* $26 <= &context */ 221 222 lw $27, 0*4($26) 223 mtc0 $27, $14 /* restore C0_epc from slot 0 */ 224 225 lw $1, 1*4($26) 226 lw $2, 2*4($26) 227 lw $3, 3*4($26) 228 lw $4, 4*4($26) 229 lw $5, 5*4($26) 230 lw $6, 6*4($26) 231 lw $7, 7*4($26) 232 lw $8, 8*4($26) 233 lw $9, 9*4($26) 234 lw $10, 10*4($26) 235 lw $11, 11*4($26) 236 lw $12, 12*4($26) 237 lw $13, 13*4($26) 238 lw $14, 14*4($26) 239 lw $15, 15*4($26) 240 lw $16, 16*4($26) 241 lw $17, 17*4($26) 242 lw $18, 18*4($26) 243 lw $19, 19*4($26) 244 lw $20, 20*4($26) 245 lw $21, 21*4($26) 246 lw $22, 22*4($26) 247 lw $23, 23*4($26) 248 lw $24, 24*4($26) 249 lw $25, 25*4($26) 250 251 lw $27, 26*4($26) 252 mthi $27 /* restore hi from slot 26 */ 253 lw $27, 27*4($26) 254 mtlo $27 /* restore lo from slot 27 */ 255 256 lw $28, 28*4($26) 257 lw $29, 29*4($26) 258 lw $30, 30*4($26) 259 lw $31, 31*4($26) /* restore ra from slot 31 */ 260 261 lw $27, 32*4($26) 262 mtc2 $27, $0 /* restore c2_ptpr from slot 32 */ 263 264 lw $27, 35*4($26) 265 mtc0 $27, $4, 2 /* restore c0_th from slot 35 */ 266 267 lw $27, 33*4($26) 268 lw $26, 34*4($26) 269 270 mtc2 $27, $1 /* restore c2_mode from slot 33 */ 271 mtc0 $26, $12 /* restore c0_sr from slot 34 */ 272 273 jr $31 /* return to caller */ 274 nop 275 213 276 .set reorder 214 277 .set at
Note: See TracChangeset
for help on using the changeset viewer.