]>
Commit | Line | Data |
---|---|---|
3c59d946 SZ |
1 | /** @file\r |
2 | \r | |
3 | The API to create the binary.\r | |
4 | \r | |
5 | Copyright (c) 2011-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 _BINARY_CREATE_H_\r | |
11 | #define _BINARY_CREATE_H_ 1\r | |
12 | \r | |
13 | #include <FvLib.h>\r | |
14 | #include "Compress.h"\r | |
15 | #include "Decompress.h"\r | |
16 | #include "CommonLib.h"\r | |
17 | #include "EfiUtilityMsgs.h"\r | |
18 | #include "FirmwareVolumeBufferLib.h"\r | |
19 | #include "OsPath.h"\r | |
20 | #include "ParseGuidedSectionTools.h"\r | |
21 | #include "StringFuncs.h"\r | |
22 | #include "ParseInf.h"\r | |
23 | #include <Common/UefiBaseTypes.h>\r | |
24 | #include <Common/UefiInternalFormRepresentation.h>\r | |
25 | #include <Common/UefiCapsule.h>\r | |
26 | #include <Common/PiFirmwareFile.h>\r | |
27 | #include <Common/PiFirmwareVolume.h>\r | |
28 | #include <Guid/PiFirmwareFileSystem.h>\r | |
29 | #include <IndustryStandard/PeImage.h>\r | |
30 | #include <Protocol/GuidedSectionExtraction.h>\r | |
31 | \r | |
32 | //1AE42876-008F-4161-B2B7-1C0D15C5EF43\r | |
33 | #define EFI_FFS_BFV_FOR_MULTIPLATFORM_GUID \\r | |
34 | { 0x1ae42876, 0x008f, 0x4161, { 0xb2, 0xb7, 0x1c, 0xd, 0x15, 0xc5, 0xef, 0x43 }}\r | |
35 | \r | |
36 | extern EFI_GUID gEfiFfsBfvForMultiPlatformGuid;\r | |
37 | \r | |
38 | // {003E7B41-98A2-4BE2-B27A-6C30C7655225}\r | |
39 | #define EFI_FFS_BFV_FOR_MULTIPLATFORM_GUID2 \\r | |
40 | { 0x3e7b41, 0x98a2, 0x4be2, { 0xb2, 0x7a, 0x6c, 0x30, 0xc7, 0x65, 0x52, 0x25 }}\r | |
41 | \r | |
42 | extern EFI_GUID gEfiFfsBfvForMultiPlatformGuid2;\r | |
43 | \r | |
44 | typedef UINT64 SKU_ID;\r | |
45 | \r | |
46 | typedef struct {\r | |
47 | UINT32 Offset:24;\r | |
48 | UINT32 Value:8;\r | |
49 | } PCD_DATA_DELTA;\r | |
50 | \r | |
51 | typedef struct {\r | |
52 | SKU_ID SkuId;\r | |
53 | UINT16 DefaultId;\r | |
54 | UINT8 Reserved[6];\r | |
55 | } PCD_DEFAULT_INFO;\r | |
56 | \r | |
57 | typedef struct {\r | |
58 | //\r | |
59 | // Full size, it must be at 8 byte alignment.\r | |
60 | //\r | |
61 | UINT32 DataSize;\r | |
62 | //\r | |
63 | // HeaderSize includes HeaderSize fields and DefaultInfo arrays\r | |
64 | //\r | |
65 | UINT32 HeaderSize;\r | |
66 | //\r | |
67 | // DefaultInfo arrays those have the same default setting.\r | |
68 | //\r | |
69 | PCD_DEFAULT_INFO DefaultInfo[1];\r | |
70 | //\r | |
71 | // Default data is stored as variable storage or the array of DATA_DELTA.\r | |
72 | //\r | |
73 | } PCD_DEFAULT_DATA;\r | |
74 | \r | |
75 | #define PCD_NV_STORE_DEFAULT_BUFFER_SIGNATURE SIGNATURE_32('N', 'S', 'D', 'B')\r | |
76 | \r | |
77 | typedef struct {\r | |
78 | //\r | |
79 | // PCD_NV_STORE_DEFAULT_BUFFER_SIGNATURE\r | |
80 | //\r | |
81 | UINT32 Signature;\r | |
82 | //\r | |
83 | // Length of the taken default buffer\r | |
84 | //\r | |
85 | UINT32 Length;\r | |
86 | //\r | |
87 | // Length of the total reserved buffer\r | |
88 | //\r | |
89 | UINT32 MaxLength;\r | |
90 | //\r | |
91 | // Reserved for 8 byte alignment\r | |
92 | //\r | |
93 | UINT32 Reserved;\r | |
94 | // one or more PCD_DEFAULT_DATA\r | |
95 | } PCD_NV_STORE_DEFAULT_BUFFER_HEADER;\r | |
96 | \r | |
97 | //\r | |
98 | // NvStoreDefaultValueBuffer layout:\r | |
99 | // +-------------------------------------+\r | |
100 | // | PCD_NV_STORE_DEFAULT_BUFFER_HEADER |\r | |
101 | // +-------------------------------------+\r | |
102 | // | PCD_DEFAULT_DATA (DEFAULT, Standard)|\r | |
103 | // +-------------------------------------+\r | |
104 | // | PCD_DATA_DELTA (DEFAULT, Standard)|\r | |
105 | // +-------------------------------------+\r | |
106 | // | ...... |\r | |
107 | // +-------------------------------------+\r | |
108 | // | PCD_DEFAULT_DATA (SKU A, Standard) |\r | |
109 | // +-------------------------------------+\r | |
110 | // | PCD_DATA_DELTA (SKU A, Standard) |\r | |
111 | // +-------------------------------------+\r | |
112 | // | ...... |\r | |
113 | // +-------------------------------------+\r | |
114 | //\r | |
115 | \r | |
116 | #pragma pack(1)\r | |
117 | \r | |
118 | typedef struct {\r | |
119 | UINT16 Offset;\r | |
120 | UINT8 Value;\r | |
121 | } DATA_DELTA;\r | |
122 | \r | |
123 | #pragma pack()\r | |
124 | \r | |
125 | /**\r | |
126 | Create the Ras section in FFS\r | |
127 | \r | |
128 | @param[in] InputFilePath The input file path and name.\r | |
129 | @param[in] OutputFilePath The output file path and name.\r | |
130 | \r | |
131 | @retval EFI_SUCCESS\r | |
132 | \r | |
133 | **/\r | |
134 | EFI_STATUS\r | |
135 | CreateRawSection (\r | |
136 | IN CHAR8* InputFilePath,\r | |
137 | IN CHAR8* OutputFilePath\r | |
138 | );\r | |
139 | \r | |
140 | /**\r | |
141 | Create the Ras type of FFS\r | |
142 | \r | |
143 | @param[in] InputFilePath .efi file, it's optional unless process PE/TE section.\r | |
144 | @param[in] OutputFilePath .te or .pe file\r | |
145 | \r | |
146 | @retval EFI_SUCCESS\r | |
147 | \r | |
148 | **/\r | |
149 | EFI_STATUS\r | |
150 | CreateRawFfs (\r | |
151 | IN CHAR8** InputFilePaths,\r | |
152 | IN CHAR8* OutputFilePath,\r | |
153 | IN BOOLEAN SizeOptimized\r | |
154 | );\r | |
155 | \r | |
156 | #endif\r | |
157 | \r |