memdisk: mBFT includes the MDI
authorShao Miller <shao.miller@yrdsb.edu.on.ca>
Tue, 9 Mar 2010 22:13:26 +0000 (17:13 -0500)
committerShao Miller <shao.miller@yrdsb.edu.on.ca>
Fri, 11 Jun 2010 01:49:10 +0000 (01:49 +0000)
Instead of padding the mBFT so its size is correct, we
actually put the MDI struct in there, since the last
commit provided it.

Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
memdisk/mstructs.h

index 9e82818..b5f3722 100644 (file)
@@ -27,6 +27,9 @@ typedef union {
     uint32_t uint32;
 } real_addr_t;
 
+/* Forward declaration */
+struct mBFT;
+
 MEMDISK_PACKED_PREFIX
 struct safe_hook {
     uint8_t jump[3];           /* Max. three bytes for jump */
@@ -50,18 +53,6 @@ struct memdisk_header {
     struct safe_hook safe_hook;
 };
 
-/* Requirement for struct acpi_description_header */
-#include "../memdisk/acpi.h"
-
-MEMDISK_PACKED_PREFIX
-struct mBFT {
-    struct acpi_description_header acpi;
-    struct safe_hook *safe_hook;       /* "Safe hook" physical address */
-    /* An mBFT is 70 bytes in total */
-    uint8_t _pad[70 - (sizeof(struct acpi_description_header) +
-                      sizeof(uint32_t))];
-} MEMDISK_PACKED_POSTFIX;
-
 MEMDISK_PACKED_PREFIX
 /* EDD disk parameter table */
 struct edd_dpt {
@@ -109,6 +100,16 @@ struct mdi {
     uint16_t dpt_ptr;
 } MEMDISK_PACKED_POSTFIX;
 
+/* Requirement for struct acpi_description_header */
+#include "../memdisk/acpi.h"
+
+MEMDISK_PACKED_PREFIX
+struct mBFT {
+    struct acpi_description_header acpi;
+    struct safe_hook *safe_hook;       /* "Safe hook" physical address */
+    struct mdi mdi;
+} MEMDISK_PACKED_POSTFIX;
+
 MEMDISK_PACKED_PREFIX
 struct patch_area {
     struct mdi mdi;