fv2.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659
  1. /*++
  2. Copyright (c) 2012 Minoca Corp. All Rights Reserved
  3. Module Name:
  4. fv2.h
  5. Abstract:
  6. This header contains definitions for the UEFI Firmware Volume 2 Protocol.
  7. Author:
  8. Evan Green 11-Mar-2014
  9. --*/
  10. //
  11. // ------------------------------------------------------------------- Includes
  12. //
  13. //
  14. // ---------------------------------------------------------------- Definitions
  15. //
  16. #define EFI_FIRMWARE_VOLUME2_PROTOCOL_GUID \
  17. { \
  18. 0x220E73B6, 0x6BDB, 0x4413, \
  19. {0x84, 0x05, 0xB9, 0x74, 0xB1, 0x08, 0x61, 0x9A} \
  20. }
  21. #define EFI_FV2_READ_DISABLE_CAP 0x0000000000000001ULL
  22. #define EFI_FV2_READ_ENABLE_CAP 0x0000000000000002ULL
  23. #define EFI_FV2_READ_STATUS 0x0000000000000004ULL
  24. #define EFI_FV2_WRITE_DISABLE_CAP 0x0000000000000008ULL
  25. #define EFI_FV2_WRITE_ENABLE_CAP 0x0000000000000010ULL
  26. #define EFI_FV2_WRITE_STATUS 0x0000000000000020ULL
  27. #define EFI_FV2_LOCK_CAP 0x0000000000000040ULL
  28. #define EFI_FV2_LOCK_STATUS 0x0000000000000080ULL
  29. #define EFI_FV2_WRITE_POLICY_RELIABLE 0x0000000000000100ULL
  30. #define EFI_FV2_READ_LOCK_CAP 0x0000000000001000ULL
  31. #define EFI_FV2_READ_LOCK_STATUS 0x0000000000002000ULL
  32. #define EFI_FV2_WRITE_LOCK_CAP 0x0000000000004000ULL
  33. #define EFI_FV2_WRITE_LOCK_STATUS 0x0000000000008000ULL
  34. #define EFI_FV2_ALIGNMENT 0x00000000001F0000ULL
  35. #define EFI_FV2_ALIGNMENT_1 0x0000000000000000ULL
  36. #define EFI_FV2_ALIGNMENT_2 0x0000000000010000ULL
  37. #define EFI_FV2_ALIGNMENT_4 0x0000000000020000ULL
  38. #define EFI_FV2_ALIGNMENT_8 0x0000000000030000ULL
  39. #define EFI_FV2_ALIGNMENT_16 0x0000000000040000ULL
  40. #define EFI_FV2_ALIGNMENT_32 0x0000000000050000ULL
  41. #define EFI_FV2_ALIGNMENT_64 0x0000000000060000ULL
  42. #define EFI_FV2_ALIGNMENT_128 0x0000000000070000ULL
  43. #define EFI_FV2_ALIGNMENT_256 0x0000000000080000ULL
  44. #define EFI_FV2_ALIGNMENT_512 0x0000000000090000ULL
  45. #define EFI_FV2_ALIGNMENT_1K 0x00000000000A0000ULL
  46. #define EFI_FV2_ALIGNMENT_2K 0x00000000000B0000ULL
  47. #define EFI_FV2_ALIGNMENT_4K 0x00000000000C0000ULL
  48. #define EFI_FV2_ALIGNMENT_8K 0x00000000000D0000ULL
  49. #define EFI_FV2_ALIGNMENT_16K 0x00000000000E0000ULL
  50. #define EFI_FV2_ALIGNMENT_32K 0x00000000000F0000ULL
  51. #define EFI_FV2_ALIGNMENT_64K 0x0000000000100000ULL
  52. #define EFI_FV2_ALIGNMENT_128K 0x0000000000110000ULL
  53. #define EFI_FV2_ALIGNMENT_256K 0x0000000000120000ULL
  54. #define EFI_FV2_ALIGNMENT_512K 0x0000000000130000ULL
  55. #define EFI_FV2_ALIGNMENT_1M 0x0000000000140000ULL
  56. #define EFI_FV2_ALIGNMENT_2M 0x0000000000150000ULL
  57. #define EFI_FV2_ALIGNMENT_4M 0x0000000000160000ULL
  58. #define EFI_FV2_ALIGNMENT_8M 0x0000000000170000ULL
  59. #define EFI_FV2_ALIGNMENT_16M 0x0000000000180000ULL
  60. #define EFI_FV2_ALIGNMENT_32M 0x0000000000190000ULL
  61. #define EFI_FV2_ALIGNMENT_64M 0x00000000001A0000ULL
  62. #define EFI_FV2_ALIGNMENT_128M 0x00000000001B0000ULL
  63. #define EFI_FV2_ALIGNMENT_256M 0x00000000001C0000ULL
  64. #define EFI_FV2_ALIGNMENT_512M 0x00000000001D0000ULL
  65. #define EFI_FV2_ALIGNMENT_1G 0x00000000001E0000ULL
  66. #define EFI_FV2_ALIGNMENT_2G 0x00000000001F0000ULL
  67. #define EFI_FV_UNRELIABLE_WRITE 0x00000000
  68. #define EFI_FV_RELIABLE_WRITE 0x00000001
  69. #define EFI_FV_FILE_ATTRIB_ALIGNMENT 0x0000001F
  70. #define EFI_FV_FILE_ATTRIB_FIXED 0x00000100
  71. #define EFI_FV_FILE_ATTRIB_MEMORY_MAPPED 0x00000200
  72. //
  73. // ------------------------------------------------------ Data Type Definitions
  74. //
  75. typedef struct _EFI_FIRMWARE_VOLUME2_PROTOCOL EFI_FIRMWARE_VOLUME2_PROTOCOL;
  76. typedef UINT64 EFI_FV_ATTRIBUTES;
  77. typedef UINT32 EFI_FV_FILE_ATTRIBUTES;
  78. typedef UINT32 EFI_FV_WRITE_POLICY;
  79. /*++
  80. Structure Description:
  81. This structure defines firmware volume write file data.
  82. Members:
  83. NameGuid - Stores a pointer to the GUID containing the name of the file to
  84. be written.
  85. Type - Stores the file type of the file to be written.
  86. FileAttributes - Stores the file attributes for the file to be written.
  87. Buffer - Stores a pointer to the buffer containing the file contents to be
  88. written.
  89. BufferSize - Stores the size of the file image contained in the buffer.
  90. --*/
  91. typedef struct {
  92. EFI_GUID *NameGuid;
  93. EFI_FV_FILETYPE Type;
  94. EFI_FV_FILE_ATTRIBUTES FileAttributes;
  95. VOID *Buffer;
  96. UINT32 BufferSize;
  97. } EFI_FV_WRITE_FILE_DATA;
  98. typedef
  99. EFI_STATUS
  100. (EFIAPI *EFI_FV_GET_ATTRIBUTES) (
  101. CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
  102. EFI_FV_ATTRIBUTES *Attributes
  103. );
  104. /*++
  105. Routine Description:
  106. This routine returns the attributes and current settings of the firmware
  107. volume. Because of constraints imposed by the underlying firmware storage,
  108. an instance of the Firmware Volume Protocol may not be to able to support
  109. all possible variations of this architecture. These constraints and the
  110. current state of the firmware volume are exposed to the caller using the
  111. get volume attributes function. The get volume attributes function is
  112. callable only from TPL_NOTIFY and below. Behavior of this routine at any
  113. EFI_TPL above TPL_NOTIFY is undefined.
  114. Arguments:
  115. This - Supplies the protocol instance.
  116. Attributes - Supplies a pointer where the volume attributes and current
  117. settings are returned.
  118. Return Value:
  119. EFI_SUCCESS on success.
  120. --*/
  121. typedef
  122. EFI_STATUS
  123. (EFIAPI *EFI_FV_SET_ATTRIBUTES) (
  124. CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
  125. EFI_FV_ATTRIBUTES *Attributes
  126. );
  127. /*++
  128. Routine Description:
  129. This routine modifies current settings of the firmware volume according to
  130. the input parameter. This function is used to set configurable firmware
  131. volume attributes. Only EFI_FV_READ_STATUS, EFI_FV_WRITE_STATUS, and
  132. EFI_FV_LOCK_STATUS may be modified, and then only in accordance with the
  133. declared capabilities. All other bits of FvAttributes are ignored on input.
  134. On successful return, all bits of *FvAttributes are valid and it contains
  135. the completed EFI_FV_ATTRIBUTES for the volume. To modify an attribute, the
  136. corresponding status bit in the EFI_FV_ATTRIBUTES is set to the desired
  137. value on input. The EFI_FV_LOCK_STATUS bit does not affect the ability to
  138. read or write the firmware volume. Rather, once the EFI_FV_LOCK_STATUS bit
  139. is set, it prevents further modification to all the attribute bits. This
  140. routine is callable only from TPL_NOTIFY and below. Behavior of this
  141. routine at any EFI_TPL above TPL_NOTIFY is undefined.
  142. Arguments:
  143. This - Supplies the protocol instance.
  144. Attributes - Supplies a that on input contains the attributes to set. On
  145. output, the new current settings of the firmware volume are returned.
  146. Return Value:
  147. EFI_SUCCESS on success.
  148. EFI_INVALID_PARAMETER if the device does not support the status bit
  149. settings.
  150. EFI_ACCESS_DENIED if the device is locked and does not allow modification.
  151. --*/
  152. typedef
  153. EFI_STATUS
  154. (EFIAPI *EFI_FV_READ_FILE) (
  155. CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
  156. CONST EFI_GUID *NameGuid,
  157. VOID **Buffer,
  158. UINTN *BufferSize,
  159. EFI_FV_FILETYPE *FoundType,
  160. EFI_FV_FILE_ATTRIBUTES *FileAttributes,
  161. UINT32 *AuthenticationStatus
  162. );
  163. /*++
  164. Routine Description:
  165. This routine retrieves a file and/or file information from the firmware
  166. volume. This routine is used to retrieve any file from a firmware volume
  167. during the DXE phase. The actual binary encoding of the file in the
  168. firmware volume media may be in any arbitrary format as long as it does the
  169. following: It is accessed using the Firmware Volume Protocol. The image
  170. that is returned follows the image format defined in Code Definitions:
  171. PI Firmware File Format. If the input buffer is NULL, it indicates the
  172. caller is requesting only that the type, attributes, and size of the file
  173. be returned and that there is no output buffer. In this case, the following
  174. occurs:
  175. - BufferSize is returned with the size that is required to
  176. successfully complete the read.
  177. - The output parameters FoundType and *FileAttributes are
  178. returned with valid values.
  179. - The returned value of *AuthenticationStatus is undefined.
  180. If the input buffer is not NULL, the output buffer is specified by a double
  181. indirection of the Buffer parameter. The input value of *Buffer is used to
  182. determine if the output buffer is caller allocated or is dynamically
  183. allocated by this routine. If the input value of *Buffer is not NULL, it
  184. indicates the output buffer is caller allocated. In this case, the input
  185. value of *BufferSize indicates the size of the caller-allocated output
  186. buffer. If the output buffer is not large enough to contain the entire
  187. requested output, it is filled up to the point that the output buffer is
  188. exhausted and EFI_WARN_BUFFER_TOO_SMALL is returned, and then BufferSize is
  189. returned with the size required to successfully complete the read. All
  190. other output parameters are returned with valid values. If the input buffer
  191. is NULL, it indicates the output buffer is to be allocated by this routine.
  192. In this case, this routine will allocate an appropriately sized buffer from
  193. boot services pool memory, which will be returned in Buffer. The size of
  194. the new buffer is returned in the buffer size parameter and all other
  195. output parameters are returned with valid values. This routine is callable
  196. only from TPL_NOTIFY and below. Behavior of this routine at any EFI_TPL
  197. above TPL_NOTIFY is undefined.
  198. Arguments:
  199. This - Supplies the protocol instance.
  200. NameGuid - Supplies a pointer to a GUID containing the name of the file.
  201. All firmware file names are EFI_GUIDs. Each firmware volume file name
  202. must be unique.
  203. Buffer - Supplies a pointer to a buffer in which the file contents are
  204. returned, not including the file header.
  205. BufferSize - Supplies a pointer that on input indicates the size of the
  206. supplied buffer in bytes.
  207. FoundType - Supplies a pointer where the file type will be returned.
  208. FileAttributes - Supplies a pointer where the file attributes will be
  209. returned.
  210. AuthenticationStatus - Supplies a pointer where the file authentication
  211. status will be returned.
  212. Return Value:
  213. EFI_SUCCESS on success.
  214. EFI_WARN_TOO_SMALL if the buffer is too small to contain the requested
  215. output. The buffer is filled and truncated.
  216. EFI_OUT_OF_RESOURCES if an allocation failed.
  217. EFI_NOT_FOUND if the given name was not in the firmware volume.
  218. EFI_DEVICE_ERROR if a hardware error occurred accessing the device.
  219. EFI_ACCESS_DENIED if the firmware volume is configured to disallow reads.
  220. --*/
  221. typedef
  222. EFI_STATUS
  223. (EFIAPI *EFI_FV_READ_SECTION) (
  224. CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
  225. CONST EFI_GUID *NameGuid,
  226. EFI_SECTION_TYPE SectionType,
  227. UINTN SectionInstance,
  228. VOID **Buffer,
  229. UINTN *BufferSize,
  230. UINT32 *AuthenticationStatus
  231. );
  232. /*++
  233. Routine Description:
  234. This routine locates the requested section within a file and returns it in
  235. a buffer. This routine is used to retrieve a specific section from a file
  236. within a firmware volume. The section returned is determined using a
  237. depth-first, left-to-right search algorithm through all sections found in
  238. the specified file. The output buffer is specified by a double indirection
  239. of the buffer parameter. The input value of Buffer is used to determine if
  240. the output buffer is caller allocated or is dynamically allocated by this
  241. routine. If the input value of the buffer is not NULL, it indicates that
  242. the output buffer is caller allocated. In this case, the input value of
  243. *BufferSize indicates the size of the caller-allocated output buffer. If
  244. the output buffer is not large enough to contain the entire requested
  245. output, it is filled up to the point that the output buffer is exhausted
  246. and EFI_WARN_BUFFER_TOO_SMALL is returned, and then BufferSize is returned
  247. with the size that is required to successfully complete the read. All other
  248. output parameters are returned with valid values. If the input value of the
  249. buffer is NULL, it indicates the output buffer is to be allocated by this
  250. routine. In this case, this routine will allocate an appropriately sized
  251. buffer from boot services pool memory, which will be returned in the buffer
  252. value. The size of the new buffer is returned in *BufferSize and all other
  253. output parameters are returned with valid values. This routine is callable
  254. only from TPL_NOTIFY and below. Behavior of this routine at any EFI_TPL
  255. above TPL_NOTIFY is undefined.
  256. Arguments:
  257. This - Supplies the protocol instance.
  258. NameGuid - Supplies a pointer to a GUID containing the name of the file.
  259. All firmware file names are EFI_GUIDs. Each firmware volume file name
  260. must be unique.
  261. SectionType - Supplies the type of section to return.
  262. SectionInstance - Supplies the occurrence of the given section type to
  263. return.
  264. Buffer - Supplies a pointer to a buffer in which the file contents are
  265. returned, not including the file header.
  266. BufferSize - Supplies a pointer that on input indicates the size of the
  267. supplied buffer in bytes.
  268. AuthenticationStatus - Supplies a pointer where the file authentication
  269. status will be returned.
  270. Return Value:
  271. EFI_SUCCESS on success.
  272. EFI_WARN_TOO_SMALL if the buffer is too small to contain the requested
  273. output. The buffer is filled and truncated.
  274. EFI_OUT_OF_RESOURCES if an allocation failed.
  275. EFI_NOT_FOUND if the requested file or section was not found in the
  276. firmware volume or file.
  277. EFI_DEVICE_ERROR if a hardware error occurred accessing the device.
  278. EFI_ACCESS_DENIED if the firmware volume is configured to disallow reads.
  279. EFI_PROTOCOL_ERROR if the requested section was not found, but the file
  280. could not be fully parsed because a required
  281. GUIDED_SECTION_EXTRACTION_PROTOCOL was not found. The requested section
  282. might have been found if only it could be extracted.
  283. --*/
  284. typedef
  285. EFI_STATUS
  286. (EFIAPI *EFI_FV_WRITE_FILE) (
  287. CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
  288. UINT32 NumberOfFiles,
  289. EFI_FV_WRITE_POLICY WritePolicy,
  290. EFI_FV_WRITE_FILE_DATA *FileData
  291. );
  292. /*++
  293. Routine Description:
  294. This routine is used to write one or more files to a firmware volume. Each
  295. file to be written is described by an EFI_FV_WRITE_FILE_DATA structure.
  296. The caller must ensure that any required alignment for all files listed in
  297. the file data array is compatible with the firmware volume. Firmware volume
  298. capabilities can be determined using the get volume attributes function.
  299. Similarly, if the write policy is set to EFI_FV_RELIABLE_WRITE, the caller
  300. must check the firmware volume capabilities to ensure EFI_FV_RELIABLE_WRITE
  301. is supported by the firmware volume. EFI_FV_UNRELIABLE_WRITE must always be
  302. supported. Writing a file with a size of zero (FileData[n].BufferSize == 0)
  303. deletes the file from the firmware volume if it exists. Deleting a file
  304. must be done one at a time. Deleting a file as part of a multiple file
  305. write is not allowed. This routine is callable only from TPL_NOTIFY and
  306. below. Behavior of this routine at any EFI_TPL above TPL_NOTIFY is
  307. undefined.
  308. Arguments:
  309. This - Supplies the protocol instance.
  310. NumberOfFiles - Supplies the number of elements in the write file data
  311. array.
  312. WritePolicy - Supplies the level of reliability for the write in the event
  313. of a power failure or other system failure during the write operation.
  314. FileData - Supplies a pointer to an array of file data structures, where
  315. each element represents a file to be written.
  316. Return Value:
  317. EFI_SUCCESS on success.
  318. EFI_OUT_OF_RESOURCES if an allocation failed.
  319. EFI_NOT_FOUND if a delete was requested but the specified file was not
  320. found.
  321. EFI_DEVICE_ERROR if a hardware error occurred accessing the device.
  322. EFI_WRITE_PROTECTED if the firmware volume is configured to disallow writes.
  323. EFI_INVALID_PARAMETER if a delete was requested with multiple file writes,
  324. the write policy was unsupported, an unknown file type was specified, or a
  325. file system specific error occurred.
  326. --*/
  327. typedef
  328. EFI_STATUS
  329. (EFIAPI *EFI_FV_GET_NEXT_FILE) (
  330. CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
  331. VOID *Key,
  332. EFI_FV_FILETYPE *FileType,
  333. EFI_GUID *NameGuid,
  334. EFI_FV_FILE_ATTRIBUTES *Attributes,
  335. UINTN *Size
  336. );
  337. /*++
  338. Routine Description:
  339. This routine retrieves information about the next file in the firmware
  340. volume store that matches the search criteria. This routine is the
  341. interface that is used to search a firmware volume for a particular file.
  342. It is called successively until the desired file is located or the function
  343. returns EFI_NOT_FOUND. To filter uninteresting files from the output, the
  344. type of file to search for may be specified in FileType. For example, if the
  345. file type is EFI_FV_FILETYPE_DRIVER, only files of this type will be
  346. returned in the output. If the file type is EFI_FV_FILETYPE_ALL, no
  347. filtering of file types is done. The key parameter is used to indicate a
  348. starting point of the search. If the value of the key parameter is
  349. completely initialized to zero, the search re-initialized and starts at the
  350. beginning. Subsequent calls to this routine must maintain the value of *Key
  351. returned by the immediately previous call. The actual contents of *Key are
  352. implementation specific and no semantic content is implied. This routine is
  353. callable only from TPL_NOTIFY and below. Behavior of this routine at any
  354. EFI_TPL above TPL_NOTIFY is undefined.
  355. Arguments:
  356. This - Supplies the protocol instance.
  357. Key - Supplies a pointer to a caller-allocated buffer containing the
  358. implementation-specific data used to track the current position of the
  359. search. The size of the buffer must be at least This->KeySize bytes
  360. long. To re-initialize the search and begin from the beginning of the
  361. firmware volume, the entire buffer must be cleared to zero. Other than
  362. clearing the buffer to initiate a new search, the caller must not
  363. modify the data in the buffer between calls to this routine.
  364. FileType - Supplies a pointer that on input contains the filter of file
  365. types to search for. If a file is found, its type will be returned
  366. here.
  367. NameGuid - Supplies a pointer where the name GUID of the file will be
  368. returned on success.
  369. Attributes - Supplies a pointer where the file attributes will be returned
  370. on success.
  371. Size - Supplies a pointer where the size of the file is returned on success.
  372. Return Value:
  373. EFI_SUCCESS on success.
  374. EFI_NOT_FOUND if no files of the given file type were found.
  375. EFI_DEVICE_ERROR if a hardware error occurred accessing the device.
  376. EFI_ACCESS_DENIED if the firmware volume does not allow reads.
  377. --*/
  378. typedef
  379. EFI_STATUS
  380. (EFIAPI *EFI_FV_GET_INFO) (
  381. CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
  382. CONST EFI_GUID *InformationType,
  383. UINTN *BufferSize,
  384. VOID *Buffer
  385. );
  386. /*++
  387. Routine Description:
  388. This routine returns information about a firmware volume. this routine
  389. returns information of the requested type for the requested firmware
  390. volume. If the volume does not support the requested information type, then
  391. EFI_UNSUPPORTED is returned. If the buffer is not large enough to hold the
  392. requested structure, EFI_BUFFER_TOO_SMALL is returned and the buffer size
  393. is set to the size of buffer that is required to make the request. The
  394. information types defined by this specification are required information
  395. types that all file systems must support.
  396. Arguments:
  397. This - Supplies the protocol instance.
  398. InformationType - Supplies a pointer to the GUID defining the type of
  399. information being requested.
  400. BufferSize - Supplies a pointer that on input contains the size of the
  401. buffer. On output, contains the size of the data, even if the buffer
  402. was too small.
  403. Buffer - Supplies the buffer where the information value will be returned.
  404. Return Value:
  405. EFI_SUCCESS on success.
  406. EFI_UNSUPPORTED if the information type is not known.
  407. EFI_NO_MEDIA if the device has no media inserted.
  408. EFI_DEVICE_ERROR if a hardware error occurred accessing the device.
  409. EFI_VOLUME_CORRUPTED if the file system structures are gonezo.
  410. EFI_BUFFER_TOO_SMALL if the supplied buffer was not large enough to hold
  411. the requested value. In this case the buffer size will have been updated
  412. to contain the needed value.
  413. --*/
  414. typedef
  415. EFI_STATUS
  416. (EFIAPI *EFI_FV_SET_INFO) (
  417. CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
  418. CONST EFI_GUID *InformationType,
  419. UINTN BufferSize,
  420. CONST VOID *Buffer
  421. );
  422. /*++
  423. Routine Description:
  424. This routine sets information about a firmware volume.
  425. Arguments:
  426. This - Supplies the protocol instance.
  427. InformationType - Supplies a pointer to the GUID defining the type of
  428. information being set.
  429. BufferSize - Supplies the size of the information value in bytes.
  430. Buffer - Supplies the information value.
  431. Return Value:
  432. EFI_SUCCESS on success.
  433. EFI_UNSUPPORTED if the information type is not known.
  434. EFI_NO_MEDIA if the device has no media inserted.
  435. EFI_DEVICE_ERROR if a hardware error occurred accessing the device.
  436. EFI_VOLUME_CORRUPTED if the file system structures are gonezo.
  437. EFI_WRITE_PROTECTED if the volume is read-only.
  438. EFI_BAD_BUFFER_SIZE if the buffer size was smaller than the size of the
  439. type indicated in the information type GUID.
  440. --*/
  441. /*++
  442. Structure Description:
  443. This structure defines firmware volume protocol.
  444. Members:
  445. GetVolumeAttributes - Stores a pointer to a function used to get volume
  446. properties.
  447. SetVolumeAttributes - Stores a pointer to a function used to set volume
  448. properties.
  449. ReadFile - Stores a pointer to a function used to a firmware volume file.
  450. ReadSection - Stores a pointer to a function used to read a section of a
  451. firmware file.
  452. WriteFile - Stores a pointer to a function used to write one or more
  453. files to a firmware volume.
  454. GetNextFile - Stores a pointer to a function used to enumerate files on a
  455. firmware volume.
  456. KeySize - Stores the size of the search key buffer supplied to the get next
  457. file function. This buffer is used internally to indicate the position
  458. in the enumeration.
  459. ParentHandle - Stores the parent firmware volume handle.
  460. GetInfo - Stores a pointer to a function used to get volume information.
  461. SetInfo - Stores a pointer to a function used to set volume information.
  462. --*/
  463. struct _EFI_FIRMWARE_VOLUME2_PROTOCOL {
  464. EFI_FV_GET_ATTRIBUTES GetVolumeAttributes;
  465. EFI_FV_SET_ATTRIBUTES SetVolumeAttributes;
  466. EFI_FV_READ_FILE ReadFile;
  467. EFI_FV_READ_SECTION ReadSection;
  468. EFI_FV_WRITE_FILE WriteFile;
  469. EFI_FV_GET_NEXT_FILE GetNextFile;
  470. UINT32 KeySize;
  471. EFI_HANDLE ParentHandle;
  472. EFI_FV_GET_INFO GetInfo;
  473. EFI_FV_SET_INFO SetInfo;
  474. };
  475. //
  476. // -------------------------------------------------------------------- Globals
  477. //
  478. //
  479. // -------------------------------------------------------- Function Prototypes
  480. //