Subversion Repositories Kolibri OS

Rev

Rev 8092 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;;                                                              ;;
  3. ;; Copyright (C) KolibriOS team 2020. All rights reserved.      ;;
  4. ;; Distributed under terms of the GNU General Public License    ;;
  5. ;; Version 2, or (at your option) any later version.            ;;
  6. ;;                                                              ;;
  7. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8. ;;                                                              ;;
  9. ;; Based on UEFI library for fasm by bzt, Public Domain.        ;;
  10. ;;                                                              ;;
  11. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  12.  
  13. EFI_LOCATE_SEARCH_TYPE:
  14. .AllHandles       = 0
  15. .ByRegisterNotify = 1
  16. .ByProtocol       = 2
  17.  
  18. ; EFI_MEMORY_TYPE
  19. EFI_RESERVED_MEMORY_TYPE        = 0
  20. EFI_LOADER_CODE                 = 1
  21. EFI_LOADER_DATA                 = 2
  22. EFI_BOOT_SERVICES_CODE          = 3
  23. EFI_BOOT_SERVICES_DATA          = 4
  24. EFI_RUNTIME_SERVICES_CODE       = 5
  25. EFI_RUNTIME_SERVICES_DATA       = 6
  26. EFI_CONVENTIONAL_MEMORY         = 7
  27. EFI_UNUSABLE_MEMORY             = 8
  28. EFI_ACPI_RECLAIM_MEMORY         = 9
  29. EFI_ACPI_MEMORY_NVS             = 10
  30. EFI_MEMORY_MAPPED_IO            = 11
  31. EFI_MEMORY_MAPPED_IO_PORT_SPACE = 12
  32. EFI_PAL_CODE                    = 13
  33. EFI_PERSISTENT_MEMORY           = 14
  34. EFI_MAX_MEMORY_TYPE             = 15
  35.  
  36. ; EFI_ALLOCATE_TYPE
  37. EFI_ALLOCATE_ANY_PAGES   = 0
  38. EFI_ALLOCATE_MAX_ADDRESS = 1
  39. EFI_ALLOCATE_ADDRESS     = 2
  40.  
  41. EFI_MEMORY_UC                   = 0x00000001
  42. EFI_MEMORY_WC                   = 0x00000002
  43. EFI_MEMORY_WT                   = 0x00000004
  44. EFI_MEMORY_WB                   = 0x00000008
  45. EFI_MEMORY_UCE                  = 0x00000010
  46. EFI_MEMORY_WP                   = 0x00001000
  47. EFI_MEMORY_RP                   = 0x00002000
  48. EFI_MEMORY_XP                   = 0x00004000
  49. EFI_MEMORY_NV                   = 0x00008000
  50. EFI_MEMORY_MORE_RELIABLE        = 0x00010000
  51. EFI_MEMORY_RO                   = 0x00020000
  52.  
  53. EFI_SUCCESS                     = 0
  54. EFI_LOAD_ERROR                  = EFIERR or 1
  55. EFI_INVALID_PARAMETER           = EFIERR or 2
  56. EFI_UNSUPPORTED                 = EFIERR or 3
  57. EFI_BAD_BUFFER_SIZE             = EFIERR or 4
  58. EFI_BUFFER_TOO_SMALL            = EFIERR or 5
  59. EFI_NOT_READY                   = EFIERR or 6
  60. EFI_DEVICE_ERROR                = EFIERR or 7
  61. EFI_WRITE_PROTECTED             = EFIERR or 8
  62. EFI_OUT_OF_RESOURCES            = EFIERR or 9
  63. EFI_VOLUME_CORRUPTED            = EFIERR or 10
  64. EFI_VOLUME_FULL                 = EFIERR or 11
  65. EFI_NO_MEDIA                    = EFIERR or 12
  66. EFI_MEDIA_CHANGED               = EFIERR or 13
  67. EFI_NOT_FOUND                   = EFIERR or 14
  68. EFI_ACCESS_DENIED               = EFIERR or 15
  69. EFI_NO_RESPONSE                 = EFIERR or 16
  70. EFI_NO_MAPPING                  = EFIERR or 17
  71. EFI_TIMEOUT                     = EFIERR or 18
  72. EFI_NOT_STARTED                 = EFIERR or 19
  73. EFI_ALREADY_STARTED             = EFIERR or 20
  74. EFI_ABORTED                     = EFIERR or 21
  75. EFI_ICMP_ERROR                  = EFIERR or 22
  76. EFI_TFTP_ERROR                  = EFIERR or 23
  77. EFI_PROTOCOL_ERROR              = EFIERR or 24
  78.  
  79.  
  80. EFI_FILE_SYSTEM_INFO_ID equ 0x93,0x6e,0x57,0x09,0x3f,0x6d,0xd2,0x11, \
  81.                             0x39,0x8e,0x00,0xa0,0xc9,0x69,0x72,0x3b
  82.  
  83. EFI_SYSTEM_TABLE_SIGNATURE equ 0x49,0x42,0x49,0x20,0x53,0x59,0x53,0x54
  84.  
  85. EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID equ 0x22,0x5b,0x4e,0x96, \
  86.                                          0x59,0x64,0xd2,0x11, \
  87.                                          0x8e,0x39,0x00,0xa0, \
  88.                                          0xc9,0x69,0x72,0x3b
  89.  
  90. EFI_LOADED_IMAGE_PROTOCOL_GUID equ 0xA1,0x31,0x1b,0x5b,0x62,0x95,0xd2,0x11, \
  91.                                     0x8E,0x3F,0x00,0xA0,0xC9,0x69,0x72,0x3B
  92.  
  93. EFI_BLOCK_IO_PROTOCOL_GUID equ 0x21,0x5b,0x4e,0x96,0x59,0x64,0xd2,0x11, \
  94.                                0x8e,0x39,0x00,0xa0,0xc9,0x69,0x72,0x3b
  95.  
  96. EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID equ 0xde,0xa9,0x42,0x90,0xdc,0x23,0x38,0x4a, \
  97.                                       0x96,0xfb,0x7a,0xde,0xd0,0x80,0x51,0x6a
  98.  
  99. EFI_FILE_MODE_READ   = 1
  100. EFI_FILE_MODE_WRITE  = 2
  101. EFI_FILE_MODE_CREATE = 0x8000000000000000
  102.  
  103. struct EFI_MEMORY_DESCRIPTOR
  104.   Type          dd ?
  105.                 dd ?    ; align
  106.   PhysicalStart DQ ?
  107.   VirtualStart  DQ ?
  108.   NumberOfPages DQ ?
  109.   Attribute     DQ ?
  110. ends
  111.  
  112. struct EFI_FILE_SYSTEM_INFO
  113.   Size          DQ ?
  114.   ReadOnly      db ?
  115.                 rb 7
  116.   VolumeSize    DQ ?
  117.   FreeSpace     DQ ?
  118.   BlockSize     dd ?
  119.   VolumeLabel   rw 32
  120. ends
  121.  
  122. struct EFI_TABLE_HEADER
  123.   Signature             DQ ?
  124.   Revision              dd ?
  125.   HeaderSize            dd ?
  126.   CRC32                 dd ?
  127.   Reserved              dd ?
  128. ends
  129.  
  130. struct EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
  131.   Reset                 DN ?
  132.   OutputString          DN ?
  133.   TestString            DN ?
  134.   QueryMode             DN ?
  135.   SetMode               DN ?
  136.   SetAttribute          DN ?
  137.   ClearScreen           DN ?
  138.   SetCursorPosition     DN ?
  139.   EnableCursor          DN ?
  140.   Mode                  DN ?
  141. ends
  142.  
  143.  
  144. struct SIMPLE_INPUT_INTERFACE
  145.   Reset                 DN ?
  146.   ReadKeyStroke         DN ?
  147.   WaitForKey            DN ?
  148. ends
  149.  
  150. struct EFI_BOOT_SERVICES
  151.   Hdr                        EFI_TABLE_HEADER
  152.   RaisePriority              DN ?
  153.   RestorePriority            DN ?
  154.   AllocatePages              DN ?
  155.   FreePages                  DN ?
  156.   GetMemoryMap               DN ?
  157.   AllocatePool               DN ?
  158.   FreePool                   DN ?
  159.   CreateEvent                DN ?
  160.   SetTimer                   DN ?
  161.   WaitForEvent               DN ?
  162.   SignalEvent                DN ?
  163.   CloseEvent                 DN ?
  164.   CheckEvent                 DN ?
  165.   InstallProtocolInterface   DN ?
  166.   ReInstallProtocolInterface DN ?
  167.   UnInstallProtocolInterface DN ?
  168.   HandleProtocol             DN ?
  169.   Reserved                   DN ?
  170.   RegisterProtocolNotify     DN ?
  171.   LocateHandle               DN ?
  172.   LocateDevicePath           DN ?
  173.   InstallConfigurationTable  DN ?
  174.   ImageLoad                  DN ?
  175.   ImageStart                 DN ?
  176.   Exit                       DN ?
  177.   ImageUnLoad                DN ?
  178.   ExitBootServices           DN ?
  179.   GetNextMonotonicCount      DN ?
  180.   Stall                      DN ?
  181.   SetWatchdogTimer           DN ?
  182.   ConnectController          DN ?
  183.   DisConnectController       DN ?
  184.   OpenProtocol               DN ?
  185.   CloseProtocol              DN ?
  186.   OpenProtocolInformation    DN ?
  187.   ProtocolsPerHandle         DN ?
  188.   LocateHandleBuffer         DN ?
  189.   LocateProtocol             DN ?
  190.   InstallMultipleProtocolInterfaces DN ?
  191.   UnInstallMultipleProtocolInterfaces DN ?
  192.   CalculateCrc32             DN ?
  193.   CopyMem                    DN ?
  194.   SetMem                     DN ?
  195. ends
  196.  
  197. struct EFI_RUNTIME_SERVICES
  198.   Hdr                   EFI_TABLE_HEADER
  199.   GetTime               DN ?
  200.   SetTime               DN ?
  201.   GetWakeUpTime         DN ?
  202.   SetWakeUpTime         DN ?
  203.   SetVirtualAddressMap  DN ?
  204.   ConvertPointer        DN ?
  205.   GetVariable           DN ?
  206.   GetNextVariableName   DN ?
  207.   SetVariable           DN ?
  208.   GetNextHighMonoCount  DN ?
  209.   ResetSystem           DN ?
  210. ends
  211.  
  212. struct EFI_SIMPLE_FILE_SYSTEM_PROTOCOL
  213.   Revision              DQ ?
  214.   OpenVolume            DN ?
  215. ends
  216.  
  217. struct EFI_FILE_PROTOCOL
  218.   Revision              DQ ?
  219.   Open                  DN ?
  220.   Close                 DN ?
  221.   Delete                DN ?
  222.   Read                  DN ?
  223.   Write                 DN ?
  224.   GetPosition           DN ?
  225.   SetPosition           DN ?
  226.   GetInfo               DN ?
  227.   SetInfo               DN ?
  228.   Flush                 DN ?
  229.   OpenEx                DN ?
  230.   ReadEx                DN ?
  231.   WriteEx               DN ?
  232.   FlushEx               DN ?
  233. ends
  234.  
  235. struct EFI_GRAPHICS_OUTPUT_PROTOCOL
  236.   QueryMode             DN ?
  237.   SetMode               DN ?
  238.   Blt                   DN ?
  239.   Mode                  DN ?
  240. ends
  241.  
  242. struct EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE
  243.   MaxMode               dd ?
  244.   Mode                  dd ?
  245.   Info                  DN ?
  246.   SizeOfInfo            DN ?
  247.   FrameBufferBase       DQ ?
  248.   FrameBufferSize       DN ?
  249. ends
  250.  
  251. EFI_GRAPHICS_PIXEL_FORMAT:
  252. .PixelRedGreenBlueReserved8BitPerColor = 0
  253. .PixelBlueGreenRedReserved8BitPerColor = 1
  254. .PixelBitMask = 2
  255. .PixelBltOnly = 3
  256. .PixelFormatMax = 4
  257.  
  258. struct EFI_PIXEL_BITMASK
  259.   RedMask               dd ?
  260.   GreenMask             dd ?
  261.   BlueMask              dd ?
  262.   ReservedMask          dd ?
  263. ends
  264.  
  265. struct EFI_GRAPHICS_OUTPUT_MODE_INFORMATION
  266.   Version               dd ?
  267.   HorizontalResolution  dd ?
  268.   VerticalResolution    dd ?
  269.   PixelFormat           dd ?
  270.   PixelInformation      EFI_PIXEL_BITMASK
  271.   PixelsPerScanLine     dd ?
  272. ends
  273.