]> Joshua Wise's Git repositories - netwatch.git/commitdiff
Merge nyus.joshuawise.com:/storage/git/netwatch
authorJoshua Wise <joshua@rebirth.joshuawise.com>
Fri, 26 Sep 2008 01:42:01 +0000 (21:42 -0400)
committerJoshua Wise <joshua@rebirth.joshuawise.com>
Fri, 26 Sep 2008 01:42:01 +0000 (21:42 -0400)
aseg/counter.c
aseg/firstrun.c
ich2/smi.c
include/smi.h

index 3c22c0545d4e2d96aa798742daebcd456332a453..4c53b59b3c65956459d58e8c6669245b8746fae7 100644 (file)
@@ -65,6 +65,15 @@ void kbc_handler(smi_event_t ev)
        pci_dump();
 }
 
+void gbl_rls_handler(smi_event_t ev)
+{
+       unsigned long ecx;
+       
+       ecx = *(unsigned char*)0xAFFD4;
+       dologf("ECX was %08x", ecx);
+       *(unsigned long*)0xAFFD4 = 0x2BADD00D;
+}
+
 void smi_entry(void)
 {
        char statstr[512];
index ec09a8218ecb07a2748f16b085b1b41ced594f08..e0e290466f9756895ba013fe8036de1316efd332 100644 (file)
@@ -9,6 +9,7 @@ extern int _bss, _bssend;
 
 extern void timer_handler(smi_event_t ev);
 extern void kbc_handler(smi_event_t ev);
+extern void gbl_rls_handler(smi_event_t ev);
 
 void __firstrun_start() {
        unsigned char *bp;
@@ -36,6 +37,9 @@ void __firstrun_start() {
        
        smi_register_handler(SMI_EVENT_DEVTRAP_KBC, kbc_handler);
        smi_enable_event(SMI_EVENT_DEVTRAP_KBC);
+       
+       smi_register_handler(SMI_EVENT_GBL_RLS, gbl_rls_handler);
+       smi_enable_event(SMI_EVENT_GBL_RLS);
 
        smi_enable();
        
index 0a0ddf47cf45e23d23fe9a2b80e43b64d3639aa0..7f9642183812738f5a4edb83e61fb972cc9057dd 100644 (file)
@@ -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;
        }
index e0fd0a06b04b382cc5f94eec05d967c8ba2b8748..69fd7efdd691fbafa43f2fb4fed0f070776874bd 100644 (file)
@@ -10,6 +10,7 @@ extern unsigned long smi_status();    /* Architecturally defined; for debugging onl
 typedef enum {
        SMI_EVENT_FAST_TIMER = 0,
        SMI_EVENT_DEVTRAP_KBC,
+       SMI_EVENT_GBL_RLS,
        SMI_EVENT_MAX
 } smi_event_t;
 
This page took 0.033325 seconds and 4 git commands to generate.