]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Universal/Console/ConSplitter/Dxe/ConSplitter.c
1. Removed #ifdef EDK_RELEASE_VERSION from all c files for all modules
[mirror_edk2.git] / EdkModulePkg / Universal / Console / ConSplitter / Dxe / ConSplitter.c
index 973f13d0f3e66390dfe70b30760bbbac08ddb7e2..bd18e2562179336a429d42b73aca6b0f276317f9 100644 (file)
@@ -1,30 +1,30 @@
 /**@file\r
-  Console Splitter Driver. Any Handle that attatched \r
+  Console Splitter Driver. Any Handle that attatched\r
   EFI_CONSOLE_IDENTIFIER_PROTOCOL can be bound by this driver.\r
-  \r
-  So far it works like any other driver by opening a SimpleTextIn and/or \r
-  SimpleTextOut protocol with EFI_OPEN_PROTOCOL_BY_DRIVER attributes. The big \r
+\r
+  So far it works like any other driver by opening a SimpleTextIn and/or\r
+  SimpleTextOut protocol with EFI_OPEN_PROTOCOL_BY_DRIVER attributes. The big\r
   difference is this driver does not layer a protocol on the passed in\r
-  handle, or construct a child handle like a standard device or bus driver. \r
-  This driver produces three virtual handles as children, one for console input \r
+  handle, or construct a child handle like a standard device or bus driver.\r
+  This driver produces three virtual handles as children, one for console input\r
   splitter, one for console output splitter and one for error output splitter.\r
-  EFI_CONSOLE_SPLIT_PROTOCOL will be attatched onto each virtual handle to \r
+  EFI_CONSOLE_SPLIT_PROTOCOL will be attatched onto each virtual handle to\r
   identify the splitter type.\r
-  \r
+\r
   Each virtual handle, that supports both the EFI_CONSOLE_SPLIT_PROTOCOL\r
-  and Console I/O protocol, will be produced in the driver entry point. \r
+  and Console I/O protocol, will be produced in the driver entry point.\r
   The virtual handle are added on driver entry and never removed.\r
   Such design ensures sytem function well during none console device situation.\r
 \r
-Copyright (c) 2006 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
-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
-  \r
+Copyright (c) 2006 - 2007 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
+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
+\r
 **/\r
 \r
 #include "ConSplitter.h"\r
@@ -104,18 +104,6 @@ STATIC TEXT_OUT_SPLITTER_PRIVATE_DATA mConOut = {
     0,\r
     FALSE,\r
   },\r
-#if (EFI_SPECIFICATION_VERSION < 0x00020000)\r
-  {\r
-    ConSpliterUgaDrawGetMode,\r
-    ConSpliterUgaDrawSetMode,\r
-    ConSpliterUgaDrawBlt\r
-  },\r
-  0,\r
-  0,\r
-  0,\r
-  0,\r
-  (EFI_UGA_PIXEL *) NULL,\r
-#else\r
   {\r
     ConSpliterGraphicsOutputQueryMode,\r
     ConSpliterGraphicsOutputSetMode,\r
@@ -126,7 +114,6 @@ STATIC TEXT_OUT_SPLITTER_PRIVATE_DATA mConOut = {
   (TEXT_OUT_GOP_MODE *) NULL,\r
   0,\r
   TRUE,\r
-#endif\r
   {\r
     ConSpliterConsoleControlGetMode,\r
     ConSpliterConsoleControlSetMode,\r
@@ -170,18 +157,6 @@ STATIC TEXT_OUT_SPLITTER_PRIVATE_DATA mStdErr = {
     0,\r
     FALSE,\r
   },\r
-#if (EFI_SPECIFICATION_VERSION < 0x00020000)\r
-  {\r
-    ConSpliterUgaDrawGetMode,\r
-    ConSpliterUgaDrawSetMode,\r
-    ConSpliterUgaDrawBlt\r
-  },\r
-  0,\r
-  0,\r
-  0,\r
-  0,\r
-  (EFI_UGA_PIXEL *) NULL,\r
-#else\r
   {\r
     ConSpliterGraphicsOutputQueryMode,\r
     ConSpliterGraphicsOutputSetMode,\r
@@ -192,7 +167,6 @@ STATIC TEXT_OUT_SPLITTER_PRIVATE_DATA mStdErr = {
   (TEXT_OUT_GOP_MODE *) NULL,\r
   0,\r
   TRUE,\r
-#endif\r
   {\r
     ConSpliterConsoleControlGetMode,\r
     ConSpliterConsoleControlSetMode,\r
@@ -259,12 +233,12 @@ ConSplitterDriverEntry (
 \r
 Routine Description:\r
   Intialize a virtual console device to act as an agrigator of physical console\r
-  devices. \r
+  devices.\r
 \r
 Arguments:\r
   ImageHandle - (Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT)\r
   SystemTable - (Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT)\r
-Returns: \r
+Returns:\r
   EFI_SUCCESS\r
 \r
 --*/\r
@@ -318,23 +292,6 @@ Returns:
   //\r
   Status = ConSplitterTextOutConstructor (&mConOut);\r
   if (!EFI_ERROR (Status)) {\r
-#if (EFI_SPECIFICATION_VERSION < 0x00020000)\r
-    //\r
-    // In EFI mode, UGA Draw protocol is installed\r
-    //\r
-    Status = gBS->InstallMultipleProtocolInterfaces (\r
-                    &mConOut.VirtualHandle,\r
-                    &gEfiSimpleTextOutProtocolGuid,\r
-                    &mConOut.TextOut,\r
-                    &gEfiUgaDrawProtocolGuid,\r
-                    &mConOut.UgaDraw,\r
-                    &gEfiConsoleControlProtocolGuid,\r
-                    &mConOut.ConsoleControl,\r
-                    &gEfiPrimaryConsoleOutDeviceGuid,\r
-                    NULL,\r
-                    NULL\r
-                    );\r
-#else\r
     //\r
     // In UEFI mode, Graphics Output Protocol is installed on virtual handle.\r
     //\r
@@ -350,7 +307,6 @@ Returns:
                     NULL,\r
                     NULL\r
                     );\r
-#endif\r
 \r
     if (!EFI_ERROR (Status)) {\r
       //\r
@@ -388,7 +344,7 @@ Arguments:
 \r
   ConInPrivate    - A pointer to the TEXT_IN_SPLITTER_PRIVATE_DATA structure.\r
 \r
-Returns: \r
+Returns:\r
   EFI_OUT_OF_RESOURCES - Out of resources.\r
 \r
 --*/\r
@@ -485,12 +441,6 @@ ConSplitterTextOutConstructor (
   ConOutPrivate->TextOutQueryData[0].Rows     = 25;\r
   DevNullTextOutSetMode (ConOutPrivate, 0);\r
 \r
-#if (EFI_SPECIFICATION_VERSION < 0x00020000)\r
-  //\r
-  // Setup the DevNullUgaDraw to 800 x 600 x 32 bits per pixel\r
-  //\r
-  ConSpliterUgaDrawSetMode (&ConOutPrivate->UgaDraw, 800, 600, 32, 60);\r
-#else\r
   //\r
   // Setup resource for mode information in Graphics Output Protocol interface\r
   //\r
@@ -526,11 +476,11 @@ ConSplitterTextOutConstructor (
   //\r
   ConOutPrivate->GraphicsOutput.Mode->Mode = 0xffff;\r
   ConOutPrivate->GraphicsOutput.SetMode (&ConOutPrivate->GraphicsOutput, 0);\r
-#endif\r
 \r
   return Status;\r
 }\r
 \r
+STATIC\r
 EFI_STATUS\r
 ConSplitterSupported (\r
   IN  EFI_DRIVER_BINDING_PROTOCOL     *This,\r
@@ -717,6 +667,7 @@ Returns:
           );\r
 }\r
 \r
+STATIC\r
 EFI_STATUS\r
 EFIAPI\r
 ConSplitterStart (\r
@@ -730,7 +681,7 @@ ConSplitterStart (
 /*++\r
 \r
 Routine Description:\r
-  Start ConSplitter on ControllerHandle, and create the virtual \r
+  Start ConSplitter on ControllerHandle, and create the virtual\r
   agrogated console device on first call Start for a SimpleTextIn handle.\r
 \r
 Arguments:\r
@@ -791,7 +742,7 @@ ConSplitterConInDriverBindingStart (
 /*++\r
 \r
 Routine Description:\r
-  Start ConSplitter on ControllerHandle, and create the virtual \r
+  Start ConSplitter on ControllerHandle, and create the virtual\r
   agrogated console device on first call Start for a SimpleTextIn handle.\r
 \r
 Arguments:\r
@@ -838,7 +789,7 @@ ConSplitterSimplePointerDriverBindingStart (
 /*++\r
 \r
 Routine Description:\r
-  Start ConSplitter on ControllerHandle, and create the virtual \r
+  Start ConSplitter on ControllerHandle, and create the virtual\r
   agrogated console device on first call Start for a SimpleTextIn handle.\r
 \r
 Arguments:\r
@@ -880,7 +831,7 @@ ConSplitterConOutDriverBindingStart (
 /*++\r
 \r
 Routine Description:\r
-  Start ConSplitter on ControllerHandle, and create the virtual \r
+  Start ConSplitter on ControllerHandle, and create the virtual\r
   agrogated console device on first call Start for a SimpleTextIn handle.\r
 \r
 Arguments:\r
@@ -944,21 +895,6 @@ Returns:
   Status = ConSplitterTextOutAddDevice (&mConOut, TextOut, GraphicsOutput, UgaDraw);\r
   ConSplitterTextOutSetAttribute (&mConOut.TextOut, EFI_TEXT_ATTR (EFI_LIGHTGRAY, EFI_BLACK));\r
 \r
-#if (EFI_SPECIFICATION_VERSION < 0x00020000)\r
-  //\r
-  // Match the UGA mode data of ConOut with the current mode\r
-  //\r
-  if (UgaDraw != NULL) {\r
-    UgaDraw->GetMode (\r
-               UgaDraw,\r
-               &mConOut.UgaHorizontalResolution,\r
-               &mConOut.UgaVerticalResolution,\r
-               &mConOut.UgaColorDepth,\r
-               &mConOut.UgaRefreshRate\r
-               );\r
-  }\r
-#endif\r
-\r
   return Status;\r
 }\r
 \r
@@ -972,7 +908,7 @@ ConSplitterStdErrDriverBindingStart (
 /*++\r
 \r
 Routine Description:\r
-  Start ConSplitter on ControllerHandle, and create the virtual \r
+  Start ConSplitter on ControllerHandle, and create the virtual\r
   agrogated console device on first call Start for a SimpleTextIn handle.\r
 \r
 Arguments:\r
@@ -1026,6 +962,7 @@ Returns:
   return Status;\r
 }\r
 \r
+STATIC\r
 EFI_STATUS\r
 EFIAPI\r
 ConSplitterStop (\r
@@ -1330,7 +1267,7 @@ Returns:
   CopyMem (Ptr, *Buffer, OldSize);\r
 \r
   if (*Buffer != NULL) {\r
-    gBS->FreePool (*Buffer);\r
+    FreePool (*Buffer);\r
   }\r
 \r
   *Buffer = Ptr;\r
@@ -1499,6 +1436,7 @@ Returns:
   return EFI_NOT_FOUND;\r
 }\r
 \r
+STATIC\r
 EFI_STATUS\r
 ConSplitterGrowMapTable (\r
   IN  TEXT_OUT_SPLITTER_PRIVATE_DATA  *Private\r
@@ -1569,12 +1507,13 @@ Returns:
     //\r
     // Free the old buffer\r
     //\r
-    gBS->FreePool (OldTextOutModeMap);\r
+    FreePool (OldTextOutModeMap);\r
   }\r
 \r
   return EFI_SUCCESS;\r
 }\r
 \r
+STATIC\r
 EFI_STATUS\r
 ConSplitterAddOutputMode (\r
   IN  TEXT_OUT_SPLITTER_PRIVATE_DATA  *Private,\r
@@ -1642,6 +1581,7 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
+STATIC\r
 VOID\r
 ConSplitterGetIntersection (\r
   IN  INT32                           *TextOutModeMap,\r
@@ -1694,6 +1634,7 @@ ConSplitterGetIntersection (
   return ;\r
 }\r
 \r
+STATIC\r
 VOID\r
 ConSplitterSyncOutputMode (\r
   IN  TEXT_OUT_SPLITTER_PRIVATE_DATA  *Private,\r
@@ -1712,7 +1653,6 @@ Returns:
 \r
 --*/\r
 {\r
-  INT32                         CurrentMode;\r
   INT32                         CurrentMaxMode;\r
   INT32                         Mode;\r
   INT32                         Index;\r
@@ -1726,7 +1666,6 @@ Returns:
   //\r
   // Must make sure that current mode won't change even if mode number changes\r
   //\r
-  CurrentMode       = Private->TextOutMode.Mode;\r
   CurrentMaxMode    = Private->TextOutMode.MaxMode;\r
   TextOutModeMap    = Private->TextOutModeMap;\r
   StepSize          = Private->TextOutListCount;\r
@@ -1771,6 +1710,7 @@ Returns:
   return ;\r
 }\r
 \r
+STATIC\r
 EFI_STATUS\r
 ConSplitterGetIntersectionBetweenConOutAndStrErr (\r
   VOID\r
@@ -1796,8 +1736,6 @@ Returns:
   UINTN                         Indexj;\r
   UINTN                         Rows;\r
   UINTN                         Columns;\r
-  INT32                         ConOutCurrentMode;\r
-  INT32                         StdErrCurrentMode;\r
   INT32                         ConOutMaxMode;\r
   INT32                         StdErrMaxMode;\r
   INT32                         Mode;\r
@@ -1808,8 +1746,6 @@ Returns:
   INT32                         *StdErrMapTable;\r
   TEXT_OUT_SPLITTER_QUERY_DATA  *ConOutQueryData;\r
   TEXT_OUT_SPLITTER_QUERY_DATA  *StdErrQueryData;\r
-  UINTN                         ConOutStepSize;\r
-  UINTN                         StdErrStepSize;\r
   BOOLEAN                       FoundTheSameTextOut;\r
   UINTN                         ConOutMapTableSize;\r
   UINTN                         StdErrMapTableSize;\r
@@ -1843,16 +1779,12 @@ Returns:
   //\r
   // Must make sure that current mode won't change even if mode number changes\r
   //\r
-  ConOutCurrentMode = mConOut.TextOutMode.Mode;\r
   ConOutMaxMode     = mConOut.TextOutMode.MaxMode;\r
   ConOutModeMap     = mConOut.TextOutModeMap;\r
-  ConOutStepSize    = mConOut.TextOutListCount;\r
   ConOutQueryData   = mConOut.TextOutQueryData;\r
 \r
-  StdErrCurrentMode = mStdErr.TextOutMode.Mode;\r
   StdErrMaxMode     = mStdErr.TextOutMode.MaxMode;\r
   StdErrModeMap     = mStdErr.TextOutModeMap;\r
-  StdErrStepSize    = mStdErr.TextOutListCount;\r
   StdErrQueryData   = mStdErr.TextOutQueryData;\r
 \r
   //\r
@@ -1926,13 +1858,13 @@ Returns:
     mStdErr.TextOut.SetMode (&(mStdErr.TextOut), 0);\r
   }\r
 \r
-  gBS->FreePool (ConOutMapTable);\r
-  gBS->FreePool (StdErrMapTable);\r
+  FreePool (ConOutMapTable);\r
+  FreePool (StdErrMapTable);\r
 \r
   return EFI_SUCCESS;\r
 }\r
 \r
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
+STATIC\r
 EFI_STATUS\r
 ConSplitterAddGraphicsOutputMode (\r
   IN  TEXT_OUT_SPLITTER_PRIVATE_DATA  *Private,\r
@@ -1987,7 +1919,7 @@ Returns:
         if (ModeBuffer == NULL) {\r
           return EFI_OUT_OF_RESOURCES;\r
         }\r
-        gBS->FreePool (Private->GraphicsOutputModeBuffer);\r
+        FreePool (Private->GraphicsOutputModeBuffer);\r
         Private->GraphicsOutputModeBuffer = ModeBuffer;\r
 \r
         //\r
@@ -2002,7 +1934,7 @@ Returns:
           Mode->HorizontalResolution = Info->HorizontalResolution;\r
           Mode->VerticalResolution = Info->VerticalResolution;\r
           Mode++;\r
-          gBS->FreePool (Info);\r
+          FreePool (Info);\r
         }\r
     } else {\r
       //\r
@@ -2026,10 +1958,10 @@ Returns:
           if ((Info->HorizontalResolution == Mode->HorizontalResolution) &&\r
               (Info->VerticalResolution == Mode->VerticalResolution)){\r
             Match = TRUE;\r
-            gBS->FreePool (Info);\r
+            FreePool (Info);\r
             break;\r
           }\r
-          gBS->FreePool (Info);\r
+          FreePool (Info);\r
         }\r
 \r
         if (Match) {\r
@@ -2043,7 +1975,7 @@ Returns:
       //\r
       // Drop the old mode buffer, assign it to a new one\r
       //\r
-      gBS->FreePool (Private->GraphicsOutputModeBuffer);\r
+      FreePool (Private->GraphicsOutputModeBuffer);\r
       Private->GraphicsOutputModeBuffer = ModeBuffer;\r
 \r
       //\r
@@ -2117,7 +2049,6 @@ Returns:
 \r
   return Status;\r
 }\r
-#endif\r
 \r
 EFI_STATUS\r
 ConSplitterTextOutAddDevice (\r
@@ -2208,21 +2139,15 @@ Returns:
   MaxMode     = Private->TextOutMode.MaxMode;\r
   ASSERT (MaxMode >= 1);\r
 \r
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
   if ((GraphicsOutput != NULL) || (UgaDraw != NULL)) {\r
     ConSplitterAddGraphicsOutputMode (Private, GraphicsOutput, UgaDraw);\r
   }\r
-#endif\r
 \r
   if (Private->ConsoleOutputMode == EfiConsoleControlScreenGraphics && GraphicsOutput != NULL) {\r
     //\r
     // We just added a new UGA device in graphics mode\r
     //\r
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
     DevNullGopSync (Private, GraphicsOutput, UgaDraw);\r
-#else\r
-    DevNullUgaSync (Private, UgaDraw);\r
-#endif\r
   } else if ((CurrentMode >= 0) && ((GraphicsOutput != NULL) || (UgaDraw != NULL)) && (CurrentMode < Private->TextOutMode.MaxMode)) {\r
     //\r
     // The new console supports the same mode of the current console so sync up\r
@@ -2306,7 +2231,7 @@ Returns:
     Private->TextOutQueryDataCount * sizeof (TEXT_OUT_SPLITTER_QUERY_DATA)\r
     );\r
 \r
-  gBS->FreePool (Private->TextOutModeMap);\r
+  FreePool (Private->TextOutModeMap);\r
   Private->TextOutModeMap = NULL;\r
   TextOutList             = Private->TextOutList;\r
 \r
@@ -2352,7 +2277,7 @@ ConSplitterTextInReset (
 \r
   Returns:\r
     EFI_SUCCESS           - The device was reset.\r
-    EFI_DEVICE_ERROR      - The device is not functioning properly and could \r
+    EFI_DEVICE_ERROR      - The device is not functioning properly and could\r
                             not be reset.\r
 \r
 --*/\r
@@ -2391,7 +2316,7 @@ ConSplitterTextInPrivateReadKeyStroke (
 /*++\r
 \r
   Routine Description:\r
-    Reads the next keystroke from the input device. The WaitForKey Event can \r
+    Reads the next keystroke from the input device. The WaitForKey Event can\r
     be used to test for existance of a keystroke via WaitForEvent () call.\r
 \r
   Arguments:\r
@@ -2401,7 +2326,7 @@ ConSplitterTextInPrivateReadKeyStroke (
   Returns:\r
     EFI_SUCCESS       - The keystroke information was returned.\r
     EFI_NOT_READY     - There was no keystroke data availiable.\r
-    EFI_DEVICE_ERROR  - The keydtroke information was not returned due to \r
+    EFI_DEVICE_ERROR  - The keydtroke information was not returned due to\r
                         hardware errors.\r
 \r
 --*/\r
@@ -2463,14 +2388,14 @@ ConSpliterConsoleControlLockStdInEvent (
 /*++\r
 \r
 Routine Description:\r
-  This timer event will fire when StdIn is locked. It will check the key \r
+  This timer event will fire when StdIn is locked. It will check the key\r
   sequence on StdIn to see if it matches the password. Any error in the\r
   password will cause the check to reset. As long a mConIn.PasswordEnabled is\r
   TRUE the StdIn splitter will not report any input.\r
 \r
 Arguments:\r
   (Standard EFI_EVENT_NOTIFY)\r
-  \r
+\r
 Returns:\r
   None\r
 \r
@@ -2547,7 +2472,7 @@ ConSpliterConsoleControlLockStdIn (
 /*++\r
 \r
 Routine Description:\r
-  If Password is NULL unlock the password state variable and set the event \r
+  If Password is NULL unlock the password state variable and set the event\r
   timer. If the Password is too big return an error. If the Password is valid\r
   Copy the Password and enable state variable and then arm the periodic timer\r
 \r
@@ -2590,7 +2515,7 @@ ConSplitterTextInReadKeyStroke (
 /*++\r
 \r
   Routine Description:\r
-    Reads the next keystroke from the input device. The WaitForKey Event can \r
+    Reads the next keystroke from the input device. The WaitForKey Event can\r
     be used to test for existance of a keystroke via WaitForEvent () call.\r
     If the ConIn is password locked make it look like no keystroke is availible\r
 \r
@@ -2601,7 +2526,7 @@ ConSplitterTextInReadKeyStroke (
   Returns:\r
     EFI_SUCCESS       - The keystroke information was returned.\r
     EFI_NOT_READY     - There was no keystroke data availiable.\r
-    EFI_DEVICE_ERROR  - The keydtroke information was not returned due to \r
+    EFI_DEVICE_ERROR  - The keydtroke information was not returned due to\r
                         hardware errors.\r
 \r
 --*/\r
@@ -2633,7 +2558,7 @@ Routine Description:
   This event agregates all the events of the ConIn devices in the spliter.\r
   If the ConIn is password locked then return.\r
   If any events of physical ConIn devices are signaled, signal the ConIn\r
-  spliter event. This will cause the calling code to call \r
+  spliter event. This will cause the calling code to call\r
   ConSplitterTextInReadKeyStroke ().\r
 \r
 Arguments:\r
@@ -2693,7 +2618,7 @@ ConSplitterSimplePointerReset (
 \r
   Returns:\r
     EFI_SUCCESS           - The device was reset.\r
-    EFI_DEVICE_ERROR      - The device is not functioning properly and could \r
+    EFI_DEVICE_ERROR      - The device is not functioning properly and could\r
                             not be reset.\r
 \r
 --*/\r
@@ -2726,6 +2651,7 @@ ConSplitterSimplePointerReset (
   return ReturnStatus;\r
 }\r
 \r
+STATIC\r
 EFI_STATUS\r
 EFIAPI\r
 ConSplitterSimplePointerPrivateGetState (\r
@@ -2735,17 +2661,17 @@ ConSplitterSimplePointerPrivateGetState (
 /*++\r
 \r
   Routine Description:\r
-    Reads the next keystroke from the input device. The WaitForKey Event can \r
+    Reads the next keystroke from the input device. The WaitForKey Event can\r
     be used to test for existance of a keystroke via WaitForEvent () call.\r
 \r
   Arguments:\r
     This   - Protocol instance pointer.\r
-    State  - \r
+    State  -\r
 \r
   Returns:\r
     EFI_SUCCESS       - The keystroke information was returned.\r
     EFI_NOT_READY     - There was no keystroke data availiable.\r
-    EFI_DEVICE_ERROR  - The keydtroke information was not returned due to \r
+    EFI_DEVICE_ERROR  - The keydtroke information was not returned due to\r
                         hardware errors.\r
 \r
 --*/\r
@@ -2814,18 +2740,18 @@ ConSplitterSimplePointerGetState (
 /*++\r
 \r
   Routine Description:\r
-    Reads the next keystroke from the input device. The WaitForKey Event can \r
+    Reads the next keystroke from the input device. The WaitForKey Event can\r
     be used to test for existance of a keystroke via WaitForEvent () call.\r
     If the ConIn is password locked make it look like no keystroke is availible\r
 \r
   Arguments:\r
     This   - Protocol instance pointer.\r
-    State  - \r
+    State  -\r
 \r
   Returns:\r
     EFI_SUCCESS       - The keystroke information was returned.\r
     EFI_NOT_READY     - There was no keystroke data availiable.\r
-    EFI_DEVICE_ERROR  - The keydtroke information was not returned due to \r
+    EFI_DEVICE_ERROR  - The keydtroke information was not returned due to\r
                         hardware errors.\r
 \r
 --*/\r
@@ -2857,7 +2783,7 @@ Routine Description:
   This event agregates all the events of the ConIn devices in the spliter.\r
   If the ConIn is password locked then return.\r
   If any events of physical ConIn devices are signaled, signal the ConIn\r
-  spliter event. This will cause the calling code to call \r
+  spliter event. This will cause the calling code to call\r
   ConSplitterTextInReadKeyStroke ().\r
 \r
 Arguments:\r
@@ -2913,7 +2839,7 @@ ConSplitterTextOutReset (
 \r
   Arguments:\r
     This                 - Protocol instance pointer.\r
-    ExtendedVerification - Driver may perform more exhaustive verfication \r
+    ExtendedVerification - Driver may perform more exhaustive verfication\r
                            operation of the device during reset.\r
 \r
   Returns:\r
@@ -2971,17 +2897,17 @@ ConSplitterTextOutOutputString (
   Arguments:\r
     This    - Protocol instance pointer.\r
     String  - The NULL-terminated Unicode string to be displayed on the output\r
-              device(s). All output devices must also support the Unicode \r
+              device(s). All output devices must also support the Unicode\r
               drawing defined in this file.\r
 \r
   Returns:\r
     EFI_SUCCESS       - The string was output to the device.\r
     EFI_DEVICE_ERROR  - The device reported an error while attempting to output\r
                          the text.\r
-    EFI_UNSUPPORTED        - The output device's mode is not currently in a \r
+    EFI_UNSUPPORTED        - The output device's mode is not currently in a\r
                               defined text mode.\r
-    EFI_WARN_UNKNOWN_GLYPH - This warning code indicates that some of the \r
-                              characters in the Unicode string could not be \r
+    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
@@ -3033,7 +2959,7 @@ ConSplitterTextOutOutputString (
   }\r
 \r
   if (BackSpaceCount) {\r
-    gBS->FreePool (TargetString);\r
+    FreePool (TargetString);\r
   }\r
 \r
   return ReturnStatus;\r
@@ -3048,7 +2974,7 @@ ConSplitterTextOutTestString (
 /*++\r
 \r
   Routine Description:\r
-    Verifies that all characters in a Unicode string can be output to the \r
+    Verifies that all characters in a Unicode string can be output to the\r
     target device.\r
 \r
   Arguments:\r
@@ -3058,8 +2984,8 @@ ConSplitterTextOutTestString (
 \r
   Returns:\r
     EFI_SUCCESS     - The device(s) are capable of rendering the output string.\r
-    EFI_UNSUPPORTED - Some of the characters in the Unicode string cannot be \r
-                       rendered by one or more of the output devices mapped \r
+    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
@@ -3115,7 +3041,7 @@ ConSplitterTextOutQueryMode (
 \r
   Returns:\r
     EFI_SUCCESS      - The requested mode information was returned.\r
-    EFI_DEVICE_ERROR - The device had an error and could not \r
+    EFI_DEVICE_ERROR - The device had an error and could not\r
                        complete the request.\r
     EFI_UNSUPPORTED - The mode number was not valid.\r
 \r
@@ -3132,7 +3058,7 @@ ConSplitterTextOutQueryMode (
   if ( (ModeNumber > (UINTN)(((UINT32)-1)>>1)) ) {\r
     return EFI_UNSUPPORTED;\r
   }\r
-  \r
+\r
   if ((INT32) ModeNumber >= This->Mode->MaxMode) {\r
     return EFI_UNSUPPORTED;\r
   }\r
@@ -3165,7 +3091,7 @@ ConSplitterTextOutSetMode (
 \r
   Returns:\r
     EFI_SUCCESS      - The requested text mode was set.\r
-    EFI_DEVICE_ERROR - The device had an error and \r
+    EFI_DEVICE_ERROR - The device had an error and\r
                        could not complete the request.\r
     EFI_UNSUPPORTED - The mode number was not valid.\r
 \r
@@ -3251,7 +3177,7 @@ ConSplitterTextOutSetAttribute (
 \r
   Returns:\r
     EFI_SUCCESS      - The attribute was set.\r
-    EFI_DEVICE_ERROR - The device had an error and \r
+    EFI_DEVICE_ERROR - The device had an error and\r
                        could not complete the request.\r
     EFI_UNSUPPORTED - The attribute requested is not defined.\r
 \r
@@ -3269,7 +3195,7 @@ ConSplitterTextOutSetAttribute (
   //\r
   if ( (Attribute > (UINTN)(((UINT32)-1)>>1)) ) {\r
     return EFI_UNSUPPORTED;\r
-  }  \r
+  }\r
 \r
   //\r
   // return the worst status met\r
@@ -3300,7 +3226,7 @@ ConSplitterTextOutClearScreen (
 /*++\r
 \r
   Routine Description:\r
-    Clears the output device(s) display to the currently selected background \r
+    Clears the output device(s) display to the currently selected background\r
     color.\r
 \r
   Arguments:\r
@@ -3308,7 +3234,7 @@ ConSplitterTextOutClearScreen (
 \r
   Returns:\r
     EFI_SUCCESS      - The operation completed successfully.\r
-    EFI_DEVICE_ERROR - The device had an error and \r
+    EFI_DEVICE_ERROR - The device had an error and\r
                        could not complete the request.\r
     EFI_UNSUPPORTED - The output device is not in a valid text mode.\r
 \r
@@ -3362,9 +3288,9 @@ ConSplitterTextOutSetCursorPosition (
 \r
   Returns:\r
     EFI_SUCCESS      - The operation completed successfully.\r
-    EFI_DEVICE_ERROR - The device had an error and \r
+    EFI_DEVICE_ERROR - The device had an error and\r
                        could not complete the request.\r
-    EFI_UNSUPPORTED - The output device is not in a valid text mode, or the \r
+    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
@@ -3424,7 +3350,7 @@ ConSplitterTextOutEnableCursor (
 \r
   Returns:\r
     EFI_SUCCESS      - The operation completed successfully.\r
-    EFI_DEVICE_ERROR - The device had an error and could not complete the \r
+    EFI_DEVICE_ERROR - The device had an error and could not complete the\r
                         request, or the device does not support changing\r
                         the cursor mode.\r
     EFI_UNSUPPORTED - The output device is not in a valid text mode.\r