VgaMiniPort.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /** @file
  2. The VGA Mini Port Protocol used to set the text display mode of a VGA controller.
  3. Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. **/
  6. #ifndef __VGA_MINI_PORT_H_
  7. #define __VGA_MINI_PORT_H_
  8. ///
  9. /// Global ID for the EFI_VGA_MINI_PORT_PROTOCOL.
  10. ///
  11. #define EFI_VGA_MINI_PORT_PROTOCOL_GUID \
  12. { \
  13. 0xc7735a2f, 0x88f5, 0x4882, {0xae, 0x63, 0xfa, 0xac, 0x8c, 0x8b, 0x86, 0xb3 } \
  14. }
  15. ///
  16. /// Forward declaration for the EFI_VGA_MINI_PORT_PROTOCOL.
  17. ///
  18. typedef struct _EFI_VGA_MINI_PORT_PROTOCOL EFI_VGA_MINI_PORT_PROTOCOL;
  19. /**
  20. Sets the text display mode of a VGA controller.
  21. Sets the text display mode of the VGA controller to the mode specified by
  22. ModeNumber. A ModeNumber of 0 is a request for an 80x25 text mode. A
  23. ModeNumber of 1 is a request for an 80x50 text mode. If ModeNumber is greater
  24. than MaxModeNumber, then EFI_UNSUPPORTED is returned. If the VGA controller
  25. is not functioning properly, then EFI_DEVICE_ERROR is returned. If the VGA
  26. controller is successfully set to the mode number specified by ModeNumber, then
  27. EFI_SUCCESS is returned.
  28. @param[in] This A pointer to the EFI_VGA_MINI_PORT_PROTOCOL instance.
  29. @param[in] ModeNumber The requested mode number. 0 for 80x25. 1 for 80x5.
  30. @retval EFI_SUCCESS The mode number was set.
  31. @retval EFI_UNSUPPORTED The mode number specified by ModeNumber is not supported.
  32. @retval EFI_DEVICE_ERROR The device is not functioning properly.
  33. **/
  34. typedef
  35. EFI_STATUS
  36. (EFIAPI *EFI_VGA_MINI_PORT_SET_MODE)(
  37. IN EFI_VGA_MINI_PORT_PROTOCOL *This,
  38. IN UINTN ModeNumber
  39. );
  40. struct _EFI_VGA_MINI_PORT_PROTOCOL {
  41. EFI_VGA_MINI_PORT_SET_MODE SetMode;
  42. ///
  43. /// MMIO base address of the VGA text mode framebuffer. Typically set to 0xB8000.
  44. ///
  45. UINT64 VgaMemoryOffset;
  46. ///
  47. /// I/O Port address for the VGA CRTC address register. Typically set to 0x3D4.
  48. ///
  49. UINT64 CrtcAddressRegisterOffset;
  50. ///
  51. /// I/O Port address for the VGA CRTC data register. Typically set to 0x3D5.
  52. ///
  53. UINT64 CrtcDataRegisterOffset;
  54. ///
  55. /// PCI Controller MMIO BAR index of the VGA text mode frame buffer. Typically
  56. /// set to EFI_PCI_IO_PASS_THROUGH_BAR
  57. ///
  58. UINT8 VgaMemoryBar;
  59. ///
  60. /// PCI Controller I/O BAR index of the VGA CRTC address register. Typically
  61. /// set to EFI_PCI_IO_PASS_THROUGH_BAR
  62. ///
  63. UINT8 CrtcAddressRegisterBar;
  64. ///
  65. /// PCI Controller I/O BAR index of the VGA CRTC data register. Typically set
  66. /// to EFI_PCI_IO_PASS_THROUGH_BAR
  67. ///
  68. UINT8 CrtcDataRegisterBar;
  69. ///
  70. /// The maximum number of text modes that this VGA controller supports.
  71. ///
  72. UINT8 MaxMode;
  73. };
  74. extern EFI_GUID gEfiVgaMiniPortProtocolGuid;
  75. #endif