mirror of https://github.com/l4ka/pistachio.git
- Add function to broadcast NMI
This commit is contained in:
parent
dff75e1e94
commit
530c77a309
|
@ -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__ */
|
||||
|
|
Loading…
Reference in New Issue