Use PCIOCREADMASK on OpenBSD.
If the machdep.allowaperture sysctl(8) variable is set to 0, writing to PCI config space is not allowed. So instead of writing 0xffffffff to the BARs in order to determine their size, use the PCIOCREADMASK ioctl(2) which returns the mask of changeable bits that was saved by the kernel when the devices was initially probed. Reviewed-by: Matthieu Herrb <email@example.com> Signed-off-by: Mark Kettenis <firstname.lastname@example.org>
Showing with 25 additions and 6 deletions