Commit d3943ea
arch: arm64: fix a4 result corruption
The SMCCC macro in arch/arm64/core/smccc-call.S used x4 to load the
result pointer from the stack after the smc/hvc instruction. However,
per the SMCCC calling convention x4 holds the returned a4 value at that
point, so loading the pointer overwrote the real return value and
res->a4 ended up containing the result pointer itself.
Use x9 as the temporary register for the result pointer so that x4 is
preserved until it is stored into res->a4.
Fixes zephyrproject-rtos#113379
Signed-off-by: Hongquan Li <hongquan.li@processmission.com>1 parent 9f8f966 commit d3943ea
1 file changed
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
0 commit comments