From 0924dee124acfd1f8ae96685720c7a4af068e843 Mon Sep 17 00:00:00 2001 From: Peter Stuge Date: Tue, 25 Nov 2008 02:03:16 +0000 Subject: msrtool: Use libpci to let system and target probes find PCI devices. And some more notes in TODO. Signed-off-by: Peter Stuge Acked-by: Carl-Daniel Hailfinger git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3770 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- util/msrtool/msrtool.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'util/msrtool/msrtool.c') 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 #include #include +#include #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); -- cgit v1.2.3