Skip to content

Commit

Permalink
k1c: Remove asm_panic dependencies for $r0
Browse files Browse the repository at this point in the history
Summary:
Remove dependencies on $r0 to be set to $sr in function called in asm_panic.
This will avoid breaking unvoluntarily this piece of code in case of changes in
caller.

Test Plan:
Check that asm_panic is still working correctly by calling them directly from
the debugger.

Reviewers: O51 Linux Coolidge, gthouvenin

Reviewed By: O51 Linux Coolidge, gthouvenin

Subscribers: gthouvenin, alfred, #linux_coolidge_cc

Differential Revision: https://phab.kalray.eu/D2157
  • Loading branch information
clementleger authored and d3athjest3r committed Nov 20, 2023
1 parent 11dd317 commit 8e336b1
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions arch/k1c/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ mmc_error_check:
;;
cb.deqz $r1? mmc_error_check_ok
;;
make $r1 = mmc_error_panic_str_label
make $r0 = mmc_error_panic_str_label
goto asm_panic
;;
#endif
Expand Down Expand Up @@ -766,7 +766,7 @@ asn_check:
;;
asn_check_err:
/* We are fried, die peacefully */
make $r1 = asn_error_panic_str_label
make $r0 = asn_error_panic_str_label
goto asm_panic
;;
#endif
Expand All @@ -775,8 +775,7 @@ asn_check_err:

/**
* This routine calls panic from assembly after setting appropriate things
* $r0 = current
* $r1 = panic string
* $r0 = panic string
*/
asm_panic:
/*
Expand All @@ -785,16 +784,16 @@ asm_panic:
*/
make $r32 = PS_HWLOOP_EN_ET_EN | SFR_SET_VAL_WFXL(PS, DAUS, 0)
make $r33 = 0
get $r34 = $sr
;;
/* Clear hw loop exit to disable current loop */
set $le = $r33
;;
wfxl $ps = $r32
;;
/* Restore kernel stack */
ld $r12 = TASK_THREAD_KERNEL_SP[$r0]
ld $r12 = TASK_THREAD_KERNEL_SP[$r34]
;;
copyd $r0 = $r1
call panic
;;
#endif
Expand Down

0 comments on commit 8e336b1

Please sign in to comment.