The trap frame already handles the floating point registers, but
floating point support was not enabled via the mstatus register. This
didn't cause an issue on the Ubuntu 22.04 standard version of qemu, but
one built from nightly source will issue an illegal instruction
exception if floating point registers are accessed without the support
being enabled.
This commit fixes the issue by enabling floating point support from
early initialization.
// we can't use keywords other than const and sym
unsafe {
asm!(
+ // Turn on floating point support
+ "li t0, 1 << 13",
+ "csrw mstatus, t0",
// Establish the stack frame reference in mscratch
"csrw mscratch, {trap_frame}",
"lla t2, m_trap_vector",