You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PiDxeCis.h 29KB

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