1 | /** @file
|
---|
2 | Define PPI to shadow Firmware Volume from flash to Permanent Memory.
|
---|
3 |
|
---|
4 | Copyright (c) 2023, Intel Corporation. All rights reserved.<BR>
|
---|
5 |
|
---|
6 | SPDX-License-Identifier: BSD-2-Clause-Patent
|
---|
7 |
|
---|
8 | **/
|
---|
9 |
|
---|
10 | #ifndef PEI_FIRMWARE_VOLUME_SHADOW_PPI_H_
|
---|
11 | #define PEI_FIRMWARE_VOLUME_SHADOW_PPI_H_
|
---|
12 |
|
---|
13 | //
|
---|
14 | // Firmware Volume Shadow PPI GUID value
|
---|
15 | //
|
---|
16 | #define EDKII_FIRMWARE_VOLUME_SHADOW_PPI_GUID \
|
---|
17 | { \
|
---|
18 | 0x7dfe756c, 0xed8d, 0x4d77, { 0x9e, 0xc4, 0x39, 0x9a, 0x8a, 0x81, 0x51, 0x16 } \
|
---|
19 | }
|
---|
20 |
|
---|
21 | /**
|
---|
22 | Copy FV to Destination. Length of copy is FV length from FV Header.
|
---|
23 |
|
---|
24 | @param[in] FirmwareVolumeBase Base address of FV to shadow. Length of FV
|
---|
25 | is in FV Header.
|
---|
26 | @param[in] Destination Pointer to the Buffer in system memory to
|
---|
27 | shadow FV.
|
---|
28 | @param[in] DestinationLength Size of Destination buffer in bytes.
|
---|
29 |
|
---|
30 | @retval EFI_SUCCESS Shadow complete
|
---|
31 | @retval EFI_INVALID_PARAMETER Destination is NULL
|
---|
32 | @retval EFI_INVALID_PARAMETER DestinationLength = 0.
|
---|
33 | @retval EFI_INVALID_PARAMETER FV does not have valid FV Header.
|
---|
34 | @retval EFI_INVALID_PARAMETER FV overlaps Destination.
|
---|
35 | @retval EFI_INVALID_PARAMETER Destination + DestinationLength rolls over 4GB
|
---|
36 | for 32-bit or 64-bit rollover.
|
---|
37 | @retval EFI_BUFFER_TOO_SMALL DestinationLength less than FV length from FV
|
---|
38 | Header.
|
---|
39 | @retval EFI_UNSUPPORTED FirmwareVolumeBase to FVBase + FVLength does
|
---|
40 | not support shadow. Caller should fallback to
|
---|
41 | CopyMem().
|
---|
42 |
|
---|
43 | **/
|
---|
44 | typedef
|
---|
45 | EFI_STATUS
|
---|
46 | (EFIAPI *EDKII_PEI_FIRMWARE_VOLUME_SHADOW)(
|
---|
47 | IN EFI_PHYSICAL_ADDRESS FirmwareVolumeBase,
|
---|
48 | IN VOID *Destination,
|
---|
49 | IN UINTN DestinationLength
|
---|
50 | );
|
---|
51 |
|
---|
52 | ///
|
---|
53 | /// This PPI provides a service to shadow a FV from one location to another
|
---|
54 | ///
|
---|
55 | typedef struct {
|
---|
56 | EDKII_PEI_FIRMWARE_VOLUME_SHADOW FirmwareVolumeShadow;
|
---|
57 | } EDKII_PEI_FIRMWARE_VOLUME_SHADOW_PPI;
|
---|
58 |
|
---|
59 | extern EFI_GUID gEdkiiPeiFirmwareVolumeShadowPpiGuid;
|
---|
60 |
|
---|
61 | #endif
|
---|