Skip to content

RISCV32 {__irq_wrapper} exception handling error under compressed instruction mode? #3826

@zephyrbot

Description

@zephyrbot

Reported by Quanwen Du:

When RISCV32 is excuting compressed instruction which is 2bytes per instruction, and trigger an exception(not an ecall exception), the following code seems NOT to consider such cases in {arch\riscv32\core\isr.S}

lw t0, __NANO_ESF_mepc_OFFSET(sp)
addi t0, t0, 4
sw t0, __NANO_ESF_mepc_OFFSET(sp)

The code {addi t0, t0, 4} does NOT take compressed instruction into consideration. if the exception instruction is compressed instruction, shall be {addi t0, t0, 2}

(Imported from Jira ZEP-2393)

Metadata

Metadata

Labels

area: RISCVRISCV Architecture (32-bit & 64-bit)bugThe issue is a bug, or the PR is fixing a bugpriority: lowLow impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions