]> Joshua Wise's Git repositories - netwatch.git/blob - ich2/smi.c
08fcc64d4263d38713a37db79675d9d4ad2b7e4d
[netwatch.git] / ich2 / smi.c
1 #include <smi.h>
2 #include <pci.h>
3 #include <io.h>
4 #include <stdint.h>
5 #include <reg-82801b.h>
6
7 uint16_t _get_PMBASE()
8 {
9         return pci_read32(ICH2_LPC_BUS, ICH2_LPC_DEV, ICH2_LPC_FN, ICH2_LPC_PCI_PMBASE) & ICH2_PMBASE_MASK;
10 }
11
12 void smi_disable()
13 {
14         unsigned short smi_en = _get_PMBASE() + ICH2_PMBASE_SMI_EN;
15         outl(smi_en, inl(smi_en) & ~ICH2_SMI_EN_GBL_SMI_EN);
16 }
17
18 void smi_enable()
19 {
20         unsigned short smi_en = _get_PMBASE() + ICH2_PMBASE_SMI_EN;
21         outl(smi_en, inl(smi_en) | ICH2_SMI_EN_GBL_SMI_EN);
22 }
23
24 unsigned long smi_status()
25 {
26         unsigned short smi_sts = _get_PMBASE() + ICH2_PMBASE_SMI_STS;
27         return inl(smi_sts);
28 }
29
This page took 0.020671 seconds and 2 git commands to generate.