]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2010-01-04 Vladimir Serbinenko <phcoder@gmail.com>
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Mon, 4 Jan 2010 13:59:06 +0000 (14:59 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Mon, 4 Jan 2010 13:59:06 +0000 (14:59 +0100)
* include/grub/efi/api.h (GRUB_EFI_PIWG_DEVICE_PATH_SUBTYPE):
New constant.
(grub_efi_piwg_device_path): New structure
(grub_efi_piwg_device_path_t): New type.
* loader/efi/appleloader.c (piwg_full_device_path): New structure.
(devpath_1): Transform to a structure. All users updated.
(devpath_2): Likewise.
(devpath_3): Likewise.
(devpath_4): Likewise.
(devpath_5): Likewise.

ChangeLog
include/grub/efi/api.h
loader/efi/appleloader.c

index db0c0d2f29662736cb86b00b0ffb64be2a741272..c71862f783cc82850f69ed768b013c452601d035 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2010-01-04  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * include/grub/efi/api.h (GRUB_EFI_PIWG_DEVICE_PATH_SUBTYPE):
+       New constant.
+       (grub_efi_piwg_device_path): New structure
+       (grub_efi_piwg_device_path_t): New type.
+       * loader/efi/appleloader.c (piwg_full_device_path): New structure.
+       (devpath_1): Transform to a structure. All users updated.
+       (devpath_2): Likewise.
+       (devpath_3): Likewise.
+       (devpath_4): Likewise.
+       (devpath_5): Likewise.
+
 2010-01-04  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * loader/efi/appleloader.c: Restored. Update all users.
index 4a81207c6c6299afe72bd1f2a50e3292de55d96b..36363ae1e99bd5c2f8e3bcb32f8307b9b7389496 100644 (file)
@@ -584,6 +584,16 @@ struct grub_efi_protocol_device_path
 };
 typedef struct grub_efi_protocol_device_path grub_efi_protocol_device_path_t;
 
+#define GRUB_EFI_PIWG_DEVICE_PATH_SUBTYPE              6
+
+struct grub_efi_piwg_device_path
+{
+  grub_efi_device_path_t header;
+  grub_efi_guid_t guid __attribute__ ((packed));
+};
+typedef struct grub_efi_piwg_device_path grub_efi_piwg_device_path_t;
+
+
 /* BIOS Boot Specification Device Path.  */
 #define GRUB_EFI_BIOS_DEVICE_PATH_TYPE                 5
 
index a64530748f123085c520ed39cf569f0af4bde743..114a0a506445d170093007a2dce2e1fdc6c723da 100644 (file)
@@ -59,58 +59,171 @@ grub_appleloader_boot (void)
   return grub_errno;
 }
 
+struct piwg_full_device_path
+{
+  struct grub_efi_memory_mapped_device_path comp1;
+  struct grub_efi_piwg_device_path comp2;
+  struct grub_efi_device_path end;
+};
+
 /* early 2006 Core Duo / Core Solo models  */
-static grub_uint8_t devpath_1[] =
+static struct piwg_full_device_path devpath_1 =
 {
-  0x01, 0x03, 0x18, 0x00, 0x0B, 0x00, 0x00, 0x00,
-  0x00, 0x00, 0xE0, 0xFF, 0x00, 0x00, 0x00, 0x00,
-  0xFF, 0xFF, 0xF9, 0xFF, 0x00, 0x00, 0x00, 0x00,
-  0x04, 0x06, 0x14, 0x00, 0xEB, 0x85, 0x05, 0x2B,
-  0xB8, 0xD8, 0xA9, 0x49, 0x8B, 0x8C, 0xE2, 0x1B,
-  0x01, 0xAE, 0xF2, 0xB7, 0x7F, 0xFF, 0x04, 0x00,
+  .comp1 =
+  {
+    .header = {
+      .type = GRUB_EFI_HARDWARE_DEVICE_PATH_TYPE,
+      .subtype = GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE,
+      .length = {sizeof (struct grub_efi_memory_mapped_device_path), 0}
+    },
+    .memory_type = GRUB_EFI_MEMORY_MAPPED_IO,
+    .start_address = 0xffe00000,
+    .end_address = 0xfff9ffff
+  },
+  .comp2 =
+  {
+    .header = {
+      .type = GRUB_EFI_MEDIA_DEVICE_PATH_TYPE,
+      .subtype = GRUB_EFI_PIWG_DEVICE_PATH_SUBTYPE,
+      .length = {sizeof (struct grub_efi_piwg_device_path), 0}
+    },
+    .guid = {0x2B0585EB, 0xD8B8, 0x49A9, {0x8B, 0x8C, 0xE2, 0x1B,
+                                         0x01, 0xAE, 0xF2, 0xB7}}
+  },
+  .end =
+  {
+    .type = GRUB_EFI_END_DEVICE_PATH_TYPE,
+    .subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE,
+    .length = {sizeof (struct grub_efi_device_path), 0}
+  }
 };
 
 /* mid-2006 Mac Pro (and probably other Core 2 models)  */
-static grub_uint8_t devpath_2[] =
+static struct piwg_full_device_path devpath_2 =
 {
-  0x01, 0x03, 0x18, 0x00, 0x0B, 0x00, 0x00, 0x00,
-  0x00, 0x00, 0xE0, 0xFF, 0x00, 0x00, 0x00, 0x00,
-  0xFF, 0xFF, 0xF7, 0xFF, 0x00, 0x00, 0x00, 0x00,
-  0x04, 0x06, 0x14, 0x00, 0xEB, 0x85, 0x05, 0x2B,
-  0xB8, 0xD8, 0xA9, 0x49, 0x8B, 0x8C, 0xE2, 0x1B,
-  0x01, 0xAE, 0xF2, 0xB7, 0x7F, 0xFF, 0x04, 0x00,
+  .comp1 =
+  {
+    .header = {
+      .type = GRUB_EFI_HARDWARE_DEVICE_PATH_TYPE,
+      .subtype = GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE,
+      .length = {sizeof (struct grub_efi_memory_mapped_device_path), 0}
+    },
+    .memory_type = GRUB_EFI_MEMORY_MAPPED_IO,
+    .start_address = 0xffe00000,
+    .end_address = 0xfff7ffff
+  },
+  .comp2 =
+  {
+    .header = {
+      .type = GRUB_EFI_MEDIA_DEVICE_PATH_TYPE,
+      .subtype = GRUB_EFI_PIWG_DEVICE_PATH_SUBTYPE,
+      .length = {sizeof (struct grub_efi_piwg_device_path), 0}
+    },
+    .guid = {0x2B0585EB, 0xD8B8, 0x49A9, {0x8B, 0x8C, 0xE2, 0x1B,
+                                         0x01, 0xAE, 0xF2, 0xB7}}
+  },
+  .end =
+  {
+    .type = GRUB_EFI_END_DEVICE_PATH_TYPE,
+    .subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE,
+    .length = {sizeof (struct grub_efi_device_path), 0}
+  }
 };
 
 /* mid-2007 MBP ("Santa Rosa" based models)  */
-static grub_uint8_t devpath_3[] =
+static struct piwg_full_device_path devpath_3 =
 {
-  0x01, 0x03, 0x18, 0x00, 0x0B, 0x00, 0x00, 0x00,
-  0x00, 0x00, 0xE0, 0xFF, 0x00, 0x00, 0x00, 0x00,
-  0xFF, 0xFF, 0xF8, 0xFF, 0x00, 0x00, 0x00, 0x00,
-  0x04, 0x06, 0x14, 0x00, 0xEB, 0x85, 0x05, 0x2B,
-  0xB8, 0xD8, 0xA9, 0x49, 0x8B, 0x8C, 0xE2, 0x1B,
-  0x01, 0xAE, 0xF2, 0xB7, 0x7F, 0xFF, 0x04, 0x00,
+  .comp1 =
+  {
+    .header = {
+      .type = GRUB_EFI_HARDWARE_DEVICE_PATH_TYPE,
+      .subtype = GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE,
+      .length = {sizeof (struct grub_efi_memory_mapped_device_path), 0}
+    },
+    .memory_type = GRUB_EFI_MEMORY_MAPPED_IO,
+    .start_address = 0xffe00000,
+    .end_address = 0xfff8ffff
+  },
+  .comp2 =
+  {
+    .header = {
+      .type = GRUB_EFI_MEDIA_DEVICE_PATH_TYPE,
+      .subtype = GRUB_EFI_PIWG_DEVICE_PATH_SUBTYPE,
+      .length = {sizeof (struct grub_efi_piwg_device_path), 0}
+    },
+    .guid = {0x2B0585EB, 0xD8B8, 0x49A9, {0x8B, 0x8C, 0xE2, 0x1B,
+                                         0x01, 0xAE, 0xF2, 0xB7}}
+  },
+  .end =
+  {
+    .type = GRUB_EFI_END_DEVICE_PATH_TYPE,
+    .subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE,
+    .length = {sizeof (struct grub_efi_device_path), 0}
+  }
 };
 
 /* early-2008 MBA  */
-static grub_uint8_t devpath_4[] =
+static struct piwg_full_device_path devpath_4 =
 {
-  0x01, 0x03, 0x18, 0x00, 0x0B, 0x00, 0x00, 0x00,
-  0x00, 0x00, 0xC0, 0xFF, 0x00, 0x00, 0x00, 0x00,
-  0xFF, 0xFF, 0xF8, 0xFF, 0x00, 0x00, 0x00, 0x00,
-  0x04, 0x06, 0x14, 0x00, 0xEB, 0x85, 0x05, 0x2B,
-  0xB8, 0xD8, 0xA9, 0x49, 0x8B, 0x8C, 0xE2, 0x1B,
-  0x01, 0xAE, 0xF2, 0xB7, 0x7F, 0xFF, 0x04, 0x00,
+  .comp1 =
+  {
+    .header = {
+      .type = GRUB_EFI_HARDWARE_DEVICE_PATH_TYPE,
+      .subtype = GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE,
+      .length = {sizeof (struct grub_efi_memory_mapped_device_path), 0}
+    },
+    .memory_type = GRUB_EFI_MEMORY_MAPPED_IO,
+    .start_address = 0xffc00000,
+    .end_address = 0xfff8ffff
+  },
+  .comp2 =
+  {
+    .header = {
+      .type = GRUB_EFI_MEDIA_DEVICE_PATH_TYPE,
+      .subtype = GRUB_EFI_PIWG_DEVICE_PATH_SUBTYPE,
+      .length = {sizeof (struct grub_efi_piwg_device_path), 0}
+    },
+    .guid = {0x2B0585EB, 0xD8B8, 0x49A9, {0x8B, 0x8C, 0xE2, 0x1B,
+                                         0x01, 0xAE, 0xF2, 0xB7}}
+  },
+  .end =
+  {
+    .type = GRUB_EFI_END_DEVICE_PATH_TYPE,
+    .subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE,
+    .length = {sizeof (struct grub_efi_device_path), 0}
+  }
 };
 
 /* late-2008 MB/MBP (NVidia chipset)  */
-static grub_uint8_t devpath_5[] = {
-    0x01, 0x03, 0x18, 0x00, 0x0B, 0x00, 0x00, 0x00,
-    0x00, 0x40, 0xCB, 0xFF, 0x00, 0x00, 0x00, 0x00,
-    0xFF, 0xBF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,
-    0x04, 0x06, 0x14, 0x00, 0xEB, 0x85, 0x05, 0x2B,
-    0xB8, 0xD8, 0xA9, 0x49, 0x8B, 0x8C, 0xE2, 0x1B,
-    0x01, 0xAE, 0xF2, 0xB7, 0x7F, 0xFF, 0x04, 0x00,
+static struct piwg_full_device_path devpath_5 =
+{
+  .comp1 =
+  {
+    .header = {
+      .type = GRUB_EFI_HARDWARE_DEVICE_PATH_TYPE,
+      .subtype = GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE,
+      .length = {sizeof (struct grub_efi_memory_mapped_device_path), 0}
+    },
+    .memory_type = GRUB_EFI_MEMORY_MAPPED_IO,
+    .start_address = 0xffcb4000,
+    .end_address = 0xffffbfff
+  },
+  .comp2 =
+  {
+    .header = {
+      .type = GRUB_EFI_MEDIA_DEVICE_PATH_TYPE,
+      .subtype = GRUB_EFI_PIWG_DEVICE_PATH_SUBTYPE,
+      .length = {sizeof (struct grub_efi_piwg_device_path), 0}
+    },
+    .guid = {0x2B0585EB, 0xD8B8, 0x49A9, {0x8B, 0x8C, 0xE2, 0x1B,
+                                         0x01, 0xAE, 0xF2, 0xB7}}
+  },
+  .end =
+  {
+    .type = GRUB_EFI_END_DEVICE_PATH_TYPE,
+    .subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE,
+    .length = {sizeof (struct grub_efi_device_path), 0}
+  }
 };
 
 struct devdata
@@ -121,11 +234,11 @@ struct devdata
 
 struct devdata devs[] =
 {
-  {"Core Duo/Solo", (grub_efi_device_path_t *) devpath_1},
-  {"Mac Pro", (grub_efi_device_path_t *) devpath_2},
-  {"MBP", (grub_efi_device_path_t *) devpath_3},
-  {"MBA", (grub_efi_device_path_t *) devpath_4},
-  {"MB NV", (grub_efi_device_path_t *) devpath_5},
+  {"Core Duo/Solo", (grub_efi_device_path_t *) &devpath_1},
+  {"Mac Pro", (grub_efi_device_path_t *) &devpath_2},
+  {"MBP", (grub_efi_device_path_t *) &devpath_3},
+  {"MBA", (grub_efi_device_path_t *) &devpath_4},
+  {"MB NV", (grub_efi_device_path_t *) &devpath_5},
   {NULL, NULL},
 };