Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(riscv): avoid flash-backed LUT for irq
Previously, the `INTERRUPT_TO_PRIORITY` constant would compile down to a runtime lookup table called `anon.HASH.2.llvm.NUMBERS` like so: ```asm status & configured_interrupts[INTERRUPT_TO_PRIORITY[cpu_intr as usize - 1]]; ... 40380fbc: 3c0095b7 lui a1,0x3c009 40380fc0: 2d858593 addi a1,a1,728 # 3c0092d8 <anon.73967c570b981c3046610ed0622f71c3.2.llvm.13737670072012269642> 40380fc4: 952e add a0,a0,a1 40380fc6: 4108 lw a0,0(a0) ``` Which means that in order to load the `a1`th slot from the LUT, we'll have to go out to flash to do it. As an alternative to an `#[inline]`'d function, which is nice in the 'c3's case because it's the identity function that disappears at runtime, instead of using a `const` INTERRUPT_TO_PRIORITY could be made a `static`, which would allow us to place it into the `.data` section via a linker directive.
- Loading branch information