]> Joshua Wise's Git repositories - netwatch.git/blobdiff - ich2/smi.c
Improve correctness of backtrace library.
[netwatch.git] / ich2 / smi.c
index 0a0ddf47cf45e23d23fe9a2b80e43b64d3639aa0..c9a1f0e8292592691b8d3cac423b44062b04e8d9 100644 (file)
@@ -1,3 +1,14 @@
+/* smi.c
+ * System management interrupt dispatch routines for ICH2 southbridge
+ * NetWatch system management mode administration console
+ *
+ * Copyright (c) 2008 Jacob Potter and Joshua Wise.  All rights reserved.
+ * This program is free software; you can redistribute and/or modify it under
+ * the terms found in the file LICENSE in the root of this source tree. 
+ *
+ */
+
+
 #include <smi.h>
 #include <pci.h>
 #include <io.h>
@@ -42,7 +53,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 +219,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 +243,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;
        }
This page took 0.026509 seconds and 4 git commands to generate.