[SeaBIOS] [PATCH 4/4] Remove pci_writel() and pci_readl() functions.

Kevin O'Connor kevin at koconnor.net
Tue Dec 31 04:24:15 CET 2013


These functions are no longer used.  Going forward it's better to move
a driver to full 32bit mode then to use these functions.

Signed-off-by: Kevin O'Connor <kevin at koconnor.net>
---
 src/hw/pci.c | 46 ----------------------------------------------
 src/hw/pci.h |  4 ----
 2 files changed, 50 deletions(-)

diff --git a/src/hw/pci.c b/src/hw/pci.c
index 6c9aa81..caf9265 100644
--- a/src/hw/pci.c
+++ b/src/hw/pci.c
@@ -234,49 +234,3 @@ pci_reboot(void)
     outb(v|6, PORT_PCI_REBOOT); /* Actually do the reset */
     udelay(50);
 }
-
-// helper functions to access pci mmio bars from real mode
-
-u32 VISIBLE32FLAT
-pci_readl_32(u32 addr)
-{
-    dprintf(9, "32: pci read : %x\n", addr);
-    return readl((void*)addr);
-}
-
-u32 pci_readl(u32 addr)
-{
-    if (MODESEGMENT) {
-        dprintf(9, "16: pci read : %x\n", addr);
-        extern void _cfunc32flat_pci_readl_32(u32 addr);
-        return call32(_cfunc32flat_pci_readl_32, addr, -1);
-    } else {
-        return pci_readl_32(addr);
-    }
-}
-
-struct reg32 {
-    u32 addr;
-    u32 data;
-};
-
-void VISIBLE32FLAT
-pci_writel_32(struct reg32 *reg32)
-{
-    dprintf(9, "32: pci write: %x, %x (%p)\n", reg32->addr, reg32->data, reg32);
-    writel((void*)(reg32->addr), reg32->data);
-}
-
-void pci_writel(u32 addr, u32 val)
-{
-    struct reg32 reg32 = { .addr = addr, .data = val };
-    if (MODESEGMENT) {
-        dprintf(9, "16: pci write: %x, %x (%x:%p)\n",
-                reg32.addr, reg32.data, GET_SEG(SS), &reg32);
-        void *flatptr = MAKE_FLATPTR(GET_SEG(SS), &reg32);
-        extern void _cfunc32flat_pci_writel_32(struct reg32 *reg32);
-        call32(_cfunc32flat_pci_writel_32, (u32)flatptr, -1);
-    } else {
-        pci_writel_32(&reg32);
-    }
-}
diff --git a/src/hw/pci.h b/src/hw/pci.h
index 9c7351d..167a027 100644
--- a/src/hw/pci.h
+++ b/src/hw/pci.h
@@ -118,8 +118,4 @@ struct pci_device *pci_find_init_device(const struct pci_device_id *ids
                                         , void *arg);
 void pci_reboot(void);
 
-// helper functions to access pci mmio bars from real mode
-u32 pci_readl(u32 addr);
-void pci_writel(u32 addr, u32 val);
-
 #endif
-- 
1.8.3.1




More information about the SeaBIOS mailing list