[SeaBIOS] [PATCH 19/23] Move pmm definitions to new file std/pmm.h.

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


Signed-off-by: Kevin O'Connor <kevin at koconnor.net>
---
 src/pmm.c     | 14 +-------------
 src/std/pmm.h | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+), 13 deletions(-)
 create mode 100644 src/std/pmm.h

diff --git a/src/pmm.c b/src/pmm.c
index cce0f29..be03bdb 100644
--- a/src/pmm.c
+++ b/src/pmm.c
@@ -8,23 +8,13 @@
 #include "config.h" // CONFIG_*
 #include "malloc.h" // _malloc
 #include "output.h" // dprintf
+#include "std/pmm.h" // PMM_SIGNATURE
 #include "string.h" // checksum
 #include "util.h" // pmm_init
 #include "x86.h" // __ffs
 
-struct pmmheader {
-    u32 signature;
-    u8 version;
-    u8 length;
-    u8 checksum;
-    struct segoff_s entry;
-    u8 reserved[5];
-} PACKED;
-
 extern struct pmmheader PMMHEADER;
 
-#define PMM_SIGNATURE 0x4d4d5024 // $PMM
-
 #if CONFIG_PMM
 struct pmmheader PMMHEADER __aligned(16) VARFSEG = {
     .signature = PMM_SIGNATURE,
@@ -33,8 +23,6 @@ struct pmmheader PMMHEADER __aligned(16) VARFSEG = {
 };
 #endif
 
-#define PMM_FUNCTION_NOT_SUPPORTED 0xffffffff
-
 // PMM - allocate
 static u32
 handle_pmm00(u16 *args)
diff --git a/src/std/pmm.h b/src/std/pmm.h
new file mode 100644
index 0000000..80027f3
--- /dev/null
+++ b/src/std/pmm.h
@@ -0,0 +1,19 @@
+#ifndef __PMM_H
+#define __PMM_H
+
+#include "types.h" // u32
+
+#define PMM_SIGNATURE 0x4d4d5024 // $PMM
+
+struct pmmheader {
+    u32 signature;
+    u8 version;
+    u8 length;
+    u8 checksum;
+    struct segoff_s entry;
+    u8 reserved[5];
+} PACKED;
+
+#define PMM_FUNCTION_NOT_SUPPORTED 0xffffffff
+
+#endif // pmm.h
-- 
1.8.3.1




More information about the SeaBIOS mailing list