[OpenBIOS] [PATCH 1/2] pci: fix compilation for architectures where OFMEM isn't available

Mark Cave-Ayland mark.cave-ayland at ilande.co.uk
Sat Jan 13 22:26:01 CET 2018


Commit 0d3345f9 "pci: add ob_pci_unmap() to unmap PCI memory" accidentally
broke compilation for architectures where OFMEM is unavailable such as x86.

Add the appropriate #if defined(CONFIG_OFMEM)...#endif block to ob_pci_unmap()
so that compilation can at least succeed for these architectures.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at ilande.co.uk>
---
 drivers/pci.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/pci.c b/drivers/pci.c
index 672dcd0..01c4374 100644
--- a/drivers/pci.c
+++ b/drivers/pci.c
@@ -402,7 +402,9 @@ static ucell ob_pci_map(uint32_t ba, ucell size) {
 }
 
 static void ob_pci_unmap(ucell virt, ucell size) {
+#if defined(CONFIG_OFMEM)
 	ofmem_unmap(virt, size); 
+#endif
 }
 
 /* ( pci-addr.lo pci-addr.mid pci-addr.hi size -- virt ) */
-- 
2.11.0




More information about the OpenBIOS mailing list