svn@coreboot.org wrote:
Author: stuge Date: 2008-11-25 03:03:16 +0100 (Tue, 25 Nov 2008) New Revision: 3770
Modified: trunk/util/msrtool/TODO trunk/util/msrtool/configure trunk/util/msrtool/msrtool.c trunk/util/msrtool/msrtool.h trunk/util/msrtool/sys.c Log: msrtool: Use libpci to let system and target probes find PCI devices.
And some more notes in TODO.
Signed-off-by: Peter Stuge peter@stuge.se Acked-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Modified: trunk/util/msrtool/TODO
--- trunk/util/msrtool/TODO 2008-11-24 20:23:23 UTC (rev 3769) +++ trunk/util/msrtool/TODO 2008-11-25 02:03:16 UTC (rev 3770) @@ -1,8 +1,9 @@ Systems
FreeBSD #defines: see svn diff -r 3697:3698 util/ +i586: assembly instruction system driver, may have to ignore -c CPU # option
Other ideas
Move MSR definitions and probe instructions into an external text file? -Handle PCI registers as well? +Handle PCI and port IO registers as well?
Modified: trunk/util/msrtool/configure
--- trunk/util/msrtool/configure 2008-11-24 20:23:23 UTC (rev 3769) +++ trunk/util/msrtool/configure 2008-11-25 02:03:16 UTC (rev 3770) @@ -135,6 +135,25 @@ test -n "$DEBUG" && myCFLAGS="-O2 -g" || myCFLAGS="-Os" CFLAGS="${CFLAGS} ${myCFLAGS} -Wall -Werror"
+cat > .config.c << EOF +#include <pci/pci.h> +struct pci_access *pacc; +int main(int argc, char *argv[]) +{ pacc = pci_alloc(); return 0; } +EOF
+pc_CFLAGS="$(pkg-config libpci --cflags 2>/dev/null)" +pc_LDFLAGS="$(pkg-config libpci --libs 2>/dev/null)" +CFLAGS=$(trycompile "libpci (from pciutils)" "${pc_CFLAGS}" "-I/usr/local/include") || {
- rm -f .config.c
- exit 1
Any reason why we don't just drink all the koolaid and use the full autoconf/automake/pkgconfig system in all its glory? This seems to be fairly prone to porting issues - especially the -I/usr/local/include bit.
Jordan