PiDxeCis.h 31 KB

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