- Add function to broadcast NMI

This commit is contained in:
Jan Stoess 2007-12-07 19:02:22 +01:00
parent dff75e1e94
commit 530c77a309
1 changed files with 16 additions and 0 deletions

View File

@ -298,6 +298,7 @@ public:
void send_nmi(u8_t apic_id);
void send_ipi(u8_t apic_id, u8_t vector);
void broadcast_ipi(u8_t vector, bool self = false);
void broadcast_nmi(bool self = false);
};
@ -419,4 +420,19 @@ INLINE void local_apic_t<base>::broadcast_ipi(u8_t vector, bool self)
write_reg(APIC_INTR_CMD1, reg.raw);
}
template <word_t base>
INLINE void local_apic_t<base>::broadcast_nmi(bool self)
{
command_reg_t reg;
reg.raw = read_reg(APIC_INTR_CMD1);
reg.x.vector = 0;
reg.x.delivery_mode = nmi;
reg.x.destination = 2 | (self ? 0 : 1);
reg.x.destination_mode = 0;
reg.x.level = 1;
reg.x.trigger_mode = 1;
write_reg(APIC_INTR_CMD1, reg.raw);
}
#endif /* !__ARCH__X86__APIC_H__ */