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 <matthieu@herbb.eu>
Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
1 file changed