[coreboot] detecting errors from libpci

Shadravan Fontanov shadravan.fontanov at googlemail.com
Tue Nov 25 19:50:15 CET 2008


Hello,

please, consider following code, reading the value in pci
configuration register and using the libpci library:
<start code>
pacc = pci_alloc();
pci_init(pacc);
pci_dev = pci_get_dev(pacc, PCI_DOMAIN, PCI_BUS, PCI_DEV, PCI_FUNC);
current_value = pci_read_byte(pci_dev, PCI_OFFSET);
pci_cleanup(pacc);

if(current_value == 0xff) {
  printf(Error\n");
  return -1;
}
<end code>

It is impossible that the value in the register is 0xff. This is how I
detect an error(for example: not sufficient read/write permissions).

Question: is there another possibility to detect errors from
reading/writing to pci registers(well, writing is not the problem, but
reading...)?

Regards

Shadravan




More information about the coreboot mailing list