Skip to content
Snippets Groups Projects
Commit 2a23ac61 authored by Lukas Auer's avatar Lukas Auer Committed by Andes
Browse files

riscv: align mtvec on a 4-byte boundary


The machine trap-vector base address (mtvec) must be aligned on a 4-byte
boundary. Add the necessary align directive to trap_entry.

This patch also removes the global directive for trap_entry, which is
not required.

Signed-off-by: default avatarLukas Auer <lukas.auer@aisec.fraunhofer.de>
Reviewed-by: default avatarBin Meng <bmeng.cn@gmail.com>
parent c55309c0
No related branches found
No related tags found
No related merge requests found
...@@ -42,7 +42,6 @@ nmi_vector: ...@@ -42,7 +42,6 @@ nmi_vector:
trap_vector: trap_vector:
j trap_entry j trap_entry
.global trap_entry
handle_reset: handle_reset:
li t0, CONFIG_SYS_SDRAM_BASE li t0, CONFIG_SYS_SDRAM_BASE
SREG a2, 0(t0) SREG a2, 0(t0)
...@@ -208,6 +207,7 @@ call_board_init_r: ...@@ -208,6 +207,7 @@ call_board_init_r:
/* /*
* trap entry * trap entry
*/ */
.align 2
trap_entry: trap_entry:
addi sp, sp, -32*REGBYTES addi sp, sp, -32*REGBYTES
SREG x1, 1*REGBYTES(sp) SREG x1, 1*REGBYTES(sp)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment