2 Routines supporting partition discovery and
5 Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
7 This program and the accompanying materials are licensed and made available
8 under the terms and conditions of the BSD License which accompanies this
9 distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 #include "FatLitePeim.h"
20 This function finds Eltorito partitions. Main algorithm
21 is ported from DXE partition driver.
23 @param[in] PrivateData The global memory map
24 @param[in] ParentBlockDevNo The parent block device
26 @retval TRUE New partitions are detected and logical block devices
27 are added to block device array
28 @retval FALSE No new partitions are added
32 FatFindEltoritoPartitions (
33 IN PEI_FAT_PRIVATE_DATA
*PrivateData
,
34 IN UINTN ParentBlockDevNo
38 This function finds Mbr partitions. Main algorithm
39 is ported from DXE partition driver.
41 @param[in] PrivateData The global memory map
42 @param[in] ParentBlockDevNo The parent block device
44 @retval TRUE New partitions are detected and logical block devices
45 are added to block device array
46 @retval FALSE No new partitions are added
50 FatFindMbrPartitions (
51 IN PEI_FAT_PRIVATE_DATA
*PrivateData
,
52 IN UINTN ParentBlockDevNo
56 This function is used for finding GPT partition on block device.
57 As follow UEFI spec we should check protective MBR first and then
58 try to check both primary/backup GPT structures.
60 @param[in] PrivateData The global memory map
61 @param[in] ParentBlockDevNo The parent block device
63 @retval TRUE New partitions are detected and logical block devices
64 are added to block device array
65 @retval FALSE No new partitions are added
69 FatFindGptPartitions (
70 IN PEI_FAT_PRIVATE_DATA
*PrivateData
,
71 IN UINTN ParentBlockDevNo
75 This function finds partitions (logical devices) in physical block devices.
77 @param PrivateData Global memory map for accessing global variables.
82 IN PEI_FAT_PRIVATE_DATA
*PrivateData
91 for (Index
= 0; Index
< PrivateData
->BlockDeviceCount
; Index
++) {
92 if (!PrivateData
->BlockDevice
[Index
].PartitionChecked
) {
93 if (FatFindGptPartitions (PrivateData
, Index
)) {
98 if (FatFindMbrPartitions (PrivateData
, Index
)) {
103 if (FatFindEltoritoPartitions (PrivateData
, Index
)) {
109 } while (Found
&& PrivateData
->BlockDeviceCount
<= PEI_FAT_MAX_BLOCK_DEVICE
);