On Sat, Jan 28, 2017 at 12:10:41PM +0100, Andrew Jones wrote: > How about just this instead (untested) > > bool pci_bar_is_valid(pcidevaddr_t dev, int bar_num) > { > assert(bar_num >= 0 && bar_num < PCI_BAR_NUM); > if (bar_num > 0 && pci_bar_is64(dev, bar_num - 1)) > return pci_bar_is_valid(dev, bar_num - 1); > return pci_bar_size(dev, bar_num); > } This one can not distinguish between PCI_BASE_ADDRESS_* flags and address bits of high part of a 64 bit address. However, it seems a newly introduced pci_dev::resource[] can be used for that. > Thanks, > drew