]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.h
Fix the comments to follow UEFI Spec regarding how to check an EFI_HANDLE is valid...
[mirror_edk2.git] / MdeModulePkg / Universal / Console / GraphicsConsoleDxe / GraphicsConsole.h
index cc25e1f35ce965951b1b5c115e00484b66e3fb4e..824de4578a42557fbd11e8dd10233de9d4f044cb 100644 (file)
@@ -1,30 +1,21 @@
-/*++\r
+/** @file\r
+  Header file for GraphicsConsole driver.\r
 \r
-Copyright (c) 2006, Intel Corporation                                                         \r
-All rights reserved. This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution.  The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
 \r
-Module Name:\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
-  GraphicsConsole.h\r
+**/\r
 \r
-Abstract:\r
+#ifndef _GRAPHICS_CONSOLE_H_\r
+#define _GRAPHICS_CONSOLE_H_\r
 \r
-  \r
-Revision History\r
-\r
---*/\r
-\r
-#ifndef _GRAPHICS_CONSOLE_H\r
-#define _GRAPHICS_CONSOLE_H\r
-\r
-#include <PiDxe.h>\r
-#include <Protocol/FrameworkHii.h>\r
+#include <Uefi.h>\r
 #include <Protocol/SimpleTextOut.h>\r
 #include <Protocol/GraphicsOutput.h>\r
 #include <Protocol/UgaDraw.h>\r
@@ -32,53 +23,41 @@ Revision History
 #include <Library/DebugLib.h>\r
 #include <Library/UefiDriverEntryPoint.h>\r
 #include <Library/UefiLib.h>\r
-#include <Library/HiiLibFramework.h>\r
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
 #include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/HiiLib.h>\r
+#include <Library/BaseLib.h>\r
+#include <Library/PcdLib.h>\r
 \r
+#include <Guid/MdeModuleHii.h>\r
 \r
-extern EFI_COMPONENT_NAME_PROTOCOL  gGraphicsConsoleComponentName;\r
+#include <Protocol/HiiFont.h>\r
+#include <Protocol/HiiDatabase.h>\r
 \r
-//\r
-// EFI Component Name Functions\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-GraphicsConsoleComponentNameGetDriverName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
-  IN  CHAR8                        *Language,\r
-  OUT CHAR16                       **DriverName\r
-  );\r
 \r
-EFI_STATUS\r
-EFIAPI\r
-GraphicsConsoleComponentNameGetControllerName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,\r
-  IN  EFI_HANDLE                                      ControllerHandle,\r
-  IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,\r
-  IN  CHAR8                                           *Language,\r
-  OUT CHAR16                                          **ControllerName\r
-  );\r
+extern EFI_COMPONENT_NAME_PROTOCOL   gGraphicsConsoleComponentName;\r
+extern EFI_COMPONENT_NAME2_PROTOCOL  gGraphicsConsoleComponentName2;\r
+extern EFI_DRIVER_BINDING_PROTOCOL   gGraphicsConsoleDriverBinding;\r
+extern EFI_NARROW_GLYPH              gUsStdNarrowGlyphData[];\r
 \r
+extern UINT32 mNarrowFontSize;\r
 //\r
-// Glyph database\r
+// User can define valid graphic resolution here\r
+// e.g. 640x480, 800x600, 1024x768...\r
 //\r
-#define GLYPH_WIDTH   8\r
-#define GLYPH_HEIGHT  19\r
+#define CURRENT_HORIZONTAL_RESOLUTION  800\r
+#define CURRENT_VERTICAL_RESOLUTION    600\r
 \r
 typedef union {\r
   EFI_NARROW_GLYPH  NarrowGlyph;\r
   EFI_WIDE_GLYPH    WideGlyph;\r
 } GLYPH_UNION;\r
 \r
-extern EFI_NARROW_GLYPH UsStdNarrowGlyphData[];\r
-extern EFI_WIDE_GLYPH   UsStdWideGlyphData[];\r
-\r
 //\r
 // Device Structure\r
 //\r
-#define GRAPHICS_CONSOLE_DEV_SIGNATURE  EFI_SIGNATURE_32 ('g', 's', 't', 'o')\r
+#define GRAPHICS_CONSOLE_DEV_SIGNATURE  SIGNATURE_32 ('g', 's', 't', 'o')\r
 \r
 typedef struct {\r
   UINTN   Columns;\r
@@ -90,7 +69,7 @@ typedef struct {
   UINT32  GopModeNumber;\r
 } GRAPHICS_CONSOLE_MODE_DATA;\r
 \r
-#define GRAPHICS_MAX_MODE 3\r
+#define GRAPHICS_MAX_MODE 5\r
 \r
 typedef struct {\r
   UINTN                            Signature;\r
@@ -100,30 +79,160 @@ typedef struct {
   EFI_SIMPLE_TEXT_OUTPUT_MODE      SimpleTextOutputMode;\r
   GRAPHICS_CONSOLE_MODE_DATA       ModeData[GRAPHICS_MAX_MODE];\r
   EFI_GRAPHICS_OUTPUT_BLT_PIXEL    *LineBuffer;\r
-  EFI_HII_HANDLE                   HiiHandle;\r
 } GRAPHICS_CONSOLE_DEV;\r
 \r
 #define GRAPHICS_CONSOLE_CON_OUT_DEV_FROM_THIS(a) \\r
   CR (a, GRAPHICS_CONSOLE_DEV, SimpleTextOutput, GRAPHICS_CONSOLE_DEV_SIGNATURE)\r
 \r
-//\r
-// Global Variables\r
-//\r
-extern EFI_DRIVER_BINDING_PROTOCOL  gGraphicsConsoleDriverBinding;\r
 \r
 //\r
-// Prototypes\r
+// EFI Component Name Functions\r
 //\r
-UINTN\r
-ReturnNarrowFontSize (\r
-  VOID\r
+/**\r
+  Retrieves a Unicode string that is the user readable name of the driver.\r
+\r
+  This function retrieves the user readable name of a driver in the form of a\r
+  Unicode string. If the driver specified by This has a user readable name in\r
+  the language specified by Language, then a pointer to the driver name is\r
+  returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
+  by This does not support the language specified by Language,\r
+  then EFI_UNSUPPORTED is returned.\r
+\r
+  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
+                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
+\r
+  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
+                                array indicating the language. This is the\r
+                                language of the driver name that the caller is\r
+                                requesting, and it must match one of the\r
+                                languages specified in SupportedLanguages. The\r
+                                number of languages supported by a driver is up\r
+                                to the driver writer. Language is specified\r
+                                in RFC 4646 or ISO 639-2 language code format.\r
+\r
+  @param  DriverName[out]       A pointer to the Unicode string to return.\r
+                                This Unicode string is the name of the\r
+                                driver specified by This in the language\r
+                                specified by Language.\r
+\r
+  @retval EFI_SUCCESS           The Unicode string for the Driver specified by\r
+                                This and the language specified by Language was\r
+                                returned in DriverName.\r
+\r
+  @retval EFI_INVALID_PARAMETER Language is NULL.\r
+\r
+  @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
+\r
+  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
+                                the language specified by Language.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+GraphicsConsoleComponentNameGetDriverName (\r
+  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
+  IN  CHAR8                        *Language,\r
+  OUT CHAR16                       **DriverName\r
   );\r
 \r
-UINTN\r
-ReturnWideFontSize (\r
-  VOID\r
+\r
+/**\r
+  Retrieves a Unicode string that is the user readable name of the controller\r
+  that is being managed by a driver.\r
+\r
+  This function retrieves the user readable name of the controller specified by\r
+  ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
+  driver specified by This has a user readable name in the language specified by\r
+  Language, then a pointer to the controller name is returned in ControllerName,\r
+  and EFI_SUCCESS is returned.  If the driver specified by This is not currently\r
+  managing the controller specified by ControllerHandle and ChildHandle,\r
+  then EFI_UNSUPPORTED is returned.  If the driver specified by This does not\r
+  support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
+\r
+  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
+                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
+\r
+  @param  ControllerHandle[in]  The handle of a controller that the driver\r
+                                specified by This is managing.  This handle\r
+                                specifies the controller whose name is to be\r
+                                returned.\r
+\r
+  @param  ChildHandle[in]       The handle of the child controller to retrieve\r
+                                the name of.  This is an optional parameter that\r
+                                may be NULL.  It will be NULL for device\r
+                                drivers.  It will also be NULL for a bus drivers\r
+                                that wish to retrieve the name of the bus\r
+                                controller.  It will not be NULL for a bus\r
+                                driver that wishes to retrieve the name of a\r
+                                child controller.\r
+\r
+  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
+                                array indicating the language.  This is the\r
+                                language of the driver name that the caller is\r
+                                requesting, and it must match one of the\r
+                                languages specified in SupportedLanguages. The\r
+                                number of languages supported by a driver is up\r
+                                to the driver writer. Language is specified in\r
+                                RFC 4646 or ISO 639-2 language code format.\r
+\r
+  @param  ControllerName[out]   A pointer to the Unicode string to return.\r
+                                This Unicode string is the name of the\r
+                                controller specified by ControllerHandle and\r
+                                ChildHandle in the language specified by\r
+                                Language from the point of view of the driver\r
+                                specified by This.\r
+\r
+  @retval EFI_SUCCESS           The Unicode string for the user readable name in\r
+                                the language specified by Language for the\r
+                                driver specified by This was returned in\r
+                                DriverName.\r
+\r
+  @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r
+\r
+  @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
+                                EFI_HANDLE.\r
+\r
+  @retval EFI_INVALID_PARAMETER Language is NULL.\r
+\r
+  @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
+\r
+  @retval EFI_UNSUPPORTED       The driver specified by This is not currently\r
+                                managing the controller specified by\r
+                                ControllerHandle and ChildHandle.\r
+\r
+  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
+                                the language specified by Language.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+GraphicsConsoleComponentNameGetControllerName (\r
+  IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,\r
+  IN  EFI_HANDLE                                      ControllerHandle,\r
+  IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,\r
+  IN  CHAR8                                           *Language,\r
+  OUT CHAR16                                          **ControllerName\r
   );\r
 \r
+\r
+/**\r
+  Reset the text output device hardware and optionally run diagnostics.\r
+  \r
+  Implements SIMPLE_TEXT_OUTPUT.Reset().\r
+  If ExtendeVerification is TRUE, then perform dependent Graphics Console\r
+  device reset, and set display mode to mode 0.\r
+  If ExtendedVerification is FALSE, only set display mode to mode 0.\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  ExtendedVerification  Indicates that the driver may perform a more\r
+                                exhaustive verification operation of the device\r
+                                during reset.\r
+\r
+  @retval EFI_SUCCESS          The text output device was reset.\r
+  @retval EFI_DEVICE_ERROR     The text output device is not functioning correctly and\r
+                               could not be reset.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 GraphicsConsoleConOutReset (\r
@@ -131,6 +240,28 @@ GraphicsConsoleConOutReset (
   IN  BOOLEAN                            ExtendedVerification\r
   );\r
 \r
+/**\r
+  Write a Unicode string to the output device.\r
+\r
+  Implements SIMPLE_TEXT_OUTPUT.OutputString(). \r
+  The Unicode string will be converted to Glyphs and will be\r
+  sent to the Graphics Console.\r
+\r
+  @param  This                    Protocol instance pointer.\r
+  @param  WString                 The NULL-terminated Unicode string to be displayed\r
+                                  on the output device(s). All output devices must\r
+                                  also support the Unicode drawing defined in this file.\r
+\r
+  @retval EFI_SUCCESS             The string was output to the device.\r
+  @retval EFI_DEVICE_ERROR        The device reported an error while attempting to output\r
+                                  the text.\r
+  @retval EFI_UNSUPPORTED         The output device's mode is not currently in a\r
+                                  defined text mode.\r
+  @retval EFI_WARN_UNKNOWN_GLYPH  This warning code indicates that some of the\r
+                                  characters in the Unicode string could not be\r
+                                  rendered and were skipped.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 GraphicsConsoleConOutOutputString (\r
@@ -138,6 +269,25 @@ GraphicsConsoleConOutOutputString (
   IN  CHAR16                           *WString\r
   );\r
 \r
+/**\r
+  Verifies that all characters in a Unicode string can be output to the \r
+  target device.\r
+\r
+  Implements SIMPLE_TEXT_OUTPUT.TestString().\r
+  If one of the characters in the *Wstring is neither valid valid Unicode\r
+  drawing characters, not ASCII code, then this function will return\r
+  EFI_UNSUPPORTED\r
+\r
+  @param  This    Protocol instance pointer.\r
+  @param  WString The NULL-terminated Unicode string to be examined for the output\r
+                  device(s).\r
+\r
+  @retval EFI_SUCCESS      The device(s) are capable of rendering the output string.\r
+  @retval EFI_UNSUPPORTED  Some of the characters in the Unicode string cannot be\r
+                           rendered by one or more of the output devices mapped\r
+                           by the EFI handle.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 GraphicsConsoleConOutTestString (\r
@@ -145,6 +295,23 @@ GraphicsConsoleConOutTestString (
   IN  CHAR16                           *WString\r
   );\r
 \r
+/**\r
+  Returns information for an available text mode that the output device(s)\r
+  supports\r
+\r
+  Implements SIMPLE_TEXT_OUTPUT.QueryMode().\r
+  It returnes information for an available text mode that the Graphics Console supports.\r
+  In this driver,we only support text mode 80x25, which is defined as mode 0.\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  ModeNumber            The mode number to return information on.\r
+  @param  Columns               The returned columns of the requested mode.\r
+  @param  Rows                  The returned rows of the requested mode.\r
+\r
+  @retval EFI_SUCCESS           The requested mode information is returned.\r
+  @retval EFI_UNSUPPORTED       The mode number is not valid.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 GraphicsConsoleConOutQueryMode (\r
@@ -154,6 +321,22 @@ GraphicsConsoleConOutQueryMode (
   OUT UINTN                            *Rows\r
   );\r
 \r
+\r
+/**\r
+  Sets the output device(s) to a specified mode.\r
+  \r
+  Implements SIMPLE_TEXT_OUTPUT.SetMode().\r
+  Set the Graphics Console to a specified mode. In this driver, we only support mode 0.\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  ModeNumber            The text mode to set.\r
+\r
+  @retval EFI_SUCCESS           The requested text mode is set.\r
+  @retval EFI_DEVICE_ERROR      The requested text mode cannot be set because of \r
+                                Graphics Console device error.\r
+  @retval EFI_UNSUPPORTED       The text mode number is not valid.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 GraphicsConsoleConOutSetMode (\r
@@ -161,6 +344,22 @@ GraphicsConsoleConOutSetMode (
   IN  UINTN                            ModeNumber\r
   );\r
 \r
+/**\r
+  Sets the background and foreground colors for the OutputString () and\r
+  ClearScreen () functions.\r
+\r
+  Implements SIMPLE_TEXT_OUTPUT.SetAttribute().\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  Attribute             The attribute to set. Bits 0..3 are the foreground\r
+                                color, and bits 4..6 are the background color. \r
+                                All other bits are undefined and must be zero.\r
+\r
+  @retval EFI_SUCCESS           The requested attribute is set.\r
+  @retval EFI_DEVICE_ERROR      The requested attribute cannot be set due to Graphics Console port error.\r
+  @retval EFI_UNSUPPORTED       The attribute requested is not defined.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 GraphicsConsoleConOutSetAttribute (\r
@@ -168,12 +367,44 @@ GraphicsConsoleConOutSetAttribute (
   IN  UINTN                            Attribute\r
   );\r
 \r
+/**\r
+  Clears the output device(s) display to the currently selected background \r
+  color.\r
+\r
+  Implements SIMPLE_TEXT_OUTPUT.ClearScreen().\r
+\r
+  @param  This                  Protocol instance pointer.\r
+\r
+  @retval  EFI_SUCCESS      The operation completed successfully.\r
+  @retval  EFI_DEVICE_ERROR The device had an error and could not complete the request.\r
+  @retval  EFI_UNSUPPORTED  The output device is not in a valid text mode.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 GraphicsConsoleConOutClearScreen (\r
   IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *This\r
   );\r
 \r
+/**\r
+  Sets the current coordinates of the cursor position.\r
+\r
+  Implements SIMPLE_TEXT_OUTPUT.SetCursorPosition().\r
+\r
+  @param  This        Protocol instance pointer.\r
+  @param  Column      The position to set the cursor to. Must be greater than or\r
+                      equal to zero and less than the number of columns and rows\r
+                      by QueryMode ().\r
+  @param  Row         The position to set the cursor to. Must be greater than or\r
+                      equal to zero and less than the number of columns and rows\r
+                      by QueryMode ().\r
+\r
+  @retval EFI_SUCCESS      The operation completed successfully.\r
+  @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.\r
+  @retval EFI_UNSUPPORTED  The output device is not in a valid text mode, or the\r
+                           cursor position is invalid for the current mode.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 GraphicsConsoleConOutSetCursorPosition (\r
@@ -182,6 +413,19 @@ GraphicsConsoleConOutSetCursorPosition (
   IN  UINTN                            Row\r
   );\r
 \r
+\r
+/**\r
+  Makes the cursor visible or invisible.\r
+\r
+  Implements SIMPLE_TEXT_OUTPUT.EnableCursor().\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  Visible               If TRUE, the cursor is set to be visible, If FALSE,\r
+                                the cursor is set to be invisible.\r
+\r
+  @retval EFI_SUCCESS           The operation completed successfully.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 GraphicsConsoleConOutEnableCursor (\r
@@ -189,11 +433,22 @@ GraphicsConsoleConOutEnableCursor (
   IN  BOOLEAN                          Visible\r
   );\r
 \r
-EFI_STATUS\r
-EfiLocateHiiProtocol (\r
-  VOID\r
-  );\r
+/**\r
+  Test to see if Graphics Console could be supported on the Controller.\r
+\r
+  Graphics Console could be supported if Graphics Output Protocol or UGA Draw\r
+  Protocol exists on the Controller. (UGA Draw Protocol could be skipped\r
+  if PcdUgaConsumeSupport is set to FALSE.)\r
+\r
+  @param  This                Protocol instance pointer.\r
+  @param  Controller          Handle of device to test.\r
+  @param  RemainingDevicePath Optional parameter use to pick a specific child\r
+                              device to start.\r
+\r
+  @retval EFI_SUCCESS         This driver supports this device.\r
+  @retval other               This driver does not support this device.\r
 \r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 GraphicsConsoleControllerDriverSupported (\r
@@ -202,6 +457,21 @@ GraphicsConsoleControllerDriverSupported (
   IN EFI_DEVICE_PATH_PROTOCOL       *RemainingDevicePath\r
   );\r
 \r
+\r
+/**\r
+  Start this driver on Controller by opening Graphics Output protocol or \r
+  UGA Draw protocol, and installing Simple Text Out protocol on Controller.\r
+  (UGA Draw protocol could be skipped if PcdUgaConsumeSupport is set to FALSE.)\r
+  \r
+  @param  This                 Protocol instance pointer.\r
+  @param  Controller           Handle of device to bind driver to\r
+  @param  RemainingDevicePath  Optional parameter use to pick a specific child\r
+                               device to start.\r
+\r
+  @retval EFI_SUCCESS          This driver is added to Controller.\r
+  @retval other                This driver does not support this device.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 GraphicsConsoleControllerDriverStart (\r
@@ -210,6 +480,24 @@ GraphicsConsoleControllerDriverStart (
   IN EFI_DEVICE_PATH_PROTOCOL       *RemainingDevicePath\r
   );\r
 \r
+/**\r
+  Stop this driver on Controller by removing Simple Text Out protocol \r
+  and closing the Graphics Output Protocol or UGA Draw protocol on Controller.\r
+  (UGA Draw protocol could be skipped if PcdUgaConsumeSupport is set to FALSE.)\r
+  \r
+\r
+  @param  This              Protocol instance pointer.\r
+  @param  Controller        Handle of device to stop driver on\r
+  @param  NumberOfChildren  Number of Handles in ChildHandleBuffer. If number of\r
+                            children is zero stop the entire bus driver.\r
+  @param  ChildHandleBuffer List of Child Handles to Stop.\r
+\r
+  @retval EFI_SUCCESS       This driver is removed Controller.\r
+  @retval EFI_NOT_STARTED   Simple Text Out protocol could not be found the \r
+                            Controller.\r
+  @retval other             This driver was not removed from this device.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 GraphicsConsoleControllerDriverStop (\r
@@ -219,4 +507,102 @@ GraphicsConsoleControllerDriverStop (
   IN  EFI_HANDLE                     *ChildHandleBuffer\r
   );\r
 \r
+\r
+/**\r
+  Locate HII Database protocol and HII Font protocol.\r
+\r
+  @retval  EFI_SUCCESS     HII Database protocol and HII Font protocol \r
+                           are located successfully.\r
+  @return  other           Failed to locate HII Database protocol or \r
+                           HII Font protocol.\r
+\r
+**/\r
+EFI_STATUS\r
+EfiLocateHiiProtocol (\r
+  VOID\r
+  );\r
+\r
+\r
+/**\r
+  Gets Graphics Console devcie's foreground color and background color.\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  Foreground            Returned text foreground color.\r
+  @param  Background            Returned text background color.\r
+\r
+  @retval EFI_SUCCESS           It returned always.\r
+\r
+**/\r
+EFI_STATUS\r
+GetTextColors (\r
+  IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *This,\r
+  OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL    *Foreground,\r
+  OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL    *Background\r
+  );\r
+\r
+/**\r
+  Draw Unicode string on the Graphics Console device's screen.\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  UnicodeWeight         One Unicode string to be displayed.\r
+  @param  Count                 The count of Unicode string.\r
+\r
+  @retval EFI_OUT_OF_RESOURCES  If no memory resource to use.\r
+  @retval EFI_UNSUPPORTED       If no Graphics Output protocol and UGA Draw\r
+                                protocol exist.\r
+  @retval EFI_SUCCESS           Drawing Unicode string implemented successfully.\r
+\r
+**/\r
+EFI_STATUS\r
+DrawUnicodeWeightAtCursorN (\r
+  IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *This,\r
+  IN  CHAR16                           *UnicodeWeight,\r
+  IN  UINTN                            Count\r
+  );\r
+\r
+/**\r
+  Flush the cursor on the screen.\r
+  \r
+  If CursorVisible is FALSE, nothing to do and return directly.\r
+  If CursorVisible is TRUE, \r
+     i) If the cursor shows on screen, it will be erased.\r
+    ii) If the cursor does not show on screen, it will be shown. \r
+\r
+  @param  This                  Protocol instance pointer.\r
+\r
+  @retval EFI_SUCCESS           The cursor is erased successfully.\r
+\r
+**/\r
+EFI_STATUS\r
+FlushCursor (\r
+  IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *This\r
+  );\r
+\r
+/**\r
+  Check if the current specific mode supported the user defined resolution\r
+  for the Graphics Console device based on Graphics Output Protocol.\r
+\r
+  If yes, set the graphic device's current mode to this specific mode.\r
+  \r
+  @param  GraphicsOutput        Graphics Output Protocol instance pointer.\r
+  @param  HorizontalResolution  User defined horizontal resolution\r
+  @param  VerticalResolution    User defined vertical resolution.\r
+  @param  CurrentModeNumber     Current specific mode to be check.\r
+\r
+  @retval EFI_SUCCESS       The mode is supported.\r
+  @retval EFI_UNSUPPORTED   The specific mode is out of range of graphics \r
+                            device supported.\r
+  @retval other             The specific mode does not support user defined \r
+                            resolution or failed to set the current mode to the \r
+                            specific mode on graphics device.\r
+\r
+**/\r
+EFI_STATUS\r
+CheckModeSupported (\r
+  EFI_GRAPHICS_OUTPUT_PROTOCOL  *GraphicsOutput,\r
+  IN  UINT32  HorizontalResolution,\r
+  IN  UINT32  VerticalResolution,\r
+  OUT UINT32  *CurrentModeNumber\r
+  );\r
+\r
 #endif\r