From b435dfd5e4f0c56fa229c63258fe4b73d6ed366c Mon Sep 17 00:00:00 2001 From: OBattler Date: Thu, 24 Oct 2024 22:06:53 +0200 Subject: [PATCH] PCI: Mask out the strict flag when checking if the added card is not on-board, fixes bridge adding. --- src/pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pci.c b/src/pci.c index b4f5eafe5..ab585c456 100644 --- a/src/pci.c +++ b/src/pci.c @@ -790,7 +790,7 @@ pci_add_card(uint8_t add_type, uint8_t (*read)(int func, int addr, void *priv), if (next_pci_card < PCI_CARDS_NUM) { dev = &pci_card_descs[next_pci_card]; - dev->type = add_type | PCI_ADD_STRICT; + dev->type = add_type | PCI_ADD_STRICT; dev->read = read; dev->write = write; dev->priv = priv; @@ -885,7 +885,7 @@ pci_register_cards(void) type = pci_card_descs[i].type; slot = pci_card_descs[i].slot; #endif - normal = (pci_card_descs[i].type == PCI_CARD_NORMAL); + normal = ((pci_card_descs[i].type & ~PCI_ADD_STRICT) == PCI_CARD_NORMAL); /* If this is a normal card, increase the next normal card index. */ if (normal)