Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718
  1. /** @file
  2. Include file matches things in PI.
  3. Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
  4. This program and the accompanying materials are licensed and made available under
  5. the terms and conditions of the BSD License that accompanies this distribution.
  6. The full text of the license may be found at
  7. http://opensource.org/licenses/bsd-license.php.
  8. THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
  10. @par Revision Reference:
  11. PI Version 1.2
  12. **/
  13. #ifndef __PI_DXECIS_H__
  14. #define __PI_DXECIS_H__
  15. FILE_LICENCE ( BSD3 );
  16. #include <ipxe/efi/Uefi/UefiMultiPhase.h>
  17. #include <ipxe/efi/Pi/PiMultiPhase.h>
  18. ///
  19. /// Global Coherencey Domain types - Memory type.
  20. ///
  21. typedef enum {
  22. ///
  23. /// A memory region that is visible to the boot processor. However, there are no system
  24. /// components that are currently decoding this memory region.
  25. ///
  26. EfiGcdMemoryTypeNonExistent,
  27. ///
  28. /// A memory region that is visible to the boot processor. This memory region is being
  29. /// decoded by a system component, but the memory region is not considered to be either
  30. /// system memory or memory-mapped I/O.
  31. ///
  32. EfiGcdMemoryTypeReserved,
  33. ///
  34. /// A memory region that is visible to the boot processor. A memory controller is
  35. /// currently decoding this memory region and the memory controller is producing a
  36. /// tested system memory region that is available to the memory services.
  37. ///
  38. EfiGcdMemoryTypeSystemMemory,
  39. ///
  40. /// A memory region that is visible to the boot processor. This memory region is
  41. /// currently being decoded by a component as memory-mapped I/O that can be used to
  42. /// access I/O devices in the platform.
  43. ///
  44. EfiGcdMemoryTypeMemoryMappedIo,
  45. EfiGcdMemoryTypeMaximum
  46. } EFI_GCD_MEMORY_TYPE;
  47. ///
  48. /// Global Coherencey Domain types - IO type.
  49. ///
  50. typedef enum {
  51. ///
  52. /// An I/O region that is visible to the boot processor. However, there are no system
  53. /// components that are currently decoding this I/O region.
  54. ///
  55. EfiGcdIoTypeNonExistent,
  56. ///
  57. /// An I/O region that is visible to the boot processor. This I/O region is currently being
  58. /// decoded by a system component, but the I/O region cannot be used to access I/O devices.
  59. ///
  60. EfiGcdIoTypeReserved,
  61. ///
  62. /// An I/O region that is visible to the boot processor. This I/O region is currently being
  63. /// decoded by a system component that is producing I/O ports that can be used to access I/O devices.
  64. ///
  65. EfiGcdIoTypeIo,
  66. EfiGcdIoTypeMaximum
  67. } EFI_GCD_IO_TYPE;
  68. ///
  69. /// The type of allocation to perform.
  70. ///
  71. typedef enum {
  72. ///
  73. /// The GCD memory space map is searched from the lowest address up to the highest address
  74. /// looking for unallocated memory ranges.
  75. ///
  76. EfiGcdAllocateAnySearchBottomUp,
  77. ///
  78. /// The GCD memory space map is searched from the lowest address up
  79. /// to the specified MaxAddress looking for unallocated memory ranges.
  80. ///
  81. EfiGcdAllocateMaxAddressSearchBottomUp,
  82. ///
  83. /// The GCD memory space map is checked to see if the memory range starting
  84. /// at the specified Address is available.
  85. ///
  86. EfiGcdAllocateAddress,
  87. ///
  88. /// The GCD memory space map is searched from the highest address down to the lowest address
  89. /// looking for unallocated memory ranges.
  90. ///
  91. EfiGcdAllocateAnySearchTopDown,
  92. ///
  93. /// The GCD memory space map is searched from the specified MaxAddress
  94. /// down to the lowest address looking for unallocated memory ranges.
  95. ///
  96. EfiGcdAllocateMaxAddressSearchTopDown,
  97. EfiGcdMaxAllocateType
  98. } EFI_GCD_ALLOCATE_TYPE;
  99. ///
  100. /// EFI_GCD_MEMORY_SPACE_DESCRIPTOR.
  101. ///
  102. typedef struct {
  103. ///
  104. /// The physical address of the first byte in the memory region. Type
  105. /// EFI_PHYSICAL_ADDRESS is defined in the AllocatePages() function
  106. /// description in the UEFI 2.0 specification.
  107. ///
  108. EFI_PHYSICAL_ADDRESS BaseAddress;
  109. ///
  110. /// The number of bytes in the memory region.
  111. ///
  112. UINT64 Length;
  113. ///
  114. /// The bit mask of attributes that the memory region is capable of supporting. The bit
  115. /// mask of available attributes is defined in the GetMemoryMap() function description
  116. /// in the UEFI 2.0 specification.
  117. ///
  118. UINT64 Capabilities;
  119. ///
  120. /// The bit mask of attributes that the memory region is currently using. The bit mask of
  121. /// available attributes is defined in GetMemoryMap().
  122. ///
  123. UINT64 Attributes;
  124. ///
  125. /// Type of the memory region. Type EFI_GCD_MEMORY_TYPE is defined in the
  126. /// AddMemorySpace() function description.
  127. ///
  128. EFI_GCD_MEMORY_TYPE GcdMemoryType;
  129. ///
  130. /// The image handle of the agent that allocated the memory resource described by
  131. /// PhysicalStart and NumberOfBytes. If this field is NULL, then the memory
  132. /// resource is not currently allocated. Type EFI_HANDLE is defined in
  133. /// InstallProtocolInterface() in the UEFI 2.0 specification.
  134. ///
  135. EFI_HANDLE ImageHandle;
  136. ///
  137. /// The device handle for which the memory resource has been allocated. If
  138. /// ImageHandle is NULL, then the memory resource is not currently allocated. If this
  139. /// field is NULL, then the memory resource is not associated with a device that is
  140. /// described by a device handle. Type EFI_HANDLE is defined in
  141. /// InstallProtocolInterface() in the UEFI 2.0 specification.
  142. ///
  143. EFI_HANDLE DeviceHandle;
  144. } EFI_GCD_MEMORY_SPACE_DESCRIPTOR;
  145. ///
  146. /// EFI_GCD_IO_SPACE_DESCRIPTOR.
  147. ///
  148. typedef struct {
  149. ///
  150. /// Physical address of the first byte in the I/O region. Type
  151. /// EFI_PHYSICAL_ADDRESS is defined in the AllocatePages() function
  152. /// description in the UEFI 2.0 specification.
  153. ///
  154. EFI_PHYSICAL_ADDRESS BaseAddress;
  155. ///
  156. /// Number of bytes in the I/O region.
  157. ///
  158. UINT64 Length;
  159. ///
  160. /// Type of the I/O region. Type EFI_GCD_IO_TYPE is defined in the
  161. /// AddIoSpace() function description.
  162. ///
  163. EFI_GCD_IO_TYPE GcdIoType;
  164. ///
  165. /// The image handle of the agent that allocated the I/O resource described by
  166. /// PhysicalStart and NumberOfBytes. If this field is NULL, then the I/O
  167. /// resource is not currently allocated. Type EFI_HANDLE is defined in
  168. /// InstallProtocolInterface() in the UEFI 2.0 specification.
  169. ///
  170. EFI_HANDLE ImageHandle;
  171. ///
  172. /// The device handle for which the I/O resource has been allocated. If ImageHandle
  173. /// is NULL, then the I/O resource is not currently allocated. If this field is NULL, then
  174. /// the I/O resource is not associated with a device that is described by a device handle.
  175. /// Type EFI_HANDLE is defined in InstallProtocolInterface() in the UEFI
  176. /// 2.0 specification.
  177. ///
  178. EFI_HANDLE DeviceHandle;
  179. } EFI_GCD_IO_SPACE_DESCRIPTOR;
  180. /**
  181. Adds reserved memory, system memory, or memory-mapped I/O resources to the
  182. global coherency domain of the processor.
  183. @param GcdMemoryType The type of memory resource being added.
  184. @param BaseAddress The physical address that is the start address
  185. of the memory resource being added.
  186. @param Length The size, in bytes, of the memory resource that
  187. is being added.
  188. @param Capabilities The bit mask of attributes that the memory
  189. resource region supports.
  190. @retval EFI_SUCCESS The memory resource was added to the global
  191. coherency domain of the processor.
  192. @retval EFI_INVALID_PARAMETER GcdMemoryType is invalid.
  193. @retval EFI_INVALID_PARAMETER Length is zero.
  194. @retval EFI_OUT_OF_RESOURCES There are not enough system resources to add
  195. the memory resource to the global coherency
  196. domain of the processor.
  197. @retval EFI_UNSUPPORTED The processor does not support one or more bytes
  198. of the memory resource range specified by
  199. BaseAddress and Length.
  200. @retval EFI_ACCESS_DENIED One or more bytes of the memory resource range
  201. specified by BaseAddress and Length conflicts
  202. with a memory resource range that was previously
  203. added to the global coherency domain of the processor.
  204. @retval EFI_ACCESS_DENIED One or more bytes of the memory resource range
  205. specified by BaseAddress and Length was allocated
  206. in a prior call to AllocateMemorySpace().
  207. **/
  208. typedef
  209. EFI_STATUS
  210. (EFIAPI *EFI_ADD_MEMORY_SPACE)(
  211. IN EFI_GCD_MEMORY_TYPE GcdMemoryType,
  212. IN EFI_PHYSICAL_ADDRESS BaseAddress,
  213. IN UINT64 Length,
  214. IN UINT64 Capabilities
  215. );
  216. /**
  217. Allocates nonexistent memory, reserved memory, system memory, or memorymapped
  218. I/O resources from the global coherency domain of the processor.
  219. @param GcdAllocateType The type of allocation to perform.
  220. @param GcdMemoryType The type of memory resource being allocated.
  221. @param Alignment The log base 2 of the boundary that BaseAddress must
  222. be aligned on output. Align with 2^Alignment.
  223. @param Length The size in bytes of the memory resource range that
  224. is being allocated.
  225. @param BaseAddress A pointer to a physical address to allocate.
  226. @param Imagehandle The image handle of the agent that is allocating
  227. the memory resource.
  228. @param DeviceHandle The device handle for which the memory resource
  229. is being allocated.
  230. @retval EFI_INVALID_PARAMETER GcdAllocateType is invalid.
  231. @retval EFI_INVALID_PARAMETER GcdMemoryType is invalid.
  232. @retval EFI_INVALID_PARAMETER Length is zero.
  233. @retval EFI_INVALID_PARAMETER BaseAddress is NULL.
  234. @retval EFI_INVALID_PARAMETER ImageHandle is NULL.
  235. @retval EFI_NOT_FOUND The memory resource request could not be satisfied.
  236. No descriptor contains the desired space.
  237. @retval EFI_OUT_OF_RESOURCES There are not enough system resources to allocate the memory
  238. resource from the global coherency domain of the processor.
  239. @retval EFI_SUCCESS The memory resource was allocated from the global coherency
  240. domain of the processor.
  241. **/
  242. typedef
  243. EFI_STATUS
  244. (EFIAPI *EFI_ALLOCATE_MEMORY_SPACE)(
  245. IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType,
  246. IN EFI_GCD_MEMORY_TYPE GcdMemoryType,
  247. IN UINTN Alignment,
  248. IN UINT64 Length,
  249. IN OUT EFI_PHYSICAL_ADDRESS *BaseAddress,
  250. IN EFI_HANDLE ImageHandle,
  251. IN EFI_HANDLE DeviceHandle OPTIONAL
  252. );
  253. /**
  254. Frees nonexistent memory, reserved memory, system memory, or memory-mapped
  255. I/O resources from the global coherency domain of the processor.
  256. @param BaseAddress The physical address that is the start address of the memory resource being freed.
  257. @param Length The size in bytes of the memory resource range that is being freed.
  258. @retval EFI_SUCCESS The memory resource was freed from the global coherency domain of
  259. the processor.
  260. @retval EFI_INVALID_PARAMETER Length is zero.
  261. @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the memory
  262. resource range specified by BaseAddress and Length.
  263. @retval EFI_NOT_FOUND The memory resource range specified by BaseAddress and
  264. Length was not allocated with previous calls to AllocateMemorySpace().
  265. @retval EFI_OUT_OF_RESOURCES There are not enough system resources to free the memory resource
  266. from the global coherency domain of the processor.
  267. **/
  268. typedef
  269. EFI_STATUS
  270. (EFIAPI *EFI_FREE_MEMORY_SPACE)(
  271. IN EFI_PHYSICAL_ADDRESS BaseAddress,
  272. IN UINT64 Length
  273. );
  274. /**
  275. Removes reserved memory, system memory, or memory-mapped I/O resources from
  276. the global coherency domain of the processor.
  277. @param BaseAddress The physical address that is the start address of the memory resource being removed.
  278. @param Length The size in bytes of the memory resource that is being removed.
  279. @retval EFI_SUCCESS The memory resource was removed from the global coherency
  280. domain of the processor.
  281. @retval EFI_INVALID_PARAMETER Length is zero.
  282. @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the memory
  283. resource range specified by BaseAddress and Length.
  284. @retval EFI_NOT_FOUND One or more bytes of the memory resource range specified by
  285. BaseAddress and Length was not added with previous calls to
  286. AddMemorySpace().
  287. @retval EFI_ACCESS_DEFINED One or more bytes of the memory resource range specified by
  288. BaseAddress and Length has been allocated with AllocateMemorySpace().
  289. @retval EFI_OUT_OF_RESOURCES There are not enough system resources to remove the memory
  290. resource from the global coherency domain of the processor.
  291. **/
  292. typedef
  293. EFI_STATUS
  294. (EFIAPI *EFI_REMOVE_MEMORY_SPACE)(
  295. IN EFI_PHYSICAL_ADDRESS BaseAddress,
  296. IN UINT64 Length
  297. );
  298. /**
  299. Retrieves the descriptor for a memory region containing a specified address.
  300. @param BaseAddress The physical address that is the start address of a memory region.
  301. @param Descriptor A pointer to a caller allocated descriptor.
  302. @retval EFI_SUCCESS The descriptor for the memory resource region containing
  303. BaseAddress was returned in Descriptor.
  304. @retval EFI_INVALID_PARAMETER Descriptor is NULL.
  305. @retval EFI_NOT_FOUND A memory resource range containing BaseAddress was not found.
  306. **/
  307. typedef
  308. EFI_STATUS
  309. (EFIAPI *EFI_GET_MEMORY_SPACE_DESCRIPTOR)(
  310. IN EFI_PHYSICAL_ADDRESS BaseAddress,
  311. OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR *Descriptor
  312. );
  313. /**
  314. Modifies the attributes for a memory region in the global coherency domain of the
  315. processor.
  316. @param BaseAddress The physical address that is the start address of a memory region.
  317. @param Length The size in bytes of the memory region.
  318. @param Attributes The bit mask of attributes to set for the memory region.
  319. @retval EFI_SUCCESS The attributes were set for the memory region.
  320. @retval EFI_INVALID_PARAMETER Length is zero.
  321. @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the memory
  322. resource range specified by BaseAddress and Length.
  323. @retval EFI_UNSUPPORTED The bit mask of attributes is not support for the memory resource
  324. range specified by BaseAddress and Length.
  325. @retval EFI_ACCESS_DEFINED The attributes for the memory resource range specified by
  326. BaseAddress and Length cannot be modified.
  327. @retval EFI_OUT_OF_RESOURCES There are not enough system resources to modify the attributes of
  328. the memory resource range.
  329. @retval EFI_NOT_AVAILABLE_YET The attributes cannot be set because CPU architectural protocol is
  330. not available yet.
  331. **/
  332. typedef
  333. EFI_STATUS
  334. (EFIAPI *EFI_SET_MEMORY_SPACE_ATTRIBUTES)(
  335. IN EFI_PHYSICAL_ADDRESS BaseAddress,
  336. IN UINT64 Length,
  337. IN UINT64 Attributes
  338. );
  339. /**
  340. Returns a map of the memory resources in the global coherency domain of the
  341. processor.
  342. @param NumberOfDescriptors A pointer to number of descriptors returned in the MemorySpaceMap buffer.
  343. @param MemorySpaceMap A pointer to the array of EFI_GCD_MEMORY_SPACE_DESCRIPTORs.
  344. @retval EFI_SUCCESS The memory space map was returned in the MemorySpaceMap
  345. buffer, and the number of descriptors in MemorySpaceMap was
  346. returned in NumberOfDescriptors.
  347. @retval EFI_INVALID_PARAMETER NumberOfDescriptors is NULL.
  348. @retval EFI_INVALID_PARAMETER MemorySpaceMap is NULL.
  349. @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate MemorySpaceMap.
  350. **/
  351. typedef
  352. EFI_STATUS
  353. (EFIAPI *EFI_GET_MEMORY_SPACE_MAP)(
  354. OUT UINTN *NumberOfDescriptors,
  355. OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR **MemorySpaceMap
  356. );
  357. /**
  358. Adds reserved I/O or I/O resources to the global coherency domain of the processor.
  359. @param GcdIoType The type of I/O resource being added.
  360. @param BaseAddress The physical address that is the start address of the I/O resource being added.
  361. @param Length The size in bytes of the I/O resource that is being added.
  362. @retval EFI_SUCCESS The I/O resource was added to the global coherency domain of
  363. the processor.
  364. @retval EFI_INVALID_PARAMETER GcdIoType is invalid.
  365. @retval EFI_INVALID_PARAMETER Length is zero.
  366. @retval EFI_OUT_OF_RESOURCES There are not enough system resources to add the I/O resource to
  367. the global coherency domain of the processor.
  368. @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the I/O
  369. resource range specified by BaseAddress and Length.
  370. @retval EFI_ACCESS_DENIED One or more bytes of the I/O resource range specified by
  371. BaseAddress and Length conflicts with an I/O resource
  372. range that was previously added to the global coherency domain
  373. of the processor.
  374. @retval EFI_ACCESS_DENIED One or more bytes of the I/O resource range specified by
  375. BaseAddress and Length was allocated in a prior call to
  376. AllocateIoSpace().
  377. **/
  378. typedef
  379. EFI_STATUS
  380. (EFIAPI *EFI_ADD_IO_SPACE)(
  381. IN EFI_GCD_IO_TYPE GcdIoType,
  382. IN EFI_PHYSICAL_ADDRESS BaseAddress,
  383. IN UINT64 Length
  384. );
  385. /**
  386. Allocates nonexistent I/O, reserved I/O, or I/O resources from the global coherency
  387. domain of the processor.
  388. @param GcdAllocateType The type of allocation to perform.
  389. @param GcdIoType The type of I/O resource being allocated.
  390. @param Alignment The log base 2 of the boundary that BaseAddress must be aligned on output.
  391. @param Length The size in bytes of the I/O resource range that is being allocated.
  392. @param BaseAddress A pointer to a physical address.
  393. @param Imagehandle The image handle of the agent that is allocating the I/O resource.
  394. @param DeviceHandle The device handle for which the I/O resource is being allocated.
  395. @retval EFI_SUCCESS The I/O resource was allocated from the global coherency domain
  396. of the processor.
  397. @retval EFI_INVALID_PARAMETER GcdAllocateType is invalid.
  398. @retval EFI_INVALID_PARAMETER GcdIoType is invalid.
  399. @retval EFI_INVALID_PARAMETER Length is zero.
  400. @retval EFI_INVALID_PARAMETER BaseAddress is NULL.
  401. @retval EFI_INVALID_PARAMETER ImageHandle is NULL.
  402. @retval EFI_OUT_OF_RESOURCES There are not enough system resources to allocate the I/O
  403. resource from the global coherency domain of the processor.
  404. @retval EFI_NOT_FOUND The I/O resource request could not be satisfied.
  405. **/
  406. typedef
  407. EFI_STATUS
  408. (EFIAPI *EFI_ALLOCATE_IO_SPACE)(
  409. IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType,
  410. IN EFI_GCD_IO_TYPE GcdIoType,
  411. IN UINTN Alignment,
  412. IN UINT64 Length,
  413. IN OUT EFI_PHYSICAL_ADDRESS *BaseAddress,
  414. IN EFI_HANDLE ImageHandle,
  415. IN EFI_HANDLE DeviceHandle OPTIONAL
  416. );
  417. /**
  418. Frees nonexistent I/O, reserved I/O, or I/O resources from the global coherency
  419. domain of the processor.
  420. @param BaseAddress The physical address that is the start address of the I/O resource being freed.
  421. @param Length The size in bytes of the I/O resource range that is being freed.
  422. @retval EFI_SUCCESS The I/O resource was freed from the global coherency domain of the
  423. processor.
  424. @retval EFI_INVALID_PARAMETER Length is zero.
  425. @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the I/O resource
  426. range specified by BaseAddress and Length.
  427. @retval EFI_NOT_FOUND The I/O resource range specified by BaseAddress and Length
  428. was not allocated with previous calls to AllocateIoSpace().
  429. @retval EFI_OUT_OF_RESOURCES There are not enough system resources to free the I/O resource from
  430. the global coherency domain of the processor.
  431. **/
  432. typedef
  433. EFI_STATUS
  434. (EFIAPI *EFI_FREE_IO_SPACE)(
  435. IN EFI_PHYSICAL_ADDRESS BaseAddress,
  436. IN UINT64 Length
  437. );
  438. /**
  439. Removes reserved I/O or I/O resources from the global coherency domain of the
  440. processor.
  441. @param BaseAddress A pointer to a physical address that is the start address of the I/O resource being
  442. removed.
  443. @param Length The size in bytes of the I/O resource that is being removed.
  444. @retval EFI_SUCCESS The I/O resource was removed from the global coherency domain
  445. of the processor.
  446. @retval EFI_INVALID_PARAMETER Length is zero.
  447. @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the I/O
  448. resource range specified by BaseAddress and Length.
  449. @retval EFI_NOT_FOUND One or more bytes of the I/O resource range specified by
  450. BaseAddress and Length was not added with previous
  451. calls to AddIoSpace().
  452. @retval EFI_ACCESS_DENIED One or more bytes of the I/O resource range specified by
  453. BaseAddress and Length has been allocated with
  454. AllocateIoSpace().
  455. @retval EFI_OUT_OF_RESOURCES There are not enough system resources to remove the I/O
  456. resource from the global coherency domain of the processor.
  457. **/
  458. typedef
  459. EFI_STATUS
  460. (EFIAPI *EFI_REMOVE_IO_SPACE)(
  461. IN EFI_PHYSICAL_ADDRESS BaseAddress,
  462. IN UINT64 Length
  463. );
  464. /**
  465. Retrieves the descriptor for an I/O region containing a specified address.
  466. @param BaseAddress The physical address that is the start address of an I/O region.
  467. @param Descriptor A pointer to a caller allocated descriptor.
  468. @retval EFI_SUCCESS The descriptor for the I/O resource region containing
  469. BaseAddress was returned in Descriptor.
  470. @retval EFI_INVALID_PARAMETER Descriptor is NULL.
  471. @retval EFI_NOT_FOUND An I/O resource range containing BaseAddress was not found.
  472. **/
  473. typedef
  474. EFI_STATUS
  475. (EFIAPI *EFI_GET_IO_SPACE_DESCRIPTOR)(
  476. IN EFI_PHYSICAL_ADDRESS BaseAddress,
  477. OUT EFI_GCD_IO_SPACE_DESCRIPTOR *Descriptor
  478. );
  479. /**
  480. Returns a map of the I/O resources in the global coherency domain of the processor.
  481. @param NumberOfDescriptors A pointer to number of descriptors returned in the IoSpaceMap buffer.
  482. @param MemorySpaceMap A pointer to the array of EFI_GCD_IO_SPACE_DESCRIPTORs.
  483. @retval EFI_SUCCESS The I/O space map was returned in the IoSpaceMap buffer, and
  484. the number of descriptors in IoSpaceMap was returned in
  485. NumberOfDescriptors.
  486. @retval EFI_INVALID_PARAMETER NumberOfDescriptors is NULL.
  487. @retval EFI_INVALID_PARAMETER IoSpaceMap is NULL.
  488. @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate IoSpaceMap.
  489. **/
  490. typedef
  491. EFI_STATUS
  492. (EFIAPI *EFI_GET_IO_SPACE_MAP)(
  493. OUT UINTN *NumberOfDescriptors,
  494. OUT EFI_GCD_IO_SPACE_DESCRIPTOR **IoSpaceMap
  495. );
  496. /**
  497. Loads and executed DXE drivers from firmware volumes.
  498. The Dispatch() function searches for DXE drivers in firmware volumes that have been
  499. installed since the last time the Dispatch() service was called. It then evaluates
  500. the dependency expressions of all the DXE drivers and loads and executes those DXE
  501. drivers whose dependency expression evaluate to TRUE. This service must interact with
  502. the Security Architectural Protocol to authenticate DXE drivers before they are executed.
  503. This process is continued until no more DXE drivers can be executed.
  504. @retval EFI_SUCCESS One or more DXE driver were dispatched.
  505. @retval EFI_NOT_FOUND No DXE drivers were dispatched.
  506. @retval EFI_ALREADY_STARTED An attempt is being made to start the DXE Dispatcher recursively.
  507. Thus, no action was taken.
  508. **/
  509. typedef
  510. EFI_STATUS
  511. (EFIAPI *EFI_DISPATCH)(
  512. VOID
  513. );
  514. /**
  515. Clears the Schedule on Request (SOR) flag for a component that is stored in a firmware volume.
  516. @param FirmwareVolumeHandle The handle of the firmware volume that contains the file specified by FileName.
  517. @param FileName A pointer to the name of the file in a firmware volume.
  518. @retval EFI_SUCCESS The DXE driver was found and its SOR bit was cleared.
  519. @retval EFI_NOT_FOUND The DXE driver does not exist, or the DXE driver exists and its SOR
  520. bit is not set.
  521. **/
  522. typedef
  523. EFI_STATUS
  524. (EFIAPI *EFI_SCHEDULE)(
  525. IN EFI_HANDLE FirmwareVolumeHandle,
  526. IN CONST EFI_GUID *FileName
  527. );
  528. /**
  529. Promotes a file stored in a firmware volume from the untrusted to the trusted state.
  530. @param FirmwareVolumeHandle The handle of the firmware volume that contains the file specified by FileName.
  531. @param DriverName A pointer to the name of the file in a firmware volume.
  532. @return Status of promoting FFS from untrusted to trusted
  533. state.
  534. @retval EFI_NOT_FOUND The file was not found in the untrusted state.
  535. **/
  536. typedef
  537. EFI_STATUS
  538. (EFIAPI *EFI_TRUST)(
  539. IN EFI_HANDLE FirmwareVolumeHandle,
  540. IN CONST EFI_GUID *FileName
  541. );
  542. /**
  543. Creates a firmware volume handle for a firmware volume that is present in system memory.
  544. @param FirmwareVolumeHeader A pointer to the header of the firmware volume.
  545. @param Size The size, in bytes, of the firmware volume.
  546. @param FirmwareVolumeHandle On output, a pointer to the created handle.
  547. @retval EFI_SUCCESS The EFI_FIRMWARE_VOLUME_PROTOCOL and
  548. EFI_DEVICE_PATH_PROTOCOL were installed onto
  549. FirmwareVolumeHandle for the firmware volume described
  550. by FirmwareVolumeHeader and Size.
  551. @retval EFI_VOLUME_CORRUPTED The firmware volume described by FirmwareVolumeHeader
  552. and Size is corrupted.
  553. @retval EFI_OUT_OF_RESOURCES There are not enough system resources available to produce the
  554. EFI_FIRMWARE_VOLUME_PROTOCOL and EFI_DEVICE_PATH_PROTOCOL
  555. for the firmware volume described by FirmwareVolumeHeader and Size.
  556. **/
  557. typedef
  558. EFI_STATUS
  559. (EFIAPI *EFI_PROCESS_FIRMWARE_VOLUME)(
  560. IN CONST VOID *FirmwareVolumeHeader,
  561. IN UINTN Size,
  562. OUT EFI_HANDLE *FirmwareVolumeHandle
  563. );
  564. //
  565. // DXE Services Table
  566. //
  567. #define DXE_SERVICES_SIGNATURE 0x565245535f455844ULL
  568. #define DXE_SPECIFICATION_MAJOR_REVISION 1
  569. #define DXE_SPECIFICATION_MINOR_REVISION 30
  570. #define DXE_SERVICES_REVISION ((DXE_SPECIFICATION_MAJOR_REVISION<<16) | (DXE_SPECIFICATION_MINOR_REVISION))
  571. typedef struct {
  572. ///
  573. /// The table header for the DXE Services Table.
  574. /// This header contains the DXE_SERVICES_SIGNATURE and DXE_SERVICES_REVISION values.
  575. ///
  576. EFI_TABLE_HEADER Hdr;
  577. //
  578. // Global Coherency Domain Services
  579. //
  580. EFI_ADD_MEMORY_SPACE AddMemorySpace;
  581. EFI_ALLOCATE_MEMORY_SPACE AllocateMemorySpace;
  582. EFI_FREE_MEMORY_SPACE FreeMemorySpace;
  583. EFI_REMOVE_MEMORY_SPACE RemoveMemorySpace;
  584. EFI_GET_MEMORY_SPACE_DESCRIPTOR GetMemorySpaceDescriptor;
  585. EFI_SET_MEMORY_SPACE_ATTRIBUTES SetMemorySpaceAttributes;
  586. EFI_GET_MEMORY_SPACE_MAP GetMemorySpaceMap;
  587. EFI_ADD_IO_SPACE AddIoSpace;
  588. EFI_ALLOCATE_IO_SPACE AllocateIoSpace;
  589. EFI_FREE_IO_SPACE FreeIoSpace;
  590. EFI_REMOVE_IO_SPACE RemoveIoSpace;
  591. EFI_GET_IO_SPACE_DESCRIPTOR GetIoSpaceDescriptor;
  592. EFI_GET_IO_SPACE_MAP GetIoSpaceMap;
  593. //
  594. // Dispatcher Services
  595. //
  596. EFI_DISPATCH Dispatch;
  597. EFI_SCHEDULE Schedule;
  598. EFI_TRUST Trust;
  599. //
  600. // Service to process a single firmware volume found in a capsule
  601. //
  602. EFI_PROCESS_FIRMWARE_VOLUME ProcessFirmwareVolume;
  603. } DXE_SERVICES;
  604. typedef DXE_SERVICES EFI_DXE_SERVICES;
  605. /**
  606. The function prototype for invoking a function on an Application Processor.
  607. This definition is used by the UEFI MP Serices Protocol, and the
  608. PI SMM System Table.
  609. @param[in,out] Buffer The pointer to private data buffer.
  610. **/
  611. typedef
  612. VOID
  613. (EFIAPI *EFI_AP_PROCEDURE)(
  614. IN OUT VOID *Buffer
  615. );
  616. #endif