mirror of
https://github.com/sgmarz/osblog.git
synced 2024-11-24 02:16:19 +04:00
During a trap, only save the FPU if the process changed them.
This commit is contained in:
parent
3793ad1e87
commit
720d084364
@ -58,8 +58,8 @@ m_trap_vector:
|
|||||||
csrr t1, mstatus
|
csrr t1, mstatus
|
||||||
srli t0, t1, 13
|
srli t0, t1, 13
|
||||||
andi t0, t0, 3
|
andi t0, t0, 3
|
||||||
|
li t3, 3
|
||||||
beqz t0, 1f
|
bne t0, t3, 1f
|
||||||
# Save floating point registers
|
# Save floating point registers
|
||||||
.set i, 0
|
.set i, 0
|
||||||
.rept 32
|
.rept 32
|
||||||
@ -94,8 +94,8 @@ m_trap_vector:
|
|||||||
csrr t1, mstatus
|
csrr t1, mstatus
|
||||||
srli t0, t1, 13
|
srli t0, t1, 13
|
||||||
andi t0, t0, 3
|
andi t0, t0, 3
|
||||||
|
li t3, 3
|
||||||
beqz t0, 1f
|
bne t0, t3, 1f
|
||||||
.set i, 0
|
.set i, 0
|
||||||
.rept 32
|
.rept 32
|
||||||
load_fp %i
|
load_fp %i
|
||||||
@ -154,7 +154,6 @@ switch_to_user:
|
|||||||
csrr t1, mstatus
|
csrr t1, mstatus
|
||||||
srli t0, t1, 13
|
srli t0, t1, 13
|
||||||
andi t0, t0, 3
|
andi t0, t0, 3
|
||||||
|
|
||||||
beqz t0, 1f
|
beqz t0, 1f
|
||||||
.set i, 0
|
.set i, 0
|
||||||
.rept 32
|
.rept 32
|
||||||
|
Loading…
Reference in New Issue
Block a user