]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c
Clean codes per ECC for GraphicsConsoleDxe module.
[mirror_edk2.git] / MdeModulePkg / Universal / Console / GraphicsConsoleDxe / GraphicsConsole.c
index caaa4dd46f7a575344b05ce356ac4bd627744a8b..1e1bd0edd4f1c6bd0ca7b7022536738ced9019c1 100644 (file)
@@ -1,4 +1,4 @@
-/**@file\r
+/** @file\r
   This is the main routine for initializing the Graphics Console support routines.\r
 Remaining Tasks\r
   Add all standard Glyphs from UEFI 2.0 Specification\r
@@ -6,7 +6,7 @@ Remaining Tasks
   Solve palette issues for mixed graphics and text\r
   When does this protocol reset the palette?\r
 \r
-Copyright (c) 2006 - 2007 Intel Corporation. <BR>\r
+Copyright (c) 2006 - 2008 Intel Corporation. <BR>\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
@@ -19,7 +19,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include "GraphicsConsole.h"\r
 \r
-STATIC\r
 EFI_STATUS\r
 GetTextColors (\r
   IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *This,\r
@@ -27,7 +26,6 @@ GetTextColors (
   OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL    *Background\r
   );\r
 \r
-STATIC\r
 EFI_STATUS\r
 DrawUnicodeWeightAtCursorN (\r
   IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *This,\r
@@ -35,7 +33,6 @@ DrawUnicodeWeightAtCursorN (
   IN  UINTN                            Count\r
   );\r
 \r
-STATIC\r
 EFI_STATUS\r
 EraseCursor (\r
   IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *This\r
@@ -92,9 +89,9 @@ BOOLEAN                     mFirstAccessFlag = TRUE;
 \r
 STATIC EFI_GUID             mFontPackageListGuid = {0xf5f219d3, 0x7006, 0x4648, 0xac, 0x8d, 0xd6, 0x1d, 0xfb, 0x7b, 0xc6, 0xad};\r
 \r
-static CHAR16               mCrLfString[3] = { CHAR_CARRIAGE_RETURN, CHAR_LINEFEED, CHAR_NULL };\r
+STATIC CHAR16               mCrLfString[3] = { CHAR_CARRIAGE_RETURN, CHAR_LINEFEED, CHAR_NULL };\r
 \r
-static EFI_GRAPHICS_OUTPUT_BLT_PIXEL        mEfiColors[16] = {\r
+STATIC EFI_GRAPHICS_OUTPUT_BLT_PIXEL        mEfiColors[16] = {\r
   //\r
   // B     G     R\r
   //\r
@@ -116,12 +113,14 @@ static EFI_GRAPHICS_OUTPUT_BLT_PIXEL        mEfiColors[16] = {
   {0xff, 0xff, 0xff, 0x00}  // WHITE\r
 };\r
 \r
-static EFI_NARROW_GLYPH     mCursorGlyph = {\r
+STATIC EFI_NARROW_GLYPH     mCursorGlyph = {\r
   0x0000,\r
   0x00,\r
   { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF }\r
 };\r
 \r
+STATIC CHAR16       SpaceStr[] = { NARROW_CHAR, ' ', 0 };\r
+\r
 EFI_DRIVER_BINDING_PROTOCOL gGraphicsConsoleDriverBinding = {\r
   GraphicsConsoleControllerDriverSupported,\r
   GraphicsConsoleControllerDriverStart,\r
@@ -226,6 +225,20 @@ Error:
   return Status;\r
 }\r
 \r
+\r
+/**\r
+  Start the controller.\r
+\r
+  @param  This                  A pointer to the EFI_DRIVER_BINDING_PROTOCOL\r
+                                instance.\r
+  @param  Controller            The handle of the controller to start.\r
+  @param  RemainingDevicePath   A pointer to the remaining portion of a devcie\r
+                                path.\r
+\r
+  @retval EFI_SUCCESS           Return successfully.\r
+  @retval EFI_OUT_OF_RESOURCES  Out of resources.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 GraphicsConsoleControllerDriverStart (\r
@@ -233,24 +246,6 @@ GraphicsConsoleControllerDriverStart (
   IN EFI_HANDLE                     Controller,\r
   IN EFI_DEVICE_PATH_PROTOCOL       *RemainingDevicePath\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-\r
-    Start the controller.\r
-\r
-  Arguments:\r
-\r
-    This                - A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
-    Controller          - The handle of the controller to start.\r
-    RemainingDevicePath - A pointer to the remaining portion of a devcie path.\r
-\r
-  Returns:\r
-\r
-    EFI_SUCCESS          - Return successfully.\r
-    EFI_OUT_OF_RESOURCES - Out of resources.\r
-\r
---*/\r
 {\r
   EFI_STATUS                           Status;\r
   GRAPHICS_CONSOLE_DEV                 *Private;\r
@@ -683,20 +678,17 @@ CheckModeSupported (
   return Status;\r
 }\r
 \r
-EFI_STATUS\r
-EfiLocateHiiProtocol (\r
-  VOID\r
-  )\r
-/*++\r
 \r
-  Routine Description:\r
-    Locate HII protocols for future usage.\r
+/**\r
+  Locate HII protocols for future usage.\r
 \r
-  Arguments:\r
 \r
-  Returns:\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+EfiLocateHiiProtocol (\r
+  VOID\r
+  )\r
 {\r
   EFI_HANDLE  Handle;\r
   UINTN       Size;\r
@@ -740,75 +732,60 @@ EfiLocateHiiProtocol (
 //\r
 // Body of the STO functions\r
 //\r
+\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                  Indicates the calling context.\r
+  @param  ExtendedVerification  Indicates that the driver may perform a more\r
+                                exhaustive verification operation of the device\r
+                                during reset.\r
+\r
+  @return EFI_SUCCESS\r
+  @return The reset operation succeeds.\r
+  @return EFI_DEVICE_ERROR\r
+  @return The Graphics Console is not functioning correctly\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 GraphicsConsoleConOutReset (\r
   IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *This,\r
   IN  BOOLEAN                          ExtendedVerification\r
   )\r
-/*++\r
-  Routine Description:\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
-  Arguments:\r
-\r
-    This - Indicates the calling context.\r
-\r
-    ExtendedVerification - Indicates that the driver may perform a more exhaustive\r
-                           verification operation of the device during reset.\r
-\r
-  Returns:\r
-\r
-    EFI_SUCCESS\r
-       The reset operation succeeds.\r
-\r
-    EFI_DEVICE_ERROR\r
-      The Graphics Console is not functioning correctly\r
-\r
---*/\r
 {\r
   This->SetAttribute (This, EFI_TEXT_ATTR (This->Mode->Attribute & 0x0F, EFI_BACKGROUND_BLACK));\r
   return This->SetMode (This, 0);\r
 }\r
 \r
+\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                  Indicates the calling context.\r
+  @param  WString               The Null-terminated Unicode string to be displayed\r
+                                on the Graphics Console.\r
+\r
+  @return EFI_SUCCESS\r
+  @return The string is output successfully.\r
+  @return EFI_DEVICE_ERROR\r
+  @return The Graphics Console failed to send the string out.\r
+  @return EFI_WARN_UNKNOWN_GLYPH\r
+  @return Indicates that some of the characters in the Unicode string could not\r
+  @return be rendered and are skipped.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 GraphicsConsoleConOutOutputString (\r
   IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *This,\r
   IN  CHAR16                           *WString\r
   )\r
-/*++\r
-  Routine Description:\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
-\r
-  Arguments:\r
-\r
-    This - Indicates the calling context.\r
-\r
-    WString - The Null-terminated Unicode string to be displayed on\r
-              the Graphics Console.\r
-\r
-  Returns:\r
-\r
-    EFI_SUCCESS\r
-       The string is output successfully.\r
-\r
-    EFI_DEVICE_ERROR\r
-      The Graphics Console failed to send the string out.\r
-\r
-    EFI_WARN_UNKNOWN_GLYPH\r
-      Indicates that some of the characters in the Unicode string could not\r
-      be rendered and are skipped.\r
-\r
---*/\r
 {\r
   GRAPHICS_CONSOLE_DEV  *Private;\r
   EFI_GRAPHICS_OUTPUT_PROTOCOL   *GraphicsOutput;\r
@@ -829,7 +806,6 @@ GraphicsConsoleConOutOutputString (
   UINTN                 Index;\r
   INT32                 OriginAttribute;\r
   EFI_TPL               OldTpl;\r
-  CHAR16                         SpaceStr[] = { NARROW_CHAR, ' ', 0 };\r
 \r
   Status = EFI_SUCCESS;\r
 \r
@@ -864,7 +840,7 @@ GraphicsConsoleConOutOutputString (
   //\r
   OriginAttribute = This->Mode->Attribute;\r
 \r
-  while (*WString) {\r
+  while (*WString != L'\0') {\r
 \r
     if (*WString == CHAR_BACKSPACE) {\r
       //\r
@@ -1079,43 +1055,36 @@ GraphicsConsoleConOutOutputString (
 \r
 }\r
 \r
+\r
+/**\r
+  Implements SIMPLE_TEXT_OUTPUT.TestString().\r
+  If one of the characters in the *Wstring is\r
+  neither valid valid Unicode drawing characters,\r
+  not ASCII code, then this function will return\r
+  EFI_UNSUPPORTED.\r
+\r
+  @param  This                  Indicates the calling context.\r
+  @param  WString               The Null-terminated Unicode string to be tested.\r
+\r
+  @return EFI_SUCCESS\r
+  @return The Graphics Console is capable of rendering the output string.\r
+  @return EFI_UNSUPPORTED\r
+  @return Some of the characters in the Unicode string cannot be rendered.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 GraphicsConsoleConOutTestString (\r
   IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *This,\r
   IN  CHAR16                           *WString\r
   )\r
-/*++\r
-  Routine Description:\r
-\r
-    Implements SIMPLE_TEXT_OUTPUT.TestString().\r
-    If one of the characters in the *Wstring is\r
-    neither valid valid Unicode drawing characters,\r
-    not ASCII code, then this function will return\r
-    EFI_UNSUPPORTED.\r
-\r
-\r
-  Arguments:\r
-\r
-    This - Indicates the calling context.\r
-\r
-    WString - The Null-terminated Unicode string to be tested.\r
-\r
-  Returns:\r
-\r
-    EFI_SUCCESS\r
-       The Graphics Console is capable of rendering the output string.\r
-\r
-    EFI_UNSUPPORTED\r
-      Some of the characters in the Unicode string cannot be rendered.\r
-\r
---*/\r
 {\r
   EFI_STATUS            Status;\r
   UINT16                Count;\r
 \r
-  EFI_IMAGE_OUTPUT      *Blt = NULL;\r
+  EFI_IMAGE_OUTPUT      *Blt;\r
 \r
+  Blt   = NULL;\r
   Count = 0;\r
 \r
   while (WString[Count] != 0) {\r
@@ -1138,6 +1107,25 @@ GraphicsConsoleConOutTestString (
   return EFI_SUCCESS;\r
 }\r
 \r
+\r
+/**\r
+  Implements SIMPLE_TEXT_OUTPUT.QueryMode().\r
+  It returnes information for an available text mode\r
+  that the Graphics Console supports.\r
+  In this driver,we only support text mode 80x25, which is\r
+  defined as mode 0.\r
+\r
+  @param  This                  Indicates the calling context.\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
+  @return EFI_SUCCESS\r
+  @return The requested mode information is returned.\r
+  @return EFI_UNSUPPORTED\r
+  @return The mode number is not valid.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 GraphicsConsoleConOutQueryMode (\r
@@ -1146,35 +1134,6 @@ GraphicsConsoleConOutQueryMode (
   OUT UINTN                            *Columns,\r
   OUT UINTN                            *Rows\r
   )\r
-/*++\r
-  Routine Description:\r
-\r
-    Implements SIMPLE_TEXT_OUTPUT.QueryMode().\r
-    It returnes information for an available text mode\r
-    that the Graphics Console supports.\r
-    In this driver,we only support text mode 80x25, which is\r
-    defined as mode 0.\r
-\r
-\r
-  Arguments:\r
-\r
-    This - Indicates the calling context.\r
-\r
-    ModeNumber - The mode number to return information on.\r
-\r
-    Columns - The returned columns of the requested mode.\r
-\r
-    Rows - The returned rows of the requested mode.\r
-\r
-  Returns:\r
-\r
-    EFI_SUCCESS\r
-      The requested mode information is returned.\r
-\r
-    EFI_UNSUPPORTED\r
-      The mode number is not valid.\r
-\r
---*/\r
 {\r
   GRAPHICS_CONSOLE_DEV  *Private;\r
   EFI_STATUS            Status;\r
@@ -1203,37 +1162,29 @@ Done:
   return Status;\r
 }\r
 \r
+\r
+/**\r
+  Implements SIMPLE_TEXT_OUTPUT.SetMode().\r
+  Set the Graphics Console to a specified mode.\r
+  In this driver, we only support mode 0.\r
+\r
+  @param  This                  Indicates the calling context.\r
+  @param  ModeNumber            The text mode to set.\r
+\r
+  @return EFI_SUCCESS\r
+  @return The requested text mode is set.\r
+  @return EFI_DEVICE_ERROR\r
+  @return The requested text mode cannot be set because of Graphics Console device error.\r
+  @return EFI_UNSUPPORTED\r
+  @return The text mode number is not valid.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 GraphicsConsoleConOutSetMode (\r
   IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *This,\r
   IN  UINTN                            ModeNumber\r
   )\r
-/*++\r
-  Routine Description:\r
-\r
-    Implements SIMPLE_TEXT_OUTPUT.SetMode().\r
-    Set the Graphics Console to a specified mode.\r
-    In this driver, we only support mode 0.\r
-\r
-  Arguments:\r
-\r
-    This - Indicates the calling context.\r
-\r
-    ModeNumber - The text mode to set.\r
-\r
-  Returns:\r
-\r
-    EFI_SUCCESS\r
-       The requested text mode is set.\r
-\r
-    EFI_DEVICE_ERROR\r
-      The requested text mode cannot be set because of Graphics Console device error.\r
-\r
-    EFI_UNSUPPORTED\r
-      The text mode number is not valid.\r
-\r
---*/\r
 {\r
   EFI_STATUS                      Status;\r
   GRAPHICS_CONSOLE_DEV            *Private;\r
@@ -1407,36 +1358,25 @@ Done:
   return Status;\r
 }\r
 \r
+\r
+/**\r
+  Implements SIMPLE_TEXT_OUTPUT.SetAttribute().\r
+\r
+  @param  This                  Indicates the calling context.\r
+  @param  Attribute             The attribute to set. Only bit0..6 are valid, all\r
+                                other bits are undefined and must be zero.\r
+\r
+  @return EFI_SUCCESS           The requested attribute is set.\r
+  @return EFI_DEVICE_ERROR      The requested attribute cannot be set due to Graphics Console port error.\r
+  @return EFI_UNSUPPORTED       The attribute requested is not defined by EFI spec.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 GraphicsConsoleConOutSetAttribute (\r
   IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *This,\r
   IN  UINTN                            Attribute\r
   )\r
-/*++\r
-  Routine Description:\r
-\r
-    Implements SIMPLE_TEXT_OUTPUT.SetAttribute().\r
-\r
-  Arguments:\r
-\r
-    This - Indicates the calling context.\r
-\r
-    Attrubute - The attribute to set. Only bit0..6 are valid, all other bits\r
-                are undefined and must be zero.\r
-\r
-  Returns:\r
-\r
-    EFI_SUCCESS\r
-      The requested attribute is set.\r
-\r
-    EFI_DEVICE_ERROR\r
-      The requested attribute cannot be set due to Graphics Console port error.\r
-\r
-    EFI_UNSUPPORTED\r
-      The attribute requested is not defined by EFI spec.\r
-\r
---*/\r
 {\r
   EFI_TPL               OldTpl;\r
 \r
@@ -1461,35 +1401,27 @@ GraphicsConsoleConOutSetAttribute (
   return EFI_SUCCESS;\r
 }\r
 \r
+\r
+/**\r
+  Implements SIMPLE_TEXT_OUTPUT.ClearScreen().\r
+  It clears the Graphics Console's display to the\r
+  currently selected background color.\r
+\r
+  @param  This                  Indicates the calling context.\r
+\r
+  @return EFI_SUCCESS\r
+  @return The operation completed successfully.\r
+  @return EFI_DEVICE_ERROR\r
+  @return The Graphics Console cannot be cleared due to Graphics Console device error.\r
+  @return EFI_UNSUPPORTED\r
+  @return The Graphics Console 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
-  Routine Description:\r
-\r
-    Implements SIMPLE_TEXT_OUTPUT.ClearScreen().\r
-    It clears the Graphics Console's display to the\r
-    currently selected background color.\r
-\r
-\r
-  Arguments:\r
-\r
-    This - Indicates the calling context.\r
-\r
-  Returns:\r
-\r
-    EFI_SUCCESS\r
-      The operation completed successfully.\r
-\r
-    EFI_DEVICE_ERROR\r
-      The Graphics Console cannot be cleared due to Graphics Console device error.\r
-\r
-    EFI_UNSUPPORTED\r
-      The Graphics Console is not in a valid text mode.\r
-\r
---*/\r
 {\r
   EFI_STATUS                    Status;\r
   GRAPHICS_CONSOLE_DEV          *Private;\r
@@ -1548,6 +1480,23 @@ GraphicsConsoleConOutClearScreen (
   return Status;\r
 }\r
 \r
+\r
+/**\r
+  Implements SIMPLE_TEXT_OUTPUT.SetCursorPosition().\r
+\r
+  @param  This                  Indicates the calling context.\r
+  @param  Column                The row to set cursor to.\r
+  @param  Row                   The column to set cursor to.\r
+\r
+  @return EFI_SUCCESS\r
+  @return The operation completed successfully.\r
+  @return EFI_DEVICE_ERROR\r
+  @return The request fails due to Graphics Console device error.\r
+  @return EFI_UNSUPPORTED\r
+  @return The Graphics Console is not in a valid text mode, or the cursor position\r
+  @return is invalid for current mode.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 GraphicsConsoleConOutSetCursorPosition (\r
@@ -1555,32 +1504,6 @@ GraphicsConsoleConOutSetCursorPosition (
   IN  UINTN                            Column,\r
   IN  UINTN                            Row\r
   )\r
-/*++\r
-  Routine Description:\r
-\r
-    Implements SIMPLE_TEXT_OUTPUT.SetCursorPosition().\r
-\r
-  Arguments:\r
-\r
-    This - Indicates the calling context.\r
-\r
-    Column - The row to set cursor to.\r
-\r
-    Row - The column to set cursor to.\r
-\r
-  Returns:\r
-\r
-    EFI_SUCCESS\r
-      The operation completed successfully.\r
-\r
-    EFI_DEVICE_ERROR\r
-      The request fails due to Graphics Console device error.\r
-\r
-    EFI_UNSUPPORTED\r
-      The Graphics Console is not in a valid text mode, or the cursor position\r
-      is invalid for current mode.\r
-\r
---*/\r
 {\r
   GRAPHICS_CONSOLE_DEV        *Private;\r
   GRAPHICS_CONSOLE_MODE_DATA  *ModeData;\r
@@ -1617,34 +1540,27 @@ Done:
   return Status;\r
 }\r
 \r
+\r
+/**\r
+  Implements SIMPLE_TEXT_OUTPUT.EnableCursor().\r
+  In this driver, the cursor cannot be hidden.\r
+\r
+  @param  This                  Indicates the calling context.\r
+  @param  Visible               If TRUE, the cursor is set to be visible, If FALSE,\r
+                                the cursor is set to be invisible.\r
+\r
+  @return EFI_SUCCESS\r
+  @return The request is valid.\r
+  @return EFI_UNSUPPORTED\r
+  @return The Graphics Console does not support a hidden cursor.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 GraphicsConsoleConOutEnableCursor (\r
   IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *This,\r
   IN  BOOLEAN                          Visible\r
   )\r
-/*++\r
-  Routine Description:\r
-\r
-    Implements SIMPLE_TEXT_OUTPUT.EnableCursor().\r
-    In this driver, the cursor cannot be hidden.\r
-\r
-  Arguments:\r
-\r
-    This - Indicates the calling context.\r
-\r
-    Visible - If TRUE, the cursor is set to be visible,\r
-              If FALSE, the cursor is set to be invisible.\r
-\r
-  Returns:\r
-\r
-    EFI_SUCCESS\r
-      The request is valid.\r
-\r
-    EFI_UNSUPPORTED\r
-      The Graphics Console does not support a hidden cursor.\r
-\r
---*/\r
 {\r
   EFI_TPL               OldTpl;\r
 \r
@@ -1660,7 +1576,6 @@ GraphicsConsoleConOutEnableCursor (
   return EFI_SUCCESS;\r
 }\r
 \r
-STATIC\r
 EFI_STATUS\r
 GetTextColors (\r
   IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *This,\r
@@ -1798,7 +1713,6 @@ DrawUnicodeWeightAtCursorN (
 }\r
 \r
 \r
-STATIC\r
 EFI_STATUS\r
 EraseCursor (\r
   IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *This\r
@@ -1813,8 +1727,8 @@ EraseCursor (
   EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION Foreground;\r
   EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION Background;\r
   EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION BltChar[EFI_GLYPH_HEIGHT][EFI_GLYPH_WIDTH];\r
-  UINTN                       X;\r
-  UINTN                       Y;\r
+  UINTN                       PosX;\r
+  UINTN                       PosY;\r
 \r
   CurrentMode = This->Mode;\r
 \r
@@ -1867,10 +1781,10 @@ EraseCursor (
   //\r
   // Convert Monochrome bitmap of the Glyph to BltBuffer structure\r
   //\r
-  for (Y = 0; Y < EFI_GLYPH_HEIGHT; Y++) {\r
-    for (X = 0; X < EFI_GLYPH_WIDTH; X++) {\r
-      if ((mCursorGlyph.GlyphCol1[Y] & (1 << X)) != 0) {\r
-        BltChar[Y][EFI_GLYPH_WIDTH - X - 1].Raw ^= Foreground.Raw;\r
+  for (PosY = 0; PosY < EFI_GLYPH_HEIGHT; PosY++) {\r
+    for (PosX = 0; PosX < EFI_GLYPH_WIDTH; PosX++) {\r
+      if ((mCursorGlyph.GlyphCol1[PosY] & (1 << PosX)) != 0) {\r
+        BltChar[PosY][EFI_GLYPH_WIDTH - PosX - 1].Raw ^= Foreground.Raw;\r
       }\r
     }\r
   }\r