TianoCore EDK2 master
|
#include <IndustryStandard/Mbr.h>
#include <Uefi/UefiGpt.h>
#include <Library/BaseLib.h>
#include "FatLitePeim.h"
Go to the source code of this file.
Data Structures | |
struct | EFI_PARTITION_ENTRY_STATUS |
Macros | |
#define | EFI_SIZE_TO_BLOCKS(a, blocksize) (((a) / (blocksize)) + (((a) % (blocksize)) ? 1 : 0)) |
Functions | |
BOOLEAN | PartitionCheckGptHeaderCRC (IN EFI_PARTITION_TABLE_HEADER *PartHeader) |
BOOLEAN | PartitionCheckGptEntryArrayCRC (IN EFI_PARTITION_TABLE_HEADER *PartHeader, IN EFI_PARTITION_ENTRY *PartEntry) |
BOOLEAN | PartitionCheckGptHeader (IN PEI_FAT_PRIVATE_DATA *PrivateData, IN UINTN ParentBlockDevNo, IN BOOLEAN IsPrimaryHeader, IN EFI_PARTITION_TABLE_HEADER *PartHdr) |
BOOLEAN | PartitionCheckGptEntryArray (IN PEI_FAT_PRIVATE_DATA *PrivateData, IN UINTN ParentBlockDevNo, IN EFI_PARTITION_TABLE_HEADER *PartHdr) |
BOOLEAN | PartitionCheckGptStructure (IN PEI_FAT_PRIVATE_DATA *PrivateData, IN UINTN ParentBlockDevNo, IN BOOLEAN IsPrimary) |
BOOLEAN | PartitionCheckProtectiveMbr (IN PEI_FAT_PRIVATE_DATA *PrivateData, IN UINTN ParentBlockDevNo) |
BOOLEAN | FatFindGptPartitions (IN PEI_FAT_PRIVATE_DATA *PrivateData, IN UINTN ParentBlockDevNo) |
Routines supporting partition discovery and logical device reading
Copyright (c) 2019 Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file Gpt.c.
#define EFI_SIZE_TO_BLOCKS | ( | a, | |
blocksize | |||
) | (((a) / (blocksize)) + (((a) % (blocksize)) ? 1 : 0)) |
BOOLEAN FatFindGptPartitions | ( | IN PEI_FAT_PRIVATE_DATA * | PrivateData, |
IN UINTN | ParentBlockDevNo | ||
) |
This function is used for finding GPT partition on block device. As follow UEFI spec we should check protective MBR first and then try to check both primary/backup GPT structures.
[in] | PrivateData | The global memory map |
[in] | ParentBlockDevNo | The parent block device |
TRUE | New partitions are detected and logical block devices are added to block device array |
FALSE | No new partitions are added |
BOOLEAN PartitionCheckGptEntryArray | ( | IN PEI_FAT_PRIVATE_DATA * | PrivateData, |
IN UINTN | ParentBlockDevNo, | ||
IN EFI_PARTITION_TABLE_HEADER * | PartHdr | ||
) |
This function is used to verify each partition in block device.
[in] | PrivateData | The global memory map |
[in] | ParentBlockDevNo | The parent block device |
[in] | PartHdr | Stores the partition table that is read |
TRUE | The partition is valid |
FALSE | The partition is not valid |
BOOLEAN PartitionCheckGptEntryArrayCRC | ( | IN EFI_PARTITION_TABLE_HEADER * | PartHeader, |
IN EFI_PARTITION_ENTRY * | PartEntry | ||
) |
BOOLEAN PartitionCheckGptHeader | ( | IN PEI_FAT_PRIVATE_DATA * | PrivateData, |
IN UINTN | ParentBlockDevNo, | ||
IN BOOLEAN | IsPrimaryHeader, | ||
IN EFI_PARTITION_TABLE_HEADER * | PartHdr | ||
) |
The function is used for valid GPT table. Both for Primary and Backup GPT header.
[in] | PrivateData | The global memory map |
[in] | ParentBlockDevNo | The parent block device |
[in] | IsPrimaryHeader | Indicate to which header will be checked. |
[in] | PartHdr | Stores the partition table that is read |
TRUE | The partition table is valid |
FALSE | The partition table is not valid |
BOOLEAN PartitionCheckGptHeaderCRC | ( | IN EFI_PARTITION_TABLE_HEADER * | PartHeader | ) |
BOOLEAN PartitionCheckGptStructure | ( | IN PEI_FAT_PRIVATE_DATA * | PrivateData, |
IN UINTN | ParentBlockDevNo, | ||
IN BOOLEAN | IsPrimary | ||
) |
The function is used to check GPT structure, include GPT header and GPT entry array.
[in] | PrivateData | The global memory map |
[in] | ParentBlockDevNo | The parent block device |
[in] | IsPrimary | Indicate primary or backup to be check |
TRUE | Primary or backup GPT structure is valid. |
FALSE | Both primary and backup are invalid. |
BOOLEAN PartitionCheckProtectiveMbr | ( | IN PEI_FAT_PRIVATE_DATA * | PrivateData, |
IN UINTN | ParentBlockDevNo | ||
) |