riscv_get_hart_index(9)
π riscv_get_hart_index β a Kernel API Manual moment
okay bestie, welcome to riscv_get_hart_index(9) from the Kernel API Manual β yes that's the whole vibe, this is a kernel API page and we're gonna get through it together π«Ά
β¨ NAME β¨
riscv_get_hart_index β literally just "get hart index for interrupt delivery". that's the job. that's what she does π
πΈ SYNOPSIS πΈ
int riscv_get_hart_index (struct fwnode_handle *fwnode , u32
logical_index , u32 *hart_index );
yup, that's the whole signature, copied exactly, no notes π
π ARGUMENTS π
fwnodeβ the interrupt controller node, that's her π¦logical_indexβ the index within the"interrupts-extended"property, iykykhart_indexβ gets filled with the hart index to use β¨
π DESCRIPTION π
so RISC-V uses the term "hart index" for its interrupt controllers, specifically for the purpose of interrupt routing to destination harts. and the thing is β these can be arbitrary numbers assigned to each destination hart in the context of a particular interrupt domain. no cap, arbitrary π₯
these numbers get encoded in the optional property "riscv,hart-indexes", which should contain the hart index for each interrupt destination in the same order as in the "interrupts-extended" property. order matters bestie, we love a matching-order situation π
and if this property does not exist? it's assumed equal to the logical index β i.e. the index within the "interrupts-extended" property. slay, fallback behavior π
β RETURN β
error code. that's it, that's the return value π
π§ SEE ALSO π§
- Kernel file
./arch/riscv/kernel/irq.cβ go read it, it's giving main character energy π
just a lil reminder: keep those property names exactly as written ("riscv,hart-indexes"and"interrupts-extended"), and keep your destinations in order. the kernel is watching π«Ά
and that's the page!! brought to you by ./arch/riscv/kernel, October 2026 edition β mwah, go route some interrupts, bestie πβ¨π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms