]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Code scrub for Universal\Console\TerminalDxe.
authorgikidy <gikidy@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 17 Dec 2008 09:34:06 +0000 (09:34 +0000)
committergikidy <gikidy@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 17 Dec 2008 09:34:06 +0000 (09:34 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7066 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/Console/TerminalDxe/Ansi.c
MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h
MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf

index 3d2982f87ed110203dd3fe2cf179f1391985de42..58d35f125624982e375309ffec902f62a5b0251b 100644 (file)
@@ -16,7 +16,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include "Terminal.h"\r
 \r
 /**\r
-  Translate all raw data in the Raw FIFI into unicode, and insert\r
+  Translate all raw data in the Raw FIFO into unicode, and insert\r
   them into Unicode FIFO.\r
 \r
   @param TerminalDevice          The terminal device.\r
index a8e4a1a0b21ea6ee271ef1fefd44072526d0b065..ac1e38838dcb868971309a3f6477c8f362470271 100644 (file)
@@ -1,5 +1,5 @@
 /** @file\r
-  Produces Simple Text Input Protocl, Simple Text Input Extended Protocol and\r
+  Produces Simple Text Input Protocol, Simple Text Input Extended Protocol and\r
   Simple Text Output Protocol upon Serial IO Protocol.\r
 \r
 Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
@@ -62,30 +62,30 @@ TERMINAL_DEV  mTerminalDevTemplate = {
   },\r
   {   // SimpleTextOutputMode\r
     1,                                           // MaxMode\r
-    0,                                           // Mode?\r
+    0,                                           // Mode\r
     EFI_TEXT_ATTR (EFI_LIGHTGRAY, EFI_BLACK),    // Attribute\r
     0,                                           // CursorColumn\r
     0,                                           // CursorRow\r
     TRUE                                         // CursorVisible\r
   },\r
-  0,\r
-  {\r
+  0,  // SerialInTimeOut\r
+  {   // RawFiFo\r
     0,\r
     0,\r
     { 0 }\r
   },\r
-  {\r
+  {  // UnicodeFiFo\r
     0,\r
     0,\r
     { 0 }\r
   },\r
-  {\r
+  {  // EfiKeyFiFo\r
     0,\r
     0,\r
     { {0} }\r
   },\r
   NULL, // ControllerNameTable\r
-  NULL,\r
+  NULL, // TwoSecondTimeOut\r
   INPUT_STATE_DEFAULT,\r
   RESET_STATE_DEFAULT,\r
   FALSE,\r
@@ -97,27 +97,12 @@ TERMINAL_DEV  mTerminalDevTemplate = {
     TerminalConInRegisterKeyNotify,\r
     TerminalConInUnregisterKeyNotify,\r
   },\r
-  {\r
+  {   // NotifyList\r
     NULL,\r
     NULL,\r
   }\r
 };\r
 \r
-\r
-/**\r
-  Free notify functions list.\r
-\r
-  @param  ListHead               The list head\r
-\r
-  @retval EFI_SUCCESS            Free the notify list successfully.\r
-  @retval EFI_INVALID_PARAMETER  ListHead is NULL.\r
-\r
-**/\r
-EFI_STATUS\r
-TerminalFreeNotifyList (\r
-  IN OUT LIST_ENTRY           *ListHead\r
-  );\r
-\r
 /**\r
   Test to see if this driver supports Controller. \r
 \r
@@ -266,6 +251,7 @@ TerminalDriverBindingStart (
   UINTN                               EntryCount;\r
   UINTN                               Index;\r
   EFI_DEVICE_PATH_PROTOCOL            *DevicePath;\r
+  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL     SimpleTextOutput;\r
 \r
   TerminalDevice = NULL;\r
   DefaultNode    = NULL;\r
@@ -504,50 +490,52 @@ TerminalDriverBindingStart (
   //\r
   // Simple Text Output Protocol\r
   //\r
-  TerminalDevice->SimpleTextOutput.Reset              = TerminalConOutReset;\r
-  TerminalDevice->SimpleTextOutput.OutputString       = TerminalConOutOutputString;\r
-  TerminalDevice->SimpleTextOutput.TestString         = TerminalConOutTestString;\r
-  TerminalDevice->SimpleTextOutput.QueryMode          = TerminalConOutQueryMode;\r
-  TerminalDevice->SimpleTextOutput.SetMode            = TerminalConOutSetMode;\r
-  TerminalDevice->SimpleTextOutput.SetAttribute       = TerminalConOutSetAttribute;\r
-  TerminalDevice->SimpleTextOutput.ClearScreen        = TerminalConOutClearScreen;\r
-  TerminalDevice->SimpleTextOutput.SetCursorPosition  = TerminalConOutSetCursorPosition;\r
-  TerminalDevice->SimpleTextOutput.EnableCursor       = TerminalConOutEnableCursor;\r
-  TerminalDevice->SimpleTextOutput.Mode               = &TerminalDevice->SimpleTextOutputMode;\r
+  SimpleTextOutput = TerminalDevice->SimpleTextOutput;\r
+  \r
+  SimpleTextOutput.Reset              = TerminalConOutReset;\r
+  SimpleTextOutput.OutputString       = TerminalConOutOutputString;\r
+  SimpleTextOutput.TestString         = TerminalConOutTestString;\r
+  SimpleTextOutput.QueryMode          = TerminalConOutQueryMode;\r
+  SimpleTextOutput.SetMode            = TerminalConOutSetMode;\r
+  SimpleTextOutput.SetAttribute       = TerminalConOutSetAttribute;\r
+  SimpleTextOutput.ClearScreen        = TerminalConOutClearScreen;\r
+  SimpleTextOutput.SetCursorPosition  = TerminalConOutSetCursorPosition;\r
+  SimpleTextOutput.EnableCursor       = TerminalConOutEnableCursor;\r
+  SimpleTextOutput.Mode               = &TerminalDevice->SimpleTextOutputMode;\r
 \r
   TerminalDevice->SimpleTextOutputMode.MaxMode        = 3;\r
   //\r
   // For terminal devices, cursor is always visible\r
   //\r
   TerminalDevice->SimpleTextOutputMode.CursorVisible  = TRUE;\r
-  Status = TerminalDevice->SimpleTextOutput.SetAttribute (\r
-                                                      &TerminalDevice->SimpleTextOutput,\r
-                                                      EFI_TEXT_ATTR (EFI_LIGHTGRAY, EFI_BLACK)\r
-                                                      );\r
+  Status = SimpleTextOutput.SetAttribute (\r
+                                       &TerminalDevice->SimpleTextOutput,\r
+                                       EFI_TEXT_ATTR (EFI_LIGHTGRAY, EFI_BLACK)\r
+                                       );\r
   if (EFI_ERROR (Status)) {\r
     goto ReportError;\r
   }\r
 \r
-  Status = TerminalDevice->SimpleTextOutput.Reset (\r
-                                              &TerminalDevice->SimpleTextOutput,\r
-                                              FALSE\r
-                                              );\r
+  Status = SimpleTextOutput.Reset (\r
+                               &TerminalDevice->SimpleTextOutput,\r
+                               FALSE\r
+                               );\r
   if (EFI_ERROR (Status)) {\r
     goto ReportError;\r
   }\r
 \r
-  Status = TerminalDevice->SimpleTextOutput.SetMode (\r
-                                              &TerminalDevice->SimpleTextOutput,\r
-                                              0\r
-                                              );\r
+  Status = SimpleTextOutput.SetMode (\r
+                                &TerminalDevice->SimpleTextOutput,\r
+                                0\r
+                                );\r
   if (EFI_ERROR (Status)) {\r
     goto ReportError;\r
   }\r
 \r
-  Status = TerminalDevice->SimpleTextOutput.EnableCursor (\r
-                                              &TerminalDevice->SimpleTextOutput,\r
-                                              TRUE\r
-                                              );\r
+  Status = SimpleTextOutput.EnableCursor (\r
+                                     &TerminalDevice->SimpleTextOutput,\r
+                                     TRUE\r
+                                     );\r
   if (EFI_ERROR (Status)) {\r
     goto ReportError;\r
   }\r
@@ -983,7 +971,7 @@ TerminalFreeNotifyList (
   Update terminal device path in Console Device Environment Variables.\r
 \r
   @param  VariableName           The Console Device Environment Variable.\r
-  @param  ParentDevicePath       The terminal devcie path to be updated.\r
+  @param  ParentDevicePath       The terminal device path to be updated.\r
 \r
   @return None.\r
 \r
@@ -1048,7 +1036,7 @@ TerminalUpdateConsoleDevVariable (
   Remove terminal device path from Console Device Environment Variables.\r
 \r
   @param  VariableName           Console Device Environment Variables.\r
-  @param  ParentDevicePath       The terminal devcie path to be updated.\r
+  @param  ParentDevicePath       The terminal device path to be updated.\r
 \r
   @return None.\r
 \r
@@ -1112,7 +1100,7 @@ TerminalRemoveConsoleDevVariable (
       SetTerminalDevicePath (TerminalType, ParentDevicePath, &TempDevicePath);\r
 \r
       //\r
-      // Compare the genterated device path to the current device path instance\r
+      // Compare the generated device path to the current device path instance\r
       //\r
       if (TempDevicePath != NULL) {\r
         if (CompareMem (Instance, TempDevicePath, InstanceSize) == 0) {\r
@@ -1172,8 +1160,8 @@ TerminalRemoveConsoleDevVariable (
   @param  VariableSize           Returns the size of the EFI variable that was read\r
 \r
   @return Dynamically allocated memory that contains a copy of the EFI variable.\r
-          Caller is repsoncible freeing the buffer. If variable was not read, \r
-          NULL regturned.\r
+          Caller is responsible freeing the buffer. If variable was not read, \r
+          NULL returned.\r
 \r
 **/\r
 VOID *\r
@@ -1238,10 +1226,10 @@ TerminalGetVariableAndSize (
 }\r
 \r
 /**\r
-  Build termial device path according to terminal type.\r
+  Build terminal device path according to terminal type.\r
 \r
   @param  TerminalType           The terminal type is PC ANSI, VT100, VT100+ or VT-UTF8.\r
-  @param  ParentDevicePath       Parent devcie path.\r
+  @param  ParentDevicePath       Parent device path.\r
   @param  TerminalDevicePath     Returned terminal device path, if building successfully.\r
 \r
   @retval EFI_UNSUPPORTED        Terminal does not belong to the supported type.\r
@@ -1324,7 +1312,7 @@ InitializeRawFiFo (
   )\r
 {\r
   //\r
-  // Make the raw fifo empty.\r
+  // Make the raw FIFO empty.\r
   //\r
   TerminalDevice->RawFiFo.Head = TerminalDevice->RawFiFo.Tail;\r
 }\r
@@ -1343,7 +1331,7 @@ InitializeUnicodeFiFo (
   )\r
 {\r
   //\r
-  // Make the unicode fifo empty\r
+  // Make the unicode FIFO empty\r
   //\r
   TerminalDevice->UnicodeFiFo.Head = TerminalDevice->UnicodeFiFo.Tail;\r
 }\r
@@ -1362,7 +1350,7 @@ InitializeEfiKeyFiFo (
   )\r
 {\r
   //\r
-  // Make the efi key fifo empty\r
+  // Make the efi key FIFO empty\r
   //\r
   TerminalDevice->EfiKeyFiFo.Head = TerminalDevice->EfiKeyFiFo.Tail;\r
 }\r
@@ -1400,6 +1388,5 @@ InitializeTerminal(
              );\r
   ASSERT_EFI_ERROR (Status);\r
 \r
-\r
   return Status;\r
 }\r
index 1aedfee78856e858f6610336bcbb22f721c377c1..1cea44b489928ec596423bfa65dbf49484259084 100644 (file)
@@ -265,7 +265,7 @@ TerminalConInWaitForKeyEx (
 //\r
 \r
 /**\r
-  Reset the input device and optionaly run diagnostics\r
+  Reset the input device and optionally run diagnostics\r
 \r
   @param  This                     Protocol instance pointer.\r
   @param  ExtendedVerification     Driver may perform diagnostics on reset.\r
@@ -284,7 +284,7 @@ TerminalConInResetEx (
 \r
 /**\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
+  be used to test for existence of a keystroke via WaitForEvent () call.\r
 \r
   @param  This                     Protocol instance pointer.\r
   @param  KeyData                  A pointer to a buffer that is filled in with the\r
@@ -292,7 +292,7 @@ TerminalConInResetEx (
                                    pressed.\r
 \r
   @retval EFI_SUCCESS              The keystroke information was returned.\r
-  @retval EFI_NOT_READY            There was no keystroke data availiable.\r
+  @retval EFI_NOT_READY            There was no keystroke data available.\r
   @retval EFI_DEVICE_ERROR         The keystroke information was not returned due\r
                                    to hardware errors.\r
   @retval EFI_INVALID_PARAMETER    KeyData is NULL.\r
@@ -652,6 +652,20 @@ TerminalDriverBindingStop (
   IN  EFI_HANDLE                     *ChildHandleBuffer\r
   );\r
 \r
+/**\r
+  Free notify functions list.\r
+\r
+  @param  ListHead               The list head\r
+\r
+  @retval EFI_SUCCESS            Free the notify list successfully.\r
+  @retval EFI_INVALID_PARAMETER  ListHead is NULL.\r
+\r
+**/\r
+EFI_STATUS\r
+TerminalFreeNotifyList (\r
+                        IN OUT LIST_ENTRY           *ListHead\r
+                        );\r
+\r
 /**\r
   Retrieves a Unicode string that is the user readable name of the driver.\r
 \r
@@ -790,7 +804,7 @@ TerminalComponentNameGetControllerName (
 \r
   @retval EFI_SUCCESS              There is key pending.\r
   @retval EFI_NOT_READY            There is no key pending.\r
-  @retval EFI_DEVICE_ERROR         If Serial IO is not attched to serial device.\r
+  @retval EFI_DEVICE_ERROR         If Serial IO is not attached to serial device.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -802,7 +816,7 @@ TerminalConInCheckForKey (
   Update terminal device path in Console Device Environment Variables.\r
 \r
   @param  VariableName           The Console Device Environment Variable.\r
-  @param  ParentDevicePath       The terminal devcie path to be updated.\r
+  @param  ParentDevicePath       The terminal device path to be updated.\r
 \r
   @return None.\r
 \r
@@ -852,7 +866,7 @@ TerminalGetVariableAndSize (
   Build termial device path according to terminal type.\r
 \r
   @param  TerminalType           The terminal type is PC ANSI, VT100, VT100+ or VT-UTF8.\r
-  @param  ParentDevicePath       Parent devcie path.\r
+  @param  ParentDevicePath       Parent device path.\r
   @param  TerminalDevicePath     Returned terminal device path, if building successfully.\r
 \r
   @retval EFI_UNSUPPORTED        Terminal does not belong to the supported type.\r
@@ -1277,9 +1291,9 @@ VTUTF8TestString (
 \r
   UTF8 Encoding Table\r
   Bits per Character | Unicode Character Range | Unicode Binary  Encoding |    UTF8 Binary Encoding\r
-        0-7             |     0x0000 - 0x007F     |     00000000 0xxxxxxx        |   0xxxxxxx\r
-        8-11          |     0x0080 - 0x07FF       |     00000xxx xxxxxxxx        |   110xxxxx 10xxxxxx\r
-       12-16          |     0x0800 - 0xFFFF       |     xxxxxxxx xxxxxxxx        |   1110xxxx 10xxxxxx 10xxxxxx\r
+        0-7             |     0x0000 - 0x007F      |     00000000 0xxxxxxx        |   0xxxxxxx\r
+        8-11          |     0x0080 - 0x07FF        |     00000xxx xxxxxxxx       |   110xxxxx 10xxxxxx\r
+       12-16           |     0x0800 - 0xFFFF       |     xxxxxxxx xxxxxxxx        |   1110xxxx 10xxxxxx 10xxxxxx\r
 \r
 \r
   @param  Unicode          Unicode character need translating.\r
@@ -1318,9 +1332,9 @@ GetOneValidUtf8Char (
 \r
   UTF8 Encoding Table\r
   Bits per Character | Unicode Character Range | Unicode Binary  Encoding |    UTF8 Binary Encoding\r
-        0-7             |     0x0000 - 0x007F     |     00000000 0xxxxxxx        |   0xxxxxxx\r
-        8-11          |     0x0080 - 0x07FF       |     00000xxx xxxxxxxx        |   110xxxxx 10xxxxxx\r
-       12-16          |     0x0800 - 0xFFFF       |     xxxxxxxx xxxxxxxx        |   1110xxxx 10xxxxxx 10xxxxxx\r
+        0-7             |     0x0000 - 0x007F      |     00000000 0xxxxxxx        |   0xxxxxxx\r
+        8-11          |     0x0080 - 0x07FF        |     00000xxx xxxxxxxx       |   110xxxxx 10xxxxxx\r
+       12-16           |     0x0800 - 0xFFFF       |     xxxxxxxx xxxxxxxx        |   1110xxxx 10xxxxxx 10xxxxxx\r
 \r
 \r
   @param  Utf8Char         VT-UTF8 character set needs translating.\r
index b82ff3d8afcf76e0563c71cb78975ac1330de3cd..406dcb794245f5e0e882ee43a681bcfb1271d9b7 100644 (file)
@@ -17,7 +17,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 /**\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
+  be used to test for existence of a keystroke via WaitForEvent () call.\r
 \r
   @param  TerminalDevice           Terminal driver private structure\r
   @param  KeyData                  A pointer to a buffer that is filled in with the\r
@@ -25,7 +25,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                                    pressed.\r
 \r
   @retval EFI_SUCCESS              The keystroke information was returned.\r
-  @retval EFI_NOT_READY            There was no keystroke data availiable.\r
+  @retval EFI_NOT_READY            There was no keystroke data available.\r
   @retval EFI_DEVICE_ERROR         The keystroke information was not returned due\r
                                    to hardware errors.\r
   @retval EFI_INVALID_PARAMETER    KeyData is NULL.\r
@@ -39,6 +39,7 @@ ReadKeyStrokeWorker (
 {\r
   EFI_STATUS                      Status;\r
   LIST_ENTRY                      *Link;\r
+  LIST_ENTRY                      *NotifyList;\r
   TERMINAL_CONSOLE_IN_EX_NOTIFY   *CurrentNotify;\r
 \r
   if (KeyData == NULL) {\r
@@ -66,7 +67,8 @@ ReadKeyStrokeWorker (
   //\r
   // Invoke notification functions if exist\r
   //\r
-  for (Link = TerminalDevice->NotifyList.ForwardLink; Link != &TerminalDevice->NotifyList; Link = Link->ForwardLink) {\r
+  NotifyList = &TerminalDevice->NotifyList;\r
+  for (Link = GetFirstNode (NotifyList); !IsNull (NotifyList,Link); Link = GetNextNode (NotifyList,Link)) {\r
     CurrentNotify = CR (\r
                       Link,\r
                       TERMINAL_CONSOLE_IN_EX_NOTIFY,\r
@@ -177,6 +179,8 @@ TerminalConInReadKeyStroke (
 \r
 /**\r
   Check if the key already has been registered.\r
+  \r
+  If both RegsiteredData and InputData is NULL, then ASSERT().\r
 \r
   @param  RegsiteredData           A pointer to a buffer that is filled in with the\r
                                    keystroke state data for the key that was\r
@@ -237,7 +241,7 @@ TerminalConInWaitForKeyEx (
 //\r
 \r
 /**\r
-  Reset the input device and optionaly run diagnostics\r
+  Reset the input device and optionally run diagnostics\r
 \r
   @param  This                     Protocol instance pointer.\r
   @param  ExtendedVerification     Driver may perform diagnostics on reset.\r
@@ -271,7 +275,7 @@ TerminalConInResetEx (
 \r
 /**\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
+  be used to test for existence of a keystroke via WaitForEvent () call.\r
 \r
   @param  This                     Protocol instance pointer.\r
   @param  KeyData                  A pointer to a buffer that is filled in with the\r
@@ -279,7 +283,7 @@ TerminalConInResetEx (
                                    pressed.\r
 \r
   @retval EFI_SUCCESS              The keystroke information was returned.\r
-  @retval EFI_NOT_READY            There was no keystroke data availiable.\r
+  @retval EFI_NOT_READY            There was no keystroke data available.\r
   @retval EFI_DEVICE_ERROR         The keystroke information was not returned due\r
                                    to hardware errors.\r
   @retval EFI_INVALID_PARAMETER    KeyData is NULL.\r
@@ -349,7 +353,7 @@ TerminalConInSetState (
 \r
   @retval EFI_SUCCESS              The notification function was registered\r
                                    successfully.\r
-  @retval EFI_OUT_OF_RESOURCES     Unable to allocate resources for necesssary data\r
+  @retval EFI_OUT_OF_RESOURCES     Unable to allocate resources for necessary data\r
                                    structures.\r
   @retval EFI_INVALID_PARAMETER    KeyData or NotifyHandle is NULL.\r
 \r
@@ -367,6 +371,7 @@ TerminalConInRegisterKeyNotify (
   TERMINAL_DEV                    *TerminalDevice;\r
   TERMINAL_CONSOLE_IN_EX_NOTIFY   *NewNotify;\r
   LIST_ENTRY                      *Link;\r
+  LIST_ENTRY                      *NotifyList;\r
   TERMINAL_CONSOLE_IN_EX_NOTIFY   *CurrentNotify;\r
 \r
   if (KeyData == NULL || NotifyHandle == NULL || KeyNotificationFunction == NULL) {\r
@@ -378,7 +383,8 @@ TerminalConInRegisterKeyNotify (
   //\r
   // Return EFI_SUCCESS if the (KeyData, NotificationFunction) is already registered.\r
   //\r
-  for (Link = TerminalDevice->NotifyList.ForwardLink; Link != &TerminalDevice->NotifyList; Link = Link->ForwardLink) {\r
+  NotifyList = &TerminalDevice->NotifyList;\r
+  for (Link = GetFirstNode (NotifyList); !IsNull (NotifyList,Link); Link = GetNextNode (NotifyList,Link)) {\r
     CurrentNotify = CR (\r
                       Link,\r
                       TERMINAL_CONSOLE_IN_EX_NOTIFY,\r
@@ -445,7 +451,8 @@ TerminalConInUnregisterKeyNotify (
   TERMINAL_DEV                    *TerminalDevice;\r
   LIST_ENTRY                      *Link;\r
   TERMINAL_CONSOLE_IN_EX_NOTIFY   *CurrentNotify;\r
-\r
+  LIST_ENTRY                      *NotifyList;\r
+  \r
   if (NotificationHandle == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
@@ -464,7 +471,8 @@ TerminalConInUnregisterKeyNotify (
 \r
   TerminalDevice = TERMINAL_CON_IN_EX_DEV_FROM_THIS (This);\r
 \r
-  for (Link = TerminalDevice->NotifyList.ForwardLink; Link != &TerminalDevice->NotifyList; Link = Link->ForwardLink) {\r
+  NotifyList = &TerminalDevice->NotifyList;\r
+  for (Link = GetFirstNode (NotifyList); !IsNull (NotifyList,Link); Link = GetNextNode (NotifyList,Link)) {\r
     CurrentNotify = CR (\r
                       Link,\r
                       TERMINAL_CONSOLE_IN_EX_NOTIFY,\r
@@ -568,7 +576,7 @@ TerminalConInWaitForKey (
 \r
   @retval EFI_SUCCESS              There is key pending.\r
   @retval EFI_NOT_READY            There is no key pending.\r
-  @retval EFI_DEVICE_ERROR         If Serial IO is not attched to serial device.\r
+  @retval EFI_DEVICE_ERROR         If Serial IO is not attached to serial device.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -682,7 +690,7 @@ TerminalConInCheckForKey (
 /**\r
   Get one key out of serial buffer.\r
 \r
-  @param  SerialIo           Serial I/O protocl attached to the serial device.\r
+  @param  SerialIo           Serial I/O protocol attached to the serial device.\r
   @param  Output             The fetched key.\r
 \r
   @return EFI_NOT_READY      If serial buffer is empty.\r
@@ -1123,32 +1131,35 @@ UnicodeToEfiKeyFlushState (
   )\r
 {\r
   EFI_INPUT_KEY Key;\r
-\r
-  if ((TerminalDevice->InputState & INPUT_STATE_ESC) != 0) {\r
+  UINT32        InputState;\r
+  \r
+  InputState = TerminalDevice->InputState;\r
+  \r
+  if ((InputState & INPUT_STATE_ESC) != 0) {\r
     Key.ScanCode    = SCAN_ESC;\r
     Key.UnicodeChar = 0;\r
     EfiKeyFiFoInsertOneKey (TerminalDevice, Key);\r
   }\r
 \r
-  if ((TerminalDevice->InputState & INPUT_STATE_CSI) != 0) {\r
+  if ((InputState & INPUT_STATE_CSI) != 0) {\r
     Key.ScanCode    = SCAN_NULL;\r
     Key.UnicodeChar = CSI;\r
     EfiKeyFiFoInsertOneKey (TerminalDevice, Key);\r
   }\r
 \r
-  if ((TerminalDevice->InputState & INPUT_STATE_LEFTOPENBRACKET) != 0) {\r
+  if ((InputState & INPUT_STATE_LEFTOPENBRACKET) != 0) {\r
     Key.ScanCode    = SCAN_NULL;\r
     Key.UnicodeChar = LEFTOPENBRACKET;\r
     EfiKeyFiFoInsertOneKey (TerminalDevice, Key);\r
   }\r
 \r
-  if ((TerminalDevice->InputState & INPUT_STATE_O) != 0) {\r
+  if ((InputState & INPUT_STATE_O) != 0) {\r
     Key.ScanCode    = SCAN_NULL;\r
     Key.UnicodeChar = 'O';\r
     EfiKeyFiFoInsertOneKey (TerminalDevice, Key);\r
   }\r
 \r
-  if ((TerminalDevice->InputState & INPUT_STATE_2) != 0) {\r
+  if ((InputState & INPUT_STATE_2) != 0) {\r
     Key.ScanCode    = SCAN_NULL;\r
     Key.UnicodeChar = '2';\r
     EfiKeyFiFoInsertOneKey (TerminalDevice, Key);\r
@@ -1173,7 +1184,7 @@ UnicodeToEfiKeyFlushState (
   \r
   The table below shows the keyboard input mappings that this function supports.\r
   If the ESC sequence listed in one of the columns is presented, then it is translated\r
-  into the coorespoding EFI Scan Code.  If a matching sequence is not found, then the raw\r
+  into the corresponding EFI Scan Code.  If a matching sequence is not found, then the raw\r
   key strokes are converted into EFI Keys.\r
 \r
   2 seconds are allowed for an ESC sequence to be completed.  If the ESC sequence is not\r
index e0c2489733b12f8de9661538dfbc475ab53a7260..83f7c900e3b6175b02ae0a8e2ff96ce8c06b4289 100644 (file)
@@ -540,7 +540,7 @@ TerminalConOutSetAttribute (
 \r
   //\r
   // Skip outputting the command string for the same attribute\r
-  // It improves the terminal performance siginificantly\r
+  // It improves the terminal performance significantly\r
   //\r
   if (This->Mode->Attribute == (INT32) Attribute) {\r
     return EFI_SUCCESS;\r
index e9228a0bb7240af8c2bc1d4688e168be0b7647db..ff0f788c88f20371ac8374c2c0dbfb9e06b631ba 100644 (file)
@@ -1,9 +1,10 @@
 #/** @file\r
-# Component description file for Terminal module.\r
-#\r
-# This driver installs Simple Text In/Out protocol for terminal devices (serial devices or hotplug devices).\r
-# Copyright (c) 2006 - 2008, Intel Corporation\r
+# \r
+#  Component description file for Terminal module.\r
 #\r
+#  This driver installs Simple Text In/Out protocol for terminal devices (serial devices or hotplug devices).\r
+# \r
+#  Copyright (c) 2006 - 2008, 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