3 Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
4 SPDX-License-Identifier: BSD-2-Clause-Patent
12 Defines data structure that is the volume header found.These data is intent
13 to decouple FVB driver with FV header.
18 // The package level header files this module uses
23 // The protocols, PPI and GUID defintions for this module
25 #include <Guid/EventGroup.h>
26 #include <Guid/FirmwareFileSystem2.h>
27 #include <Guid/SystemNvDataGuid.h>
28 #include <Protocol/FirmwareVolumeBlock.h>
29 #include <Protocol/DevicePath.h>
31 // The Library classes this module consumes
33 #include <Library/UefiLib.h>
34 #include <Library/UefiDriverEntryPoint.h>
35 #include <Library/BaseLib.h>
36 #include <Library/DxeServicesTableLib.h>
37 #include <Library/UefiRuntimeLib.h>
38 #include <Library/DebugLib.h>
39 #include <Library/HobLib.h>
40 #include <Library/BaseMemoryLib.h>
41 #include <Library/MemoryAllocationLib.h>
42 #include <Library/UefiBootServicesTableLib.h>
43 #include <Library/PcdLib.h>
47 EFI_FIRMWARE_VOLUME_HEADER FvbInfo
;
49 // EFI_FV_BLOCK_MAP_ENTRY ExtraBlockMap[n];//n=0
51 EFI_FV_BLOCK_MAP_ENTRY End
[1];
54 EFI_FVB_MEDIA_INFO mPlatformFvbMediaInfo
[] = {
59 FixedPcdGet32 (PcdWinNtFlashFvRecoverySize
),
64 EFI_FIRMWARE_FILE_SYSTEM2_GUID
,
65 FixedPcdGet32 (PcdWinNtFlashFvRecoverySize
),
67 EFI_FVB2_MEMORY_MAPPED
|
68 EFI_FVB2_READ_ENABLED_CAP
|
69 EFI_FVB2_READ_STATUS
|
70 EFI_FVB2_WRITE_ENABLED_CAP
|
71 EFI_FVB2_WRITE_STATUS
|
72 EFI_FVB2_ERASE_POLARITY
|
73 EFI_FVB2_ALIGNMENT_16
,
74 sizeof (EFI_FIRMWARE_VOLUME_HEADER
) + sizeof (EFI_FV_BLOCK_MAP_ENTRY
),
82 FixedPcdGet32 (PcdWinNtFlashFvRecoverySize
)/FixedPcdGet32 (PcdWinNtFirmwareBlockSize
),
83 FixedPcdGet32 (PcdWinNtFirmwareBlockSize
),
92 // Systen NvStorage FVB
95 FixedPcdGet32 (PcdFlashNvStorageVariableSize
) +
96 FixedPcdGet32 (PcdFlashNvStorageFtwWorkingSize
) +
97 FixedPcdGet32 (PcdFlashNvStorageFtwSpareSize
) +
98 FixedPcdGet32 (PcdWinNtFlashNvStorageEventLogSize
),
103 EFI_SYSTEM_NV_DATA_FV_GUID
,
104 FixedPcdGet32 (PcdFlashNvStorageVariableSize
) +
105 FixedPcdGet32 (PcdFlashNvStorageFtwWorkingSize
) +
106 FixedPcdGet32 (PcdFlashNvStorageFtwSpareSize
) +
107 FixedPcdGet32 (PcdWinNtFlashNvStorageEventLogSize
),
109 EFI_FVB2_MEMORY_MAPPED
|
110 EFI_FVB2_READ_ENABLED_CAP
|
111 EFI_FVB2_READ_STATUS
|
112 EFI_FVB2_WRITE_ENABLED_CAP
|
113 EFI_FVB2_WRITE_STATUS
|
114 EFI_FVB2_ERASE_POLARITY
|
115 EFI_FVB2_ALIGNMENT_16
,
116 sizeof (EFI_FIRMWARE_VOLUME_HEADER
) + sizeof (EFI_FV_BLOCK_MAP_ENTRY
),
118 0, // ExtHeaderOffset
124 (FixedPcdGet32 (PcdFlashNvStorageVariableSize
) +
125 FixedPcdGet32 (PcdFlashNvStorageFtwWorkingSize
) +
126 FixedPcdGet32 (PcdFlashNvStorageFtwSpareSize
) +
127 FixedPcdGet32 (PcdWinNtFlashNvStorageEventLogSize
)) / FixedPcdGet32 (PcdWinNtFirmwareBlockSize
),
128 FixedPcdGet32 (PcdWinNtFirmwareBlockSize
),
141 OUT EFI_FIRMWARE_VOLUME_HEADER
**FvbInfo
146 for (Index
= 0; Index
< sizeof (mPlatformFvbMediaInfo
) / sizeof (EFI_FVB_MEDIA_INFO
); Index
+= 1) {
147 if (mPlatformFvbMediaInfo
[Index
].FvLength
== FvLength
) {
148 *FvbInfo
= &mPlatformFvbMediaInfo
[Index
].FvbInfo
;
153 return EFI_NOT_FOUND
;