[SeaBIOS] [PATCH 11/23] Move pirtable definitions from hw/pci.h to std/pirtable.h and util.h.

Kevin O'Connor kevin at koconnor.net
Sun Sep 15 07:10:26 CEST 2013


Signed-off-by: Kevin O'Connor <kevin at koconnor.net>
---
 src/fw/biostables.c |  2 +-
 src/fw/pirtable.c   |  2 +-
 src/hw/pci.h        | 40 ----------------------------------------
 src/pcibios.c       |  1 +
 src/std/pirtable.h  | 35 +++++++++++++++++++++++++++++++++++
 src/util.h          |  4 ++++
 6 files changed, 42 insertions(+), 42 deletions(-)
 create mode 100644 src/std/pirtable.h

diff --git a/src/fw/biostables.c b/src/fw/biostables.c
index 8fa9fac..a51e8ee 100644
--- a/src/fw/biostables.c
+++ b/src/fw/biostables.c
@@ -6,11 +6,11 @@
 
 #include "acpi.h" // struct rsdp_descriptor
 #include "config.h" // CONFIG_*
-#include "hw/pci.h" // struct pir_header
 #include "malloc.h" // malloc_fseg
 #include "mptable.h" // MPTABLE_SIGNATURE
 #include "output.h" // dprintf
 #include "smbios.h" // struct smbios_entry_point
+#include "std/pirtable.h" // struct pir_header
 #include "string.h" // memcpy
 #include "util.h" // copy_table
 
diff --git a/src/fw/pirtable.c b/src/fw/pirtable.c
index bd4a6aa..ee2659d 100644
--- a/src/fw/pirtable.c
+++ b/src/fw/pirtable.c
@@ -6,8 +6,8 @@
 // This file may be distributed under the terms of the GNU LGPLv3 license.
 
 #include "config.h" // CONFIG_*
-#include "hw/pci.h" // struct pir_header
 #include "output.h" // dprintf
+#include "std/pirtable.h" // struct pir_header
 #include "string.h" // checksum
 
 struct pir_header *PirAddr VARFSEG;
diff --git a/src/hw/pci.h b/src/hw/pci.h
index 7760d21..8fccefc 100644
--- a/src/hw/pci.h
+++ b/src/hw/pci.h
@@ -118,44 +118,4 @@ void pci_reboot(void);
 u32 pci_readl(u32 addr);
 void pci_writel(u32 addr, u32 val);
 
-// pirtable.c
-void pirtable_setup(void);
-
-
-/****************************************************************
- * PIR table
- ****************************************************************/
-
-struct link_info {
-    u8 link;
-    u16 bitmap;
-} PACKED;
-
-struct pir_slot {
-    u8 bus;
-    u8 dev;
-    struct link_info links[4];
-    u8 slot_nr;
-    u8 reserved;
-} PACKED;
-
-struct pir_header {
-    u32 signature;
-    u16 version;
-    u16 size;
-    u8 router_bus;
-    u8 router_devfunc;
-    u16 exclusive_irqs;
-    u32 compatible_devid;
-    u32 miniport_data;
-    u8 reserved[11];
-    u8 checksum;
-    struct pir_slot slots[0];
-} PACKED;
-
-extern struct pir_header *PirAddr;
-
-#define PIR_SIGNATURE 0x52495024 // $PIR
-
-
 #endif
diff --git a/src/pcibios.c b/src/pcibios.c
index 8e7e1f9..7e5d972 100644
--- a/src/pcibios.c
+++ b/src/pcibios.c
@@ -10,6 +10,7 @@
 #include "hw/pci.h" // pci_config_readl
 #include "hw/pci_regs.h" // PCI_VENDOR_ID
 #include "output.h" // dprintf
+#include "std/pirtable.h" // struct pir_header
 #include "string.h" // checksum
 #include "util.h" // handle_1ab1
 
diff --git a/src/std/pirtable.h b/src/std/pirtable.h
new file mode 100644
index 0000000..9de3a43
--- /dev/null
+++ b/src/std/pirtable.h
@@ -0,0 +1,35 @@
+#ifndef __PIRTABLE_H
+#define __PIRTABLE_H
+
+#include "types.h" // u32
+
+struct link_info {
+    u8 link;
+    u16 bitmap;
+} PACKED;
+
+struct pir_slot {
+    u8 bus;
+    u8 dev;
+    struct link_info links[4];
+    u8 slot_nr;
+    u8 reserved;
+} PACKED;
+
+struct pir_header {
+    u32 signature;
+    u16 version;
+    u16 size;
+    u8 router_bus;
+    u8 router_devfunc;
+    u16 exclusive_irqs;
+    u32 compatible_devid;
+    u32 miniport_data;
+    u8 reserved[11];
+    u8 checksum;
+    struct pir_slot slots[0];
+} PACKED;
+
+#define PIR_SIGNATURE 0x52495024 // $PIR
+
+#endif // pirtable.h
diff --git a/src/util.h b/src/util.h
index 2712f46..2c65494 100644
--- a/src/util.h
+++ b/src/util.h
@@ -60,6 +60,10 @@ void qemu_prep_reset(void);
 extern const u8 pci_irqs[4];
 void pci_setup(void);
 
+// fw/pirtable.c
+extern struct pir_header *PirAddr;
+void pirtable_setup(void);
+
 // fw/smm.c
 void smm_device_setup(void);
 void smm_setup(void);
-- 
1.8.3.1




More information about the SeaBIOS mailing list