Move optionroms definitions into a separate header
authorJulian Pidancet <julian.pidancet@gmail.com>
Mon, 19 Dec 2011 05:07:54 +0000 (05:07 +0000)
committerKevin O'Connor <kevin@koconnor.net>
Wed, 21 Dec 2011 04:13:05 +0000 (23:13 -0500)
Create optionroms.h so the VGA rom can reuse the definitions.

Signed-off-by: Julian Pidancet <julian.pidancet@gmail.com>
src/optionroms.c
src/optionroms.h [new file with mode: 0644]

index 2832eab1ab42b696292faf3eec1090ac0f99d003..725767bc81356103ab4f0884a3065eae3f8f54a2 100644 (file)
 #include "pci_ids.h" // PCI_CLASS_DISPLAY_VGA
 #include "boot.h" // IPL
 #include "paravirt.h" // qemu_cfg_*
-
+#include "optionroms.h" // struct rom_header
 
 /****************************************************************
  * Definitions
  ****************************************************************/
 
-struct rom_header {
-    u16 signature;
-    u8 size;
-    u8 initVector[4];
-    u8 reserved[17];
-    u16 pcioffset;
-    u16 pnpoffset;
-} PACKED;
-
-struct pci_data {
-    u32 signature;
-    u16 vendor;
-    u16 device;
-    u16 vitaldata;
-    u16 dlen;
-    u8 drevision;
-    u8 class_lo;
-    u16 class_hi;
-    u16 ilen;
-    u16 irevision;
-    u8 type;
-    u8 indicator;
-    u16 reserved;
-} PACKED;
-
-struct pnp_data {
-    u32 signature;
-    u8 revision;
-    u8 len;
-    u16 nextoffset;
-    u8 reserved_08;
-    u8 checksum;
-    u32 devid;
-    u16 manufacturer;
-    u16 productname;
-    u8 type_lo;
-    u16 type_hi;
-    u8 dev_flags;
-    u16 bcv;
-    u16 dv;
-    u16 bev;
-    u16 reserved_1c;
-    u16 staticresource;
-} PACKED;
-
-#define OPTION_ROM_SIGNATURE 0xaa55
-#define OPTION_ROM_ALIGN 2048
-#define OPTION_ROM_INITVECTOR offsetof(struct rom_header, initVector[0])
-#define PCI_ROM_SIGNATURE 0x52494350 // PCIR
-#define PCIROM_CODETYPE_X86 0
-
 // The end of the last deployed rom.
 u32 RomEnd = BUILD_ROM_START;
 
diff --git a/src/optionroms.h b/src/optionroms.h
new file mode 100644 (file)
index 0000000..94ca4ae
--- /dev/null
@@ -0,0 +1,59 @@
+#ifndef __OPTIONROMS_H
+#define __OPTIONROMS_H
+
+#include "types.h" // u32
+
+#define OPTION_ROM_SIGNATURE 0xaa55
+
+struct rom_header {
+    u16 signature;
+    u8 size;
+    u8 initVector[4];
+    u8 reserved[17];
+    u16 pcioffset;
+    u16 pnpoffset;
+} PACKED;
+
+#define PCI_ROM_SIGNATURE 0x52494350 // "PCIR"
+
+struct pci_data {
+    u32 signature;
+    u16 vendor;
+    u16 device;
+    u16 vitaldata;
+    u16 dlen;
+    u8 drevision;
+    u8 class_lo;
+    u16 class_hi;
+    u16 ilen;
+    u16 irevision;
+    u8 type;
+    u8 indicator;
+    u16 reserved;
+} PACKED;
+
+struct pnp_data {
+    u32 signature;
+    u8 revision;
+    u8 len;
+    u16 nextoffset;
+    u8 reserved_08;
+    u8 checksum;
+    u32 devid;
+    u16 manufacturer;
+    u16 productname;
+    u8 type_lo;
+    u16 type_hi;
+    u8 dev_flags;
+    u16 bcv;
+    u16 dv;
+    u16 bev;
+    u16 reserved_1c;
+    u16 staticresource;
+} PACKED;
+
+#define OPTION_ROM_ALIGN 2048
+#define OPTION_ROM_INITVECTOR offsetof(struct rom_header, initVector[0])
+#define PCIROM_CODETYPE_X86 0
+
+#endif