]>
Commit | Line | Data |
---|---|---|
0889f342 JP |
1 | #include <sys/io.h> |
2 | #include <reg-82801b.h> | |
3 | #include <string.h> | |
4 | #include <stdint.h> | |
ea6c242b | 5 | #include <stdlib.h> |
0889f342 JP |
6 | |
7 | static uint16_t _get_PMBASE() | |
8 | { | |
9 | static long pmbase = -1; | |
10 | ||
11 | if (pmbase == -1) | |
12 | pmbase = pci_read32(ICH2_LPC_BUS, ICH2_LPC_DEV, ICH2_LPC_FN, ICH2_LPC_PCI_PMBASE) & ICH2_PMBASE_MASK; | |
13 | ||
14 | return pmbase; | |
15 | } | |
16 | ||
17 | ||
ea6c242b | 18 | extern unsigned int poke(unsigned long addr); |
0889f342 JP |
19 | |
20 | int main(int argc, char **argv) | |
21 | { | |
22 | unsigned int res; | |
23 | ||
24 | if (iopl(3) < 0) | |
25 | { | |
26 | perror("iopl"); | |
27 | return 1; | |
28 | } | |
ea6c242b | 29 | |
0889f342 JP |
30 | res = poke(_get_PMBASE() + 0x04); |
31 | printf("found %p\n", res); | |
32 | } |