]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Update partition driver to not produce BlockIo if a GPT with OS-specific field (BIT1...
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 21 Sep 2009 14:22:14 +0000 (14:22 +0000)
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 21 Sep 2009 14:22:14 +0000 (14:22 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9293 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c
MdeModulePkg/Universal/Disk/PartitionDxe/Partition.h

index 7bcfe697474e00e7f656d15fd73fea74b2a0e6a4..68d5830fcb3421e7f2e0d9ad3264e61433ae7193 100644 (file)
@@ -339,10 +339,12 @@ PartitionInstallGptChildHandles (
   for (Index = 0; Index < PrimaryHeader->NumberOfPartitionEntries; Index++) {\r
     if (CompareGuid (&PartEntry[Index].PartitionTypeGUID, &gEfiPartTypeUnusedGuid) ||\r
         PEntryStatus[Index].OutOfRange ||\r
-        PEntryStatus[Index].Overlap\r
+        PEntryStatus[Index].Overlap ||\r
+        PEntryStatus[Index].OsSpecific\r
         ) {\r
       //\r
-      // Don't use null EFI Partition Entries or Invalid Partition Entries\r
+      // Don't use null EFI Partition Entries, Invalid Partition Entries or OS specific\r
+      // partition Entries\r
       //\r
       continue;\r
     }\r
@@ -652,6 +654,7 @@ PartitionCheckGptEntry (
   EFI_LBA EndingLBA;\r
   UINTN   Index1;\r
   UINTN   Index2;\r
+  UINT64  Attributes;\r
 \r
   DEBUG ((EFI_D_INFO, " start check partition entries\n"));\r
   for (Index1 = 0; Index1 < PartHeader->NumberOfPartitionEntries; Index1++) {\r
@@ -687,6 +690,14 @@ PartitionCheckGptEntry (
 \r
       }\r
     }\r
+\r
+    Attributes = PartEntry[Index1].Attributes;\r
+    if ((Attributes & BIT1) != 0) {\r
+      //\r
+      // If Bit 1 is set, this indicate that this is an OS specific GUID partition. \r
+      //\r
+      PEntryStatus[Index1].OsSpecific = TRUE;\r
+    }\r
   }\r
 \r
   DEBUG ((EFI_D_INFO, " End check partition entries\n"));\r
index 6b0d73438d2d4f5245a4fb030173aff750ed4491..d1288bad1c0ceaed57b04fbf7b258bb9e0e85779 100644 (file)
@@ -4,7 +4,7 @@
   of the raw block devices media. Currently "El Torito CD-ROM", Legacy \r
   MBR, and GPT partition schemes are supported.\r
 \r
-Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
+Copyright (c) 2006 - 2009, Intel Corporation. <BR>\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -92,6 +92,7 @@ extern EFI_COMPONENT_NAME2_PROTOCOL  gPartitionComponentName2;
 typedef struct {\r
   BOOLEAN OutOfRange;\r
   BOOLEAN Overlap;\r
+  BOOLEAN OsSpecific;\r
 } EFI_PARTITION_ENTRY_STATUS;\r
 \r
 //\r