[SeaBIOS] [PATCH 18/23] Move pnpbios definition to new file std/pnpbios.h.

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


Signed-off-by: Kevin O'Connor <kevin at koconnor.net>
---
 src/optionroms.c  |  1 +
 src/pnpbios.c     | 19 +------------------
 src/std/pnpbios.h | 24 ++++++++++++++++++++++++
 src/util.h        |  1 -
 4 files changed, 26 insertions(+), 19 deletions(-)
 create mode 100644 src/std/pnpbios.h

diff --git a/src/optionroms.c b/src/optionroms.c
index 8f9bb31..04afb2c 100644
--- a/src/optionroms.c
+++ b/src/optionroms.c
@@ -17,6 +17,7 @@
 #include "romfile.h" // romfile_loadint
 #include "stacks.h" // farcall16big
 #include "std/optionrom.h" // struct rom_header
+#include "std/pnpbios.h" // PNP_SIGNATURE
 #include "string.h" // memset
 #include "util.h" // get_pnp_offset
 
diff --git a/src/pnpbios.c b/src/pnpbios.c
index 87eea9f..95ce21f 100644
--- a/src/pnpbios.c
+++ b/src/pnpbios.c
@@ -7,25 +7,10 @@
 #include "config.h" // BUILD_BIOS_ADDR
 #include "farptr.h" // SET_FARVAR
 #include "output.h" // dprintf
+#include "std/pnpbios.h" // PNP_SIGNATURE
 #include "string.h" // checksum
 #include "util.h" // pnp_init
 
-struct pnpheader {
-    u32 signature;
-    u8 version;
-    u8 length;
-    u16 control;
-    u8 checksum;
-    u32 eventloc;
-    u16 real_ip;
-    u16 real_cs;
-    u16 prot_ip;
-    u32 prot_base;
-    u32 oemid;
-    u16 real_ds;
-    u32 prot_database;
-} PACKED;
-
 extern struct pnpheader PNPHEADER;
 extern char pnp_string[];
 
@@ -46,8 +31,6 @@ struct pnpheader PNPHEADER __aligned(16) VARFSEG = {
 char pnp_string[] __aligned(2) VARFSEG = " $PnP";
 #endif
 
-#define FUNCTION_NOT_SUPPORTED 0x82
-
 // BBS - Get Version and Installation Check
 static u16
 handle_pnp60(u16 *args)
diff --git a/src/std/pnpbios.h b/src/std/pnpbios.h
new file mode 100644
index 0000000..0871e3a
--- /dev/null
+++ b/src/std/pnpbios.h
@@ -0,0 +1,24 @@
+#ifndef __PNPHEADER_H
+#define __PNPHEADER_H
+
+#define PNP_SIGNATURE 0x506e5024 // $PnP
+
+struct pnpheader {
+    u32 signature;
+    u8 version;
+    u8 length;
+    u16 control;
+    u8 checksum;
+    u32 eventloc;
+    u16 real_ip;
+    u16 real_cs;
+    u16 prot_ip;
+    u32 prot_base;
+    u32 oemid;
+    u16 real_ds;
+    u32 prot_database;
+} PACKED;
+
+#define FUNCTION_NOT_SUPPORTED 0x82
+
+#endif // pnpheader.h
diff --git a/src/util.h b/src/util.h
index 95be57f..333d116 100644
--- a/src/util.h
+++ b/src/util.h
@@ -139,7 +139,6 @@ extern int HaveRunPost;
 void dma_setup(void);
 
 // pnpbios.c
-#define PNP_SIGNATURE 0x506e5024 // $PnP
 u16 get_pnp_offset(void);
 void pnp_init(void);
 
-- 
1.8.3.1




More information about the SeaBIOS mailing list