X-Git-Url: http://git.joshuawise.com/netwatch.git/blobdiff_plain/8a677ebb8955dbe1b09e755dbb8343a3b8fdddb1..0cd80c5181dfee5d7853de038f08303c6a33c01b:/ich2/smi.c?ds=sidebyside diff --git a/ich2/smi.c b/ich2/smi.c index 0a0ddf4..7f96421 100644 --- a/ich2/smi.c +++ b/ich2/smi.c @@ -42,7 +42,10 @@ void smi_poll() if (sts & ICH2_SMI_STS_BIOS_STS) { - output("Unhandled: BIOS_STS"); + if (_handlers[SMI_EVENT_GBL_RLS] == SMI_HANDLER_NONE) + output("Unhandled: BIOS_STS"); + else if (_handlers[SMI_EVENT_GBL_RLS] != SMI_HANDLER_IGNORE) + _handlers[SMI_EVENT_GBL_RLS](SMI_EVENT_GBL_RLS); outl(_get_PMBASE() + ICH2_PMBASE_SMI_STS, ICH2_SMI_STS_BIOS_STS); } @@ -205,6 +208,11 @@ int smi_enable_event(smi_event_t ev) inl(_get_PMBASE() + ICH2_PMBASE_DEVTRAP_EN) | ICH2_DEVTRAP_EN_KBC_TRP_EN); return 0; + case SMI_EVENT_GBL_RLS: + outl(_get_PMBASE() + ICH2_PMBASE_SMI_EN, + inl(_get_PMBASE() + ICH2_PMBASE_SMI_EN) | + ICH2_SMI_EN_BIOS_EN); + return 0; default: return -1; } @@ -224,6 +232,11 @@ int smi_disable_event(smi_event_t ev) inl(_get_PMBASE() + ICH2_PMBASE_DEVTRAP_EN) & ~ICH2_DEVTRAP_EN_KBC_TRP_EN); return 0; + case SMI_EVENT_GBL_RLS: + outl(_get_PMBASE() + ICH2_PMBASE_SMI_EN, + inl(_get_PMBASE() + ICH2_PMBASE_SMI_EN) & + ~ICH2_SMI_EN_BIOS_EN); + return 0; default: return -1; }