PCI: Fix and delegate bridge initialization on Dell riser machines

This commit is contained in:
RichardG867
2025-05-28 16:35:38 -03:00
parent 72a52318f5
commit 2b71002dab
6 changed files with 41 additions and 28 deletions

View File

@@ -855,10 +855,10 @@ pci_register_card(int pci_card)
/* Add an instance of the PCI bridge. */
void
pci_add_bridge(uint8_t agp, uint8_t (*read)(int func, int addr, void *priv), void (*write)(int func, int addr, uint8_t val, void *priv), void *priv, uint8_t *slot)
pci_add_bridge(uint8_t add_type, uint8_t (*read)(int func, int addr, void *priv), void (*write)(int func, int addr, uint8_t val, void *priv), void *priv, uint8_t *slot)
{
pci_card_t *card;
uint8_t bridge_slot = agp ? pci_find_slot(PCI_ADD_AGPBRIDGE, 0xff) : last_normal_pci_card_id;
uint8_t bridge_slot = (add_type == PCI_ADD_NORMAL) ? last_normal_pci_card_id : pci_find_slot(add_type, 0xff);
if (bridge_slot != PCI_CARD_INVALID) {
card = &pci_cards[bridge_slot];