ueficore.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377
  1. /*++
  2. Copyright (c) 2014 Minoca Corp. All Rights Reserved
  3. Module Name:
  4. ueficore.h
  5. Abstract:
  6. This header contains internal definitions for the UEFI core.
  7. Author:
  8. Evan Green 26-Feb-2014
  9. --*/
  10. //
  11. // ------------------------------------------------------------------- Includes
  12. //
  13. //
  14. // Define away API decorators, as everything is linked statically.
  15. //
  16. #define RTL_API
  17. #define KERNEL_API
  18. #include <minoca/lib/types.h>
  19. #include <minoca/lib/status.h>
  20. #include <minoca/kernel/arch.h>
  21. #include <minoca/lib/rtl.h>
  22. #include <uefifw.h>
  23. #include "image.h"
  24. #include "lock.h"
  25. #include "devpath.h"
  26. #include "handle.h"
  27. #include "memory.h"
  28. #include "runtime.h"
  29. #include "shortcut.h"
  30. //
  31. // --------------------------------------------------------------------- Macros
  32. //
  33. #define EFI_UNPACK_UINT32(_Pointer) \
  34. (((UINT8 *)_Pointer)[0] | \
  35. (((UINT8 *)_Pointer)[1] << 8) | \
  36. (((UINT8 *)_Pointer)[2] << 16) | \
  37. (((UINT8 *)_Pointer)[3] << 24))
  38. //
  39. // ---------------------------------------------------------------- Definitions
  40. //
  41. //
  42. // ------------------------------------------------------ Data Type Definitions
  43. //
  44. #if defined(EFI_X86)
  45. typedef struct _EFI_JUMP_BUFFER {
  46. UINT32 Ebx;
  47. UINT32 Esi;
  48. UINT32 Edi;
  49. UINT32 Ebp;
  50. UINT32 Esp;
  51. UINT32 Eip;
  52. } EFI_JUMP_BUFFER, *PEFI_JUMP_BUFFER;
  53. #define EFI_JUMP_BUFFER_ALIGNMENT 4
  54. #elif defined(EFI_ARM)
  55. typedef struct _EFI_JUMP_BUFFER {
  56. UINT32 R3;
  57. UINT32 R4;
  58. UINT32 R5;
  59. UINT32 R6;
  60. UINT32 R7;
  61. UINT32 R8;
  62. UINT32 R9;
  63. UINT32 R10;
  64. UINT32 R11;
  65. UINT32 R12;
  66. UINT32 R14;
  67. } EFI_JUMP_BUFFER, *PEFI_JUMP_BUFFER;
  68. #define EFI_JUMP_BUFFER_ALIGNMENT 4
  69. #else
  70. #error Unsupported Architecture
  71. #endif
  72. //
  73. // -------------------------------------------------------------------- Globals
  74. //
  75. extern EFI_TPL EfiCurrentTpl;
  76. extern UINTN EfiEventsPending;
  77. //
  78. // Define timer services data.
  79. //
  80. extern UINT32 EfiClockTimerInterruptNumber;
  81. //
  82. // Store the runtime handoff information.
  83. //
  84. extern EFI_RUNTIME_ARCH_PROTOCOL *EfiRuntimeProtocol;
  85. //
  86. // Store the image handle of the firmware itself.
  87. //
  88. extern EFI_HANDLE EfiFirmwareImageHandle;
  89. //
  90. // -------------------------------------------------------- Function Prototypes
  91. //
  92. VOID
  93. EfipInitializeProcessor (
  94. VOID
  95. );
  96. /*++
  97. Routine Description:
  98. This routine initializes processor-specific structures. In the case of x86,
  99. it initializes the GDT and TSS.
  100. Arguments:
  101. None.
  102. Return Value:
  103. None.
  104. --*/
  105. EFIAPI
  106. EFI_TPL
  107. EfiCoreRaiseTpl (
  108. EFI_TPL NewTpl
  109. );
  110. /*++
  111. Routine Description:
  112. This routine raises the current Task Priority Level.
  113. Arguments:
  114. NewTpl - Supplies the new TPL to set.
  115. Return Value:
  116. Returns the previous TPL.
  117. --*/
  118. EFIAPI
  119. VOID
  120. EfiCoreRestoreTpl (
  121. EFI_TPL OldTpl
  122. );
  123. /*++
  124. Routine Description:
  125. This routine restores the Task Priority Level back to its original value
  126. before it was raised.
  127. Arguments:
  128. OldTpl - Supplies the original TPL to restore back to.
  129. Return Value:
  130. None.
  131. --*/
  132. EFI_STATUS
  133. EfiCoreInitializeInterruptServices (
  134. VOID
  135. );
  136. /*++
  137. Routine Description:
  138. This routine initializes core interrupt services.
  139. Arguments:
  140. None.
  141. Return Value:
  142. EFI status code.
  143. --*/
  144. VOID
  145. EfiCoreTerminateInterruptServices (
  146. VOID
  147. );
  148. /*++
  149. Routine Description:
  150. This routine terminates interrupt services in preparation for transitioning
  151. out of boot services.
  152. Arguments:
  153. None.
  154. Return Value:
  155. None.
  156. --*/
  157. VOID
  158. EfiCoreDispatchInterrupt (
  159. VOID
  160. );
  161. /*++
  162. Routine Description:
  163. This routine is called to service an interrupt.
  164. Arguments:
  165. None.
  166. Return Value:
  167. None.
  168. --*/
  169. EFIAPI
  170. EFI_STATUS
  171. EfiCoreGetNextMonotonicCount (
  172. UINT64 *Count
  173. );
  174. /*++
  175. Routine Description:
  176. This routine returns a monotonically increasing count for the platform.
  177. Arguments:
  178. Count - Supplies a pointer where the next count is returned.
  179. Return Value:
  180. EFI_SUCCESS on success.
  181. EFI_INVALID_PARAMETER if the count is NULL.
  182. EFI_DEVICE_ERROR if the device is not functioning properly.
  183. --*/
  184. EFIAPI
  185. EFI_STATUS
  186. EfiCoreStall (
  187. UINTN Microseconds
  188. );
  189. /*++
  190. Routine Description:
  191. This routine induces a fine-grained delay.
  192. Arguments:
  193. Microseconds - Supplies the number of microseconds to stall execution for.
  194. Return Value:
  195. EFI_SUCCESS on success.
  196. --*/
  197. EFIAPI
  198. EFI_STATUS
  199. EfiCoreSetWatchdogTimer (
  200. UINTN Timeout,
  201. UINT64 WatchdogCode,
  202. UINTN DataSize,
  203. CHAR16 *WatchdogData
  204. );
  205. /*++
  206. Routine Description:
  207. This routine sets the system's watchdog timer.
  208. Arguments:
  209. Timeout - Supplies the number of seconds to set the timer for.
  210. WatchdogCode - Supplies a numeric code to log on a watchdog timeout event.
  211. DataSize - Supplies the size of the watchdog data.
  212. WatchdogData - Supplies an optional buffer that includes a null-terminated
  213. string, optionally followed by additional binary data.
  214. Return Value:
  215. EFI_SUCCESS on success.
  216. EFI_INVALID_PARAMETER if the supplied watchdog code is invalid.
  217. EFI_UNSUPPORTED if there is no watchdog timer.
  218. EFI_DEVICE_ERROR if an error occurred accessing the device hardware.
  219. --*/
  220. UINT64
  221. EfiCoreReadTimeCounter (
  222. VOID
  223. );
  224. /*++
  225. Routine Description:
  226. This routine reads the current time counter value.
  227. Arguments:
  228. None.
  229. Return Value:
  230. Returns a 64-bit non-decreasing value.
  231. 0 if the time counter is not implemented.
  232. --*/
  233. UINT64
  234. EfiCoreReadRecentTimeCounter (
  235. VOID
  236. );
  237. /*++
  238. Routine Description:
  239. This routine reads a relatively recent but not entirely up to date version
  240. of the time counter.
  241. Arguments:
  242. None.
  243. Return Value:
  244. Returns a 64-bit non-decreasing value.
  245. 0 if the time counter is not implemented.
  246. --*/
  247. UINT64
  248. EfiCoreGetTimeCounterFrequency (
  249. VOID
  250. );
  251. /*++
  252. Routine Description:
  253. This routine returns the frequency of the time counter.
  254. Arguments:
  255. None.
  256. Return Value:
  257. Returns the frequency of the time counter.
  258. 0 if the time counter is not implemented.
  259. --*/
  260. VOID
  261. EfiCoreServiceClockInterrupt (
  262. UINT32 InterruptNumber
  263. );
  264. /*++
  265. Routine Description:
  266. This routine is called to service the clock interrupt.
  267. Arguments:
  268. InterruptNumber - Supplies the interrupt number that fired.
  269. Return Value:
  270. None.
  271. --*/
  272. EFI_STATUS
  273. EfiCoreInitializeTimerServices (
  274. VOID
  275. );
  276. /*++
  277. Routine Description:
  278. This routine initializes platform timer services, including the periodic
  279. tick and time counter.
  280. Arguments:
  281. None.
  282. Return Value:
  283. EFI status code.
  284. --*/
  285. VOID
  286. EfiCoreTerminateTimerServices (
  287. VOID
  288. );
  289. /*++
  290. Routine Description:
  291. This routine terminates timer services in preparation for the termination
  292. of boot services.
  293. Arguments:
  294. None.
  295. Return Value:
  296. None.
  297. --*/
  298. EFIAPI
  299. EFI_STATUS
  300. EfiCoreCreateEvent (
  301. UINT32 Type,
  302. EFI_TPL NotifyTpl,
  303. EFI_EVENT_NOTIFY NotifyFunction,
  304. VOID *NotifyContext,
  305. EFI_EVENT *Event
  306. );
  307. /*++
  308. Routine Description:
  309. This routine creates an event.
  310. Arguments:
  311. Type - Supplies the type of event to create, as well as its mode and
  312. attributes.
  313. NotifyTpl - Supplies an optional task priority level of event notifications.
  314. NotifyFunction - Supplies an optional pointer to the event's notification
  315. function.
  316. NotifyContext - Supplies an optional context pointer that will be passed
  317. to the notify function when the event is signaled.
  318. Event - Supplies a pointer where the new event will be returned on success.
  319. Return Value:
  320. EFI_SUCCESS on success.
  321. EFI_INVALID_PARAMETER if one or more parameters are not valid.
  322. EFI_OUT_OF_RESOURCES if memory could not be allocated.
  323. --*/
  324. EFIAPI
  325. EFI_STATUS
  326. EfiCoreCreateEventEx (
  327. UINT32 Type,
  328. EFI_TPL NotifyTpl,
  329. EFI_EVENT_NOTIFY NotifyFunction,
  330. VOID *NotifyContext,
  331. EFI_GUID *EventGroup,
  332. EFI_EVENT *Event
  333. );
  334. /*++
  335. Routine Description:
  336. This routine creates an event.
  337. Arguments:
  338. Type - Supplies the type of event to create, as well as its mode and
  339. attributes.
  340. NotifyTpl - Supplies an optional task priority level of event notifications.
  341. NotifyFunction - Supplies an optional pointer to the event's notification
  342. function.
  343. NotifyContext - Supplies an optional context pointer that will be passed
  344. to the notify function when the event is signaled.
  345. EventGroup - Supplies an optional pointer to the unique identifier of the
  346. group to which this event belongs. If this is NULL, the function
  347. behaves as if the parameters were passed to the original create event
  348. function.
  349. Event - Supplies a pointer where the new event will be returned on success.
  350. Return Value:
  351. EFI_SUCCESS on success.
  352. EFI_INVALID_PARAMETER if one or more parameters are not valid.
  353. EFI_OUT_OF_RESOURCES if memory could not be allocated.
  354. --*/
  355. EFIAPI
  356. EFI_STATUS
  357. EfiCoreCloseEvent (
  358. EFI_EVENT Event
  359. );
  360. /*++
  361. Routine Description:
  362. This routine closes an event.
  363. Arguments:
  364. Event - Supplies the event to close.
  365. Return Value:
  366. EFI_SUCCESS on success.
  367. EFI_INVALID_PARAMETER if the given event is invalid.
  368. --*/
  369. EFIAPI
  370. EFI_STATUS
  371. EfiCoreSignalEvent (
  372. EFI_EVENT Event
  373. );
  374. /*++
  375. Routine Description:
  376. This routine signals an event.
  377. Arguments:
  378. Event - Supplies the event to signal.
  379. Return Value:
  380. EFI_SUCCESS on success.
  381. EFI_INVALID_PARAMETER if the given event is not valid.
  382. --*/
  383. EFIAPI
  384. EFI_STATUS
  385. EfiCoreCheckEvent (
  386. EFI_EVENT Event
  387. );
  388. /*++
  389. Routine Description:
  390. This routine checks whether or not an event is in the signaled state.
  391. Arguments:
  392. Event - Supplies the event to check.
  393. Return Value:
  394. EFI_SUCCESS on success.
  395. EFI_NOT_READY if the event is not signaled.
  396. EFI_INVALID_PARAMETER if the event is of type EVT_NOTIFY_SIGNAL.
  397. --*/
  398. EFIAPI
  399. EFI_STATUS
  400. EfiCoreWaitForEvent (
  401. UINTN NumberOfEvents,
  402. EFI_EVENT *Event,
  403. UINTN *Index
  404. );
  405. /*++
  406. Routine Description:
  407. This routine stops execution until an event is signaled.
  408. Arguments:
  409. NumberOfEvents - Supplies the number of events in the event array.
  410. Event - Supplies the array of EFI_EVENTs.
  411. Index - Supplies a pointer where the index of the event which satisfied the
  412. wait will be returned.
  413. Return Value:
  414. EFI_SUCCESS on success.
  415. EFI_INVALID_PARAMETER if the number of events is zero, or the event
  416. indicated by the index return parameter is of type EVT_NOTIFY_SIGNAL.
  417. EFI_UNSUPPORTED if the current TPL is not TPL_APPLICATION.
  418. --*/
  419. EFIAPI
  420. EFI_STATUS
  421. EfiCoreSetTimer (
  422. EFI_EVENT Event,
  423. EFI_TIMER_DELAY Type,
  424. UINT64 TriggerTime
  425. );
  426. /*++
  427. Routine Description:
  428. This routine sets the type of timer and trigger time for a timer event.
  429. Arguments:
  430. Event - Supplies the timer to set.
  431. Type - Supplies the type of trigger to set.
  432. TriggerTime - Supplies the number of 100ns units until the timer expires.
  433. Zero is legal, and means the timer will be signaled on the next timer
  434. tick.
  435. Return Value:
  436. EFI_SUCCESS on success.
  437. EFI_INVALID_PARAMETER if the event or type is not valid.
  438. --*/
  439. EFI_STATUS
  440. EfiCoreInitializeEventServices (
  441. UINTN Phase
  442. );
  443. /*++
  444. Routine Description:
  445. This routine initializes event support.
  446. Arguments:
  447. Phase - Supplies the initialization phase. Valid values are 0 and 1.
  448. Return Value:
  449. EFI Status code.
  450. --*/
  451. VOID
  452. EfiCoreDispatchEventNotifies (
  453. EFI_TPL Priority
  454. );
  455. /*++
  456. Routine Description:
  457. This routine dispatches all pending events.
  458. Arguments:
  459. Priority - Supplies the task priority level of the event notifications to
  460. dispatch.
  461. Return Value:
  462. None.
  463. --*/
  464. VOID
  465. EfipCoreTimerTick (
  466. UINT64 CurrentTime
  467. );
  468. /*++
  469. Routine Description:
  470. This routine is called when a clock interrupt comes in.
  471. Arguments:
  472. CurrentTime - Supplies the new current time.
  473. Return Value:
  474. None.
  475. --*/
  476. VOID
  477. EfipCoreNotifySignalList (
  478. EFI_GUID *EventGroup
  479. );
  480. /*++
  481. Routine Description:
  482. This routine signals all events in the given event group.
  483. Arguments:
  484. EventGroup - Supplies a pointer to the GUID identifying the event group
  485. to signal.
  486. Return Value:
  487. None.
  488. --*/
  489. EFIAPI
  490. EFI_STATUS
  491. EfiCoreConnectController (
  492. EFI_HANDLE ControllerHandle,
  493. EFI_HANDLE *DriverImageHandle,
  494. EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath,
  495. BOOLEAN Recursive
  496. );
  497. /*++
  498. Routine Description:
  499. This routine connects one or more drivers to a controller.
  500. Arguments:
  501. ControllerHandle - Supplies the handle of the controller which driver(s)
  502. are connecting to.
  503. DriverImageHandle - Supplies a pointer to an ordered list of handles that
  504. support the EFI_DRIVER_BINDING_PROTOCOL.
  505. RemainingDevicePath - Supplies an optional pointer to the device path that
  506. specifies a child of the controller specified by the controller handle.
  507. Recursive - Supplies a boolean indicating if this routine should be called
  508. recursively until the entire tree of controllers below the specified
  509. controller has been connected. If FALSE, then the tree of controllers
  510. is only expanded one level.
  511. Return Value:
  512. EFI_SUCCESS on success.
  513. EFI_INVALID_PARAMETER if the controller handle is NULL.
  514. EFI_NOT_FOUND if either there are no EFI_DRIVER_BINDING_PROTOCOL instances
  515. present in the system, or no drivers were connected to the controller
  516. handle.
  517. EFI_SECURITY_VIOLATION if the user has no permission to start UEFI device
  518. drivers on the device associated with the controller handle or specified
  519. by the remaining device path.
  520. --*/
  521. EFIAPI
  522. EFI_STATUS
  523. EfiCoreDisconnectController (
  524. EFI_HANDLE ControllerHandle,
  525. EFI_HANDLE DriverImageHandle,
  526. EFI_HANDLE ChildHandle
  527. );
  528. /*++
  529. Routine Description:
  530. This routine disconnects one or more drivers to a controller.
  531. Arguments:
  532. ControllerHandle - Supplies the handle of the controller which driver(s)
  533. are disconnecting from.
  534. DriverImageHandle - Supplies an optional pointer to the driver to
  535. disconnect from the controller. If NULL, all drivers are disconnected.
  536. ChildHandle - Supplies an optional pointer to the handle of the child to
  537. destroy.
  538. Return Value:
  539. EFI_SUCCESS if one or more drivers were disconnected, no drivers are
  540. managing the handle, or a driver image handle was supplied and it is not
  541. controlling the given handle.
  542. EFI_INVALID_PARAMETER if the controller handle or driver handle is not a
  543. valid EFI handle, or the driver image handle doesn't support the
  544. EFI_DRIVER_BINDING_PROTOCOL.
  545. EFI_OUT_OF_RESOURCES if there are not enough resources are available to
  546. disconnect the controller(s).
  547. EFI_DEVICE_ERROR if the controller could not be disconnected because of a
  548. device error.
  549. --*/
  550. EFI_STATUS
  551. EfiCoreInitializeImageServices (
  552. VOID *FirmwareBaseAddress,
  553. VOID *FirmwareLowestAddress,
  554. UINTN FirmwareSize
  555. );
  556. /*++
  557. Routine Description:
  558. This routine initializes image service support for the UEFI core.
  559. Arguments:
  560. FirmwareBaseAddress - Supplies the base address where the firmware was
  561. loaded into memory. Supply -1 to indicate that the image is loaded at
  562. its preferred base address and was not relocated.
  563. FirmwareLowestAddress - Supplies the lowest address where the firmware was
  564. loaded into memory.
  565. FirmwareSize - Supplies the size of the firmware image in memory, in bytes.
  566. Return Value:
  567. EFI Status code.
  568. --*/
  569. EFIAPI
  570. EFI_STATUS
  571. EfiCoreCalculateCrc32 (
  572. VOID *Data,
  573. UINTN DataSize,
  574. UINT32 *Crc32
  575. );
  576. /*++
  577. Routine Description:
  578. This routine computes the 32-bit CRC for a data buffer.
  579. Arguments:
  580. Data - Supplies a pointer to the buffer to compute the CRC on.
  581. DataSize - Supplies the size of the data buffer in bytes.
  582. Crc32 - Supplies a pointer where the 32-bit CRC will be returned.
  583. Return Value:
  584. EFI_SUCCESS on success.
  585. EFI_INVALID_PARAMETER if any parameter is NULL, or the data size is zero.
  586. --*/
  587. EFIAPI
  588. EFI_STATUS
  589. EfiCoreInstallConfigurationTable (
  590. EFI_GUID *Guid,
  591. VOID *Table
  592. );
  593. /*++
  594. Routine Description:
  595. This routine adds, updates, or removes a configuration table entry from the
  596. EFI System Table.
  597. Arguments:
  598. Guid - Supplies a pointer to the GUID for the entry to add, update, or
  599. remove.
  600. Table - Supplies a pointer to the configuration table for the entry to add,
  601. update, or remove. This may be NULL.
  602. Return Value:
  603. EFI_SUCCESS on success.
  604. EFI_NOT_FOUND if an attempt was made to delete a nonexistant entry.
  605. EFI_INVALID_PARAMETER if the GUID is NULL.
  606. EFI_OUT_OF_RESOURCES if an allocation failed.
  607. --*/
  608. EFIAPI
  609. EFI_STATUS
  610. EfiFvInitializeSectionExtraction (
  611. EFI_HANDLE ImageHandle,
  612. EFI_SYSTEM_TABLE *SystemTable
  613. );
  614. /*++
  615. Routine Description:
  616. This routine initializes the section extraction support for firmware
  617. volumes.
  618. Arguments:
  619. ImageHandle - Supplies a pointer to the image handle.
  620. SystemTable - Supplies a pointer to the EFI system table.
  621. Return Value:
  622. EFI status code.
  623. --*/
  624. EFIAPI
  625. EFI_STATUS
  626. EfiFvInitializeBlockSupport (
  627. EFI_HANDLE ImageHandle,
  628. EFI_SYSTEM_TABLE *SystemTable
  629. );
  630. /*++
  631. Routine Description:
  632. This routine initializes the Firmware Volume Block I/O support module.
  633. Arguments:
  634. ImageHandle - Supplies a pointer to the image handle.
  635. SystemTable - Supplies a pointer to the EFI system table.
  636. Return Value:
  637. EFI status code.
  638. --*/
  639. EFIAPI
  640. EFI_STATUS
  641. EfiFvDriverInit (
  642. EFI_HANDLE ImageHandle,
  643. EFI_SYSTEM_TABLE *SystemTable
  644. );
  645. /*++
  646. Routine Description:
  647. This routine initializes support for UEFI firmware volumes.
  648. Arguments:
  649. ImageHandle - Supplies the image handle for this driver. This is probably
  650. the firmware core image handle.
  651. SystemTable - Supplies a pointer to the system table.
  652. Return Value:
  653. EFI status code.
  654. --*/
  655. VOID
  656. EfiCoreInitializeDispatcher (
  657. VOID
  658. );
  659. /*++
  660. Routine Description:
  661. This routine initializes the driver dispatcher.
  662. Arguments:
  663. None.
  664. Return Value:
  665. None.
  666. --*/
  667. EFIAPI
  668. EFI_STATUS
  669. EfiCoreDispatcher (
  670. VOID
  671. );
  672. /*++
  673. Routine Description:
  674. This routine runs the driver dispatcher. It drains the scheduled queue
  675. loading and starting drivers until there are no more drivers to run.
  676. Arguments:
  677. None.
  678. Return Value:
  679. EFI_SUCCESS if one or more drivers were loaded.
  680. EFI_NOT_FOUND if no drivers were loaded.
  681. EFI_ALREADY_STARTED if the dispatcher is already running.
  682. --*/
  683. EFIAPI
  684. UINTN
  685. EfipArchSetJump (
  686. PEFI_JUMP_BUFFER JumpBuffer
  687. );
  688. /*++
  689. Routine Description:
  690. This routine sets the context in the given jump buffer such that when
  691. long jump is called, execution continues at the return value from this
  692. routine with a non-zero return value.
  693. Arguments:
  694. JumpBuffer - Supplies a pointer where the architecture-specific context
  695. will be saved.
  696. Return Value:
  697. 0 upon the initial return from this routine.
  698. Non-zero when returning as the target of a long jump.
  699. --*/
  700. EFIAPI
  701. VOID
  702. EfipArchLongJump (
  703. PEFI_JUMP_BUFFER JumpBuffer,
  704. UINTN Value
  705. );
  706. /*++
  707. Routine Description:
  708. This routine restores machine context to the state it was in when the
  709. set jump that saved into the given jump buffer was called. The return
  710. value will be set to the given value.
  711. Arguments:
  712. JumpBuffer - Supplies a pointer to the context to restore.
  713. Value - Supplies the new return value to set from set jump. This should not
  714. be zero, otherwise the caller of set jump will not be able to
  715. differentiate it from its initial return.
  716. Return Value:
  717. This routine does not return.
  718. --*/
  719. VOID
  720. EfiCoreLoadVariablesFromFileSystem (
  721. VOID
  722. );
  723. /*++
  724. Routine Description:
  725. This routine loads variable data from the EFI system partition(s).
  726. Arguments:
  727. None.
  728. Return Value:
  729. None. Failure here is not fatal.
  730. --*/
  731. VOID
  732. EfiCoreSaveVariablesToFileSystem (
  733. VOID
  734. );
  735. /*++
  736. Routine Description:
  737. This routine saves variable data to the EFI system partition(s).
  738. Arguments:
  739. None.
  740. Return Value:
  741. None. Failure here is not fatal.
  742. --*/
  743. EFIAPI
  744. VOID
  745. EfiBdsEntry (
  746. VOID
  747. );
  748. /*++
  749. Routine Description:
  750. This routine is the entry point into the boot device selection phase of
  751. the firmware. It attempts to find an OS loader and launch it.
  752. Arguments:
  753. None.
  754. Return Value:
  755. None. This routine does not return.
  756. --*/
  757. //
  758. // Built-in drivers
  759. //
  760. EFIAPI
  761. EFI_STATUS
  762. EfiDiskIoDriverEntry (
  763. EFI_HANDLE ImageHandle,
  764. EFI_SYSTEM_TABLE *SystemTable
  765. );
  766. /*++
  767. Routine Description:
  768. This routine is the entry point into the disk I/O driver.
  769. Arguments:
  770. ImageHandle - Supplies the driver image handle.
  771. SystemTable - Supplies a pointer to the EFI system table.
  772. Return Value:
  773. EFI status code.
  774. --*/
  775. EFIAPI
  776. EFI_STATUS
  777. EfiPartitionDriverEntry (
  778. EFI_HANDLE ImageHandle,
  779. EFI_SYSTEM_TABLE *SystemTable
  780. );
  781. /*++
  782. Routine Description:
  783. This routine is the entry point into the partition driver.
  784. Arguments:
  785. ImageHandle - Supplies the driver image handle.
  786. SystemTable - Supplies a pointer to the EFI system table.
  787. Return Value:
  788. EFI status code.
  789. --*/
  790. EFIAPI
  791. EFI_STATUS
  792. EfiFatDriverEntry (
  793. EFI_HANDLE ImageHandle,
  794. EFI_SYSTEM_TABLE *SystemTable
  795. );
  796. /*++
  797. Routine Description:
  798. This routine is the entry point into the disk I/O driver.
  799. Arguments:
  800. ImageHandle - Supplies the driver image handle.
  801. SystemTable - Supplies a pointer to the EFI system table.
  802. Return Value:
  803. EFI status code.
  804. --*/
  805. EFIAPI
  806. EFI_STATUS
  807. EfiGraphicsTextDriverEntry (
  808. EFI_HANDLE ImageHandle,
  809. EFI_SYSTEM_TABLE *SystemTable
  810. );
  811. /*++
  812. Routine Description:
  813. This routine initializes support for UEFI video consoles.
  814. Arguments:
  815. ImageHandle - Supplies the image handle for this driver. This is probably
  816. the firmware core image handle.
  817. SystemTable - Supplies a pointer to the system table.
  818. Return Value:
  819. EFI status code.
  820. --*/
  821. EFIAPI
  822. EFI_STATUS
  823. EfiAcpiDriverEntry (
  824. EFI_HANDLE ImageHandle,
  825. EFI_SYSTEM_TABLE *SystemTable
  826. );
  827. /*++
  828. Routine Description:
  829. This routine is the entry point into the ACPI driver.
  830. Arguments:
  831. ImageHandle - Supplies the driver image handle.
  832. SystemTable - Supplies a pointer to the EFI system table.
  833. Return Value:
  834. EFI status code.
  835. --*/
  836. EFIAPI
  837. EFI_STATUS
  838. EfiSmbiosDriverEntry (
  839. EFI_HANDLE ImageHandle,
  840. EFI_SYSTEM_TABLE *SystemTable
  841. );
  842. /*++
  843. Routine Description:
  844. This routine is the entry point into the SMBIOS driver.
  845. Arguments:
  846. ImageHandle - Supplies the driver image handle.
  847. SystemTable - Supplies a pointer to the EFI system table.
  848. Return Value:
  849. EFI status code.
  850. --*/