diff --git a/src/arch/riscv/common_riscv.lds b/src/arch/riscv/common_riscv.lds index be5938edb6..889085d02b 100644 --- a/src/arch/riscv/common_riscv.lds +++ b/src/arch/riscv/common_riscv.lds @@ -39,10 +39,8 @@ SECTIONS .text . : AT(ADDR(.text) - KERNEL_OFFSET) { - . = ALIGN(4K); - - - /* Standard kernel */ + /* runtime kernel */ + *(.vectors) *(.text) } diff --git a/src/arch/riscv/traps.S b/src/arch/riscv/traps.S index 3cf9e54b5f..c34904d55a 100644 --- a/src/arch/riscv/traps.S +++ b/src/arch/riscv/traps.S @@ -14,16 +14,14 @@ #define REGBYTES (CONFIG_WORD_SIZE / 8) -.section .text - -.global trap_entry .extern c_handle_syscall .extern c_handle_fastpath_reply_recv .extern c_handle_fastpath_call .extern c_handle_interrupt .extern c_handle_exception -trap_entry: +.section .vectors, "ax" +BEGIN_FUNC(trap_entry) #ifdef ENABLE_SMP_SUPPORT /* The sscratch contains the stack for the current core */ @@ -137,3 +135,5 @@ interrupt: /* Save NextIP */ STORE x1, (34*REGBYTES)(t0) j c_handle_interrupt + +END_FUNC(trap_entry)