From 118b792662dfcbd630c2224e844963549d4ebe92 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Thu, 24 Sep 2020 10:43:48 +0200 Subject: pci: factor out pci bar allocation. Factor out pci bar allocation into a separate pci_setup_alloc() function so it can also be used without running the platform setup code. Signed-off-by: Gerd Hoffmann --- src/fw/pciinit.c | 6 ++++++ src/util.h | 1 + 2 files changed, 7 insertions(+) diff --git a/src/fw/pciinit.c b/src/fw/pciinit.c index d25931bb..0aaf626e 100644 --- a/src/fw/pciinit.c +++ b/src/fw/pciinit.c @@ -1164,6 +1164,12 @@ pci_setup(void) pcimem_start = RamSize; pci_bios_init_platform(); + pci_setup_alloc(); +} + +void +pci_setup_alloc(void) +{ dprintf(1, "=== PCI new allocation pass #1 ===\n"); struct pci_bus *busses = malloc_tmp(sizeof(*busses) * (MaxPCIBus + 1)); if (!busses) { diff --git a/src/util.h b/src/util.h index f3695ac5..f31fd46f 100644 --- a/src/util.h +++ b/src/util.h @@ -139,6 +139,7 @@ extern u64 pcimem_start, pcimem_end; extern u64 pcimem64_start, pcimem64_end; extern const u8 pci_irqs[4]; void pci_setup(void); +void pci_setup_alloc(void); void pci_resume(void); // fw/pirtable.c -- cgit