aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv64/kernel/entry.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/riscv64/kernel/entry.S')
-rw-r--r--arch/riscv64/kernel/entry.S13
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