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