outlog();
}
+void kbc_handler(smi_event_t ev)
+{
+ pci_dump();
+}
+
void smi_entry(void)
{
char statstr[512];
sprintf(statstr, "15-412! %08x %08x", smi_status(), counter);
strblit(statstr, 0, 0);
- if (inl(0x834) & 0x1000)
- {
- if (inl(0x844) & 0x1000) /* devact_sts */
- {
- pci_dump();
- outl(0x844, 0x1000); /* ack it */
- }
- }
if (inl(0x840) & 0x1000)
{
pci_dump();
extern int _bss, _bssend;
extern void timer_handler(smi_event_t ev);
+extern void kbc_handler(smi_event_t ev);
void __firstrun_start() {
unsigned char *bp;
/* Turn on the SMIs we want */
smi_disable();
+
smi_register_handler(SMI_EVENT_FAST_TIMER, timer_handler);
smi_enable_event(SMI_EVENT_FAST_TIMER);
- outb(0x848, ICH2_DEVTRAP_EN_KBC_TRP_EN);
+
+ smi_register_handler(SMI_EVENT_DEVTRAP_KBC, kbc_handler);
+ smi_enable_event(SMI_EVENT_DEVTRAP_KBC);
+
smi_enable();
smram_restore_state(smram);
unsigned short mon_smi = inw(_get_PMBASE() + ICH2_PMBASE_MON_SMI);
unsigned long devact_sts = inl(_get_PMBASE() + ICH2_PMBASE_DEVACT_STS);
unsigned long devtrap_en = inl(_get_PMBASE() + ICH2_PMBASE_DEVTRAP_EN);
+
+ if (devact_sts & ICH2_DEVACT_STS_KBC_ACT_STS)
+ {
+ if (_handlers[SMI_EVENT_DEVTRAP_KBC] == SMI_HANDLER_NONE)
+ output("Unhandled: DEVACT_KBC_ACT_STS");
+ else if (_handlers[SMI_EVENT_DEVTRAP_KBC] != SMI_HANDLER_IGNORE)
+ _handlers[SMI_EVENT_DEVTRAP_KBC](SMI_EVENT_DEVTRAP_KBC);
+ outl(_get_PMBASE() + ICH2_PMBASE_DEVACT_STS, ICH2_DEVACT_STS_KBC_ACT_STS);
+ }
+
+ /* Refresh register cache so that we can print unhandleds as needed. */
+ mon_smi = inw(_get_PMBASE() + ICH2_PMBASE_MON_SMI);
+ devact_sts = inl(_get_PMBASE() + ICH2_PMBASE_DEVACT_STS);
+ devtrap_en = inl(_get_PMBASE() + ICH2_PMBASE_DEVTRAP_EN);
+
if (((mon_smi & 0x0F00) >> 8) & ((mon_smi & 0xF000) >> 12))
outputf("Unhandled: MON_SMI (%04x)", mon_smi);
if (devact_sts & devtrap_en)
inl(_get_PMBASE() + ICH2_PMBASE_SMI_EN) |
ICH2_SMI_EN_SWSMI_TMR_EN);
return 0;
+ case SMI_EVENT_DEVTRAP_KBC:
+ outl(_get_PMBASE() + ICH2_PMBASE_DEVTRAP_EN,
+ inl(_get_PMBASE() + ICH2_PMBASE_DEVTRAP_EN) |
+ ICH2_DEVTRAP_EN_KBC_TRP_EN);
+ return 0;
default:
return -1;
}
inl(_get_PMBASE() + ICH2_PMBASE_SMI_EN) &
~ICH2_SMI_EN_SWSMI_TMR_EN);
return 0;
+ case SMI_EVENT_DEVTRAP_KBC:
+ outl(_get_PMBASE() + ICH2_PMBASE_DEVTRAP_EN,
+ inl(_get_PMBASE() + ICH2_PMBASE_DEVTRAP_EN) &
+ ~ICH2_DEVTRAP_EN_KBC_TRP_EN);
+ return 0;
default:
return -1;
}