1 #ifndef _EFI_PROT_H 2 #define _EFI_PROT_H 3 4 /*++ 5 6 Copyright (c) 1998 Intel Corporation 7 8 Module Name: 9 10 efiprot.h 11 12 Abstract: 13 14 EFI Protocols 15 16 17 18 Revision History 19 20 --*/ 21 22 // 23 // FPSWA library protocol 24 // 25 #define EFI_FPSWA_PROTOCOL_GUID \ 26 { 0xc41b6531, 0x97b9, 0x11d3, {0x9a, 0x29, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } 27 #define FPSWA_PROTOCOL EFI_FPSWA_PROTOCOL_GUID 28 29 // 30 // Device Path protocol 31 // 32 33 #define EFI_DEVICE_PATH_PROTOCOL_GUID \ 34 { 0x9576e91, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} } 35 #define DEVICE_PATH_PROTOCOL EFI_DEVICE_PATH_PROTOCOL_GUID 36 37 38 // 39 // Block IO protocol 40 // 41 42 #define EFI_BLOCK_IO_PROTOCOL_GUID \ 43 { 0x964e5b21, 0x6459, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} } 44 #define BLOCK_IO_PROTOCOL EFI_BLOCK_IO_PROTOCOL_GUID 45 46 #define EFI_BLOCK_IO_PROTOCOL_REVISION 0x00010000 47 #define EFI_BLOCK_IO_PROTOCOL_REVISION2 0x00020001 48 #define EFI_BLOCK_IO_PROTOCOL_REVISION3 ((2<<16) | 31) 49 #define EFI_BLOCK_IO_INTERFACE_REVISION EFI_BLOCK_IO_PROTOCOL_REVISION 50 #define EFI_BLOCK_IO_INTERFACE_REVISION2 EFI_BLOCK_IO_PROTOCOL_REVISION2 51 #define EFI_BLOCK_IO_INTERFACE_REVISION3 EFI_BLOCK_IO_PROTOCOL_REVISION3 52 53 INTERFACE_DECL(_EFI_BLOCK_IO_PROTOCOL); 54 55 typedef 56 EFI_STATUS 57 (EFIAPI *EFI_BLOCK_RESET) ( 58 IN struct _EFI_BLOCK_IO_PROTOCOL *This, 59 IN BOOLEAN ExtendedVerification 60 ); 61 62 typedef 63 EFI_STATUS 64 (EFIAPI *EFI_BLOCK_READ) ( 65 IN struct _EFI_BLOCK_IO_PROTOCOL *This, 66 IN UINT32 MediaId, 67 IN EFI_LBA LBA, 68 IN UINTN BufferSize, 69 OUT VOID *Buffer 70 ); 71 72 73 typedef 74 EFI_STATUS 75 (EFIAPI *EFI_BLOCK_WRITE) ( 76 IN struct _EFI_BLOCK_IO_PROTOCOL *This, 77 IN UINT32 MediaId, 78 IN EFI_LBA LBA, 79 IN UINTN BufferSize, 80 IN VOID *Buffer 81 ); 82 83 84 typedef 85 EFI_STATUS 86 (EFIAPI *EFI_BLOCK_FLUSH) ( 87 IN struct _EFI_BLOCK_IO_PROTOCOL *This 88 ); 89 90 91 92 typedef struct { 93 UINT32 MediaId; 94 BOOLEAN RemovableMedia; 95 BOOLEAN MediaPresent; 96 97 BOOLEAN LogicalPartition; 98 BOOLEAN ReadOnly; 99 BOOLEAN WriteCaching; 100 101 UINT32 BlockSize; 102 UINT32 IoAlign; 103 104 EFI_LBA LastBlock; 105 106 /* revision 2 */ 107 EFI_LBA LowestAlignedLba; 108 UINT32 LogicalBlocksPerPhysicalBlock; 109 /* revision 3 */ 110 UINT32 OptimalTransferLengthGranularity; 111 } EFI_BLOCK_IO_MEDIA; 112 113 typedef struct _EFI_BLOCK_IO_PROTOCOL { 114 UINT64 Revision; 115 116 EFI_BLOCK_IO_MEDIA *Media; 117 118 EFI_BLOCK_RESET Reset; 119 EFI_BLOCK_READ ReadBlocks; 120 EFI_BLOCK_WRITE WriteBlocks; 121 EFI_BLOCK_FLUSH FlushBlocks; 122 123 } EFI_BLOCK_IO_PROTOCOL; 124 125 typedef struct _EFI_BLOCK_IO_PROTOCOL _EFI_BLOCK_IO; 126 typedef EFI_BLOCK_IO_PROTOCOL EFI_BLOCK_IO; 127 128 129 // 130 // Disk Block IO protocol 131 // 132 133 #define EFI_DISK_IO_PROTOCOL_GUID \ 134 { 0xce345171, 0xba0b, 0x11d2, {0x8e, 0x4f, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} } 135 #define DISK_IO_PROTOCOL EFI_DISK_IO_PROTOCOL_GUID 136 137 #define EFI_DISK_IO_PROTOCOL_REVISION 0x00010000 138 #define EFI_DISK_IO_INTERFACE_REVISION EFI_DISK_IO_PROTOCOL_REVISION 139 140 INTERFACE_DECL(_EFI_DISK_IO_PROTOCOL); 141 142 typedef 143 EFI_STATUS 144 (EFIAPI *EFI_DISK_READ) ( 145 IN struct _EFI_DISK_IO_PROTOCOL *This, 146 IN UINT32 MediaId, 147 IN UINT64 Offset, 148 IN UINTN BufferSize, 149 OUT VOID *Buffer 150 ); 151 152 153 typedef 154 EFI_STATUS 155 (EFIAPI *EFI_DISK_WRITE) ( 156 IN struct _EFI_DISK_IO_PROTOCOL *This, 157 IN UINT32 MediaId, 158 IN UINT64 Offset, 159 IN UINTN BufferSize, 160 IN VOID *Buffer 161 ); 162 163 164 typedef struct _EFI_DISK_IO_PROTOCOL { 165 UINT64 Revision; 166 EFI_DISK_READ ReadDisk; 167 EFI_DISK_WRITE WriteDisk; 168 } EFI_DISK_IO_PROTOCOL; 169 170 typedef struct _EFI_DISK_IO_PROTOCOL _EFI_DISK_IO; 171 typedef EFI_DISK_IO_PROTOCOL EFI_DISK_IO; 172 173 // 174 // Simple file system protocol 175 // 176 177 #define EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID \ 178 { 0x964e5b22, 0x6459, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} } 179 #define SIMPLE_FILE_SYSTEM_PROTOCOL EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID 180 181 INTERFACE_DECL(_EFI_SIMPLE_FILE_SYSTEM_PROTOCOL); 182 INTERFACE_DECL(_EFI_FILE_HANDLE); 183 184 typedef 185 EFI_STATUS 186 (EFIAPI *EFI_VOLUME_OPEN) ( 187 IN struct _EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *This, 188 OUT struct _EFI_FILE_HANDLE **Root 189 ); 190 191 #define EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_REVISION 0x00010000 192 #define EFI_FILE_IO_INTERFACE_REVISION EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_REVISION 193 194 typedef struct _EFI_SIMPLE_FILE_SYSTEM_PROTOCOL { 195 UINT64 Revision; 196 EFI_VOLUME_OPEN OpenVolume; 197 } EFI_SIMPLE_FILE_SYSTEM_PROTOCOL; 198 199 typedef struct _EFI_SIMPLE_FILE_SYSTEM_PROTOCOL _EFI_FILE_IO_INTERFACE; 200 typedef EFI_SIMPLE_FILE_SYSTEM_PROTOCOL EFI_FILE_IO_INTERFACE; 201 202 // 203 // 204 // 205 206 typedef 207 EFI_STATUS 208 (EFIAPI *EFI_FILE_OPEN) ( 209 IN struct _EFI_FILE_HANDLE *File, 210 OUT struct _EFI_FILE_HANDLE **NewHandle, 211 IN CHAR16 *FileName, 212 IN UINT64 OpenMode, 213 IN UINT64 Attributes 214 ); 215 216 // Open modes 217 #define EFI_FILE_MODE_READ 0x0000000000000001 218 #define EFI_FILE_MODE_WRITE 0x0000000000000002 219 #define EFI_FILE_MODE_CREATE 0x8000000000000000 220 221 // File attributes 222 #define EFI_FILE_READ_ONLY 0x0000000000000001 223 #define EFI_FILE_HIDDEN 0x0000000000000002 224 #define EFI_FILE_SYSTEM 0x0000000000000004 225 #define EFI_FILE_RESERVIED 0x0000000000000008 226 #define EFI_FILE_DIRECTORY 0x0000000000000010 227 #define EFI_FILE_ARCHIVE 0x0000000000000020 228 #define EFI_FILE_VALID_ATTR 0x0000000000000037 229 230 typedef 231 EFI_STATUS 232 (EFIAPI *EFI_FILE_CLOSE) ( 233 IN struct _EFI_FILE_HANDLE *File 234 ); 235 236 typedef 237 EFI_STATUS 238 (EFIAPI *EFI_FILE_DELETE) ( 239 IN struct _EFI_FILE_HANDLE *File 240 ); 241 242 typedef 243 EFI_STATUS 244 (EFIAPI *EFI_FILE_READ) ( 245 IN struct _EFI_FILE_HANDLE *File, 246 IN OUT UINTN *BufferSize, 247 OUT VOID *Buffer 248 ); 249 250 typedef 251 EFI_STATUS 252 (EFIAPI *EFI_FILE_WRITE) ( 253 IN struct _EFI_FILE_HANDLE *File, 254 IN OUT UINTN *BufferSize, 255 IN VOID *Buffer 256 ); 257 258 typedef 259 EFI_STATUS 260 (EFIAPI *EFI_FILE_SET_POSITION) ( 261 IN struct _EFI_FILE_HANDLE *File, 262 IN UINT64 Position 263 ); 264 265 typedef 266 EFI_STATUS 267 (EFIAPI *EFI_FILE_GET_POSITION) ( 268 IN struct _EFI_FILE_HANDLE *File, 269 OUT UINT64 *Position 270 ); 271 272 typedef 273 EFI_STATUS 274 (EFIAPI *EFI_FILE_GET_INFO) ( 275 IN struct _EFI_FILE_HANDLE *File, 276 IN EFI_GUID *InformationType, 277 IN OUT UINTN *BufferSize, 278 OUT VOID *Buffer 279 ); 280 281 typedef 282 EFI_STATUS 283 (EFIAPI *EFI_FILE_SET_INFO) ( 284 IN struct _EFI_FILE_HANDLE *File, 285 IN EFI_GUID *InformationType, 286 IN UINTN BufferSize, 287 IN VOID *Buffer 288 ); 289 290 typedef 291 EFI_STATUS 292 (EFIAPI *EFI_FILE_FLUSH) ( 293 IN struct _EFI_FILE_HANDLE *File 294 ); 295 296 297 298 #define EFI_FILE_HANDLE_REVISION 0x00010000 299 typedef struct _EFI_FILE_HANDLE { 300 UINT64 Revision; 301 EFI_FILE_OPEN Open; 302 EFI_FILE_CLOSE Close; 303 EFI_FILE_DELETE Delete; 304 EFI_FILE_READ Read; 305 EFI_FILE_WRITE Write; 306 EFI_FILE_GET_POSITION GetPosition; 307 EFI_FILE_SET_POSITION SetPosition; 308 EFI_FILE_GET_INFO GetInfo; 309 EFI_FILE_SET_INFO SetInfo; 310 EFI_FILE_FLUSH Flush; 311 } EFI_FILE, *EFI_FILE_HANDLE; 312 313 314 // 315 // File information types 316 // 317 318 #define EFI_FILE_INFO_ID \ 319 { 0x9576e92, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} } 320 321 typedef struct { 322 UINT64 Size; 323 UINT64 FileSize; 324 UINT64 PhysicalSize; 325 EFI_TIME CreateTime; 326 EFI_TIME LastAccessTime; 327 EFI_TIME ModificationTime; 328 UINT64 Attribute; 329 CHAR16 FileName[1]; 330 } EFI_FILE_INFO; 331 332 // 333 // The FileName field of the EFI_FILE_INFO data structure is variable length. 334 // Whenever code needs to know the size of the EFI_FILE_INFO data structure, it needs to 335 // be the size of the data structure without the FileName field. The following macro 336 // computes this size correctly no matter how big the FileName array is declared. 337 // This is required to make the EFI_FILE_INFO data structure ANSI compilant. 338 // 339 340 #define SIZE_OF_EFI_FILE_INFO EFI_FIELD_OFFSET(EFI_FILE_INFO,FileName) 341 342 #define EFI_FILE_SYSTEM_INFO_ID \ 343 { 0x9576e93, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} } 344 345 typedef struct { 346 UINT64 Size; 347 BOOLEAN ReadOnly; 348 UINT64 VolumeSize; 349 UINT64 FreeSpace; 350 UINT32 BlockSize; 351 CHAR16 VolumeLabel[1]; 352 } EFI_FILE_SYSTEM_INFO; 353 354 // 355 // The VolumeLabel field of the EFI_FILE_SYSTEM_INFO data structure is variable length. 356 // Whenever code needs to know the size of the EFI_FILE_SYSTEM_INFO data structure, it needs 357 // to be the size of the data structure without the VolumeLable field. The following macro 358 // computes this size correctly no matter how big the VolumeLable array is declared. 359 // This is required to make the EFI_FILE_SYSTEM_INFO data structure ANSI compilant. 360 // 361 362 #define SIZE_OF_EFI_FILE_SYSTEM_INFO EFI_FIELD_OFFSET(EFI_FILE_SYSTEM_INFO,VolumeLabel) 363 364 #define EFI_FILE_SYSTEM_VOLUME_LABEL_INFO_ID \ 365 { 0xDB47D7D3,0xFE81, 0x11d3, {0x9A, 0x35, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D} } 366 367 typedef struct { 368 CHAR16 VolumeLabel[1]; 369 } EFI_FILE_SYSTEM_VOLUME_LABEL_INFO; 370 371 #define SIZE_OF_EFI_FILE_SYSTEM_VOLUME_LABEL_INFO EFI_FIELD_OFFSET(EFI_FILE_SYSTEM_VOLUME_LABEL_INFO,VolumeLabel) 372 373 // 374 // Load file protocol 375 // 376 377 378 #define EFI_LOAD_FILE_PROTOCOL_GUID \ 379 { 0x56EC3091, 0x954C, 0x11d2, {0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B} } 380 #define LOAD_FILE_PROTOCOL EFI_LOAD_FILE_PROTOCOL_GUID 381 382 INTERFACE_DECL(_EFI_LOAD_FILE_PROTOCOL); 383 384 typedef 385 EFI_STATUS 386 (EFIAPI *EFI_LOAD_FILE) ( 387 IN struct _EFI_LOAD_FILE_PROTOCOL *This, 388 IN EFI_DEVICE_PATH *FilePath, 389 IN BOOLEAN BootPolicy, 390 IN OUT UINTN *BufferSize, 391 IN VOID *Buffer OPTIONAL 392 ); 393 394 typedef struct _EFI_LOAD_FILE_PROTOCOL { 395 EFI_LOAD_FILE LoadFile; 396 } EFI_LOAD_FILE_PROTOCOL; 397 398 typedef struct _EFI_LOAD_FILE_PROTOCOL _EFI_LOAD_FILE_INTERFACE; 399 typedef EFI_LOAD_FILE_PROTOCOL EFI_LOAD_FILE_INTERFACE; 400 401 // 402 // Device IO protocol 403 // 404 405 #define EFI_DEVICE_IO_PROTOCOL_GUID \ 406 { 0xaf6ac311, 0x84c3, 0x11d2, {0x8e, 0x3c, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b} } 407 #define DEVICE_IO_PROTOCOL EFI_DEVICE_IO_PROTOCOL_GUID 408 409 INTERFACE_DECL(_EFI_DEVICE_IO_PROTOCOL); 410 411 typedef enum { 412 IO_UINT8, 413 IO_UINT16, 414 IO_UINT32, 415 IO_UINT64, 416 // 417 // Specification Change: Copy from MMIO to MMIO vs. MMIO to buffer, buffer to MMIO 418 // 419 MMIO_COPY_UINT8, 420 MMIO_COPY_UINT16, 421 MMIO_COPY_UINT32, 422 MMIO_COPY_UINT64 423 } EFI_IO_WIDTH; 424 425 #define EFI_PCI_ADDRESS(_bus,_dev,_func) \ 426 ( (UINT64) ( (((UINTN)_bus) << 24) + (((UINTN)_dev) << 16) + (((UINTN)_func) << 8) ) ) 427 428 429 typedef 430 EFI_STATUS 431 (EFIAPI *EFI_DEVICE_IO) ( 432 IN struct _EFI_DEVICE_IO_PROTOCOL *This, 433 IN EFI_IO_WIDTH Width, 434 IN UINT64 Address, 435 IN UINTN Count, 436 IN OUT VOID *Buffer 437 ); 438 439 typedef struct { 440 EFI_DEVICE_IO Read; 441 EFI_DEVICE_IO Write; 442 } EFI_IO_ACCESS; 443 444 typedef 445 EFI_STATUS 446 (EFIAPI *EFI_PCI_DEVICE_PATH) ( 447 IN struct _EFI_DEVICE_IO_PROTOCOL *This, 448 IN UINT64 Address, 449 IN OUT EFI_DEVICE_PATH **PciDevicePath 450 ); 451 452 typedef enum { 453 EfiBusMasterRead, 454 EfiBusMasterWrite, 455 EfiBusMasterCommonBuffer 456 } EFI_IO_OPERATION_TYPE; 457 458 typedef 459 EFI_STATUS 460 (EFIAPI *EFI_IO_MAP) ( 461 IN struct _EFI_DEVICE_IO_PROTOCOL *This, 462 IN EFI_IO_OPERATION_TYPE Operation, 463 IN EFI_PHYSICAL_ADDRESS *HostAddress, 464 IN OUT UINTN *NumberOfBytes, 465 OUT EFI_PHYSICAL_ADDRESS *DeviceAddress, 466 OUT VOID **Mapping 467 ); 468 469 typedef 470 EFI_STATUS 471 (EFIAPI *EFI_IO_UNMAP) ( 472 IN struct _EFI_DEVICE_IO_PROTOCOL *This, 473 IN VOID *Mapping 474 ); 475 476 typedef 477 EFI_STATUS 478 (EFIAPI *EFI_IO_ALLOCATE_BUFFER) ( 479 IN struct _EFI_DEVICE_IO_PROTOCOL *This, 480 IN EFI_ALLOCATE_TYPE Type, 481 IN EFI_MEMORY_TYPE MemoryType, 482 IN UINTN Pages, 483 IN OUT EFI_PHYSICAL_ADDRESS *HostAddress 484 ); 485 486 typedef 487 EFI_STATUS 488 (EFIAPI *EFI_IO_FLUSH) ( 489 IN struct _EFI_DEVICE_IO_PROTOCOL *This 490 ); 491 492 typedef 493 EFI_STATUS 494 (EFIAPI *EFI_IO_FREE_BUFFER) ( 495 IN struct _EFI_DEVICE_IO_PROTOCOL *This, 496 IN UINTN Pages, 497 IN EFI_PHYSICAL_ADDRESS HostAddress 498 ); 499 500 typedef struct _EFI_DEVICE_IO_PROTOCOL { 501 EFI_IO_ACCESS Mem; 502 EFI_IO_ACCESS Io; 503 EFI_IO_ACCESS Pci; 504 EFI_IO_MAP Map; 505 EFI_PCI_DEVICE_PATH PciDevicePath; 506 EFI_IO_UNMAP Unmap; 507 EFI_IO_ALLOCATE_BUFFER AllocateBuffer; 508 EFI_IO_FLUSH Flush; 509 EFI_IO_FREE_BUFFER FreeBuffer; 510 } EFI_DEVICE_IO_PROTOCOL; 511 512 typedef struct _EFI_DEVICE_IO_PROTOCOL _EFI_DEVICE_IO_INTERFACE; 513 typedef EFI_DEVICE_IO_PROTOCOL EFI_DEVICE_IO_INTERFACE; 514 515 // 516 // Unicode Collation protocol 517 // 518 519 #define EFI_UNICODE_COLLATION_PROTOCOL_GUID \ 520 { 0x1d85cd7f, 0xf43d, 0x11d2, {0x9a, 0xc, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } 521 #define UNICODE_COLLATION_PROTOCOL EFI_UNICODE_COLLATION_PROTOCOL_GUID 522 523 #define EFI_UNICODE_BYTE_ORDER_MARK (CHAR16)(0xfeff) 524 #define UNICODE_BYTE_ORDER_MARK EFI_UNICODE_BYTE_ORDER_MARK 525 526 INTERFACE_DECL(_EFI_UNICODE_COLLATION_PROTOCOL); 527 528 typedef 529 INTN 530 (EFIAPI *EFI_UNICODE_STRICOLL) ( 531 IN struct _EFI_UNICODE_COLLATION_PROTOCOL *This, 532 IN CHAR16 *s1, 533 IN CHAR16 *s2 534 ); 535 536 typedef 537 BOOLEAN 538 (EFIAPI *EFI_UNICODE_METAIMATCH) ( 539 IN struct _EFI_UNICODE_COLLATION_PROTOCOL *This, 540 IN CHAR16 *String, 541 IN CHAR16 *Pattern 542 ); 543 544 typedef 545 VOID 546 (EFIAPI *EFI_UNICODE_STRLWR) ( 547 IN struct _EFI_UNICODE_COLLATION_PROTOCOL *This, 548 IN OUT CHAR16 *Str 549 ); 550 551 typedef 552 VOID 553 (EFIAPI *EFI_UNICODE_STRUPR) ( 554 IN struct _EFI_UNICODE_COLLATION_PROTOCOL *This, 555 IN OUT CHAR16 *Str 556 ); 557 558 typedef 559 VOID 560 (EFIAPI *EFI_UNICODE_FATTOSTR) ( 561 IN struct _EFI_UNICODE_COLLATION_PROTOCOL *This, 562 IN UINTN FatSize, 563 IN CHAR8 *Fat, 564 OUT CHAR16 *String 565 ); 566 567 typedef 568 BOOLEAN 569 (EFIAPI *EFI_UNICODE_STRTOFAT) ( 570 IN struct _EFI_UNICODE_COLLATION_PROTOCOL *This, 571 IN CHAR16 *String, 572 IN UINTN FatSize, 573 OUT CHAR8 *Fat 574 ); 575 576 // 577 // Hash Protocol 578 // 579 #define EFI_HASH_PROTOCOL_GUID \ 580 { 0xC5184932, 0xDBA5, 0x46DB, { 0xA5, 0xBA, 0xCC, 0x0B, 0xDA, 0x9C, 0x14, 0x35 } } 581 #define HASH_PROTOCOL EFI_HASH_PROTOCOL_GUID 582 583 #define EFI_HASH_ALGORITHM_SHA1_GUID \ 584 { 0x2AE9D80F, 0x3FB2, 0x4095, { 0xB7, 0xB1, 0xE9, 0x31, 0x57, 0xB9, 0x46, 0xB6 } } // Deprecated 585 #define EFI_HASH_ALGORITHM_SHA1 EFI_HASH_ALGORITHM_SHA1_GUID 586 587 #define EFI_HASH_ALGORITHM_SHA224_GUID \ 588 { 0x8DF01A06, 0x9BD5, 0x4BF7, { 0xB0, 0x21, 0xDB, 0x4F, 0xD9, 0xCC, 0xF4, 0x5B } } // Deprecated 589 #define EFI_HASH_ALGORITHM_SHA224 EFI_HASH_ALGORITHM_SHA224_GUID 590 591 #define EFI_HASH_ALGORITHM_SHA256_GUID \ 592 { 0x51AA59DE, 0xFDF2, 0x4EA3, { 0xBC, 0x63, 0x87, 0x5F, 0xB7, 0x84, 0x2E, 0xE9 } } // Deprecated 593 #define EFI_HASH_ALGORITHM_SHA256 EFI_HASH_ALGORITHM_SHA256_GUID 594 595 #define EFI_HASH_ALGORITHM_SHA384_GUID \ 596 { 0xEFA96432, 0xDE33, 0x4DD2, { 0xAE, 0xE6, 0x32, 0x8C, 0x33, 0xDF, 0x77, 0x7A } } // Deprecated 597 #define EFI_HASH_ALGORITHM_SHA384 EFI_HASH_ALGORITHM_SHA384_GUID 598 599 #define EFI_HASH_ALGORITHM_SHA512_GUID \ 600 { 0xCAA4381E, 0x750C, 0x4770, { 0xB8, 0x70, 0x7A, 0x23, 0xB4, 0xE4, 0x21, 0x30 } } // Deprecated 601 #define EFI_HASH_ALGORITHM_SHA512 EFI_HASH_ALGORITHM_SHA512_GUID 602 603 #define EFI_HASH_ALGORITHM_MD5_GUID \ 604 { 0x0AF7C79C, 0x65B5, 0x4319, { 0xB0, 0xAE, 0x44, 0xEC, 0x48, 0x4E, 0x4A, 0xD7 } } // Deprecated 605 #define EFI_HASH_ALGORITHM_MD5 EFI_HASH_ALGORITHM_MD5_GUID 606 607 #define EFI_HASH_ALGORITHM_SHA1_NOPAD_GUID \ 608 { 0x24C5DC2F, 0x53E2, 0x40CA, { 0x9E, 0xD6, 0xA5, 0xD9, 0xA4, 0x9F, 0x46, 0x3B } } 609 #define EFI_HASH_ALGORITHM_SHA1_NOPAD EFI_HASH_ALGORITHM_SHA1_NOPAD_GUID 610 611 #define EFI_HASH_ALGORITHM_SHA256_NOPAD_GUID \ 612 { 0x8628752A, 0x6CB7, 0x4814, { 0x96, 0xFC, 0x24, 0xA8, 0x15, 0xAC, 0x22, 0x26 } } 613 #define EFI_HASH_ALGORITHM_SHA256_NOPAD EFI_HASH_ALGORITHM_SHA256_NOPAD_GUID 614 615 616 INTERFACE_DECL(_EFI_HASH_PROTOCOL); 617 618 typedef UINT8 EFI_MD5_HASH[16]; 619 typedef UINT8 EFI_SHA1_HASH[20]; 620 typedef UINT8 EFI_SHA224_HASH[28]; 621 typedef UINT8 EFI_SHA256_HASH[32]; 622 typedef UINT8 EFI_SHA384_HASH[48]; 623 typedef UINT8 EFI_SHA512_HASH[64]; 624 typedef union _EFI_HASH_OUTPUT { 625 EFI_MD5_HASH *Md5Hash; 626 EFI_SHA1_HASH *Sha1Hash; 627 EFI_SHA224_HASH *Sha224Hash; 628 EFI_SHA256_HASH *Sha256Hash; 629 EFI_SHA384_HASH *Sha384Hash; 630 EFI_SHA512_HASH *Sha512Hash; 631 } EFI_HASH_OUTPUT; 632 633 typedef 634 EFI_STATUS 635 (EFIAPI *EFI_HASH_GET_HASH_SIZE) ( 636 IN CONST struct _EFI_HASH_PROTOCOL *This, 637 IN CONST EFI_GUID *HashAlgorithm, 638 OUT UINTN *HashSize); 639 640 typedef 641 EFI_STATUS 642 (EFIAPI *EFI_HASH_HASH) ( 643 IN CONST struct _EFI_HASH_PROTOCOL *This, 644 IN CONST EFI_GUID *HashAlgorithm, 645 IN BOOLEAN Extend, 646 IN CONST UINT8 *Message, 647 IN UINT64 MessageSize, 648 IN OUT EFI_HASH_OUTPUT *Hash); 649 650 typedef struct _EFI_HASH_PROTOCOL { 651 EFI_HASH_GET_HASH_SIZE GetHashSize; 652 EFI_HASH_HASH Hash; 653 } EFI_HASH_PROTOCOL; 654 655 typedef struct _EFI_HASH_PROTOCOL _EFI_HASH; 656 typedef EFI_HASH_PROTOCOL EFI_HASH; 657 658 659 typedef struct _EFI_UNICODE_COLLATION_PROTOCOL { 660 661 // general 662 EFI_UNICODE_STRICOLL StriColl; 663 EFI_UNICODE_METAIMATCH MetaiMatch; 664 EFI_UNICODE_STRLWR StrLwr; 665 EFI_UNICODE_STRUPR StrUpr; 666 667 // for supporting fat volumes 668 EFI_UNICODE_FATTOSTR FatToStr; 669 EFI_UNICODE_STRTOFAT StrToFat; 670 671 CHAR8 *SupportedLanguages; 672 } EFI_UNICODE_COLLATION_PROTOCOL; 673 674 typedef struct _EFI_UNICODE_COLLATION_PROTOCOL EFI_UNICODE_COLLATION_PROTOCOL; 675 typedef EFI_UNICODE_COLLATION_PROTOCOL EFI_UNICODE_COLLATION_INTERFACE; 676 677 /* Graphics output protocol */ 678 #define EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID \ 679 { 0x9042a9de, 0x23dc, 0x4a38, {0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a } } 680 typedef struct _EFI_GRAPHICS_OUTPUT_PROTOCOL EFI_GRAPHICS_OUTPUT_PROTOCOL; 681 682 typedef struct { 683 UINT32 RedMask; 684 UINT32 GreenMask; 685 UINT32 BlueMask; 686 UINT32 ReservedMask; 687 } EFI_PIXEL_BITMASK; 688 689 typedef enum { 690 PixelRedGreenBlueReserved8BitPerColor, 691 PixelBlueGreenRedReserved8BitPerColor, 692 PixelBitMask, 693 PixelBltOnly, 694 PixelFormatMax 695 } EFI_GRAPHICS_PIXEL_FORMAT; 696 697 typedef struct { 698 UINT32 Version; 699 UINT32 HorizontalResolution; 700 UINT32 VerticalResolution; 701 EFI_GRAPHICS_PIXEL_FORMAT PixelFormat; 702 EFI_PIXEL_BITMASK PixelInformation; 703 UINT32 PixelsPerScanLine; 704 } EFI_GRAPHICS_OUTPUT_MODE_INFORMATION; 705 706 /** 707 Return the current video mode information. 708 709 @param This Protocol instance pointer. 710 @param ModeNumber The mode number to return information on. 711 @param SizeOfInfo A pointer to the size, in bytes, of the Info buffer. 712 @param Info A pointer to callee allocated buffer that returns information about ModeNumber. 713 714 @retval EFI_SUCCESS Mode information returned. 715 @retval EFI_BUFFER_TOO_SMALL The Info buffer was too small. 716 @retval EFI_DEVICE_ERROR A hardware error occurred trying to retrieve the video mode. 717 @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode () 718 @retval EFI_INVALID_PARAMETER One of the input args was NULL. 719 720 **/ 721 typedef 722 EFI_STATUS 723 (EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE) ( 724 IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This, 725 IN UINT32 ModeNumber, 726 OUT UINTN *SizeOfInfo, 727 OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION **Info 728 ) 729 ; 730 731 /** 732 Return the current video mode information. 733 734 @param This Protocol instance pointer. 735 @param ModeNumber The mode number to be set. 736 737 @retval EFI_SUCCESS Graphics mode was changed. 738 @retval EFI_DEVICE_ERROR The device had an error and could not complete the request. 739 @retval EFI_UNSUPPORTED ModeNumber is not supported by this device. 740 741 **/ 742 typedef 743 EFI_STATUS 744 (EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE) ( 745 IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This, 746 IN UINT32 ModeNumber 747 ); 748 749 typedef struct { 750 UINT8 Blue; 751 UINT8 Green; 752 UINT8 Red; 753 UINT8 Reserved; 754 } EFI_GRAPHICS_OUTPUT_BLT_PIXEL; 755 756 typedef union { 757 EFI_GRAPHICS_OUTPUT_BLT_PIXEL Pixel; 758 UINT32 Raw; 759 } EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION; 760 761 typedef enum { 762 EfiBltVideoFill, 763 EfiBltVideoToBltBuffer, 764 EfiBltBufferToVideo, 765 EfiBltVideoToVideo, 766 EfiGraphicsOutputBltOperationMax 767 } EFI_GRAPHICS_OUTPUT_BLT_OPERATION; 768 769 /** 770 The following table defines actions for BltOperations: 771 772 <B>EfiBltVideoFill</B> - Write data from the BltBuffer pixel (SourceX, SourceY) 773 directly to every pixel of the video display rectangle 774 (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height). 775 Only one pixel will be used from the BltBuffer. Delta is NOT used. 776 777 <B>EfiBltVideoToBltBuffer</B> - Read data from the video display rectangle 778 (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in 779 the BltBuffer rectangle (DestinationX, DestinationY ) 780 (DestinationX + Width, DestinationY + Height). If DestinationX or 781 DestinationY is not zero then Delta must be set to the length in bytes 782 of a row in the BltBuffer. 783 784 <B>EfiBltBufferToVideo</B> - Write data from the BltBuffer rectangle 785 (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the 786 video display rectangle (DestinationX, DestinationY) 787 (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is 788 not zero then Delta must be set to the length in bytes of a row in the 789 BltBuffer. 790 791 <B>EfiBltVideoToVideo</B> - Copy from the video display rectangle (SourceX, SourceY) 792 (SourceX + Width, SourceY + Height) .to the video display rectangle 793 (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height). 794 The BltBuffer and Delta are not used in this mode. 795 796 @param This Protocol instance pointer. 797 @param BltBuffer Buffer containing data to blit into video buffer. This 798 buffer has a size of Width*Height*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL) 799 @param BltOperation Operation to perform on BlitBuffer and video memory 800 @param SourceX X coordinate of source for the BltBuffer. 801 @param SourceY Y coordinate of source for the BltBuffer. 802 @param DestinationX X coordinate of destination for the BltBuffer. 803 @param DestinationY Y coordinate of destination for the BltBuffer. 804 @param Width Width of rectangle in BltBuffer in pixels. 805 @param Height Hight of rectangle in BltBuffer in pixels. 806 @param Delta OPTIONAL 807 808 @retval EFI_SUCCESS The Blt operation completed. 809 @retval EFI_INVALID_PARAMETER BltOperation is not valid. 810 @retval EFI_DEVICE_ERROR A hardware error occured writting to the video buffer. 811 812 **/ 813 typedef 814 EFI_STATUS 815 (EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT) ( 816 IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This, 817 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, OPTIONAL 818 IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation, 819 IN UINTN SourceX, 820 IN UINTN SourceY, 821 IN UINTN DestinationX, 822 IN UINTN DestinationY, 823 IN UINTN Width, 824 IN UINTN Height, 825 IN UINTN Delta OPTIONAL 826 ); 827 828 typedef struct { 829 UINT32 MaxMode; 830 UINT32 Mode; 831 EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Info; 832 UINTN SizeOfInfo; 833 EFI_PHYSICAL_ADDRESS FrameBufferBase; 834 UINTN FrameBufferSize; 835 } EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE; 836 837 struct _EFI_GRAPHICS_OUTPUT_PROTOCOL { 838 EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE QueryMode; 839 EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE SetMode; 840 EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT Blt; 841 EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE *Mode; 842 }; 843 844 845 846 /* 847 * EFI EDID Discovered Protocol 848 * UEFI Specification Version 2.5 Section 11.9 849 */ 850 #define EFI_EDID_DISCOVERED_PROTOCOL_GUID \ 851 { 0x1C0C34F6, 0xD380, 0x41FA, { 0xA0, 0x49, 0x8a, 0xD0, 0x6C, 0x1A, 0x66, 0xAA} } 852 853 typedef struct _EFI_EDID_DISCOVERED_PROTOCOL { 854 UINT32 SizeOfEdid; 855 UINT8 *Edid; 856 } EFI_EDID_DISCOVERED_PROTOCOL; 857 858 859 860 /* 861 * EFI EDID Active Protocol 862 * UEFI Specification Version 2.5 Section 11.9 863 */ 864 #define EFI_EDID_ACTIVE_PROTOCOL_GUID \ 865 { 0xBD8C1056, 0x9F36, 0x44EC, { 0x92, 0xA8, 0xA6, 0x33, 0x7F, 0x81, 0x79, 0x86} } 866 867 typedef struct _EFI_EDID_ACTIVE_PROTOCOL { 868 UINT32 SizeOfEdid; 869 UINT8 *Edid; 870 } EFI_EDID_ACTIVE_PROTOCOL; 871 872 873 874 /* 875 * EFI EDID Override Protocol 876 * UEFI Specification Version 2.5 Section 11.9 877 */ 878 #define EFI_EDID_OVERRIDE_PROTOCOL_GUID \ 879 { 0x48ECB431, 0xFB72, 0x45C0, { 0xA9, 0x22, 0xF4, 0x58, 0xFE, 0x04, 0x0B, 0xD5} } 880 881 INTERFACE_DECL(_EFI_EDID_OVERRIDE_PROTOCOL); 882 883 typedef 884 EFI_STATUS 885 (EFIAPI *EFI_EDID_OVERRIDE_PROTOCOL_GET_EDID) ( 886 IN struct _EFI_EDID_OVERRIDE_PROTOCOL *This, 887 IN EFI_HANDLE *ChildHandle, 888 OUT UINT32 *Attributes, 889 IN OUT UINTN *EdidSize, 890 IN OUT UINT8 **Edid); 891 892 typedef struct _EFI_EDID_OVERRIDE_PROTOCOL { 893 EFI_EDID_OVERRIDE_PROTOCOL_GET_EDID GetEdid; 894 } EFI_EDID_OVERRIDE_PROTOCOL; 895 896 897 898 INTERFACE_DECL(_EFI_SERVICE_BINDING); 899 900 typedef 901 EFI_STATUS 902 (EFIAPI *EFI_SERVICE_BINDING_CREATE_CHILD) ( 903 IN struct _EFI_SERVICE_BINDING *This, 904 IN EFI_HANDLE *ChildHandle 905 ); 906 907 typedef 908 EFI_STATUS 909 (EFIAPI *EFI_SERVICE_BINDING_DESTROY_CHILD) ( 910 IN struct _EFI_SERVICE_BINDING *This, 911 IN EFI_HANDLE ChildHandle 912 ); 913 914 typedef struct _EFI_SERVICE_BINDING { 915 EFI_SERVICE_BINDING_CREATE_CHILD CreateChild; 916 EFI_SERVICE_BINDING_DESTROY_CHILD DestroyChild; 917 } EFI_SERVICE_BINDING; 918 919 920 921 /* 922 * EFI Driver Binding Protocol 923 * UEFI Specification Version 2.5 Section 10.1 924 */ 925 #define EFI_DRIVER_BINDING_PROTOCOL_GUID \ 926 { 0x18A031AB, 0xB443, 0x4D1A, { 0xA5, 0xC0, 0x0C, 0x09, 0x26, 0x1E, 0x9F, 0x71} } 927 #define DRIVER_BINDING_PROTOCOL EFI_DRIVER_BINDING_PROTOCOL_GUID 928 929 INTERFACE_DECL(_EFI_DRIVER_BINDING_PROTOCOL); 930 931 typedef 932 EFI_STATUS 933 (EFIAPI *EFI_DRIVER_BINDING_PROTOCOL_SUPPORTED) ( 934 IN struct _EFI_DRIVER_BINDING_PROTOCOL *This, 935 IN EFI_HANDLE ControllerHandle, 936 IN EFI_DEVICE_PATH *RemainingDevicePath OPTIONAL); 937 938 typedef 939 EFI_STATUS 940 (EFIAPI *EFI_DRIVER_BINDING_PROTOCOL_START) ( 941 IN struct _EFI_DRIVER_BINDING_PROTOCOL *This, 942 IN EFI_HANDLE ControllerHandle, 943 IN EFI_DEVICE_PATH *RemainingDevicePath OPTIONAL); 944 945 typedef 946 EFI_STATUS 947 (EFIAPI *EFI_DRIVER_BINDING_PROTOCOL_STOP) ( 948 IN struct _EFI_DRIVER_BINDING_PROTOCOL *This, 949 IN EFI_HANDLE ControllerHandle, 950 IN UINTN NumberOfChildren, 951 IN EFI_HANDLE *ChildHandleBuffer OPTIONAL); 952 953 typedef struct _EFI_DRIVER_BINDING_PROTOCOL { 954 EFI_DRIVER_BINDING_PROTOCOL_SUPPORTED Supported; 955 EFI_DRIVER_BINDING_PROTOCOL_START Start; 956 EFI_DRIVER_BINDING_PROTOCOL_STOP Stop; 957 UINT32 Version; 958 EFI_HANDLE ImageHandle; 959 EFI_HANDLE DriverBindingHandle; 960 } EFI_DRIVER_BINDING_PROTOCOL; 961 962 typedef struct _EFI_DRIVER_BINDING_PROTOCOL _EFI_DRIVER_BINDING; 963 typedef EFI_DRIVER_BINDING_PROTOCOL EFI_DRIVER_BINDING; 964 965 966 /* 967 * Backwards compatibility with older GNU-EFI versions. Deprecated. 968 */ 969 #define EFI_DRIVER_SUPPORTED EFI_DRIVER_BINDING_PROTOCOL_SUPPORTED 970 #define EFI_DRIVER_START EFI_DRIVER_BINDING_PROTOCOL_START 971 #define EFI_DRIVER_STOP EFI_DRIVER_BINDING_PROTOCOL_STOP 972 973 974 975 /* 976 * EFI Component Name Protocol 977 * Deprecated - use EFI Component Name 2 Protocol instead 978 */ 979 #define EFI_COMPONENT_NAME_PROTOCOL_GUID \ 980 {0x107A772C, 0xD5E1, 0x11D4, { 0x9A, 0x46, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D} } 981 #define COMPONENT_NAME_PROTOCOL EFI_COMPONENT_NAME_PROTOCOL_GUID 982 983 INTERFACE_DECL(_EFI_COMPONENT_NAME_PROTOCOL); 984 985 typedef 986 EFI_STATUS 987 (EFIAPI *EFI_COMPONENT_NAME_GET_DRIVER_NAME) ( 988 IN struct _EFI_COMPONENT_NAME_PROTOCOL *This, 989 IN CHAR8 *Language, 990 OUT CHAR16 **DriverName); 991 992 typedef 993 EFI_STATUS 994 (EFIAPI *EFI_COMPONENT_NAME_GET_CONTROLLER_NAME) ( 995 IN struct _EFI_COMPONENT_NAME_PROTOCOL *This, 996 IN EFI_HANDLE ControllerHandle, 997 IN EFI_HANDLE ChildHandle OPTIONAL, 998 IN CHAR8 *Language, 999 OUT CHAR16 **ControllerName); 1000 1001 typedef struct _EFI_COMPONENT_NAME_PROTOCOL { 1002 EFI_COMPONENT_NAME_GET_DRIVER_NAME GetDriverName; 1003 EFI_COMPONENT_NAME_GET_CONTROLLER_NAME GetControllerName; 1004 CHAR8 *SupportedLanguages; 1005 } EFI_COMPONENT_NAME_PROTOCOL; 1006 1007 typedef struct _EFI_COMPONENT_NAME_PROTOCOL _EFI_COMPONENT_NAME; 1008 typedef EFI_COMPONENT_NAME_PROTOCOL EFI_COMPONENT_NAME; 1009 1010 1011 /* 1012 * EFI Component Name 2 Protocol 1013 * UEFI Specification Version 2.5 Section 10.5 1014 */ 1015 #define EFI_COMPONENT_NAME2_PROTOCOL_GUID \ 1016 {0x6A7A5CFF, 0xE8D9, 0x4F70, { 0xBA, 0xDA, 0x75, 0xAB, 0x30, 0x25, 0xCE, 0x14} } 1017 #define COMPONENT_NAME2_PROTOCOL EFI_COMPONENT_NAME2_PROTOCOL_GUID 1018 1019 INTERFACE_DECL(_EFI_COMPONENT_NAME2_PROTOCOL); 1020 1021 typedef 1022 EFI_STATUS 1023 (EFIAPI *EFI_COMPONENT_NAME2_GET_DRIVER_NAME) ( 1024 IN struct _EFI_COMPONENT_NAME2_PROTOCOL *This, 1025 IN CHAR8 *Language, 1026 OUT CHAR16 **DriverName); 1027 1028 typedef 1029 EFI_STATUS 1030 (EFIAPI *EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) ( 1031 IN struct _EFI_COMPONENT_NAME2_PROTOCOL *This, 1032 IN EFI_HANDLE ControllerHandle, 1033 IN EFI_HANDLE ChildHandle OPTIONAL, 1034 IN CHAR8 *Language, 1035 OUT CHAR16 **ControllerName); 1036 1037 typedef struct _EFI_COMPONENT_NAME2_PROTOCOL { 1038 EFI_COMPONENT_NAME2_GET_DRIVER_NAME GetDriverName; 1039 EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME GetControllerName; 1040 CHAR8 *SupportedLanguages; 1041 } EFI_COMPONENT_NAME2_PROTOCOL; 1042 1043 typedef struct _EFI_COMPONENT_NAME2_PROTOCOL _EFI_COMPONENT_NAME2; 1044 typedef EFI_COMPONENT_NAME2_PROTOCOL EFI_COMPONENT_NAME2; 1045 1046 1047 1048 /* 1049 * EFI Loaded Image Protocol 1050 * UEFI Specification Version 2.5 Section 8.1 1051 */ 1052 #define EFI_LOADED_IMAGE_PROTOCOL_GUID \ 1053 { 0x5B1B31A1, 0x9562, 0x11d2, {0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B} } 1054 #define LOADED_IMAGE_PROTOCOL EFI_LOADED_IMAGE_PROTOCOL_GUID 1055 1056 #define EFI_LOADED_IMAGE_PROTOCOL_REVISION 0x1000 1057 #define EFI_IMAGE_INFORMATION_REVISION EFI_LOADED_IMAGE_PROTOCOL_REVISION 1058 1059 typedef 1060 EFI_STATUS 1061 (EFIAPI *EFI_IMAGE_UNLOAD) ( 1062 IN EFI_HANDLE ImageHandle 1063 ); 1064 1065 typedef struct { 1066 UINT32 Revision; 1067 EFI_HANDLE ParentHandle; 1068 struct _EFI_SYSTEM_TABLE *SystemTable; 1069 1070 // Source location of image 1071 EFI_HANDLE DeviceHandle; 1072 EFI_DEVICE_PATH *FilePath; 1073 VOID *Reserved; 1074 1075 // Images load options 1076 UINT32 LoadOptionsSize; 1077 VOID *LoadOptions; 1078 1079 // Location of where image was loaded 1080 VOID *ImageBase; 1081 UINT64 ImageSize; 1082 EFI_MEMORY_TYPE ImageCodeType; 1083 EFI_MEMORY_TYPE ImageDataType; 1084 1085 // If the driver image supports a dynamic unload request 1086 EFI_IMAGE_UNLOAD Unload; 1087 } EFI_LOADED_IMAGE_PROTOCOL; 1088 1089 typedef EFI_LOADED_IMAGE_PROTOCOL EFI_LOADED_IMAGE; 1090 1091 1092 1093 /* 1094 * Random Number Generator Protocol 1095 * UEFI Specification Version 2.5 Section 35.5 1096 */ 1097 #define EFI_RNG_PROTOCOL_GUID \ 1098 { 0x3152bca5, 0xeade, 0x433d, {0x86, 0x2e, 0xc0, 0x1c, 0xdc, 0x29, 0x1f, 0x44} } 1099 1100 typedef EFI_GUID EFI_RNG_ALGORITHM; 1101 1102 #define EFI_RNG_ALGORITHM_SP800_90_HASH_256_GUID \ 1103 {0xa7af67cb, 0x603b, 0x4d42, {0xba, 0x21, 0x70, 0xbf, 0xb6, 0x29, 0x3f, 0x96} } 1104 1105 #define EFI_RNG_ALGORITHM_SP800_90_HMAC_256_GUID \ 1106 {0xc5149b43, 0xae85, 0x4f53, {0x99, 0x82, 0xb9, 0x43, 0x35, 0xd3, 0xa9, 0xe7} } 1107 1108 #define EFI_RNG_ALGORITHM_SP800_90_CTR_256_GUID \ 1109 {0x44f0de6e, 0x4d8c, 0x4045, {0xa8, 0xc7, 0x4d, 0xd1, 0x68, 0x85, 0x6b, 0x9e} } 1110 1111 #define EFI_RNG_ALGORITHM_X9_31_3DES_GUID \ 1112 {0x63c4785a, 0xca34, 0x4012, {0xa3, 0xc8, 0x0b, 0x6a, 0x32, 0x4f, 0x55, 0x46} } 1113 1114 #define EFI_RNG_ALGORITHM_X9_31_AES_GUID \ 1115 {0xacd03321, 0x777e, 0x4d3d, {0xb1, 0xc8, 0x20, 0xcf, 0xd8, 0x88, 0x20, 0xc9} } 1116 1117 #define EFI_RNG_ALGORITHM_RAW \ 1118 {0xe43176d7, 0xb6e8, 0x4827, {0xb7, 0x84, 0x7f, 0xfd, 0xc4, 0xb6, 0x85, 0x61} } 1119 1120 INTERFACE_DECL(_EFI_RNG_PROTOCOL); 1121 1122 typedef 1123 EFI_STATUS 1124 (EFIAPI *EFI_RNG_GET_INFO) ( 1125 IN struct _EFI_RNG_PROTOCOL *This, 1126 IN OUT UINTN *RNGAlgorithmListSize, 1127 OUT EFI_RNG_ALGORITHM *RNGAlgorithmList 1128 ); 1129 1130 typedef 1131 EFI_STATUS 1132 (EFIAPI *EFI_RNG_GET_RNG) ( 1133 IN struct _EFI_RNG_PROTOCOL *This, 1134 IN EFI_RNG_ALGORITHM *RNGAlgorithm, OPTIONAL 1135 IN UINTN RNGValueLength, 1136 OUT UINT8 *RNGValue 1137 ); 1138 1139 typedef struct _EFI_RNG_PROTOCOL { 1140 EFI_RNG_GET_INFO GetInfo; 1141 EFI_RNG_GET_RNG GetRNG; 1142 } EFI_RNG_PROTOCOL; 1143 1144 1145 // 1146 // EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL 1147 // 1148 1149 #define EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL_GUID \ 1150 { 0x6b30c738, 0xa391, 0x11d4, {0x9a, 0x3b, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } 1151 1152 INTERFACE_DECL(_EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL); 1153 1154 typedef 1155 EFI_STATUS 1156 (EFIAPI *EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER) ( 1157 IN struct _EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL *This, 1158 IN EFI_HANDLE ControllerHandle, 1159 IN OUT EFI_HANDLE *DriverImageHandle); 1160 1161 typedef 1162 EFI_STATUS 1163 (EFIAPI *EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER_PATH) ( 1164 IN struct _EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL *This, 1165 IN EFI_HANDLE ControllerHandle, 1166 IN OUT EFI_DEVICE_PATH **DriverImagePath); 1167 1168 typedef 1169 EFI_STATUS 1170 (EFIAPI *EFI_PLATFORM_DRIVER_OVERRIDE_DRIVER_LOADED) ( 1171 IN struct _EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL *This, 1172 IN EFI_HANDLE ControllerHandle, 1173 IN EFI_DEVICE_PATH *DriverImagePath, 1174 IN EFI_HANDLE DriverImageHandle); 1175 1176 typedef struct _EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL { 1177 EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER GetDriver; 1178 EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER_PATH GetDriverPath; 1179 EFI_PLATFORM_DRIVER_OVERRIDE_DRIVER_LOADED DriverLoaded; 1180 } EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL; 1181 1182 // 1183 // EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL 1184 // 1185 1186 #define EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL_GUID \ 1187 { 0x3bc1b285, 0x8a15, 0x4a82, {0xaa, 0xbf, 0x4d, 0x7d, 0x13, 0xfb, 0x32, 0x65} } 1188 1189 INTERFACE_DECL(_EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL); 1190 1191 typedef 1192 EFI_STATUS 1193 (EFIAPI *EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_GET_DRIVER) ( 1194 IN struct _EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL *This, 1195 IN OUT EFI_HANDLE *DriverImageHandle); 1196 1197 typedef struct _EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL { 1198 EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_GET_DRIVER GetDriver; 1199 } EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL; 1200 1201 // 1202 // EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL 1203 // 1204 1205 #define EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL_GUID \ 1206 { 0xb1ee129e, 0xda36, 0x4181, {0x91, 0xf8, 0x04, 0xa4, 0x92, 0x37, 0x66, 0xa7} } 1207 1208 INTERFACE_DECL(_EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL); 1209 1210 typedef 1211 UINT32 1212 (EFIAPI *EFI_DRIVER_FAMILY_OVERRIDE_GET_VERSION) ( 1213 IN struct _EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL *This); 1214 1215 typedef struct _EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL { 1216 EFI_DRIVER_FAMILY_OVERRIDE_GET_VERSION GetVersion; 1217 } EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL; 1218 1219 1220 #endif 1221 1222