Skip to content

Commit

Permalink
riscv64: interrupt handling optimizations
Browse files Browse the repository at this point in the history
JIRA: RTOS-844
  • Loading branch information
lukileczo committed Jun 25, 2024
1 parent c5167b3 commit 62a034f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions hal/riscv64/_interrupts.S
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@
sd sp, 232(sp) /* ksp */

/* Check FPU status */
csrr t0, sstatus
srli t0, t0, 13
csrr s1, sstatus
srli t0, s1, 13

/* If FPU is clean or dirty, save context */
andi t0, t0, 2
Expand Down Expand Up @@ -148,15 +148,13 @@
csrc sstatus, t0
li t0, (2 << 13)
csrs sstatus, t0
3:
csrr s1, sstatus
3:
csrr s2, sepc
csrr s3, sbadaddr
csrr s4, scause

sd s1, 240(sp) /* sstatus */
sd s2, 248(sp) /* sepc */
sd s3, 256(sp) /* sbadaddr */
sd s4, 264(sp) /* scause */
sd tp, 280(sp) /* tp */
.endm
Expand Down Expand Up @@ -425,8 +423,10 @@ _interrupts_exceptionFpu:
tail _interrupts_returnUnlocked

_interrupts_exceptionNotFpu:
csrr s3, sbadaddr
/* Save sscratch to be able to get hart ID */
csrr s5, sscratch
sd s3, 256(sp) /* sbadaddr */
sd s5, 272(sp)

mv a1, sp
Expand Down

0 comments on commit 62a034f

Please sign in to comment.