arch/x86/include/asm/nmi.h
Source file repositories/reference/linux-study-clean/arch/x86/include/asm/nmi.h
File Facts
- System
- Linux kernel
- Corpus path
arch/x86/include/asm/nmi.h- Extension
.h- Size
- 3065 bytes
- Lines
- 109
- Domain
- Architecture Layer
- Bucket
- arch/x86
- Inferred role
- Architecture Layer: implementation source
- Status
- source implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/irq_work.hlinux/pm.hasm/irq.hasm/io.h
Detected Declarations
struct nmiaction
Annotated Snippet
struct nmiaction {
struct list_head list;
nmi_handler_t handler;
u64 max_duration;
unsigned long flags;
const char *name;
};
/**
* register_nmi_handler - Register a handler for a specific NMI type
* @t: NMI type (e.g. NMI_LOCAL)
* @fn: The NMI handler
* @fg: Flags associated with the NMI handler
* @n: Name of the NMI handler
* @init: Optional __init* attributes for struct nmiaction
*
* Adds the provided handler to the list of handlers for the specified
* NMI type. Handlers flagged with NMI_FLAG_FIRST would be executed first.
*
* Sometimes the source of an NMI can't be reliably determined which
* results in an NMI being tagged as "unknown". 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.
*/
#define register_nmi_handler(t, fn, fg, n, init...) \
({ \
static struct nmiaction init fn##_na = { \
.list = LIST_HEAD_INIT(fn##_na.list), \
.handler = (fn), \
.name = (n), \
.flags = (fg), \
}; \
__register_nmi_handler((t), &fn##_na); \
})
int __register_nmi_handler(unsigned int, struct nmiaction *);
/**
* unregister_nmi_handler - Unregister a handler for a specific NMI type
* @type: NMI type (e.g. NMI_LOCAL)
* @name: Name of the NMI handler used during registration
*
* Removes the handler associated with the specified NMI type from the
* NMI handler list. The "name" is used as a lookup key to identify the
* handler.
*/
void unregister_nmi_handler(unsigned int type, const char *name);
void set_emergency_nmi_handler(unsigned int type, nmi_handler_t handler);
void stop_nmi(void);
void restart_nmi(void);
void local_touch_nmi(void);
#endif /* _ASM_X86_NMI_H */
Annotation
- Immediate include surface: `linux/irq_work.h`, `linux/pm.h`, `asm/irq.h`, `asm/io.h`.
- Detected declarations: `struct nmiaction`.
- Atlas domain: Architecture Layer / arch/x86.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.