riscv-rt: new attribute macro to define custom _setup_interrupts function.#390
riscv-rt: new attribute macro to define custom _setup_interrupts function.#390romancardenas wants to merge 4 commits intorust-embedded:masterfrom
riscv-rt: new attribute macro to define custom _setup_interrupts function.#390Conversation
|
@MabezDev what do you think about calling the feature |
|
Wouldn’t the default function be garbage collected by the linker when it observes that it’s unreachable when it’s replaced by another function? If not, I have problems over in aarch32 land… |
|
This full story started with #155 It looks like "default" symbols are not optimized out, and when you override them, you end up having both routines. We have been working on reducing/reusing default symbols to minimize this binary size overhead since then. As a side note, we experimented with weak symbols in assembly (that was our first approach). However, using weak symbols currently breaks LTO (#247) |
…u-boot is enabled
This PR provides the following changes:
custom-setup-interruptsfeature to opt-out the default implementation of_setup_interrupts_default_setup_interruptssymbol that acts as a weak implementation of_default_setup_interrupts,riscv-rtnow directly defines_setup_interrupts(protected under a feature gate). This reduces the amount of code in the final binary when users define their custom interrupt setup routine._setup_interruptscan accept anusizeinput argument that corresponds to the ID of the running hart. This might be useful in multi-hart targets to define hart-specific interrupt setup routines.riscv_macros::setup_interruptsattribute macro for aiding users defining their custom interrupt setup routine.About feature naming
I think
custom-setup-interruptsis a clear name for the feature, as it should be activated whenever users want to implement their custom interrupt setup routine. However, previous similar features follow ano-*name (e.g.,no-interruptsorno-exceptions). Let me know if you prefer to stick to theno-*naming or if you prefer usingcustom-*.While I am currently more inclined to
custom-*, I would like to know you opinion.