--- /dev/null
+/** @file\r
+ Defines several datastructures used by Capsule On Disk feature.\r
+ They are mainly used for FAT files.\r
+\r
+ Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>\r
+ SPDX-License-Identifier: BSD-2-Clause-Patent\r
+\r
+**/\r
+\r
+#ifndef _CAPSULES_ON_DISK_H_\r
+#define _CAPSULES_ON_DISK_H_\r
+\r
+#include <Uefi.h>\r
+#include <Pi/PiMultiPhase.h>\r
+\r
+#include <Library/UefiLib.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/BaseLib.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/UefiRuntimeServicesTableLib.h>\r
+#include <Library/UefiRuntimeLib.h>\r
+#include <Library/BaseMemoryLib.h>\r
+#include <Library/MemoryAllocationLib.h>\r
+#include <Library/FileHandleLib.h>\r
+#include <Library/CapsuleLib.h>\r
+#include <Library/DevicePathLib.h>\r
+#include <Library/PrintLib.h>\r
+#include <Library/UefiBootManagerLib.h>\r
+\r
+#include <Protocol/SimpleFileSystem.h>\r
+#include <Protocol/DiskIo.h>\r
+#include <Protocol/BlockIo.h>\r
+\r
+#include <Guid/CapsuleVendor.h>\r
+#include <Guid/FileInfo.h>\r
+#include <Guid/GlobalVariable.h>\r
+\r
+//\r
+// This data structure is the part of FILE_INFO_ENTRY\r
+//\r
+#define FILE_INFO_SIGNATURE SIGNATURE_32 ('F', 'L', 'I', 'F')\r
+\r
+//\r
+// LoadOptionNumber of the boot option where the capsules is relocated.\r
+//\r
+#define COD_RELOCATION_LOAD_OPTION_VAR_NAME L"CodRelocationLoadOption"\r
+\r
+//\r
+// (20 * (6+5+2))+1) unicode characters from EFI FAT spec (doubled for bytes)\r
+//\r
+#define MAX_FILE_NAME_SIZE 522\r
+#define MAX_FILE_NAME_LEN (MAX_FILE_NAME_SIZE / sizeof(CHAR16))\r
+#define MAX_FILE_INFO_LEN (OFFSET_OF(EFI_FILE_INFO, FileName) + MAX_FILE_NAME_LEN)\r
+\r
+typedef struct {\r
+ UINTN Signature;\r
+ LIST_ENTRY Link; /// Linked list members.\r
+ EFI_FILE_INFO *FileInfo; /// Pointer to the FileInfo struct for this file or NULL.\r
+ CHAR16 *FileNameFirstPart; /// Text to the left of right-most period in the file name. String is capitialized\r
+ CHAR16 *FileNameSecondPart; /// Text to the right of right-most period in the file name.String is capitialized. Maybe NULL\r
+} FILE_INFO_ENTRY;\r
+\r
+typedef struct {\r
+ //\r
+ // image address.\r
+ //\r
+ VOID *ImageAddress;\r
+ //\r
+ // The file info of the image comes from.\r
+ // if FileInfo == NULL. means image does not come from file\r
+ //\r
+ EFI_FILE_INFO *FileInfo;\r
+} IMAGE_INFO;\r
+\r
+#endif // _CAPSULES_ON_DISK_H_\r