]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.h
MdeModulePkg: Add Capsule On Disk APIs into CapsuleLib.
[mirror_edk2.git] / MdeModulePkg / Library / DxeCapsuleLibFmp / CapsuleOnDisk.h
CommitLineData
8636f70b
WX
1/** @file\r
2 Defines several datastructures used by Capsule On Disk feature.\r
3 They are mainly used for FAT files.\r
4\r
5 Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>\r
6 SPDX-License-Identifier: BSD-2-Clause-Patent\r
7\r
8**/\r
9\r
10#ifndef _CAPSULES_ON_DISK_H_\r
11#define _CAPSULES_ON_DISK_H_\r
12\r
13#include <Uefi.h>\r
14#include <Pi/PiMultiPhase.h>\r
15\r
16#include <Library/UefiLib.h>\r
17#include <Library/DebugLib.h>\r
18#include <Library/BaseLib.h>\r
19#include <Library/UefiBootServicesTableLib.h>\r
20#include <Library/UefiRuntimeServicesTableLib.h>\r
21#include <Library/UefiRuntimeLib.h>\r
22#include <Library/BaseMemoryLib.h>\r
23#include <Library/MemoryAllocationLib.h>\r
24#include <Library/FileHandleLib.h>\r
25#include <Library/CapsuleLib.h>\r
26#include <Library/DevicePathLib.h>\r
27#include <Library/PrintLib.h>\r
28#include <Library/UefiBootManagerLib.h>\r
29\r
30#include <Protocol/SimpleFileSystem.h>\r
31#include <Protocol/DiskIo.h>\r
32#include <Protocol/BlockIo.h>\r
33\r
34#include <Guid/CapsuleVendor.h>\r
35#include <Guid/FileInfo.h>\r
36#include <Guid/GlobalVariable.h>\r
37\r
38//\r
39// This data structure is the part of FILE_INFO_ENTRY\r
40//\r
41#define FILE_INFO_SIGNATURE SIGNATURE_32 ('F', 'L', 'I', 'F')\r
42\r
43//\r
44// LoadOptionNumber of the boot option where the capsules is relocated.\r
45//\r
46#define COD_RELOCATION_LOAD_OPTION_VAR_NAME L"CodRelocationLoadOption"\r
47\r
48//\r
49// (20 * (6+5+2))+1) unicode characters from EFI FAT spec (doubled for bytes)\r
50//\r
51#define MAX_FILE_NAME_SIZE 522\r
52#define MAX_FILE_NAME_LEN (MAX_FILE_NAME_SIZE / sizeof(CHAR16))\r
53#define MAX_FILE_INFO_LEN (OFFSET_OF(EFI_FILE_INFO, FileName) + MAX_FILE_NAME_LEN)\r
54\r
55typedef struct {\r
56 UINTN Signature;\r
57 LIST_ENTRY Link; /// Linked list members.\r
58 EFI_FILE_INFO *FileInfo; /// Pointer to the FileInfo struct for this file or NULL.\r
59 CHAR16 *FileNameFirstPart; /// Text to the left of right-most period in the file name. String is capitialized\r
60 CHAR16 *FileNameSecondPart; /// Text to the right of right-most period in the file name.String is capitialized. Maybe NULL\r
61} FILE_INFO_ENTRY;\r
62\r
63typedef struct {\r
64 //\r
65 // image address.\r
66 //\r
67 VOID *ImageAddress;\r
68 //\r
69 // The file info of the image comes from.\r
70 // if FileInfo == NULL. means image does not come from file\r
71 //\r
72 EFI_FILE_INFO *FileInfo;\r
73} IMAGE_INFO;\r
74\r
75#endif // _CAPSULES_ON_DISK_H_\r