register_nmi_handler(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– register_nmi_handler(9) πŸ’–

okay so bestie, welcome to the Kernel API Manual β€” this page is all about register_nmi_handler and it's lowkey iconic 🫢✨


πŸŽ€ NAME πŸŽ€

register_nmi_handler β€” Register a handler for a specific NMI type πŸ’…


✨ SYNOPSIS ✨

register_nmi_handler (t , fn , fg , n , init... );

🌸 ARGUMENTS 🌸

  • t β€” NMI type, like NMI_LOCAL fr fr.
  • fn β€” the NMI handler itself πŸ‘‘
  • fg β€” the flags associated with the NMI handler 🚩
  • n β€” name of the NMI handler 🏷️
  • init β€” optional __init* attributes for struct nmiaction ✨

πŸ¦‹ DESCRIPTION πŸ¦‹

So what it does: it adds the provided handler to the list of handlers for the specified NMI type 🫢 Handlers flagged with NMI_FLAG_FIRST would be executed first β€” yes, first is first, no cap πŸ’…

Sometimes the source of an NMI can't be reliably determined, which results in an NMI being tagged as "unknown" 😭 When that happens, register an additional handler using the NMI type - NMI_UNKNOWN to handle such cases. The caller would get one last chance to assume responsibility for the NMI πŸ‘€πŸ”₯


πŸ’€ RETURN πŸ’€

0 on success, or an error code on failure 😭 manifesting zero, but prepare for the error code bestie.


🌈 SEE ALSO 🌈

  • Kernel file ./arch/x86/include/asm/nmi.h enum (anonymous)(9) πŸ‘€
  • unregister_nmi_handler(9) β€” the counterpart, obviously πŸ’…

and yeah, this lil page's source/version is ./arch/x86/include/asm, dated October 2026, and it's serving register_nmi_handler(9) energy β€” periodt πŸ’–πŸŽ€

πŸ“¦ where this page comes from