]>
Commit | Line | Data |
---|---|---|
85bc8ca6 JW |
1 | #include <smi.h> |
2 | #include <pci.h> | |
3 | #include <io.h> | |
4 | #include <stdint.h> | |
5 | ||
6 | uint16_t _get_PMBASE() | |
7 | { | |
8 | return pci_read32(0, 0, 0, 0x40) & 0xFF80; | |
9 | } | |
10 | ||
11 | void smi_disable() | |
12 | { | |
13 | unsigned short smi_en = _get_PMBASE() + 0x30; | |
14 | outl(smi_en, inl(smi_en) & ~0x0001); | |
15 | } | |
16 | ||
17 | void smi_enable() | |
18 | { | |
19 | unsigned short smi_en = _get_PMBASE() + 0x30; | |
20 | outl(smi_en, inl(smi_en) | 0x0001); | |
21 | } | |
22 | ||
23 | unsigned long smi_status() | |
24 | { | |
25 | unsigned short smi_sts = _get_PMBASE() + 0x34; | |
26 | return inl(smi_sts); | |
27 | } |