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

838 lines
16 KiB

  1. #ifndef _EFILIB_INCLUDE_
  2. #define _EFILIB_INCLUDE_
  3. /*++
  4. Copyright (c) 2000 Intel Corporation
  5. Module Name:
  6. efilib.h
  7. Abstract:
  8. EFI library functions
  9. Revision History
  10. --*/
  11. #include "efidebug.h"
  12. #include "efipart.h"
  13. #include "efilibplat.h"
  14. #include "link.h"
  15. #include "EfiRtLib.h"
  16. #include "pci22.h"
  17. /*
  18. * Public read-only data in the EFI library
  19. */
  20. extern EFI_SYSTEM_TABLE *ST;
  21. extern EFI_BOOT_SERVICES *BS;
  22. extern EFI_RUNTIME_SERVICES *RT;
  23. extern EFI_GUID DevicePathProtocol;
  24. extern EFI_GUID LoadedImageProtocol;
  25. extern EFI_GUID TextInProtocol;
  26. extern EFI_GUID TextOutProtocol;
  27. extern EFI_GUID BlockIoProtocol;
  28. extern EFI_GUID DiskIoProtocol;
  29. extern EFI_GUID FileSystemProtocol;
  30. extern EFI_GUID LoadFileProtocol;
  31. extern EFI_GUID DeviceIoProtocol;
  32. extern EFI_GUID VariableStoreProtocol;
  33. extern EFI_GUID LegacyBootProtocol;
  34. extern EFI_GUID UnicodeCollationProtocol;
  35. extern EFI_GUID SerialIoProtocol;
  36. extern EFI_GUID VgaClassProtocol;
  37. extern EFI_GUID TextOutSpliterProtocol;
  38. extern EFI_GUID ErrorOutSpliterProtocol;
  39. extern EFI_GUID TextInSpliterProtocol;
  40. extern EFI_GUID SimpleNetworkProtocol;
  41. extern EFI_GUID PxeBaseCodeProtocol;
  42. extern EFI_GUID PxeCallbackProtocol;
  43. extern EFI_GUID NetworkInterfaceIdentifierProtocol;
  44. extern EFI_GUID InternalLoadProtocol;
  45. extern EFI_GUID EfiGlobalVariable;
  46. extern EFI_GUID GenericFileInfo;
  47. extern EFI_GUID FileSystemInfo;
  48. extern EFI_GUID FileSystemVolumeLabelInfo;
  49. extern EFI_GUID PcAnsiProtocol;
  50. extern EFI_GUID Vt100Protocol;
  51. extern EFI_GUID NullGuid;
  52. extern EFI_GUID UnknownDevice;
  53. extern EFI_GUID MpsTableGuid;
  54. extern EFI_GUID AcpiTableGuid;
  55. extern EFI_GUID SMBIOSTableGuid;
  56. extern EFI_GUID SalSystemTableGuid;
  57. /*
  58. * EFI Variable strings
  59. */
  60. #define VarLanguageCodes L"LangCodes"
  61. #define VarLanguage L"Lang"
  62. #define VarTimeout L"Timeout"
  63. #define VarConsoleInp L"ConIn"
  64. #define VarConsoleOut L"ConOut"
  65. #define VarErrorOut L"ErrOut"
  66. #define VarBootOption L"Boot%04x"
  67. #define VarBootOrder L"BootOrder"
  68. #define VarBootNext L"BootNext"
  69. #define VarBootCurrent L"BootCurrent"
  70. #define VarDriverOption L"Driver%04x"
  71. #define VarDriverOrder L"DriverOrder"
  72. #define VarSerialNumber L"SerialNumber"
  73. #define VarSystemGUID L"SystemGUID"
  74. #define VarConsoleInpDev L"ConInDev"
  75. #define VarConsoleOutDev L"ConOutDev"
  76. #define VarErrorOutDev L"ErrOutDev"
  77. #define LanguageCodeEnglish "eng"
  78. extern EFI_DEVICE_PATH RootDevicePath[];
  79. extern EFI_DEVICE_PATH EndDevicePath[];
  80. extern EFI_DEVICE_PATH EndInstanceDevicePath[];
  81. /*
  82. * Other public data in the EFI library
  83. */
  84. extern EFI_MEMORY_TYPE PoolAllocationType;
  85. /*
  86. * STATIC - Name is internal to the module
  87. * INTERNAL - Name is internal to the component (i.e., directory)
  88. * BOOTSERVCE - Name of a boot service function
  89. */
  90. #define STATIC
  91. #define INTERNAL
  92. #define BOOTSERVICE
  93. /*
  94. * Prototypes
  95. */
  96. VOID
  97. InitializeLib (
  98. IN EFI_HANDLE ImageHandle,
  99. IN EFI_SYSTEM_TABLE *SystemTable
  100. );
  101. VOID
  102. InitializeUnicodeSupport (
  103. CHAR8 *LangCode
  104. );
  105. VOID
  106. SetCrc (
  107. IN OUT EFI_TABLE_HEADER *Hdr
  108. );
  109. VOID
  110. SetCrcAltSize (
  111. IN UINTN Size,
  112. IN OUT EFI_TABLE_HEADER *Hdr
  113. );
  114. BOOLEAN
  115. CheckCrc (
  116. IN UINTN MaxSize,
  117. IN OUT EFI_TABLE_HEADER *Hdr
  118. );
  119. BOOLEAN
  120. CheckCrcAltSize (
  121. IN UINTN MaxSize,
  122. IN UINTN Size,
  123. IN OUT EFI_TABLE_HEADER *Hdr
  124. );
  125. UINT32
  126. CalculateCrc (
  127. UINT8 *pt,
  128. UINTN Size
  129. );
  130. VOID
  131. ZeroMem (
  132. IN VOID *Buffer,
  133. IN UINTN Size
  134. );
  135. VOID
  136. SetMem (
  137. IN VOID *Buffer,
  138. IN UINTN Size,
  139. IN UINT8 Value
  140. );
  141. VOID
  142. CopyMem (
  143. IN VOID *Dest,
  144. IN VOID *Src,
  145. IN UINTN len
  146. );
  147. INTN
  148. CompareMem (
  149. IN VOID *Dest,
  150. IN VOID *Src,
  151. IN UINTN len
  152. );
  153. INTN
  154. StrCmp (
  155. IN CHAR16 *s1,
  156. IN CHAR16 *s2
  157. );
  158. INTN
  159. StrnCmp (
  160. IN CHAR16 *s1,
  161. IN CHAR16 *s2,
  162. IN UINTN len
  163. );
  164. INTN
  165. StriCmp (
  166. IN CHAR16 *s1,
  167. IN CHAR16 *s2
  168. );
  169. VOID
  170. StrLwr (
  171. IN CHAR16 *Str
  172. );
  173. VOID
  174. StrUpr (
  175. IN CHAR16 *Str
  176. );
  177. VOID
  178. StrCpy (
  179. IN CHAR16 *Dest,
  180. IN CHAR16 *Src
  181. );
  182. VOID
  183. StrCat (
  184. IN CHAR16 *Dest,
  185. IN CHAR16 *Src
  186. );
  187. UINTN
  188. StrLen (
  189. IN CHAR16 *s1
  190. );
  191. UINTN
  192. StrSize (
  193. IN CHAR16 *s1
  194. );
  195. CHAR16 *
  196. StrDuplicate (
  197. IN CHAR16 *Src
  198. );
  199. UINTN
  200. strlena (
  201. IN CHAR8 *s1
  202. );
  203. UINTN
  204. strcmpa (
  205. IN CHAR8 *s1,
  206. IN CHAR8 *s2
  207. );
  208. UINTN
  209. strncmpa (
  210. IN CHAR8 *s1,
  211. IN CHAR8 *s2,
  212. IN UINTN len
  213. );
  214. UINTN
  215. xtoi (
  216. CHAR16 *str
  217. );
  218. UINTN
  219. Atoi (
  220. CHAR16 *str
  221. );
  222. BOOLEAN
  223. MetaMatch (
  224. IN CHAR16 *String,
  225. IN CHAR16 *Pattern
  226. );
  227. BOOLEAN
  228. MetaiMatch (
  229. IN CHAR16 *String,
  230. IN CHAR16 *Pattern
  231. );
  232. UINT64
  233. LShiftU64 (
  234. IN UINT64 Operand,
  235. IN UINTN Count
  236. );
  237. UINT64
  238. RShiftU64 (
  239. IN UINT64 Operand,
  240. IN UINTN Count
  241. );
  242. UINT64
  243. MultU64x32 (
  244. IN UINT64 Multiplicand,
  245. IN UINTN Multiplier
  246. );
  247. UINT64
  248. DivU64x32 (
  249. IN UINT64 Dividend,
  250. IN UINTN Divisor,
  251. OUT UINTN *Remainder OPTIONAL
  252. );
  253. VOID
  254. InitializeLock (
  255. IN OUT FLOCK *Lock,
  256. IN EFI_TPL Priority
  257. );
  258. VOID
  259. AcquireLock (
  260. IN FLOCK *Lock
  261. );
  262. VOID
  263. ReleaseLock (
  264. IN FLOCK *Lock
  265. );
  266. INTN
  267. CompareGuid(
  268. IN EFI_GUID *Guid1,
  269. IN EFI_GUID *Guid2
  270. );
  271. VOID *
  272. AllocatePool (
  273. IN UINTN Size
  274. );
  275. VOID *
  276. AllocateZeroPool (
  277. IN UINTN Size
  278. );
  279. VOID *
  280. ReallocatePool (
  281. IN VOID *OldPool,
  282. IN UINTN OldSize,
  283. IN UINTN NewSize
  284. );
  285. VOID
  286. FreePool (
  287. IN VOID *p
  288. );
  289. VOID
  290. Output (
  291. IN CHAR16 *Str
  292. );
  293. VOID
  294. Input (
  295. IN CHAR16 *Prompt OPTIONAL,
  296. OUT CHAR16 *InStr,
  297. IN UINTN StrLen
  298. );
  299. VOID
  300. IInput (
  301. IN SIMPLE_TEXT_OUTPUT_INTERFACE *ConOut,
  302. IN SIMPLE_INPUT_INTERFACE *ConIn,
  303. IN CHAR16 *Prompt OPTIONAL,
  304. OUT CHAR16 *InStr,
  305. IN UINTN StrLen
  306. );
  307. UINTN
  308. Print (
  309. IN CHAR16 *fmt,
  310. ...
  311. );
  312. UINTN
  313. SPrint (
  314. OUT CHAR16 *Str,
  315. IN UINTN StrSize,
  316. IN CHAR16 *fmt,
  317. ...
  318. );
  319. CHAR16 *
  320. PoolPrint (
  321. IN CHAR16 *fmt,
  322. ...
  323. );
  324. typedef struct {
  325. CHAR16 *str;
  326. UINTN len;
  327. UINTN maxlen;
  328. } POOL_PRINT;
  329. CHAR16 *
  330. CatPrint (
  331. IN OUT POOL_PRINT *Str,
  332. IN CHAR16 *fmt,
  333. ...
  334. );
  335. UINTN
  336. PrintAt (
  337. IN UINTN Column,
  338. IN UINTN Row,
  339. IN CHAR16 *fmt,
  340. ...
  341. );
  342. UINTN
  343. IPrint (
  344. IN SIMPLE_TEXT_OUTPUT_INTERFACE *Out,
  345. IN CHAR16 *fmt,
  346. ...
  347. );
  348. UINTN
  349. IPrintAt (
  350. IN SIMPLE_TEXT_OUTPUT_INTERFACE *Out,
  351. IN UINTN Column,
  352. IN UINTN Row,
  353. IN CHAR16 *fmt,
  354. ...
  355. );
  356. UINTN
  357. APrint (
  358. IN CHAR8 *fmt,
  359. ...
  360. );
  361. VOID
  362. ValueToHex (
  363. IN CHAR16 *Buffer,
  364. IN UINT64 v
  365. );
  366. VOID
  367. ValueToString (
  368. IN CHAR16 *Buffer,
  369. IN BOOLEAN Comma,
  370. IN INT64 v
  371. );
  372. VOID
  373. TimeToString (
  374. OUT CHAR16 *Buffer,
  375. IN EFI_TIME *Time
  376. );
  377. VOID
  378. GuidToString (
  379. OUT CHAR16 *Buffer,
  380. IN EFI_GUID *Guid
  381. );
  382. VOID
  383. StatusToString (
  384. OUT CHAR16 *Buffer,
  385. EFI_STATUS Status
  386. );
  387. VOID
  388. DumpHex (
  389. IN UINTN Indent,
  390. IN UINTN Offset,
  391. IN UINTN DataSize,
  392. IN VOID *UserData
  393. );
  394. BOOLEAN
  395. GrowBuffer(
  396. IN OUT EFI_STATUS *Status,
  397. IN OUT VOID **Buffer,
  398. IN UINTN BufferSize
  399. );
  400. EFI_MEMORY_DESCRIPTOR *
  401. LibMemoryMap (
  402. OUT UINTN *NoEntries,
  403. OUT UINTN *MapKey,
  404. OUT UINTN *DescriptorSize,
  405. OUT UINT32 *DescriptorVersion
  406. );
  407. VOID *
  408. LibGetVariable (
  409. IN CHAR16 *Name,
  410. IN EFI_GUID *VendorGuid
  411. );
  412. VOID *
  413. LibGetVariableAndSize (
  414. IN CHAR16 *Name,
  415. IN EFI_GUID *VendorGuid,
  416. OUT UINTN *VarSize
  417. );
  418. EFI_STATUS
  419. LibLocateProtocol (
  420. IN EFI_GUID *ProtocolGuid,
  421. OUT VOID **Interface
  422. );
  423. EFI_STATUS
  424. LibLocateHandle (
  425. IN EFI_LOCATE_SEARCH_TYPE SearchType,
  426. IN EFI_GUID *Protocol OPTIONAL,
  427. IN VOID *SearchKey OPTIONAL,
  428. IN OUT UINTN *NoHandles,
  429. OUT EFI_HANDLE **Buffer
  430. );
  431. EFI_STATUS
  432. LibLocateHandleByDiskSignature (
  433. IN UINT8 MBRType,
  434. IN UINT8 SignatureType,
  435. IN VOID *Signature,
  436. IN OUT UINTN *NoHandles,
  437. OUT EFI_HANDLE **Buffer
  438. );
  439. EFI_STATUS
  440. LibInstallProtocolInterfaces (
  441. IN OUT EFI_HANDLE *Handle,
  442. ...
  443. );
  444. VOID
  445. LibUninstallProtocolInterfaces (
  446. IN EFI_HANDLE Handle,
  447. ...
  448. );
  449. EFI_STATUS
  450. LibReinstallProtocolInterfaces (
  451. IN OUT EFI_HANDLE *Handle,
  452. ...
  453. );
  454. EFI_EVENT
  455. LibCreateProtocolNotifyEvent (
  456. IN EFI_GUID *ProtocolGuid,
  457. IN EFI_TPL NotifyTpl,
  458. IN EFI_EVENT_NOTIFY NotifyFunction,
  459. IN VOID *NotifyContext,
  460. OUT VOID *Registration
  461. );
  462. EFI_STATUS
  463. WaitForSingleEvent (
  464. IN EFI_EVENT Event,
  465. IN UINT64 Timeout OPTIONAL
  466. );
  467. VOID
  468. WaitForEventWithTimeout (
  469. IN EFI_EVENT Event,
  470. IN UINTN Timeout,
  471. IN UINTN Row,
  472. IN UINTN Column,
  473. IN CHAR16 *String,
  474. IN EFI_INPUT_KEY TimeoutKey,
  475. OUT EFI_INPUT_KEY *Key
  476. );
  477. EFI_FILE_HANDLE
  478. LibOpenRoot (
  479. IN EFI_HANDLE DeviceHandle
  480. );
  481. EFI_FILE_INFO *
  482. LibFileInfo (
  483. IN EFI_FILE_HANDLE FHand
  484. );
  485. EFI_FILE_SYSTEM_INFO *
  486. LibFileSystemInfo (
  487. IN EFI_FILE_HANDLE FHand
  488. );
  489. EFI_FILE_SYSTEM_VOLUME_LABEL_INFO *
  490. LibFileSystemVolumeLabelInfo (
  491. IN EFI_FILE_HANDLE FHand
  492. );
  493. BOOLEAN
  494. ValidMBR(
  495. IN MASTER_BOOT_RECORD *Mbr,
  496. IN EFI_BLOCK_IO *BlkIo
  497. );
  498. BOOLEAN
  499. LibMatchDevicePaths (
  500. IN EFI_DEVICE_PATH *Multi,
  501. IN EFI_DEVICE_PATH *Single
  502. );
  503. EFI_DEVICE_PATH *
  504. LibDuplicateDevicePathInstance (
  505. IN EFI_DEVICE_PATH *DevPath
  506. );
  507. EFI_DEVICE_PATH *
  508. DevicePathFromHandle (
  509. IN EFI_HANDLE Handle
  510. );
  511. EFI_DEVICE_PATH *
  512. DevicePathInstance (
  513. IN OUT EFI_DEVICE_PATH **DevicePath,
  514. OUT UINTN *Size
  515. );
  516. UINTN
  517. DevicePathInstanceCount (
  518. IN EFI_DEVICE_PATH *DevicePath
  519. );
  520. EFI_DEVICE_PATH *
  521. AppendDevicePath (
  522. IN EFI_DEVICE_PATH *Src1,
  523. IN EFI_DEVICE_PATH *Src2
  524. );
  525. EFI_DEVICE_PATH *
  526. AppendDevicePathNode (
  527. IN EFI_DEVICE_PATH *Src1,
  528. IN EFI_DEVICE_PATH *Src2
  529. );
  530. EFI_DEVICE_PATH*
  531. AppendDevicePathInstance (
  532. IN EFI_DEVICE_PATH *Src,
  533. IN EFI_DEVICE_PATH *Instance
  534. );
  535. EFI_DEVICE_PATH *
  536. FileDevicePath (
  537. IN EFI_HANDLE Device OPTIONAL,
  538. IN CHAR16 *FileName
  539. );
  540. UINTN
  541. DevicePathSize (
  542. IN EFI_DEVICE_PATH *DevPath
  543. );
  544. EFI_DEVICE_PATH *
  545. DuplicateDevicePath (
  546. IN EFI_DEVICE_PATH *DevPath
  547. );
  548. EFI_DEVICE_PATH *
  549. UnpackDevicePath (
  550. IN EFI_DEVICE_PATH *DevPath
  551. );
  552. EFI_STATUS
  553. LibDevicePathToInterface (
  554. IN EFI_GUID *Protocol,
  555. IN EFI_DEVICE_PATH *FilePath,
  556. OUT VOID **Interface
  557. );
  558. CHAR16 *
  559. DevicePathToStr (
  560. EFI_DEVICE_PATH *DevPath
  561. );
  562. /*
  563. * BugBug: I need my own include files
  564. */
  565. typedef struct {
  566. UINT8 Register;
  567. UINT8 Function;
  568. UINT8 Device;
  569. UINT8 Bus;
  570. UINT32 Reserved;
  571. } EFI_ADDRESS;
  572. typedef union {
  573. UINT64 Address;
  574. EFI_ADDRESS EfiAddress;
  575. } EFI_PCI_ADDRESS_UNION;
  576. EFI_STATUS
  577. PciFindDeviceClass (
  578. IN OUT EFI_PCI_ADDRESS_UNION *Address,
  579. IN UINT8 BaseClass,
  580. IN UINT8 SubClass
  581. );
  582. EFI_STATUS
  583. PciFindDevice (
  584. IN OUT EFI_PCI_ADDRESS_UNION *DeviceAddress,
  585. IN UINT16 VendorId,
  586. IN UINT16 DeviceId,
  587. IN OUT PCI_TYPE00 *Pci
  588. );
  589. /*
  590. * SIMPLE_READ_FILE object used to access files
  591. */
  592. typedef VOID *SIMPLE_READ_FILE;
  593. EFI_STATUS
  594. OpenSimpleReadFile (
  595. IN BOOLEAN BootPolicy,
  596. IN VOID *SourceBuffer OPTIONAL,
  597. IN UINTN SourceSize,
  598. IN OUT EFI_DEVICE_PATH **FilePath,
  599. OUT EFI_HANDLE *DeviceHandle,
  600. OUT SIMPLE_READ_FILE *SimpleReadHandle
  601. );
  602. EFI_STATUS
  603. ReadSimpleReadFile (
  604. IN SIMPLE_READ_FILE SimpleReadHandle,
  605. IN UINTN Offset,
  606. IN OUT UINTN *ReadSize,
  607. OUT VOID *Buffer
  608. );
  609. VOID
  610. CloseSimpleReadFile (
  611. IN SIMPLE_READ_FILE SimpleReadHandle
  612. );
  613. VOID
  614. InitializeGuid (
  615. VOID
  616. );
  617. UINT8
  618. DecimaltoBCD(
  619. IN UINT8 DecValue
  620. );
  621. UINT8
  622. BCDtoDecimal(
  623. IN UINT8 BcdValue
  624. );
  625. EFI_STATUS
  626. LibGetSystemConfigurationTable(
  627. IN EFI_GUID *TableGuid,
  628. IN OUT VOID **Table
  629. );
  630. BOOLEAN
  631. LibIsValidTextGraphics (
  632. IN CHAR16 Graphic,
  633. OUT CHAR8 *PcAnsi, OPTIONAL
  634. OUT CHAR8 *Ascii OPTIONAL
  635. );
  636. BOOLEAN
  637. IsValidAscii (
  638. IN CHAR16 Ascii
  639. );
  640. BOOLEAN
  641. IsValidEfiCntlChar (
  642. IN CHAR16 c
  643. );
  644. EFI_STATUS
  645. InitializeGlobalIoDevice (
  646. IN EFI_DEVICE_PATH *DevicePath,
  647. IN EFI_GUID *Protocol,
  648. IN CHAR8 *ErrorStr,
  649. OUT EFI_DEVICE_IO_INTERFACE **GlobalIoFncs
  650. );
  651. UINT32
  652. ReadPort (
  653. IN EFI_DEVICE_IO_INTERFACE *GlobalIoFncs,
  654. IN EFI_IO_WIDTH Width,
  655. IN UINTN Port
  656. );
  657. UINT32
  658. WritePort (
  659. IN EFI_DEVICE_IO_INTERFACE *GlobalIoFncs,
  660. IN EFI_IO_WIDTH Width,
  661. IN UINTN Port,
  662. IN UINTN Data
  663. );
  664. UINT32
  665. ReadPciConfig (
  666. IN EFI_DEVICE_IO_INTERFACE *GlobalIoFncs,
  667. IN EFI_IO_WIDTH Width,
  668. IN UINTN Port
  669. );
  670. UINT32
  671. WritePciConfig (
  672. IN EFI_DEVICE_IO_INTERFACE *GlobalIoFncs,
  673. IN EFI_IO_WIDTH Width,
  674. IN UINTN Port,
  675. IN UINTN Data
  676. );
  677. extern EFI_DEVICE_IO_INTERFACE *GlobalIoFncs;
  678. #define outp(_Port, _DataByte) (UINT8)WritePort(GlobalIoFncs, IO_UINT8, (UINTN)_Port, (UINTN)_DataByte)
  679. #define inp(_Port) (UINT8)ReadPort(GlobalIoFncs, IO_UINT8, (UINTN)_Port)
  680. #define outpw(_Port, _DataByte) (UINT16)WritePort(GlobalIoFncs, IO_UINT16, (UINTN)_Port, (UINTN)_DataByte)
  681. #define inpw(_Port) (UINT16)ReadPort(GlobalIoFncs, IO_UINT16, (UINTN)_Port)
  682. #define outpd(_Port, _DataByte) (UINT32)WritePort(GlobalIoFncs, IO_UINT32, (UINTN)_Port, (UINTN)_DataByte)
  683. #define inpd(_Port) (UINT32)ReadPort(GlobalIoFncs, IO_UINT32, (UINTN)_Port)
  684. #define writepci8(_Addr, _DataByte) (UINT8)WritePciConfig(GlobalIoFncs, IO_UINT8, (UINTN)_Addr, (UINTN)_DataByte)
  685. #define readpci8(_Addr) (UINT8)ReadPciConfig(GlobalIoFncs, IO_UINT8, (UINTN)_Addr)
  686. #define writepci16(_Addr, _DataByte) (UINT16)WritePciConfig(GlobalIoFncs, IO_UINT16, (UINTN)_Addr, (UINTN)_DataByte)
  687. #define readpci16(_Addr) (UINT16)ReadPciConfig(GlobalIoFncs, IO_UINT16, (UINTN)_Addr)
  688. #define writepci32(_Addr, _DataByte) (UINT32)WritePciConfig(GlobalIoFncs, IO_UINT32, (UINTN)_Addr, (UINTN)_DataByte)
  689. #define readpci32(_Addr) (UINT32)ReadPciConfig(GlobalIoFncs, IO_UINT32, (UINTN)_Addr)
  690. #define Pause() WaitForSingleEvent (ST->ConIn->WaitForKey, 0)
  691. #define Port80(_PostCode) GlobalIoFncs->Io.Write (GlobalIoFncs, IO_UINT16, (UINT64)0x80, 1, &(_PostCode))
  692. #endif