# RISC-V
`rt` requires the A extension (both Zalrsc and Zaamo) as well as the Zicsr
extension. The M and Zbb extensions improve performance in several places but
are not required.
`rt_trap_handler` must be used to handle the top-level trap (mcause.Interrupt
== 0), and it will invoke a handler from `rt_trap_vector`, which must be
provided by the application. The environment call handler fields in
`rt_trap_vector` must be set to `rt_ecall_handler`. Declarations for these
symbols are provided in [`<rt/arch/trap.h>`](include/rt/arch/trap.h).
If vectored asynchronous interrupts are not enabled, then `mtvec` may be set
directly to `rt_trap_handler`, otherwise, the instruction located at the
`mtvec.BASE` address must be a jump to `rt_trap_handler`, and other
instructions at `mtvec.BASE + 4*cause` should be jumps to the appropriate
handler for each interrupt type.
`rt_msi_handler` is provided for handling the machine software interrupt, which
is used for asynchronous system calls made by other interrupts. The software
interrupt MMIO base address must be configured with `MSIP_BASE` at compile
time; `<rt/arch/msi.h>` provides `msi_pend` and uses `MSIP_BASE` for the
assembly path that clears the interrupt.