aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2024-02-08 19:44:11 +0100
committerHelge Deller <deller@gmx.de>2024-02-08 19:44:11 +0100
commit424f05599bf08e31252f79fc9901405c374ede31 (patch)
tree6e43401e72d43dbe20d703ae76c5c9f3fc198797
parent75d008843685d46f8791be49d7248db02c196bf0 (diff)
downloadseabios-hppa-424f05599bf08e31252f79fc9901405c374ede31.zip
seabios-hppa-424f05599bf08e31252f79fc9901405c374ede31.tar.gz
seabios-hppa-424f05599bf08e31252f79fc9901405c374ede31.tar.bz2
parisc: Fix hpa_name() to resolve & print PCI device
Signed-off-by: Helge Deller <deller@gmx.de>
-rw-r--r--src/parisc/parisc.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/parisc/parisc.c b/src/parisc/parisc.c
index 8813d33..2e66a95 100644
--- a/src/parisc/parisc.c
+++ b/src/parisc/parisc.c
@@ -370,7 +370,6 @@ static hppa_device_t *parisc_devices = machine_B160L.device_list;
static const char *hpa_name(unsigned long hpa)
{
- struct pci_device *pci;
int i;
#define DO(x) if (hpa == F_EXTEND(x)) return #x;
@@ -407,17 +406,12 @@ static const char *hpa_name(unsigned long hpa)
}
}
- /* could be a PCI device */
- foreachpci(pci) {
- unsigned long mem, mmio;
- mem = pci_config_readl(pci->bdf, PCI_BASE_ADDRESS_0);
- mem &= PCI_BASE_ADDRESS_MEM_MASK;
- if (hpa == mem)
- return "HPA_PCI_CARD_MEM";
- mmio = pci_config_readl(pci->bdf, PCI_BASE_ADDRESS_2);
- mmio &= PCI_BASE_ADDRESS_MEM_MASK;
- if (hpa == mem)
- return "HPA_PCI_CARD_MMIO";
+ /* search PCI devices */
+ hppa_device_t *dev = find_hpa_device(hpa);
+ if (dev) {
+ static char pci_dev_name[12];
+ snprintf(pci_dev_name, sizeof(pci_dev_name), "PCI_%pP", dev->pci);
+ return pci_dev_name;
}
return "UNKNOWN HPA";