Leaked source code of windows server 2003
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.

765 lines
21 KiB

  1. #ifndef _EFI_PROT_H
  2. #define _EFI_PROT_H
  3. /*++
  4. Copyright (c) 1998 Intel Corporation
  5. Module Name:
  6. efiprot.h
  7. Abstract:
  8. EFI Protocols
  9. Revision History
  10. --*/
  11. /*
  12. * Device Path protocol
  13. */
  14. #define DEVICE_PATH_PROTOCOL \
  15. { 0x9576e91, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
  16. /*
  17. * Block IO protocol
  18. */
  19. #define BLOCK_IO_PROTOCOL \
  20. { 0x964e5b21, 0x6459, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
  21. #define EFI_BLOCK_IO_INTERFACE_REVISION 0x00010000
  22. INTERFACE_DECL(_EFI_BLOCK_IO);
  23. typedef
  24. EFI_STATUS
  25. (EFIAPI *EFI_BLOCK_RESET) (
  26. IN struct _EFI_BLOCK_IO *This,
  27. IN BOOLEAN ExtendedVerification
  28. );
  29. typedef
  30. EFI_STATUS
  31. (EFIAPI *EFI_BLOCK_READ) (
  32. IN struct _EFI_BLOCK_IO *This,
  33. IN UINT32 MediaId,
  34. IN EFI_LBA LBA,
  35. IN UINTN BufferSize,
  36. OUT VOID *Buffer
  37. );
  38. typedef
  39. EFI_STATUS
  40. (EFIAPI *EFI_BLOCK_WRITE) (
  41. IN struct _EFI_BLOCK_IO *This,
  42. IN UINT32 MediaId,
  43. IN EFI_LBA LBA,
  44. IN UINTN BufferSize,
  45. IN VOID *Buffer
  46. );
  47. typedef
  48. EFI_STATUS
  49. (EFIAPI *EFI_BLOCK_FLUSH) (
  50. IN struct _EFI_BLOCK_IO *This
  51. );
  52. typedef struct {
  53. UINT32 MediaId;
  54. BOOLEAN RemovableMedia;
  55. BOOLEAN MediaPresent;
  56. BOOLEAN LogicalPartition;
  57. BOOLEAN ReadOnly;
  58. BOOLEAN WriteCaching;
  59. UINT32 BlockSize;
  60. UINT32 IoAlign;
  61. EFI_LBA LastBlock;
  62. } EFI_BLOCK_IO_MEDIA;
  63. typedef struct _EFI_BLOCK_IO {
  64. UINT64 Revision;
  65. EFI_BLOCK_IO_MEDIA *Media;
  66. EFI_BLOCK_RESET Reset;
  67. EFI_BLOCK_READ ReadBlocks;
  68. EFI_BLOCK_WRITE WriteBlocks;
  69. EFI_BLOCK_FLUSH FlushBlocks;
  70. } EFI_BLOCK_IO;
  71. /*
  72. * Disk Block IO protocol
  73. */
  74. #define DISK_IO_PROTOCOL \
  75. { 0xce345171, 0xba0b, 0x11d2, 0x8e, 0x4f, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
  76. #define EFI_DISK_IO_INTERFACE_REVISION 0x00010000
  77. INTERFACE_DECL(_EFI_DISK_IO);
  78. typedef
  79. EFI_STATUS
  80. (EFIAPI *EFI_DISK_READ) (
  81. IN struct _EFI_DISK_IO *This,
  82. IN UINT32 MediaId,
  83. IN UINT64 Offset,
  84. IN UINTN BufferSize,
  85. OUT VOID *Buffer
  86. );
  87. typedef
  88. EFI_STATUS
  89. (EFIAPI *EFI_DISK_WRITE) (
  90. IN struct _EFI_DISK_IO *This,
  91. IN UINT32 MediaId,
  92. IN UINT64 Offset,
  93. IN UINTN BufferSize,
  94. IN VOID *Buffer
  95. );
  96. typedef struct _EFI_DISK_IO {
  97. UINT64 Revision;
  98. EFI_DISK_READ ReadDisk;
  99. EFI_DISK_WRITE WriteDisk;
  100. } EFI_DISK_IO;
  101. /*
  102. * Simple file system protocol
  103. */
  104. #define SIMPLE_FILE_SYSTEM_PROTOCOL \
  105. { 0x964e5b22, 0x6459, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
  106. INTERFACE_DECL(_EFI_FILE_IO_INTERFACE);
  107. INTERFACE_DECL(_EFI_FILE_HANDLE);
  108. typedef
  109. EFI_STATUS
  110. (EFIAPI *EFI_VOLUME_OPEN) (
  111. IN struct _EFI_FILE_IO_INTERFACE *This,
  112. OUT struct _EFI_FILE_HANDLE **Root
  113. );
  114. #define EFI_FILE_IO_INTERFACE_REVISION 0x00010000
  115. typedef struct _EFI_FILE_IO_INTERFACE {
  116. UINT64 Revision;
  117. EFI_VOLUME_OPEN OpenVolume;
  118. } EFI_FILE_IO_INTERFACE;
  119. /*
  120. *
  121. */
  122. typedef
  123. EFI_STATUS
  124. (EFIAPI *EFI_FILE_OPEN) (
  125. IN struct _EFI_FILE_HANDLE *File,
  126. OUT struct _EFI_FILE_HANDLE **NewHandle,
  127. IN CHAR16 *FileName,
  128. IN UINT64 OpenMode,
  129. IN UINT64 Attributes
  130. );
  131. /* Open modes */
  132. #define EFI_FILE_MODE_READ 0x0000000000000001
  133. #define EFI_FILE_MODE_WRITE 0x0000000000000002
  134. #define EFI_FILE_MODE_CREATE 0x8000000000000000
  135. /* File attributes */
  136. #define EFI_FILE_READ_ONLY 0x0000000000000001
  137. #define EFI_FILE_HIDDEN 0x0000000000000002
  138. #define EFI_FILE_SYSTEM 0x0000000000000004
  139. #define EFI_FILE_RESERVIED 0x0000000000000008
  140. #define EFI_FILE_DIRECTORY 0x0000000000000010
  141. #define EFI_FILE_ARCHIVE 0x0000000000000020
  142. #define EFI_FILE_VALID_ATTR 0x0000000000000037
  143. typedef
  144. EFI_STATUS
  145. (EFIAPI *EFI_FILE_CLOSE) (
  146. IN struct _EFI_FILE_HANDLE *File
  147. );
  148. typedef
  149. EFI_STATUS
  150. (EFIAPI *EFI_FILE_DELETE) (
  151. IN struct _EFI_FILE_HANDLE *File
  152. );
  153. typedef
  154. EFI_STATUS
  155. (EFIAPI *EFI_FILE_READ) (
  156. IN struct _EFI_FILE_HANDLE *File,
  157. IN OUT UINTN *BufferSize,
  158. OUT VOID *Buffer
  159. );
  160. typedef
  161. EFI_STATUS
  162. (EFIAPI *EFI_FILE_WRITE) (
  163. IN struct _EFI_FILE_HANDLE *File,
  164. IN OUT UINTN *BufferSize,
  165. IN VOID *Buffer
  166. );
  167. typedef
  168. EFI_STATUS
  169. (EFIAPI *EFI_FILE_SET_POSITION) (
  170. IN struct _EFI_FILE_HANDLE *File,
  171. IN UINT64 Position
  172. );
  173. typedef
  174. EFI_STATUS
  175. (EFIAPI *EFI_FILE_GET_POSITION) (
  176. IN struct _EFI_FILE_HANDLE *File,
  177. OUT UINT64 *Position
  178. );
  179. typedef
  180. EFI_STATUS
  181. (EFIAPI *EFI_FILE_GET_INFO) (
  182. IN struct _EFI_FILE_HANDLE *File,
  183. IN EFI_GUID *InformationType,
  184. IN OUT UINTN *BufferSize,
  185. OUT VOID *Buffer
  186. );
  187. typedef
  188. EFI_STATUS
  189. (EFIAPI *EFI_FILE_SET_INFO) (
  190. IN struct _EFI_FILE_HANDLE *File,
  191. IN EFI_GUID *InformationType,
  192. IN UINTN BufferSize,
  193. IN VOID *Buffer
  194. );
  195. typedef
  196. EFI_STATUS
  197. (EFIAPI *EFI_FILE_FLUSH) (
  198. IN struct _EFI_FILE_HANDLE *File
  199. );
  200. #define EFI_FILE_HANDLE_REVISION 0x00010000
  201. typedef struct _EFI_FILE_HANDLE {
  202. UINT64 Revision;
  203. EFI_FILE_OPEN Open;
  204. EFI_FILE_CLOSE Close;
  205. EFI_FILE_DELETE Delete;
  206. EFI_FILE_READ Read;
  207. EFI_FILE_WRITE Write;
  208. EFI_FILE_GET_POSITION GetPosition;
  209. EFI_FILE_SET_POSITION SetPosition;
  210. EFI_FILE_GET_INFO GetInfo;
  211. EFI_FILE_SET_INFO SetInfo;
  212. EFI_FILE_FLUSH Flush;
  213. } EFI_FILE, *EFI_FILE_HANDLE;
  214. /*
  215. * File information types
  216. */
  217. #define EFI_FILE_INFO_ID \
  218. { 0x9576e92, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
  219. typedef struct {
  220. UINT64 Size;
  221. UINT64 FileSize;
  222. UINT64 PhysicalSize;
  223. EFI_TIME CreateTime;
  224. EFI_TIME LastAccessTime;
  225. EFI_TIME ModificationTime;
  226. UINT64 Attribute;
  227. CHAR16 FileName[1];
  228. } EFI_FILE_INFO;
  229. /*
  230. * The FileName field of the EFI_FILE_INFO data structure is variable length.
  231. * Whenever code needs to know the size of the EFI_FILE_INFO data structure, it needs to
  232. * be the size of the data structure without the FileName field. The following macro
  233. * computes this size correctly no matter how big the FileName array is declared.
  234. * This is required to make the EFI_FILE_INFO data structure ANSI compilant.
  235. */
  236. #define SIZE_OF_EFI_FILE_INFO EFI_FIELD_OFFSET(EFI_FILE_INFO,FileName)
  237. #define EFI_FILE_SYSTEM_INFO_ID \
  238. { 0x9576e93, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
  239. typedef struct {
  240. UINT64 Size;
  241. BOOLEAN ReadOnly;
  242. UINT64 VolumeSize;
  243. UINT64 FreeSpace;
  244. UINT32 BlockSize;
  245. CHAR16 VolumeLabel[1];
  246. } EFI_FILE_SYSTEM_INFO;
  247. /*
  248. * The VolumeLabel field of the EFI_FILE_SYSTEM_INFO data structure is variable length.
  249. * Whenever code needs to know the size of the EFI_FILE_SYSTEM_INFO data structure, it needs
  250. * to be the size of the data structure without the VolumeLable field. The following macro
  251. * computes this size correctly no matter how big the VolumeLable array is declared.
  252. * This is required to make the EFI_FILE_SYSTEM_INFO data structure ANSI compilant.
  253. */
  254. #define SIZE_OF_EFI_FILE_SYSTEM_INFO EFI_FIELD_OFFSET(EFI_FILE_SYSTEM_INFO,VolumeLabel)
  255. #define EFI_FILE_SYSTEM_VOLUME_LABEL_INFO_ID \
  256. { 0xDB47D7D3,0xFE81, 0x11d3, 0x9A, 0x35, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }
  257. typedef struct {
  258. CHAR16 VolumeLabel[1];
  259. } EFI_FILE_SYSTEM_VOLUME_LABEL_INFO;
  260. #define SIZE_OF_EFI_FILE_SYSTEM_VOLUME_LABEL_INFO EFI_FIELD_OFFSET(EFI_FILE_SYSTEM_VOLUME_LABEL_INFO,VolumeLabel)
  261. /*
  262. * Load file protocol
  263. */
  264. #define LOAD_FILE_PROTOCOL \
  265. { 0x56EC3091, 0x954C, 0x11d2, 0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B }
  266. INTERFACE_DECL(_EFI_LOAD_FILE_INTERFACE);
  267. typedef
  268. EFI_STATUS
  269. (EFIAPI *EFI_LOAD_FILE) (
  270. IN struct _EFI_LOAD_FILE_INTERFACE *This,
  271. IN EFI_DEVICE_PATH *FilePath,
  272. IN BOOLEAN BootPolicy,
  273. IN OUT UINTN *BufferSize,
  274. IN VOID *Buffer OPTIONAL
  275. );
  276. typedef struct _EFI_LOAD_FILE_INTERFACE {
  277. EFI_LOAD_FILE LoadFile;
  278. } EFI_LOAD_FILE_INTERFACE;
  279. /*
  280. * Device IO protocol
  281. */
  282. #define DEVICE_IO_PROTOCOL \
  283. { 0xaf6ac311, 0x84c3, 0x11d2, 0x8e, 0x3c, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
  284. INTERFACE_DECL(_EFI_DEVICE_IO_INTERFACE);
  285. typedef enum {
  286. IO_UINT8,
  287. IO_UINT16,
  288. IO_UINT32,
  289. IO_UINT64,
  290. /*
  291. * Specification Change: Copy from MMIO to MMIO vs. MMIO to buffer, buffer to MMIO
  292. */
  293. MMIO_COPY_UINT8,
  294. MMIO_COPY_UINT16,
  295. MMIO_COPY_UINT32,
  296. MMIO_COPY_UINT64
  297. } EFI_IO_WIDTH;
  298. #define EFI_PCI_ADDRESS(_bus,_dev,_func) \
  299. ( (UINT64) ( (((UINTN)_bus) << 24) + (((UINTN)_dev) << 16) + (((UINTN)_func) << 8) ) )
  300. typedef
  301. EFI_STATUS
  302. (EFIAPI *EFI_DEVICE_IO) (
  303. IN struct _EFI_DEVICE_IO_INTERFACE *This,
  304. IN EFI_IO_WIDTH Width,
  305. IN UINT64 Address,
  306. IN UINTN Count,
  307. IN OUT VOID *Buffer
  308. );
  309. typedef struct {
  310. EFI_DEVICE_IO Read;
  311. EFI_DEVICE_IO Write;
  312. } EFI_IO_ACCESS;
  313. typedef
  314. EFI_STATUS
  315. (EFIAPI *EFI_PCI_DEVICE_PATH) (
  316. IN struct _EFI_DEVICE_IO_INTERFACE *This,
  317. IN UINT64 Address,
  318. IN OUT EFI_DEVICE_PATH **PciDevicePath
  319. );
  320. typedef enum {
  321. EfiBusMasterRead,
  322. EfiBusMasterWrite,
  323. EfiBusMasterCommonBuffer
  324. } EFI_IO_OPERATION_TYPE;
  325. typedef
  326. EFI_STATUS
  327. (EFIAPI *EFI_IO_MAP) (
  328. IN struct _EFI_DEVICE_IO_INTERFACE *This,
  329. IN EFI_IO_OPERATION_TYPE Operation,
  330. IN EFI_PHYSICAL_ADDRESS *HostAddress,
  331. IN OUT UINTN *NumberOfBytes,
  332. OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,
  333. OUT VOID **Mapping
  334. );
  335. typedef
  336. EFI_STATUS
  337. (EFIAPI *EFI_IO_UNMAP) (
  338. IN struct _EFI_DEVICE_IO_INTERFACE *This,
  339. IN VOID *Mapping
  340. );
  341. typedef
  342. EFI_STATUS
  343. (EFIAPI *EFI_IO_ALLOCATE_BUFFER) (
  344. IN struct _EFI_DEVICE_IO_INTERFACE *This,
  345. IN EFI_ALLOCATE_TYPE Type,
  346. IN EFI_MEMORY_TYPE MemoryType,
  347. IN UINTN Pages,
  348. IN OUT EFI_PHYSICAL_ADDRESS *HostAddress
  349. );
  350. typedef
  351. EFI_STATUS
  352. (EFIAPI *EFI_IO_FLUSH) (
  353. IN struct _EFI_DEVICE_IO_INTERFACE *This
  354. );
  355. typedef
  356. EFI_STATUS
  357. (EFIAPI *EFI_IO_FREE_BUFFER) (
  358. IN struct _EFI_DEVICE_IO_INTERFACE *This,
  359. IN UINTN Pages,
  360. IN EFI_PHYSICAL_ADDRESS HostAddress
  361. );
  362. typedef struct _EFI_DEVICE_IO_INTERFACE {
  363. EFI_IO_ACCESS Mem;
  364. EFI_IO_ACCESS Io;
  365. EFI_IO_ACCESS Pci;
  366. EFI_IO_MAP Map;
  367. EFI_PCI_DEVICE_PATH PciDevicePath;
  368. EFI_IO_UNMAP Unmap;
  369. EFI_IO_ALLOCATE_BUFFER AllocateBuffer;
  370. EFI_IO_FLUSH Flush;
  371. EFI_IO_FREE_BUFFER FreeBuffer;
  372. } EFI_DEVICE_IO_INTERFACE;
  373. /*
  374. * PCI IO protocol
  375. */
  376. #define EFI_PCI_IO_PROTOCOL \
  377. { 0x4cf5b200, 0x68b8, 0x4ca5, 0x9e, 0xec, 0xb2, 0x3e, 0x3f, 0x50, 0x2, 0x9a }
  378. INTERFACE_DECL(_EFI_PCI_IO_INTERFACE);
  379. typedef enum {
  380. EfiPciIoWidthUint8,
  381. EfiPciIoWidthUint16,
  382. EfiPciIoWidthUint32,
  383. EfiPciIoWidthUint64,
  384. EfiPciIoWidthFifoUint8,
  385. EfiPciIoWidthFifoUint16,
  386. EfiPciIoWidthFifoUint32,
  387. EfiPciIoWidthFifoUint64,
  388. EfiPciIoWidthFillUint8,
  389. EfiPciIoWidthFillUint16,
  390. EfiPciIoWidthFillUint32,
  391. EfiPciIoWidthFillUint64,
  392. EfiPciIoWidthMaximum
  393. } EFI_PCI_IO_PROTOCOL_WIDTH;
  394. typedef
  395. EFI_STATUS
  396. (EFIAPI *EFI_PCI_IO_PROTOCOL_POLL_IO_MEM) (
  397. IN struct _EFI_PCI_IO_INTERFACE *This,
  398. IN EFI_PCI_IO_PROTOCOL_WIDTH Width,
  399. IN UINT8 BarIndex,
  400. IN UINT64 Offset,
  401. IN UINT64 Mask,
  402. IN UINT64 Value,
  403. IN UINT64 Delay,
  404. OUT UINT64 *Result
  405. );
  406. typedef
  407. EFI_STATUS
  408. (EFIAPI *EFI_PCI_IO_PROTOCOL_IO_MEM) (
  409. IN struct _EFI_PCI_IO_INTERFACE *This,
  410. IN EFI_PCI_IO_PROTOCOL_WIDTH Width,
  411. IN UINT8 BarIndex,
  412. IN UINT64 Offset,
  413. IN UINTN Count,
  414. IN OUT VOID *Buffer
  415. );
  416. typedef struct {
  417. EFI_PCI_IO_PROTOCOL_IO_MEM Read;
  418. EFI_PCI_IO_PROTOCOL_IO_MEM Write;
  419. } EFI_PCI_IO_PROTOCOL_ACCESS;
  420. typedef
  421. EFI_STATUS
  422. (EFIAPI *EFI_PCI_IO_PROTOCOL_CONFIG) (
  423. IN struct _EFI_PCI_IO_INTERFACE *This,
  424. IN EFI_PCI_IO_PROTOCOL_WIDTH Width,
  425. IN UINT32 Offset,
  426. IN UINTN Count,
  427. IN OUT VOID *Buffer
  428. );
  429. typedef struct {
  430. EFI_PCI_IO_PROTOCOL_CONFIG Read;
  431. EFI_PCI_IO_PROTOCOL_CONFIG Write;
  432. } EFI_PCI_IO_PROTOCOL_CONFIG_ACCESS;
  433. #define EFI_PCI_IO_ATTRIBUTE_ISA_MOTHERBOARD_IO 0x0001
  434. #define EFI_PCI_IO_ATTRIBUTE_ISA_IO 0x0002
  435. #define EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO 0x0004
  436. #define EFI_PCI_IO_ATTRIBUTE_VGA_MEMORY 0x0008
  437. #define EFI_PCI_IO_ATTRIBUTE_VGA_IO 0x0010
  438. #define EFI_PCI_IO_ATTRIBUTE_IDE_PRIMARY_IO 0x0020
  439. #define EFI_PCI_IO_ATTRIBUTE_IDE_SECONDARY_IO 0x0040
  440. #define EFI_PCI_IO_ATTRIBUTE_MEMORY_WRITE_COMBINE 0x0080
  441. #define EFI_PCI_IO_ATTRIBUTE_IO 0x0100
  442. #define EFI_PCI_IO_ATTRIBUTE_MEMORY 0x0200
  443. #define EFI_PCI_IO_ATTRIBUTE_BUS_MASTER 0x0400
  444. #define EFI_PCI_IO_ATTRIBUTE_MEMORY_CACHED 0x0800
  445. #define EFI_PCI_IO_ATTRIBUTE_MEMORY_DISABLE 0x1000
  446. #define EFI_PCI_IO_ATTRIBUTE_EMBEDDED_DEVICE 0x2000
  447. #define EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM 0x4000
  448. typedef enum {
  449. EfiPciIoOperationBusMasterRead,
  450. EfiPciIoOperationBusMasterWrite,
  451. EfiPciIoOperationBusMasterCommonBuffer,
  452. EfiPciIoOperationMaximum
  453. } EFI_PCI_IO_PROTOCOL_OPERATION;
  454. typedef
  455. EFI_STATUS
  456. (EFIAPI *EFI_PCI_IO_PROTOCOL_COPY_MEM) (
  457. IN struct _EFI_PCI_IO_INTERFACE *This,
  458. IN EFI_PCI_IO_PROTOCOL_WIDTH Width,
  459. IN UINT8 DestBarIndex,
  460. IN UINT64 DestOffset,
  461. IN UINT8 SrcBarIndex,
  462. IN UINT64 SrcOffset,
  463. IN UINTN Count
  464. );
  465. typedef
  466. EFI_STATUS
  467. (EFIAPI *EFI_PCI_IO_PROTOCOL_MAP) (
  468. IN struct _EFI_PCI_IO_INTERFACE *This,
  469. IN EFI_PCI_IO_PROTOCOL_OPERATION Operation,
  470. IN VOID *HostAddress,
  471. IN OUT UINTN *NumberOfBytes,
  472. OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,
  473. OUT VOID **Mapping
  474. );
  475. typedef
  476. EFI_STATUS
  477. (EFIAPI *EFI_PCI_IO_PROTOCOL_UNMAP) (
  478. IN struct _EFI_PCI_IO_INTERFACE *This,
  479. IN VOID *Mapping
  480. );
  481. typedef
  482. EFI_STATUS
  483. (EFIAPI *EFI_PCI_IO_PROTOCOL_ALLOCATE_BUFFER) (
  484. IN struct _EFI_PCI_IO_INTERFACE *This,
  485. IN EFI_ALLOCATE_TYPE Type,
  486. IN EFI_MEMORY_TYPE MemoryType,
  487. IN UINTN Pages,
  488. IN OUT VOID **HostAddress,
  489. IN UINT64 Attributes
  490. );
  491. typedef
  492. EFI_STATUS
  493. (EFIAPI *EFI_PCI_IO_PROTOCOL_FREE_BUFFER) (
  494. IN struct _EFI_PCI_IO_INTERFACE *This,
  495. IN UINTN Pages,
  496. IN VOID *HostAddress
  497. );
  498. typedef
  499. EFI_STATUS
  500. (EFIAPI *EFI_PCI_IO_PROTOCOL_FLUSH) (
  501. IN struct _EFI_PCI_IO_INTERFACE *This
  502. );
  503. typedef
  504. EFI_STATUS
  505. (EFIAPI *EFI_PCI_IO_PROTOCOL_GET_LOCATION) (
  506. IN struct _EFI_PCI_IO_INTERFACE *This,
  507. OUT UINTN *SegmentNumber,
  508. OUT UINTN *BusNumber,
  509. OUT UINTN *DeviceNumber,
  510. OUT UINTN *FunctionNumber
  511. );
  512. typedef enum {
  513. EfiPciIoAttributeOperationGet,
  514. EfiPciIoAttributeOperationSet,
  515. EfiPciIoAttributeOperationEnable,
  516. EfiPciIoAttributeOperationDisable,
  517. EfiPciIoAttributeOperationSupported,
  518. EfiPciIoAttributeOperationMaximum
  519. } EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION;
  520. typedef
  521. EFI_STATUS
  522. (EFIAPI *EFI_PCI_IO_PROTOCOL_ATTRIBUTES) (
  523. IN struct _EFI_PCI_IO_INTERFACE *This,
  524. IN EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION Operation,
  525. IN UINT64 Attributes,
  526. OUT UINT64 *Result OPTIONAL
  527. );
  528. typedef
  529. EFI_STATUS
  530. (EFIAPI *EFI_PCI_IO_PROTOCOL_GET_BAR_ATTRIBUTES) (
  531. IN struct _EFI_PCI_IO_INTERFACE *This,
  532. IN UINT8 BarIndex,
  533. OUT UINT64 *Supports OPTIONAL,
  534. OUT VOID **Resources OPTIONAL
  535. );
  536. typedef
  537. EFI_STATUS
  538. (EFIAPI *EFI_PCI_IO_PROTOCOL_SET_BAR_ATTRIBUTES) (
  539. IN struct _EFI_PCI_IO_INTERFACE *This,
  540. IN UINT64 Attributes,
  541. IN UINT8 BarIndex,
  542. IN OUT UINT64 *Offset,
  543. IN OUT UINT64 *Length
  544. );
  545. typedef struct _EFI_PCI_IO_INTERFACE {
  546. EFI_PCI_IO_PROTOCOL_POLL_IO_MEM PollMem;
  547. EFI_PCI_IO_PROTOCOL_POLL_IO_MEM PollIo;
  548. EFI_PCI_IO_PROTOCOL_ACCESS Mem;
  549. EFI_PCI_IO_PROTOCOL_ACCESS Io;
  550. EFI_PCI_IO_PROTOCOL_CONFIG_ACCESS Pci;
  551. EFI_PCI_IO_PROTOCOL_COPY_MEM CopyMem;
  552. EFI_PCI_IO_PROTOCOL_MAP Map;
  553. EFI_PCI_IO_PROTOCOL_UNMAP Unmap;
  554. EFI_PCI_IO_PROTOCOL_ALLOCATE_BUFFER AllocateBuffer;
  555. EFI_PCI_IO_PROTOCOL_FREE_BUFFER FreeBuffer;
  556. EFI_PCI_IO_PROTOCOL_FLUSH Flush;
  557. EFI_PCI_IO_PROTOCOL_GET_LOCATION GetLocation;
  558. EFI_PCI_IO_PROTOCOL_ATTRIBUTES Attributes;
  559. EFI_PCI_IO_PROTOCOL_GET_BAR_ATTRIBUTES GetBarAttributes;
  560. EFI_PCI_IO_PROTOCOL_SET_BAR_ATTRIBUTES SetBarAttributes;
  561. UINT64 RomSize;
  562. VOID *RomImage;
  563. } EFI_PCI_IO_INTERFACE;
  564. /*
  565. * Unicode Collation protocol
  566. */
  567. #define UNICODE_COLLATION_PROTOCOL \
  568. { 0x1d85cd7f, 0xf43d, 0x11d2, 0x9a, 0xc, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d }
  569. #define UNICODE_BYTE_ORDER_MARK (CHAR16)(0xfeff)
  570. INTERFACE_DECL(_EFI_UNICODE_COLLATION_INTERFACE);
  571. typedef
  572. INTN
  573. (EFIAPI *EFI_UNICODE_STRICOLL) (
  574. IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
  575. IN CHAR16 *s1,
  576. IN CHAR16 *s2
  577. );
  578. typedef
  579. BOOLEAN
  580. (EFIAPI *EFI_UNICODE_METAIMATCH) (
  581. IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
  582. IN CHAR16 *String,
  583. IN CHAR16 *Pattern
  584. );
  585. typedef
  586. VOID
  587. (EFIAPI *EFI_UNICODE_STRLWR) (
  588. IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
  589. IN OUT CHAR16 *Str
  590. );
  591. typedef
  592. VOID
  593. (EFIAPI *EFI_UNICODE_STRUPR) (
  594. IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
  595. IN OUT CHAR16 *Str
  596. );
  597. typedef
  598. VOID
  599. (EFIAPI *EFI_UNICODE_FATTOSTR) (
  600. IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
  601. IN UINTN FatSize,
  602. IN CHAR8 *Fat,
  603. OUT CHAR16 *String
  604. );
  605. typedef
  606. BOOLEAN
  607. (EFIAPI *EFI_UNICODE_STRTOFAT) (
  608. IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
  609. IN CHAR16 *String,
  610. IN UINTN FatSize,
  611. OUT CHAR8 *Fat
  612. );
  613. typedef struct _EFI_UNICODE_COLLATION_INTERFACE {
  614. /* general */
  615. EFI_UNICODE_STRICOLL StriColl;
  616. EFI_UNICODE_METAIMATCH MetaiMatch;
  617. EFI_UNICODE_STRLWR StrLwr;
  618. EFI_UNICODE_STRUPR StrUpr;
  619. /* for supporting fat volumes */
  620. EFI_UNICODE_FATTOSTR FatToStr;
  621. EFI_UNICODE_STRTOFAT StrToFat;
  622. CHAR8 *SupportedLanguages;
  623. } EFI_UNICODE_COLLATION_INTERFACE;
  624. #endif