TianoCore EDK2 master
Loading...
Searching...
No Matches
PeiCdExpress.h
Go to the documentation of this file.
1
10#ifndef _PEI_CD_EXPRESS_H_
11#define _PEI_CD_EXPRESS_H_
12
13#include <PiPei.h>
14
15#include <Ppi/BlockIo.h>
16#include <Ppi/BlockIo2.h>
17#include <Guid/RecoveryDevice.h>
19
20#include <Library/DebugLib.h>
21#include <Library/PcdLib.h>
27
28#pragma pack(1)
29
30#define PEI_CD_EXPRESS_MAX_BLOCK_IO_PPI 8
31#define PEI_CD_EXPRESS_MAX_CAPSULE_NUMBER 16
32
33#define PEI_CD_BLOCK_SIZE 0x800
34#define PEI_MEMMORY_PAGE_SIZE 0x1000
35
36//
37// Following are defined according to ISO-9660 specification
38//
39#define PEI_CD_STANDARD_ID "CD001"
40#define PEI_CD_EXPRESS_STANDARD_ID_SIZE 5
41
42#define PEI_CD_EXPRESS_VOLUME_TYPE_OFFSET 0
43#define PEI_CD_EXPRESS_STANDARD_ID_OFFSET 1
44#define PEI_CD_EXPRESS_VOLUME_SPACE_OFFSET 80
45#define PEI_CD_EXPRESS_ROOT_DIR_RECORD_OFFSET 156
46
47#define PEI_CD_EXPRESS_VOLUME_TYPE_PRIMARY 1
48#define PEI_CD_EXPRESS_VOLUME_TYPE_TERMINATOR 255
49
50#define PEI_CD_EXPRESS_DIR_FILE_REC_FLAG_ISDIR 0x02
51
52typedef struct {
53 UINTN CapsuleStartLBA;
54 UINTN CapsuleSize;
55 UINTN CapsuleBlockAlignedSize;
56 UINTN IndexBlock;
60
61#define PEI_CD_EXPRESS_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('p', 'c', 'd', 'e')
62
63typedef struct {
64 UINTN Signature;
65 EFI_PEI_DEVICE_RECOVERY_MODULE_PPI DeviceRecoveryPpi;
66 EFI_PEI_PPI_DESCRIPTOR PpiDescriptor;
67 EFI_PEI_NOTIFY_DESCRIPTOR NotifyDescriptor;
68 EFI_PEI_NOTIFY_DESCRIPTOR NotifyDescriptor2;
69
70 UINT8 *BlockBuffer;
71 UINTN CapsuleCount;
72 PEI_CD_EXPRESS_CAPSULE_DATA CapsuleData[PEI_CD_EXPRESS_MAX_CAPSULE_NUMBER];
74
75#define PEI_CD_EXPRESS_PRIVATE_DATA_FROM_THIS(a) \
76 CR (a, \
77 PEI_CD_EXPRESS_PRIVATE_DATA, \
78 DeviceRecoveryPpi, \
79 PEI_CD_EXPRESS_PRIVATE_DATA_SIGNATURE \
80 )
81
82typedef struct {
83 UINT8 Length;
84 UINT8 ExtendedAttributeRecordLength;
85 UINT32 LocationOfExtent[2];
86 UINT32 DataLength[2];
87 UINT8 DateTime[7];
88 UINT8 Flag;
89 UINT8 FileUnitSize;
90 UINT8 InterleaveGapSize;
91 UINT32 VolumeSequenceNumber;
92 UINT8 FileIDLength;
93 UINT8 FileID[1];
95
110EFIAPI
112 IN EFI_PEI_SERVICES **PeiServices,
113 IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,
114 IN VOID *Ppi
115 );
116
129 IN BOOLEAN BlockIo2
130 );
131
156EFIAPI
158 IN EFI_PEI_SERVICES **PeiServices,
160 OUT UINTN *NumberRecoveryCapsules
161 );
162
189EFIAPI
191 IN EFI_PEI_SERVICES **PeiServices,
193 IN UINTN CapsuleInstance,
194 OUT UINTN *Size,
195 OUT EFI_GUID *CapsuleType
196 );
197
218EFIAPI
220 IN EFI_PEI_SERVICES **PeiServices,
222 IN UINTN CapsuleInstance,
223 OUT VOID *Buffer
224 );
225
236EFIAPI
239 );
240
256EFIAPI
261 IN UINTN IndexBlockDevice,
262 IN UINT32 Lba
263 );
264
277BOOLEAN
278StringCmp (
279 IN UINT8 *Source1,
280 IN UINT8 *Source2,
281 IN UINTN Size,
282 IN BOOLEAN CaseSensitive
283 );
284
285#pragma pack()
286
287#endif
UINT64 UINTN
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
EFI_STATUS UpdateBlocksAndVolumes(IN OUT PEI_CD_EXPRESS_PRIVATE_DATA *PrivateData, IN BOOLEAN BlockIo2)
Definition: PeiCdExpress.c:154
EFI_STATUS EFIAPI GetRecoveryCapsuleInfo(IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_DEVICE_RECOVERY_MODULE_PPI *This, IN UINTN CapsuleInstance, OUT UINTN *Size, OUT EFI_GUID *CapsuleType)
Definition: FatLiteApi.c:413
EFI_STATUS EFIAPI FindRecoveryCapsules(IN OUT PEI_CD_EXPRESS_PRIVATE_DATA *PrivateData)
Definition: PeiCdExpress.c:299
EFI_STATUS EFIAPI GetNumberRecoveryCapsules(IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_DEVICE_RECOVERY_MODULE_PPI *This, OUT UINTN *NumberRecoveryCapsules)
Definition: FatLiteApi.c:350
EFI_STATUS EFIAPI BlockIoNotifyEntry(IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor, IN VOID *Ppi)
Definition: FatLiteApi.c:214
EFI_STATUS EFIAPI LoadRecoveryCapsule(IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_DEVICE_RECOVERY_MODULE_PPI *This, IN UINTN CapsuleInstance, OUT VOID *Buffer)
Definition: FatLiteApi.c:542
EFI_STATUS EFIAPI RetrieveCapsuleFileFromRoot(IN OUT PEI_CD_EXPRESS_PRIVATE_DATA *PrivateData, IN EFI_PEI_RECOVERY_BLOCK_IO_PPI *BlockIoPpi, IN EFI_PEI_RECOVERY_BLOCK_IO2_PPI *BlockIo2Ppi, IN UINTN IndexBlockDevice, IN UINT32 Lba)
Definition: PeiCdExpress.c:421
BOOLEAN StringCmp(IN UINT8 *Source1, IN UINT8 *Source2, IN UINTN Size, IN BOOLEAN CaseSensitive)
Definition: PeiCdExpress.c:701
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
Definition: Base.h:213