2 Routines supporting partition discovery and
5 Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
7 SPDX-License-Identifier: BSD-2-Clause-Patent
11 #include "FatLitePeim.h"
14 This function finds Eltorito partitions. Main algorithm
15 is ported from DXE partition driver.
17 @param[in] PrivateData The global memory map
18 @param[in] ParentBlockDevNo The parent block device
20 @retval TRUE New partitions are detected and logical block devices
21 are added to block device array
22 @retval FALSE No new partitions are added
26 FatFindEltoritoPartitions (
27 IN PEI_FAT_PRIVATE_DATA
*PrivateData
,
28 IN UINTN ParentBlockDevNo
32 This function finds Mbr partitions. Main algorithm
33 is ported from DXE partition driver.
35 @param[in] PrivateData The global memory map
36 @param[in] ParentBlockDevNo The parent block device
38 @retval TRUE New partitions are detected and logical block devices
39 are added to block device array
40 @retval FALSE No new partitions are added
44 FatFindMbrPartitions (
45 IN PEI_FAT_PRIVATE_DATA
*PrivateData
,
46 IN UINTN ParentBlockDevNo
50 This function is used for finding GPT partition on block device.
51 As follow UEFI spec we should check protective MBR first and then
52 try to check both primary/backup GPT structures.
54 @param[in] PrivateData The global memory map
55 @param[in] ParentBlockDevNo The parent block device
57 @retval TRUE New partitions are detected and logical block devices
58 are added to block device array
59 @retval FALSE No new partitions are added
63 FatFindGptPartitions (
64 IN PEI_FAT_PRIVATE_DATA
*PrivateData
,
65 IN UINTN ParentBlockDevNo
69 This function finds partitions (logical devices) in physical block devices.
71 @param PrivateData Global memory map for accessing global variables.
76 IN PEI_FAT_PRIVATE_DATA
*PrivateData
85 for (Index
= 0; Index
< PrivateData
->BlockDeviceCount
; Index
++) {
86 if (!PrivateData
->BlockDevice
[Index
].PartitionChecked
) {
87 if (FatFindGptPartitions (PrivateData
, Index
)) {
92 if (FatFindMbrPartitions (PrivateData
, Index
)) {
97 if (FatFindEltoritoPartitions (PrivateData
, Index
)) {
103 } while (Found
&& PrivateData
->BlockDeviceCount
<= PEI_FAT_MAX_BLOCK_DEVICE
);