\r
Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>\r
\r
-This program and the accompanying materials are licensed and made available\r
-under the terms and conditions of the BSD License which accompanies this\r
-distribution. The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
\r
IN UINTN ParentBlockDevNo\r
);\r
\r
+/**\r
+ This function is used for finding GPT partition on block device.\r
+ As follow UEFI spec we should check protective MBR first and then\r
+ try to check both primary/backup GPT structures.\r
+\r
+ @param[in] PrivateData The global memory map\r
+ @param[in] ParentBlockDevNo The parent block device\r
+\r
+ @retval TRUE New partitions are detected and logical block devices\r
+ are added to block device array\r
+ @retval FALSE No new partitions are added\r
+\r
+**/\r
+BOOLEAN\r
+FatFindGptPartitions (\r
+ IN PEI_FAT_PRIVATE_DATA *PrivateData,\r
+ IN UINTN ParentBlockDevNo\r
+ );\r
+\r
/**\r
This function finds partitions (logical devices) in physical block devices.\r
\r
\r
for (Index = 0; Index < PrivateData->BlockDeviceCount; Index++) {\r
if (!PrivateData->BlockDevice[Index].PartitionChecked) {\r
- Found = FatFindMbrPartitions (PrivateData, Index);\r
- if (!Found) {\r
- Found = FatFindEltoritoPartitions (PrivateData, Index);\r
+ if (FatFindGptPartitions (PrivateData, Index)) {\r
+ Found = TRUE;\r
+ continue;\r
+ }\r
+\r
+ if (FatFindMbrPartitions (PrivateData, Index)) {\r
+ Found = TRUE;\r
+ continue;\r
+ }\r
+\r
+ if (FatFindEltoritoPartitions (PrivateData, Index)) {\r
+ Found = TRUE;\r
+ continue;\r
}\r
}\r
}\r
} while (Found && PrivateData->BlockDeviceCount <= PEI_FAT_MAX_BLOCK_DEVICE);\r
}\r
-\r