Am 29.06.2011 03:32 schrieb Stefan Reinauer: > On Tue, Jun 28, 2011 at 5:54 PM, Carl-Daniel Hailfinger > <[email protected]> wrote: > > > >>> 2. Due to issues with libpci, you can't use the same binary on machines with >>> PCI and without PCI. So for example, you can't program a SPI ROM onboard a >>> PCI card that is connected to your ARM SoC. >>> >> Could you explain more? IIRC some people were using flashrom on ARM >> (independent patch) with PCI support. Not calling any PCI functions >> should be enough to avoid any and all interactions between libpci and >> the hardware. >> > One of the problems is that if you call libpci's init function on a > system with no PCI support, libpci will not return an error but just > end the program right away. This makes it hard to have one binary that > works on PCI and non-PCI ARM systems. >
Just set pci_access->error to a function with printf signature (e.g. my_libpci_error_interceptor) before calling pci_init and make sure my_libpci_error_interceptor sets a global variable pci_failed=1 once it is called. That is ugly, but it should work. Regards, Carl-Daniel -- http://www.hailfinger.org/ _______________________________________________ flashrom mailing list [email protected] http://www.flashrom.org/mailman/listinfo/flashrom
