Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

PiDxeCis.h 26KB

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