]> Joshua Wise's Git repositories - netwatch.git/blobdiff - ich2/smi.c
Split reg-82801b out.
[netwatch.git] / ich2 / smi.c
index 3666a6c22cc1195f7b18abe4c3fa5e2b203fc6ba..6ca00c94618c30490006a6197455a78ff2951d35 100644 (file)
@@ -2,26 +2,27 @@
 #include <pci.h>
 #include <io.h>
 #include <stdint.h>
+#include <reg-82801b.h>
 
 uint16_t _get_PMBASE()
 {
-       return pci_read32(0, 31, 0, 0x40) & 0xFF80;
+       return pci_read32(ICH2_LPC_BUS, ICH2_LPC_DEV, ICH2_LPC_FN, ICH2_LPC_PCI_PMBASE) & ICH2_PMBASE_MASK;
 }
 
 void smi_disable()
 {
-       unsigned short smi_en = _get_PMBASE() + 0x30;
-       outl(smi_en, inl(smi_en) & ~0x0001);
+       unsigned short smi_en = _get_PMBASE() + ICH2_PMBASE_SMI_EN;
+       outl(smi_en, inl(smi_en) & ~ICH2_SMI_EN_GBL_SMI_EN);
 }
 
 void smi_enable()
 {
-       unsigned short smi_en = _get_PMBASE() + 0x30;
-       outl(smi_en, inl(smi_en) | 0x0001);
+       unsigned short smi_en = _get_PMBASE() + ICH2_PMBASE_SMI_EN;
+       outl(smi_en, inl(smi_en) | ICH2_SMI_EN_GBL_SMI_EN);
 }
 
 unsigned long smi_status()
 {
-       unsigned short smi_sts = _get_PMBASE() + 0x34;
+       unsigned short smi_sts = _get_PMBASE() + ICH2_PMBASE_SMI_STS;
        return inl(smi_sts);
 }
This page took 0.025836 seconds and 4 git commands to generate.