diff options
Diffstat (limited to 'util/msrtool/msrtool.c')
-rw-r--r-- | util/msrtool/msrtool.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/util/msrtool/msrtool.c b/util/msrtool/msrtool.c index 6f0b3a0109..5742a1765c 100644 --- a/util/msrtool/msrtool.c +++ b/util/msrtool/msrtool.c @@ -25,6 +25,7 @@ #include <sys/stat.h> #include <fcntl.h> #include <errno.h> +#include <pci/pci.h> #include "msrtool.h" @@ -36,6 +37,8 @@ const struct targetdef **targets = NULL; const struct sysdef *sys = NULL; uint8_t reserved = 0, verbose = 0, quiet = 0; +struct pci_access *pacc = NULL; + static struct targetdef alltargets[] = { { "geodelx", "AMD Geode(tm) LX", geodelx_probe, geodelx_msrs }, { "cs5536", "AMD Geode(tm) CS5536", cs5536_probe, cs5536_msrs }, @@ -296,6 +299,14 @@ int main(int argc, char *argv[]) { printf_quiet("msrtool %s\n", VERSION); + pacc = pci_alloc(); + if (NULL == pacc) { + fprintf(stderr, "Could not initialize PCI library! pci_alloc() failed.\n"); + return 1; + } + pci_init(pacc); + pci_scan_bus(pacc); + if (!sys && !input && !listknown) for (sys = allsystems; !SYSTEM_ISEOT(*sys); sys++) { printf_verbose("Probing for system %s: %s\n", sys->name, sys->prettyname); |