diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2023-05-17 23:10:50 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2023-05-17 23:10:50 +0300 |
| commit | b7f53b9a9001708dea5303faf52f1b508eefb712 (patch) | |
| tree | bfd9807e620f0670f6e7a58a637b36a480f90b72 /arch | |
| parent | 4a5071dfda941383aa1245a5d69254b07dabe796 (diff) | |
| download | kmi-b7f53b9a9001708dea5303faf52f1b508eefb712.tar.gz kmi-b7f53b9a9001708dea5303faf52f1b508eefb712.zip | |
align handle_irq to four byte boundaries always
+ CSR_STVEC requires four byte alignment
Diffstat (limited to 'arch')
| -rw-r--r-- | arch/riscv64/kernel/entry.S | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/riscv64/kernel/entry.S b/arch/riscv64/kernel/entry.S index 5331385..02aaccf 100644 --- a/arch/riscv64/kernel/entry.S +++ b/arch/riscv64/kernel/entry.S @@ -14,6 +14,19 @@ /* very much based on linux, but why change it if works, eh? */ .section .text + +.option push +/* norelax necessary for LLVM, as relaxed alignment is apparently unimplemented + * (as of 2023/05/17, clang 14.0.6): + */ +.option norelax +/* align 2, meaning 2^2 = 4 bytes, necessary as CSR_STVEC requires minimum + * four byte alignment + */ +.align 2 +/* we can go back to relaxed mode if we want */ +.option pop + .global handle_irq handle_irq: csrrw tp, CSR_SSCRATCH, tp |
