efisup.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167
  1. /*++
  2. Copyright (c) 2013 Minoca Corp. All Rights Reserved
  3. Module Name:
  4. efisup.h
  5. Abstract:
  6. This header contains definitions for EFI support in the boot loader.
  7. Author:
  8. Evan Green 11-Feb-2014
  9. --*/
  10. //
  11. // ------------------------------------------------------------------- Includes
  12. //
  13. //
  14. // ---------------------------------------------------------------- Definitions
  15. //
  16. //
  17. // ------------------------------------------------------ Data Type Definitions
  18. //
  19. //
  20. // -------------------------------------------------------------------- Globals
  21. //
  22. //
  23. // Store pointers to the main EFI structures.
  24. //
  25. extern EFI_HANDLE BoEfiImageHandle;
  26. extern EFI_SYSTEM_TABLE *BoEfiSystemTable;
  27. extern EFI_BOOT_SERVICES *BoEfiBootServices;
  28. extern EFI_RUNTIME_SERVICES *BoEfiRuntimeServices;
  29. //
  30. // Define some needed protocol GUIDs.
  31. //
  32. extern EFI_GUID BoEfiLoadedImageProtocolGuid;
  33. extern EFI_GUID BoEfiBlockIoProtocolGuid;
  34. extern EFI_GUID BoEfiGraphicsOutputProtocolGuid;
  35. extern EFI_GUID BoEfiDevicePathProtocolGuid;
  36. extern EFI_GUID BoEfiRamDiskProtocolGuid;
  37. extern EFI_GUID BoEfiAcpiTableGuid;
  38. extern EFI_GUID BoEfiAcpi1TableGuid;
  39. extern EFI_GUID BoEfiSmbiosTableGuid;
  40. //
  41. // Store the allocation containing the memory descriptors for the memory map.
  42. // This is the first allocation to arrive and the last to go, as it contains
  43. // the list of other allocations to clean up.
  44. //
  45. extern EFI_PHYSICAL_ADDRESS BoEfiDescriptorAllocation;
  46. extern UINTN BoEfiDescriptorAllocationPageCount;
  47. //
  48. // -------------------------------------------------------- Function Prototypes
  49. //
  50. //
  51. // Define functions implemented by the application, callable by the boot
  52. // library.
  53. //
  54. EFI_STATUS
  55. BoEfiApplicationMain (
  56. EFI_HANDLE ImageHandle,
  57. EFI_SYSTEM_TABLE *SystemTable,
  58. PVOID TopOfStack,
  59. ULONG StackSize
  60. );
  61. /*++
  62. Routine Description:
  63. This routine is the entry point for the EFI Boot Application.
  64. Arguments:
  65. ImageHandle - Supplies a pointer to the image handle.
  66. SystemTable - Supplies a pointer to the EFI system table.
  67. TopOfStack - Supplies the top of the stack that has been set up for the
  68. loader.
  69. StackSize - Supplies the total size of the stack set up for the loader, in
  70. bytes.
  71. Return Value:
  72. EFI status code.
  73. --*/
  74. VOID
  75. BopEfiArchInitialize (
  76. PVOID *TopOfStack,
  77. PULONG StackSize
  78. );
  79. /*++
  80. Routine Description:
  81. This routine performs early architecture specific initialization of an EFI
  82. application.
  83. Arguments:
  84. TopOfStack - Supplies a pointer where an approximation of the top of the
  85. stack will be returned.
  86. StackSize - Supplies a pointer where the stack size will be returned.
  87. Return Value:
  88. None.
  89. --*/
  90. //
  91. // Utility functions
  92. //
  93. UINTN
  94. BopEfiGetStackPointer (
  95. VOID
  96. );
  97. /*++
  98. Routine Description:
  99. This routine gets the value of the stack register. Note that this can only
  100. be used as an approximate value, since as soon as this function returns
  101. the stack pointer changes.
  102. Arguments:
  103. None.
  104. Return Value:
  105. Returns the current stack pointer.
  106. --*/
  107. VOID
  108. BopEfiSaveInitialState (
  109. VOID
  110. );
  111. /*++
  112. Routine Description:
  113. This routine saves the initial CPU state as passed to the application. This
  114. state is restored when making EFI calls.
  115. Arguments:
  116. None.
  117. Return Value:
  118. None. The original contents are saved in globals.
  119. --*/
  120. VOID
  121. BopEfiRestoreFirmwareContext (
  122. VOID
  123. );
  124. /*++
  125. Routine Description:
  126. This routine restores the processor context set when the EFI application
  127. was started. This routine is called right before an EFI firmware call is
  128. made. It is not possible to debug through this function, as the IDT is
  129. swapped out.
  130. Arguments:
  131. None.
  132. Return Value:
  133. None. The OS loader context is saved in globals.
  134. --*/
  135. VOID
  136. BopEfiRestoreApplicationContext (
  137. VOID
  138. );
  139. /*++
  140. Routine Description:
  141. This routine restores the boot application context. This routine is called
  142. after an EFI call to restore the processor state set up by the OS loader.
  143. Arguments:
  144. None.
  145. Return Value:
  146. None.
  147. --*/
  148. EFI_STATUS
  149. BopEfiLocateHandle (
  150. EFI_LOCATE_SEARCH_TYPE SearchType,
  151. EFI_GUID *Protocol,
  152. VOID *SearchKey,
  153. UINTN *BufferSize,
  154. EFI_HANDLE *Buffer
  155. );
  156. /*++
  157. Routine Description:
  158. This routine returns an array of handles that support a specified protocol.
  159. Arguments:
  160. SearchType - Supplies which handle(s) are to be returned.
  161. Protocol - Supplies an optional pointer to the protocols to search by.
  162. SearchKey - Supplies an optional pointer to the search key.
  163. BufferSize - Supplies a pointer that on input contains the size of the
  164. result buffer in bytes. On output, the size of the result array will be
  165. returned (even if the buffer was too small).
  166. Buffer - Supplies a pointer where the results will be returned.
  167. Return Value:
  168. EFI status code.
  169. --*/
  170. EFI_STATUS
  171. BopEfiLocateHandleBuffer (
  172. EFI_LOCATE_SEARCH_TYPE SearchType,
  173. EFI_GUID *Protocol,
  174. VOID *SearchKey,
  175. UINTN *HandleCount,
  176. EFI_HANDLE **Buffer
  177. );
  178. /*++
  179. Routine Description:
  180. This routine returns an array of handles that support the requested
  181. protocol in a buffer allocated from pool.
  182. Arguments:
  183. SearchType - Supplies the search behavior.
  184. Protocol - Supplies a pointer to the protocol to search by.
  185. SearchKey - Supplies a pointer to the search key.
  186. HandleCount - Supplies a pointer where the number of handles will be
  187. returned.
  188. Buffer - Supplies a pointer where an array will be returned containing the
  189. requested handles.
  190. Return Value:
  191. EFI_SUCCESS on success.
  192. EFI_NOT_FOUND if no handles match the search.
  193. EFI_INVALID_PARAMETER if the handle count or buffer is NULL.
  194. EFI_OUT_OF_RESOURCES if an allocation failed.
  195. --*/
  196. EFI_STATUS
  197. BopEfiOpenProtocol (
  198. EFI_HANDLE Handle,
  199. EFI_GUID *Protocol,
  200. VOID **Interface,
  201. EFI_HANDLE AgentHandle,
  202. EFI_HANDLE ControllerHandle,
  203. UINT32 Attributes
  204. );
  205. /*++
  206. Routine Description:
  207. This routine queries a handle to determine if it supports a specified
  208. protocol. If the protocol is supported by the handle, it opens the protocol
  209. on behalf of the calling agent.
  210. Arguments:
  211. Handle - Supplies the handle for the protocol interface that is being
  212. opened.
  213. Protocol - Supplies the published unique identifier of the protocol.
  214. Interface - Supplies the address where a pointer to the corresponding
  215. protocol interface is returned.
  216. AgentHandle - Supplies the handle of the agent that is opening the protocol
  217. interface specified by the protocol and interface.
  218. ControllerHandle - Supplies the controller handle that requires the
  219. protocl interface if the caller is a driver that follows the UEFI
  220. driver model. If the caller does not follow the UEFI Driver Model, then
  221. this parameter is optional.
  222. Attributes - Supplies the open mode of the protocol interface specified by
  223. the given handle and protocol.
  224. Return Value:
  225. EFI status code.
  226. --*/
  227. EFI_STATUS
  228. BopEfiCloseProtocol (
  229. EFI_HANDLE Handle,
  230. EFI_GUID *Protocol,
  231. EFI_HANDLE AgentHandle,
  232. EFI_HANDLE ControllerHandle
  233. );
  234. /*++
  235. Routine Description:
  236. This routine closes a protocol on a handle that was previously opened.
  237. Arguments:
  238. Handle - Supplies the handle for the protocol interface was previously
  239. opened.
  240. Protocol - Supplies the published unique identifier of the protocol.
  241. AgentHandle - Supplies the handle of the agent that is closing the
  242. protocol interface.
  243. ControllerHandle - Supplies the controller handle that required the
  244. protocl interface if the caller is a driver that follows the UEFI
  245. driver model. If the caller does not follow the UEFI Driver Model, then
  246. this parameter is optional.
  247. Return Value:
  248. EFI status code.
  249. --*/
  250. EFI_STATUS
  251. BopEfiHandleProtocol (
  252. EFI_HANDLE Handle,
  253. EFI_GUID *Protocol,
  254. VOID **Interface
  255. );
  256. /*++
  257. Routine Description:
  258. This routine queries a handle to determine if it supports a specified
  259. protocol.
  260. Arguments:
  261. Handle - Supplies the handle being queried.
  262. Protocol - Supplies the published unique identifier of the protocol.
  263. Interface - Supplies the address where a pointer to the corresponding
  264. protocol interface is returned.
  265. Return Value:
  266. EFI_SUCCESS if the interface information was returned.
  267. EFI_UNSUPPORTED if the device not support the specified protocol.
  268. EFI_INVALID_PARAMETER if the handle, protocol, or interface is NULL.
  269. --*/
  270. EFI_STATUS
  271. BopEfiFreePool (
  272. VOID *Buffer
  273. );
  274. /*++
  275. Routine Description:
  276. This routine frees memory allocated from the EFI firmware heap (not the
  277. boot environment heap).
  278. Arguments:
  279. Buffer - Supplies a pointer to the buffer to free.
  280. Return Value:
  281. EFI_SUCCESS on success.
  282. EFI_INVALID_PARAMETER if the buffer was invalid.
  283. --*/
  284. EFI_STATUS
  285. BopEfiExitBootServices (
  286. EFI_HANDLE ImageHandle,
  287. UINTN MapKey
  288. );
  289. /*++
  290. Routine Description:
  291. This routine terminates all boot services.
  292. Arguments:
  293. ImageHandle - Supplies the handle that identifies the exiting image.
  294. MapKey - Supplies the latest memory map key.
  295. Return Value:
  296. EFI_SUCCESS on success.
  297. EFI_INVALID_PARAMETER if the map key is incorrect.
  298. --*/
  299. EFI_STATUS
  300. BopEfiGetTime (
  301. EFI_TIME *Time,
  302. EFI_TIME_CAPABILITIES *Capabilities
  303. );
  304. /*++
  305. Routine Description:
  306. This routine returns the current time and date information, and
  307. timekeeping capabilities of the hardware platform.
  308. Arguments:
  309. Time - Supplies a pointer where the current time will be returned.
  310. Capabilities - Supplies an optional pointer where the capabilities will be
  311. returned on success.
  312. Return Value:
  313. EFI_SUCCESS on success.
  314. EFI_INVALID_PARAMETER if the time parameter was NULL.
  315. EFI_DEVICE_ERROR if there was a hardware error accessing the device.
  316. --*/
  317. EFI_STATUS
  318. BopEfiStall (
  319. UINTN Microseconds
  320. );
  321. /*++
  322. Routine Description:
  323. This routine induces a fine-grained delay.
  324. Arguments:
  325. Microseconds - Supplies the number of microseconds to stall execution for.
  326. Return Value:
  327. EFI_SUCCESS on success.
  328. --*/
  329. VOID
  330. BopEfiResetSystem (
  331. EFI_RESET_TYPE ResetType,
  332. EFI_STATUS ResetStatus,
  333. UINTN DataSize,
  334. VOID *ResetData
  335. );
  336. /*++
  337. Routine Description:
  338. This routine resets the entire platform.
  339. Arguments:
  340. ResetType - Supplies the type of reset to perform.
  341. ResetStatus - Supplies the status code for this reset.
  342. DataSize - Supplies the size of the reset data.
  343. ResetData - Supplies an optional pointer for reset types of cold, warm, or
  344. shutdown to a null-terminated string, optionally followed by additional
  345. binary data.
  346. Return Value:
  347. None. This routine does not return.
  348. --*/
  349. VOID
  350. BopEfiPrintString (
  351. PWSTR WideString
  352. );
  353. /*++
  354. Routine Description:
  355. This routine prints a string to the EFI standard out console.
  356. Arguments:
  357. WideString - Supplies a pointer to the wide string to print. A wide
  358. character is two bytes in EFI.
  359. Return Value:
  360. None.
  361. --*/
  362. KSTATUS
  363. BopEfiGetSystemConfigurationTable (
  364. EFI_GUID *Guid,
  365. VOID **Table
  366. );
  367. /*++
  368. Routine Description:
  369. This routine attempts to find a configuration table with the given GUID.
  370. Arguments:
  371. Guid - Supplies a pointer to the GUID to search for.
  372. Table - Supplies a pointer where a pointer to the table will be returned on
  373. success.
  374. Return Value:
  375. STATUS_SUCCESS on success.
  376. STATUS_NOT_FOUND if no table with the given GUID could be found.
  377. STATUS_NOT_INITIALIZED if the EFI subsystem has not yet started.
  378. --*/
  379. KSTATUS
  380. BopEfiStatusToKStatus (
  381. EFI_STATUS Status
  382. );
  383. /*++
  384. Routine Description:
  385. This routine returns a kernel status code similar to the given EFI status
  386. code.
  387. Arguments:
  388. Status - Supplies the EFI status code.
  389. Return Value:
  390. Status code.
  391. --*/
  392. BOOL
  393. BopEfiAreGuidsEqual (
  394. EFI_GUID *FirstGuid,
  395. EFI_GUID *SecondGuid
  396. );
  397. /*++
  398. Routine Description:
  399. This routine determines if two GUIDs are equal.
  400. Arguments:
  401. FirstGuid - Supplies a pointer to the first GUID to compare.
  402. SecondGuid - Supplies a pointer to the second GUId to compare.
  403. Return Value:
  404. TRUE if the two GUIDs have equal values.
  405. FALSE if the two GUIDs are not the same.
  406. --*/
  407. //
  408. // Memory functions
  409. //
  410. KSTATUS
  411. BopEfiInitializeMemory (
  412. VOID
  413. );
  414. /*++
  415. Routine Description:
  416. This routine initializes memory services for the boot loader.
  417. Arguments:
  418. None.
  419. Return Value:
  420. Status code.
  421. --*/
  422. VOID
  423. BopEfiDestroyMemory (
  424. VOID
  425. );
  426. /*++
  427. Routine Description:
  428. This routine cleans up memory services upon failure.
  429. Arguments:
  430. None.
  431. Return Value:
  432. None.
  433. --*/
  434. KSTATUS
  435. BopEfiLoaderAllocatePages (
  436. PULONGLONG Address,
  437. ULONGLONG Size,
  438. MEMORY_TYPE MemoryType
  439. );
  440. /*++
  441. Routine Description:
  442. This routine allocates physical pages for use.
  443. Arguments:
  444. Address - Supplies a pointer to where the allocation will be returned.
  445. Size - Supplies the size of the required space, in bytes.
  446. MemoryType - Supplies the type of memory to mark the allocation as.
  447. Return Value:
  448. STATUS_SUCCESS if the allocation was successful.
  449. STATUS_INVALID_PARAMETER if a page count of 0 was passed or the address
  450. parameter was not filled out.
  451. STATUS_NO_MEMORY if the allocation request could not be filled.
  452. --*/
  453. KSTATUS
  454. BopEfiSynchronizeMemoryMap (
  455. PUINTN Key
  456. );
  457. /*++
  458. Routine Description:
  459. This routine synchronizes the EFI memory map with the boot memory map.
  460. Arguments:
  461. Key - Supplies a pointer where the latest EFI memory map key will be
  462. returned.
  463. Return Value:
  464. Status code.
  465. --*/
  466. KSTATUS
  467. BopEfiVirtualizeFirmwareServices (
  468. UINTN MemoryMapSize,
  469. UINTN DescriptorSize,
  470. UINT32 DescriptorVersion,
  471. EFI_MEMORY_DESCRIPTOR *VirtualMap
  472. );
  473. /*++
  474. Routine Description:
  475. This routine changes the runtime addressing mode of EFI firmware from
  476. physical to virtual.
  477. Arguments:
  478. MemoryMapSize - Supplies the size of the virtual map.
  479. DescriptorSize - Supplies the size of an entry in the virtual map.
  480. DescriptorVersion - Supplies the version of the structure entries in the
  481. virtual map.
  482. VirtualMap - Supplies the array of memory descriptors which contain the
  483. new virtual address mappings for all runtime ranges.
  484. Return Value:
  485. Status code.
  486. --*/
  487. KSTATUS
  488. BopEfiGetAllocatedMemoryMap (
  489. UINTN *MemoryMapSize,
  490. EFI_MEMORY_DESCRIPTOR **MemoryMap,
  491. UINTN *MapKey,
  492. UINTN *DescriptorSize,
  493. UINT32 *DescriptorVersion
  494. );
  495. /*++
  496. Routine Description:
  497. This routine returns the current memory map.
  498. Arguments:
  499. MemoryMapSize - Supplies a pointer where the size in bytes of the map
  500. buffer will be returned.
  501. MemoryMap - Supplies a pointer where a pointer to the memory map will be
  502. returned on success. The caller is responsible for freeing this memory.
  503. MapKey - Supplies a pointer where the map key will be returned on success.
  504. DescriptorSize - Supplies a pointer where the firmware returns the size of
  505. the EFI_MEMORY_DESCRIPTOR structure.
  506. DescriptorVersion - Supplies a pointer where the firmware returns the
  507. version number associated with the EFI_MEMORY_DESCRIPTOR structure.
  508. Return Value:
  509. Status code.
  510. --*/
  511. //
  512. // Disk functions
  513. //
  514. KSTATUS
  515. BopEfiOpenBootDisk (
  516. PHANDLE Handle
  517. );
  518. /*++
  519. Routine Description:
  520. This routine attempts to open the boot disk, the disk from which to load
  521. the OS.
  522. Arguments:
  523. Handle - Supplies a pointer where a handle to the disk will be returned.
  524. Return Value:
  525. Status code.
  526. --*/
  527. KSTATUS
  528. BopEfiOpenPartition (
  529. UCHAR PartitionId[FIRMWARE_PARTITION_ID_SIZE],
  530. PHANDLE Handle
  531. );
  532. /*++
  533. Routine Description:
  534. This routine opens a handle to a disk and partition with the given IDs.
  535. Arguments:
  536. PartitionId - Supplies the partition identifier to match against.
  537. Handle - Supplies a pointer where a handle to the opened disk will be
  538. returned upon success.
  539. Return Value:
  540. Status code.
  541. --*/
  542. VOID
  543. BopEfiCloseDisk (
  544. HANDLE DiskHandle
  545. );
  546. /*++
  547. Routine Description:
  548. This routine closes an open disk.
  549. Arguments:
  550. DiskHandle - Supplies a pointer to the open disk handle.
  551. Return Value:
  552. None.
  553. --*/
  554. KSTATUS
  555. BopEfiLoaderBlockIoRead (
  556. HANDLE DiskHandle,
  557. ULONGLONG Sector,
  558. ULONG SectorCount,
  559. PVOID Buffer
  560. );
  561. /*++
  562. Routine Description:
  563. This routine uses firmware calls read sectors off of a disk.
  564. Arguments:
  565. DiskHandle - Supplies a handle to the disk to read from.
  566. Sector - Supplies the zero-based sector number to read from.
  567. SectorCount - Supplies the number of sectors to read. The supplied buffer
  568. must be at least this large.
  569. Buffer - Supplies the buffer where the data read from the disk will be
  570. returned upon success.
  571. Return Value:
  572. STATUS_SUCCESS if the operation completed successfully.
  573. STATUS_FIRMWARE_ERROR if the firmware returned an error.
  574. Other error codes.
  575. --*/
  576. KSTATUS
  577. BopEfiLoaderBlockIoWrite (
  578. HANDLE DiskHandle,
  579. ULONGLONG Sector,
  580. ULONG SectorCount,
  581. PVOID Buffer
  582. );
  583. /*++
  584. Routine Description:
  585. This routine uses firmware calls to write sectors to a disk.
  586. Arguments:
  587. DiskHandle - Supplies a handle to the disk to write to.
  588. Sector - Supplies the zero-based sector number to write to.
  589. SectorCount - Supplies the number of sectors to write. The supplied buffer
  590. must be at least this large.
  591. Buffer - Supplies the buffer containing the data to write to the disk.
  592. Return Value:
  593. STATUS_SUCCESS if the operation completed successfully.
  594. STATUS_FIRMWARE_ERROR if the firmware returned an error.
  595. Other error codes.
  596. --*/
  597. ULONG
  598. BopEfiGetDiskBlockSize (
  599. HANDLE DiskHandle
  600. );
  601. /*++
  602. Routine Description:
  603. This routine determines the number of bytes in a sector on the given disk.
  604. Arguments:
  605. DiskHandle - Supplies a handle to the disk to query.
  606. Return Value:
  607. Returns the number of bytes in a sector on success.
  608. 0 on error.
  609. --*/
  610. ULONGLONG
  611. BopEfiGetDiskBlockCount (
  612. HANDLE DiskHandle
  613. );
  614. /*++
  615. Routine Description:
  616. This routine determines the number of sectors on the disk.
  617. Arguments:
  618. DiskHandle - Supplies a handle to the disk to query.
  619. Return Value:
  620. Returns the number of sectors in the disk on success.
  621. 0 on error.
  622. --*/
  623. KSTATUS
  624. BopEfiGetRamDisks (
  625. PBOOT_RAM_DISK *RamDisks,
  626. PULONG RamDiskCount
  627. );
  628. /*++
  629. Routine Description:
  630. This routine returns an array of the RAM disks known to the firmware.
  631. Arguments:
  632. RamDisks - Supplies a pointer where an array of RAM disk structures will
  633. be allocated and returned. It is the caller's responsibility to free
  634. this memory.
  635. RamDiskCount - Supplies a pointer where the count of RAM disks in the
  636. array will be returned.
  637. Return Value:
  638. Status code.
  639. --*/
  640. //
  641. // Video services
  642. //
  643. VOID
  644. BopEfiInitializeVideo (
  645. VOID
  646. );
  647. /*++
  648. Routine Description:
  649. This routine initializes UEFI video services. Failure here is not fatal.
  650. Arguments:
  651. None.
  652. Return Value:
  653. None.
  654. --*/
  655. KSTATUS
  656. BopEfiGetVideoInformation (
  657. PULONG ResolutionX,
  658. PULONG ResolutionY,
  659. PULONG PixelsPerScanLine,
  660. PULONG BitsPerPixel,
  661. PULONG RedMask,
  662. PULONG GreenMask,
  663. PULONG BlueMask,
  664. PPHYSICAL_ADDRESS FrameBufferBase,
  665. PULONGLONG FrameBufferSize
  666. );
  667. /*++
  668. Routine Description:
  669. This routine returns information about the video frame buffer.
  670. Arguments:
  671. ResolutionX - Supplies a pointer where the horizontal resolution in pixels
  672. will be returned on success.
  673. ResolutionY - Supplies a pointer where the vertical resolution in pixels
  674. will be returned on success.
  675. PixelsPerScanLine - Supplies a pointer where the number of pixels per scan
  676. line will be returned on success.
  677. BitsPerPixel - Supplies a pointer where the number of bits per pixel will
  678. be returned on success.
  679. RedMask - Supplies a pointer where the mask of bits corresponding to the
  680. red channel will be returned on success. It is assumed this will be a
  681. contiguous chunk of bits.
  682. GreenMask - Supplies a pointer where the mask of bits corresponding to the
  683. green channel will be returned on success. It is assumed this will be a
  684. contiguous chunk of bits.
  685. BlueMask - Supplies a pointer where the mask of bits corresponding to the
  686. blue channel will be returned on success. It is assumed this will be a
  687. contiguous chunk of bits.
  688. FrameBufferBase - Supplies a pointer where the physical base address of the
  689. frame buffer will be returned on success.
  690. FrameBufferSize - Supplies a pointer where the size of the frame buffer in
  691. bytes will be returned on success.
  692. Return Value:
  693. STATUS_SUCCESS on success.
  694. STATUS_NOT_CONFIGURED if video services could not be initialized.
  695. --*/
  696. VOID
  697. BopEfiGetDebugDevice (
  698. VOID
  699. );
  700. /*++
  701. Routine Description:
  702. This routine searches for the Serial I/O protocol and enumerates a debug
  703. devices with it if found.
  704. Arguments:
  705. None.
  706. Return Value:
  707. None. Failure is not fatal.
  708. --*/
  709. //
  710. // Time services
  711. //
  712. KSTATUS
  713. BopEfiGetCurrentTime (
  714. PSYSTEM_TIME Time
  715. );
  716. /*++
  717. Routine Description:
  718. This routine attempts to get the current system time.
  719. Arguments:
  720. Time - Supplies a pointer where the current time will be returned.
  721. Return Value:
  722. Status code.
  723. --*/