riscv_get_hart_index(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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, iykyk
  • hart_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