diff --git a/stand/i386/libfirewire/firewire.c b/stand/i386/libfirewire/firewire.c index 48403259873d..e0b0bf98dc1c 100644 --- a/stand/i386/libfirewire/firewire.c +++ b/stand/i386/libfirewire/firewire.c @@ -108,11 +108,11 @@ fw_probe(int index, struct fwohci_softc *sc) biospci_write_config(sc->locator, 0x4 /* command */, 0x6 /* enable bus master and memory mapped I/O */, - 1 /* word */); + BIOSPCI_16BITS); - biospci_read_config(sc->locator, 0x00 /*devid*/, 2 /*dword*/, + biospci_read_config(sc->locator, 0x00 /*devid*/, BIOSPCI_32BITS, &sc->devid); - biospci_read_config(sc->locator, 0x10 /*base_addr*/, 2 /*dword*/, + biospci_read_config(sc->locator, 0x10 /*base_addr*/, BIOSPCI_32BITS, &sc->base_addr); sc->handle = (uint32_t)PTOV(sc->base_addr); diff --git a/stand/i386/libi386/biospci.c b/stand/i386/libi386/biospci.c index 098e30caa5f1..7f038670c13b 100644 --- a/stand/i386/libi386/biospci.c +++ b/stand/i386/libi386/biospci.c @@ -285,7 +285,7 @@ biospci_enumerate(void) break; /* Read the device identifier from the nominated device */ - err = biospci_read_config(locator, 0, 2, &devid); + err = biospci_read_config(locator, 0, BIOSPCI_32BITS, &devid); if (err != 0) break; diff --git a/stand/i386/libi386/comconsole.c b/stand/i386/libi386/comconsole.c index f98a1f74d9d5..b9fcf032e185 100644 --- a/stand/i386/libi386/comconsole.c +++ b/stand/i386/libi386/comconsole.c @@ -263,7 +263,7 @@ comc_pcidev_handle(uint32_t locator) uint32_t port; if (biospci_read_config(locator & 0xffff, - (locator & 0xff0000) >> 16, 2, &port) == -1) { + (locator & 0xff0000) >> 16, BIOSPCI_32BITS, &port) == -1) { printf("Cannot read bar at 0x%x\n", locator); return (CMD_ERROR); } diff --git a/stand/i386/libi386/libi386.h b/stand/i386/libi386/libi386.h index e65a060acb77..297d493422b9 100644 --- a/stand/i386/libi386/libi386.h +++ b/stand/i386/libi386/libi386.h @@ -135,6 +135,13 @@ extern vm_offset_t memtop_copyin; /* memtop less heap size for the cases */ extern uint32_t high_heap_size; /* extended memory region available */ extern vm_offset_t high_heap_base; /* for use as the heap */ +/* + * Values for width parameter to biospci_{read,write}_config + */ +#define BIOSPCI_8BITS 0 +#define BIOSPCI_16BITS 1 +#define BIOSPCI_32BITS 2 + void biospci_detect(void); int biospci_find_devclass(uint32_t class, int index, uint32_t *locator); int biospci_read_config(uint32_t locator, int offset, int width, uint32_t *val);