PCI_BAR_IOBASE() macro for bit extraction
This commit is contained in:
@@ -48,6 +48,8 @@ typedef union {
|
||||
#define PCI_DEV_PER_BUS 32
|
||||
#define PCI_FN_PER_DEV 32
|
||||
|
||||
#define PCI_BAR_IOBASE(bar) ((bar) & 0xFFFFFFFC)
|
||||
|
||||
uint32_t pci_read32(PciDev dev, uint32_t field);
|
||||
uint16_t pci_read16(PciDev dev, uint32_t field);
|
||||
uint8_t pci_read8(PciDev dev, uint32_t field);
|
||||
|
||||
@@ -162,7 +162,7 @@ void pci_qemu_pci_serial_init(void) {
|
||||
|
||||
LOG("pci", "QEMU_PCI_SERIAL bar0=0x%x\n", bar0);
|
||||
|
||||
uint16_t iobase = bar0 & 0xFFFFFFFC;
|
||||
uint16_t iobase = PCI_BAR_IOBASE(bar0);
|
||||
LOG("pci", "QEMU_PCI_SERIAL iobase=0x%x\n", iobase);
|
||||
|
||||
QEMU_PCI_SERIAL_DEV.iobase = iobase;
|
||||
|
||||
Reference in New Issue
Block a user