What reassert_nmi() in default_do_nmi() is for?

From: Huang Ying
Date: Mon Aug 30 2010 - 04:56:40 EST


Hi, All,

When reading NMI handler code, I find there is reassert_nmi() in the end
of default_do_nmi(). And it is only called if the reason & 0xc0 != 0
(reason = inb(0x61)).

The comments for it is as follow:

/*
* Reassert NMI in case it became active meanwhile
* as it's edge-triggered:
*/
reassert_nmi();

The implementation of reassert_nmi is as follow:

static inline void reassert_nmi(void)
{
int old_reg = -1;

if (do_i_have_lock_cmos())
old_reg = current_lock_cmos_reg();
else
lock_cmos(0); /* register doesn't matter here */
outb(0x8f, 0x70);
inb(0x71); /* dummy */
outb(0x0f, 0x70);
inb(0x71); /* dummy */
if (old_reg >= 0)
outb(old_reg, 0x70);
else
unlock_cmos();
}

I can not understand the code and the logic. Can anyone explain it in
more detail?

Thanks,
Huang Ying


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/