Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 310620
b: refs/heads/master
c: eeaaa96
h: refs/heads/master
v: v3
  • Loading branch information
Don Zickus authored and Ingo Molnar committed Jun 8, 2012
1 parent bab40a8 commit 6462966
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d5d2d2eea84b0d8450b082edbc3dbde41fb8bfd8
refs/heads/master: eeaaa96a3a2134a174100afd129bb0891d05f4b2
14 changes: 14 additions & 0 deletions trunk/arch/x86/include/asm/nmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,20 @@ struct nmiaction {
__register_nmi_handler((t), &fn##_na); \
})

/*
* For special handlers that register/unregister in the
* init section only. This should be considered rare.
*/
#define register_nmi_handler_initonly(t, fn, fg, n) \
({ \
static struct nmiaction fn##_na __initdata = { \
.handler = (fn), \
.name = (n), \
.flags = (fg), \
}; \
__register_nmi_handler((t), &fn##_na); \
})

int __register_nmi_handler(unsigned int, struct nmiaction *);

void unregister_nmi_handler(unsigned int, const char *);
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/x86/kernel/nmi_selftest.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ static int __init nmi_unk_cb(unsigned int val, struct pt_regs *regs)
static void __init init_nmi_testsuite(void)
{
/* trap all the unknown NMIs we may generate */
register_nmi_handler(NMI_UNKNOWN, nmi_unk_cb, 0, "nmi_selftest_unk");
register_nmi_handler_initonly(NMI_UNKNOWN, nmi_unk_cb, 0, "nmi_selftest_unk");
}

static void __init cleanup_nmi_testsuite(void)
Expand All @@ -64,7 +64,7 @@ static void __init test_nmi_ipi(struct cpumask *mask)
{
unsigned long timeout;

if (register_nmi_handler(NMI_LOCAL, test_nmi_ipi_callback,
if (register_nmi_handler_initonly(NMI_LOCAL, test_nmi_ipi_callback,
NMI_FLAG_FIRST, "nmi_selftest")) {
nmi_fail = FAILURE;
return;
Expand Down

0 comments on commit 6462966

Please sign in to comment.