Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
riscv-rt: Align _vector_table to 256 instead of 4
The RISC-V Privileged Specification (version 1.11) for mtvec CSR says: > The value in the BASE field must always be aligned on a 4-byte boundary, and the MODE setting may > impose additional alignment constraints on the value in the BASE field. > [...] > An implementation may have different alignment constraints for different modes. In particular, > MODE=Vectored may have stricter alignment constraints than MODE=Direct. The Ibex Reference Guide for mtvec CSR says[^1]: > The trap-vector base address, always aligned to 256 bytes I'm not sure how we can parametrize mtvec alignment without cargo features, so this PR simply uses the stricter alignment. If a cargo feature is preferred, I can add `mtvec-align-256`. Note that multiple `mtvec-align-N` features are additive because the stricter one wins. [^1]: https://ibex-core.readthedocs.io/en/latest/03_reference/cs_registers.html#machine-trap-vector-base-address-mtvec
- Loading branch information