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