TianoCore EDK2 master
Loading...
Searching...
No Matches
SystemFirmwareDxe.h
Go to the documentation of this file.
1
9#ifndef _SYSTEM_FIRMWARE_UPDATE_H_
10#define _SYSTEM_FIRMWARE_UPDATE_H_
11
12#include <PiDxe.h>
13
16#include <Guid/WinCertificate.h>
18
21
22#include <Library/BaseLib.h>
24#include <Library/DebugLib.h>
26#include <Library/PcdLib.h>
28#include <Library/UefiLib.h>
32#include <Library/HobLib.h>
36
37typedef struct {
38 UINT32 LastAttemptVersion;
39 UINT32 LastAttemptStatus;
41
42#define SYSTEM_FMP_LAST_ATTEMPT_VARIABLE_NAME L"SystemLastAttempVar"
43
44#define SYSTEM_FMP_LAST_ATTEMPT_VARIABLE_GUID {0x2f564d6f, 0xcc2c, 0x4838, { 0xb9, 0xa8, 0xbe, 0x59, 0x48, 0xb0, 0x3d, 0x59 }}
45
46#define SYSTEM_FMP_PRIVATE_DATA_SIGNATURE SIGNATURE_32('S', 'Y', 'S', 'F')
47
48#define SYSTEM_FMP_PROTOCOL_GUID {0x6d16624a, 0x26a6, 0x4cb4, { 0x84, 0xfa, 0x6, 0x78, 0x5a, 0x7e, 0x82, 0x6a }}
49
50//
51// SYSTEM FMP private data structure.
52//
53
55 UINT32 Signature;
57 EFI_HANDLE Handle;
58 UINT8 DescriptorCount;
61};
62
64
75#define SYSTEM_FMP_PRIVATE_DATA_FROM_FMP(a) \
76 CR ( \
77 (a), \
78 SYSTEM_FMP_PRIVATE_DATA, \
79 Fmp, \
80 SYSTEM_FMP_PRIVATE_DATA_SIGNATURE \
81 )
82
83//
84// Update data
85//
86
87typedef struct {
88 UINTN NumOfUpdates;
90
91typedef struct {
92 UINTN Index;
93 PLATFORM_FIRMWARE_TYPE FirmwareType;
94 FLASH_ADDRESS_TYPE AddressType;
95 EFI_GUID FileGuid;
96 EFI_PHYSICAL_ADDRESS BaseAddress;
97 UINTN Length;
98 UINTN ImageOffset;
100
101//
102// System Firmware Update SMM Communication
103//
104
105#define SYSTEM_FIRMWARE_UPDATE_COMMUNICATION_FUNCTION_SET_IMAGE 1
106
107typedef struct {
108 UINTN Function;
109 EFI_STATUS ReturnStatus;
110 // UINT8 Data[];
112
113#define ABORT_REASON_MAX_SIZE 0x40 // UnicodeStringSize including final L'\0'
114
115#define CAPSULE_IMAGE_ADDITIONAL_MAX_SIZE (0x20020 + 0xA0000) // Additional size for Capsule Header, FV block alignment + DispatchImage.
116
117typedef struct {
118 UINT8 ImageIndex;
119 UINTN ImageSize;
120 UINTN AbortReasonSize;
121 UINT32 LastAttemptVersion;
122 UINT32 LastAttemptStatus;
123 // UINT8 Data[AbortReasonMaxSize + ImageSize];
125
165EFIAPI
168 IN OUT UINTN *ImageInfoSize,
170 OUT UINT32 *DescriptorVersion,
171 OUT UINT8 *DescriptorCount,
172 OUT UINTN *DescriptorSize,
173 OUT UINT32 *PackageVersion,
174 OUT CHAR16 **PackageVersionName
175 );
176
201EFIAPI
204 IN UINT8 ImageIndex,
205 IN OUT VOID *Image,
206 IN OUT UINTN *ImageSize
207 );
208
256EFIAPI
259 IN UINT8 ImageIndex,
260 IN CONST VOID *Image,
261 IN UINTN ImageSize,
262 IN CONST VOID *VendorCode,
264 OUT CHAR16 **AbortReason
265 );
266
288EFIAPI
291 IN UINT8 ImageIndex,
292 IN CONST VOID *Image,
293 IN UINTN ImageSize,
294 OUT UINT32 *ImageUpdatable
295 );
296
330EFIAPI
333 OUT UINT32 *PackageVersion,
334 OUT CHAR16 **PackageVersionName,
335 OUT UINT32 *PackageVersionNameMaxLen,
336 OUT UINT64 *AttributesSupported,
337 OUT UINT64 *AttributesSetting
338 );
339
372EFIAPI
375 IN CONST VOID *Image,
376 IN UINTN ImageSize,
377 IN CONST VOID *VendorCode,
378 IN UINT32 PackageVersion,
379 IN CONST CHAR16 *PackageVersionName
380 );
381
391 IN SYSTEM_FMP_PRIVATE_DATA *SystemFmpPrivate
392 );
393
394extern EFI_GUID gSystemFmpLastAttemptVariableGuid;
395extern EFI_GUID mCurrentImageTypeId;
396extern EFI_GUID gSystemFmpProtocolGuid;
397
398#endif
UINT64 UINTN
EFI_STATUS(EFIAPI * EFI_FIRMWARE_MANAGEMENT_UPDATE_IMAGE_PROGRESS)(IN UINTN Completion)
#define CONST
Definition: Base.h:259
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
EFI_STATUS EFIAPI FmpGetImageInfo(IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *This, IN OUT UINTN *ImageInfoSize, IN OUT EFI_FIRMWARE_IMAGE_DESCRIPTOR *ImageInfo, OUT UINT32 *DescriptorVersion, OUT UINT8 *DescriptorCount, OUT UINTN *DescriptorSize, OUT UINT32 *PackageVersion, OUT CHAR16 **PackageVersionName)
EFI_STATUS EFIAPI FmpCheckImage(IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *This, IN UINT8 ImageIndex, IN CONST VOID *Image, IN UINTN ImageSize, OUT UINT32 *ImageUpdatable)
EFI_STATUS EFIAPI FmpGetImage(IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *This, IN UINT8 ImageIndex, IN OUT VOID *Image, IN OUT UINTN *ImageSize)
EFI_STATUS InitializePrivateData(IN SYSTEM_FMP_PRIVATE_DATA *SystemFmpPrivate)
EFI_STATUS EFIAPI FmpSetImage(IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *This, IN UINT8 ImageIndex, IN CONST VOID *Image, IN UINTN ImageSize, IN CONST VOID *VendorCode, IN EFI_FIRMWARE_MANAGEMENT_UPDATE_IMAGE_PROGRESS Progress, OUT CHAR16 **AbortReason)
EFI_STATUS EFIAPI FmpGetPackageInfo(IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *This, OUT UINT32 *PackageVersion, OUT CHAR16 **PackageVersionName, OUT UINT32 *PackageVersionNameMaxLen, OUT UINT64 *AttributesSupported, OUT UINT64 *AttributesSetting)
EFI_STATUS EFIAPI FmpSetPackageInfo(IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *This, IN CONST VOID *Image, IN UINTN ImageSize, IN CONST VOID *VendorCode, IN UINT32 PackageVersion, IN CONST CHAR16 *PackageVersionName)
UINT64 EFI_PHYSICAL_ADDRESS
Definition: UefiBaseType.h:50
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
Definition: Base.h:213