]> git.proxmox.com Git - mirror_edk2.git/commitdiff
1.fixed one bug to 'reconnect -r' when running 4 times.
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 14 Jan 2009 07:47:48 +0000 (07:47 +0000)
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 14 Jan 2009 07:47:48 +0000 (07:47 +0000)
2.Code scrub.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7269 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.h
MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterGraphics.c

index 0c0bd303366eb015d01d59cca63bf5482c4bb096..153974a051108a494d0cb81385b282786d21f459 100644 (file)
@@ -2686,9 +2686,13 @@ ConSplitterAddGraphicsOutputMode (
         //\r
         // This is the first Graphics Output device added\r
         //\r
-        CopyMem (CurrentGraphicsOutputMode, GraphicsOutput->Mode, sizeof (EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE));\r
+        CurrentGraphicsOutputMode->MaxMode = GraphicsOutput->Mode->MaxMode;\r
+        CurrentGraphicsOutputMode->Mode = GraphicsOutput->Mode->Mode;\r
         CopyMem (CurrentGraphicsOutputMode->Info, GraphicsOutput->Mode->Info, GraphicsOutput->Mode->SizeOfInfo);\r
-\r
+        CurrentGraphicsOutputMode->SizeOfInfo = GraphicsOutput->Mode->SizeOfInfo;\r
+        CurrentGraphicsOutputMode->FrameBufferBase = GraphicsOutput->Mode->FrameBufferBase;\r
+        CurrentGraphicsOutputMode->FrameBufferSize = GraphicsOutput->Mode->FrameBufferSize;\r
+  \r
         //\r
         // Allocate resource for the private mode buffer\r
         //\r
@@ -3389,10 +3393,12 @@ ConSpliterConssoleControlStdInLocked (
 \r
 \r
 /**\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
+  Record and check key sequence on StdIn.\r
+\r
+  This timer event will fire when StdIn is locked. It will record the key sequence\r
+  on StdIn and also check to see if it matches the password. Any error in the\r
+  password will cause the check to reset. As long as a mConIn.PasswordEnabled is\r
+  TRUE, the StdIn splitter will not report any input.\r
 \r
   @param  Event                  The Event this notify function registered to.\r
   @param  Context                Pointer to the context data registerd to the\r
@@ -3414,9 +3420,12 @@ ConSpliterConsoleControlLockStdInEvent (
     Status = ConSplitterTextInPrivateReadKeyStroke (&mConIn, &Key);\r
     if (!EFI_ERROR (Status)) {\r
       //\r
-      // if it's an ENTER, match password\r
+      // If key read successfully\r
       //\r
       if ((Key.UnicodeChar == CHAR_CARRIAGE_RETURN) && (Key.ScanCode == SCAN_NULL)) {\r
+        //\r
+        // If it's an ENTER, match password\r
+        //\r
         mConIn.PwdAttempt[mConIn.PwdIndex] = CHAR_NULL;\r
         if (StrCmp (mConIn.Password, mConIn.PwdAttempt) != 0) {\r
           //\r
@@ -3451,7 +3460,8 @@ ConSpliterConsoleControlLockStdInEvent (
         }\r
       } else if ((Key.ScanCode == SCAN_NULL) && (Key.UnicodeChar >= 32)) {\r
         //\r
-        // If it's not an ENTER, neigher a function key, nor a CTRL-X or ALT-X, record the input\r
+        // If it's not an ENTER, neigher a function key, nor a CTRL-X or ALT-X, record the input,\r
+        // value 32 stands for a Blank Space key.\r
         //\r
         if (mConIn.PwdIndex < (MAX_STD_IN_PASSWORD - 1)) {\r
           if (mConIn.PwdIndex == 0) {\r
@@ -3504,7 +3514,7 @@ ConSpliterConsoleControlLockStdIn (
   mConIn.PasswordEnabled  = TRUE;\r
   mConIn.PwdIndex         = 0;\r
   //\r
-  // Timer Periodic is 25ms.\r
+  // Lock Timer Periodic is 25ms.\r
   //\r
   gBS->SetTimer (mConIn.LockEvent, TimerPeriodic, 10000 * 25);\r
 \r
@@ -3550,7 +3560,8 @@ ConSplitterTextInReadKeyStroke (
 \r
 \r
 /**\r
-  This event agregates all the events of the ConIn devices in the spliter.\r
+  This event aggregates all the events of the ConIn devices in the spliter.\r
+\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
@@ -3572,6 +3583,7 @@ ConSplitterTextInWaitForKey (
   UINTN                         Index;\r
 \r
   Private = (TEXT_IN_SPLITTER_PRIVATE_DATA *) Context;\r
+\r
   if (Private->PasswordEnabled) {\r
     //\r
     // If StdIn Locked return not ready\r
@@ -3579,15 +3591,16 @@ ConSplitterTextInWaitForKey (
     return ;\r
   }\r
 \r
-  //\r
-  // if KeyEventSignalState is flagged before, and not cleared by Reset() or ReadKeyStroke()\r
-  //\r
   if (Private->KeyEventSignalState) {\r
+    //\r
+    // If KeyEventSignalState is flagged before, and not cleared by Reset() or ReadKeyStroke()\r
+    //\r
     gBS->SignalEvent (Event);\r
     return ;\r
   }\r
+\r
   //\r
-  // if any physical console input device has key input, signal the event.\r
+  // If any physical console input device has key input, signal the event.\r
   //\r
   for (Index = 0; Index < Private->CurrentNumberOfConsoles; Index++) {\r
     Status = gBS->CheckEvent (Private->TextInList[Index]->WaitForKey);\r
@@ -3822,7 +3835,7 @@ ConSplitterTextInSetState (
                                    successfully.\r
   @retval EFI_OUT_OF_RESOURCES     Unable to allocate resources for necesssary data\r
                                    structures.\r
-  @retval EFI_INVALID_PARAMETER    KeyData or NotifyHandle is NULL.\r
+  @retval EFI_INVALID_PARAMETER    KeyData or KeyNotificationFunction or NotifyHandle is NULL.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -3849,7 +3862,7 @@ ConSplitterTextInRegisterKeyNotify (
   Private = TEXT_IN_EX_SPLITTER_PRIVATE_DATA_FROM_THIS (This);\r
 \r
   //\r
-  // if no physical console input device exists,\r
+  // If no physical console input device exists,\r
   // return EFI_SUCCESS directly.\r
   //\r
   if (Private->CurrentNumberOfExConsoles <= 0) {\r
index 5ff5e6adac2956ad44656aca28f54f6e257904a1..5c5d691761ab68d523e277a5db31e6e9b4ada6e1 100644 (file)
@@ -1425,7 +1425,7 @@ ConSplitterTextInSetState (
                                    successfully.\r
   @retval EFI_OUT_OF_RESOURCES     Unable to allocate resources for necesssary data\r
                                    structures.\r
-  @retval EFI_INVALID_PARAMETER    KeyData or NotifyHandle is NULL.\r
+  @retval EFI_INVALID_PARAMETER    KeyData or KeyNotificationFunction or NotifyHandle is NULL.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -1459,7 +1459,8 @@ ConSplitterTextInUnregisterKeyNotify (
   );\r
 \r
 /**\r
-  This event agregates all the events of the ConIn devices in the spliter.\r
+  This event aggregates all the events of the ConIn devices in the spliter.\r
+\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
@@ -1490,10 +1491,12 @@ ConSpliterConssoleControlStdInLocked (
   );\r
 \r
 /**\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
+  Record and check key sequence on StdIn.\r
+\r
+  This timer event will fire when StdIn is locked. It will record the key sequence\r
+  on StdIn and also check to see if it matches the password. Any error in the\r
+  password will cause the check to reset. As long as a mConIn.PasswordEnabled is\r
+  TRUE, the StdIn splitter will not report any input.\r
 \r
   @param  Event                  The Event this notify function registered to.\r
   @param  Context                Pointer to the context data registerd to the\r
@@ -2197,20 +2200,17 @@ DevNullTextOutClearScreen (
   );\r
 \r
 /**\r
-  Sets the current coordinates of the cursor position.\r
+  Sets the current coordinates of the cursor position on NULL device.\r
 \r
-  @param  Private                 Text Out Splitter pointer.\r
-  @param  Column\r
-  @param  Row                     the position to set the cursor to. Must be\r
-                                  greater than or equal to zero and less than the\r
-                                  number of columns and rows by QueryMode ().\r
+  @param  Private                  Text Out Splitter pointer.\r
+  @param  Column                   The column position to set the cursor to. Must be\r
+                                   greater than or equal to zero and less than the\r
+                                   number of columns by QueryMode ().\r
+  @param  Row                      The row position to set the cursor to. Must be\r
+                                   greater than or equal to zero and less than the\r
+                                   number of rows 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\r
-                                  the request.\r
-  @retval EFI_UNSUPPORTED         The output device is not in a valid text mode, or\r
-                                  the cursor position is invalid for the current\r
-                                  mode.\r
+  @retval EFI_SUCCESS              Always returned.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -2221,13 +2221,13 @@ DevNullTextOutSetCursorPosition (
   );\r
 \r
 /**\r
-  Set cursor visibility property.\r
+  Set cursor visibility property on NULL device.\r
 \r
   @param  Private                 Text Out Splitter pointer.\r
   @param  Visible                 If TRUE, the cursor is set to be visible, If\r
                                   FALSE, the cursor is set to be invisible.\r
 \r
-  @retval EFI_SUCCESS             Returns always.\r
+  @retval EFI_SUCCESS             Always returned.\r
 \r
 **/\r
 EFI_STATUS\r
index 251ab5dcb251ebb738c0115beb20cddb63e21c7b..63deaf598670ad79a0a6c0f8bbf94b6764057e16 100644 (file)
@@ -1471,7 +1471,7 @@ DevNullTextOutSetMode (
   Row     = Mode->Rows;\r
   Column  = Mode->Columns;\r
 \r
-  if (Row <= 0 && Column <= 0) {\r
+  if (Row == 0 || Column == 0) {\r
     return EFI_UNSUPPORTED;\r
   }\r
 \r
@@ -1558,20 +1558,17 @@ DevNullTextOutClearScreen (
 \r
 \r
 /**\r
-  Sets the current coordinates of the cursor position.\r
+  Sets the current coordinates of the cursor position on NULL device.\r
 \r
-  @param  Private                 Text Out Splitter pointer.\r
-  @param  Column\r
-  @param  Row                     the position to set the cursor to. Must be\r
-                                  greater than or equal to zero and less than the\r
-                                  number of columns and rows by QueryMode ().\r
+  @param  Private                  Text Out Splitter pointer.\r
+  @param  Column                   The column position to set the cursor to. Must be\r
+                                   greater than or equal to zero and less than the\r
+                                   number of columns by QueryMode ().\r
+  @param  Row                      The row position to set the cursor to. Must be\r
+                                   greater than or equal to zero and less than the\r
+                                   number of rows 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\r
-                                  the request.\r
-  @retval EFI_UNSUPPORTED         The output device is not in a valid text mode, or\r
-                                  the cursor position is invalid for the current\r
-                                  mode.\r
+  @retval EFI_SUCCESS              Always returned.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -1594,13 +1591,13 @@ DevNullTextOutSetCursorPosition (
 \r
 \r
 /**\r
-  Set cursor visibility property.\r
+  Set cursor visibility property on NULL device.\r
 \r
   @param  Private                 Text Out Splitter pointer.\r
   @param  Visible                 If TRUE, the cursor is set to be visible, If\r
                                   FALSE, the cursor is set to be invisible.\r
 \r
-  @retval EFI_SUCCESS             Returns always.\r
+  @retval EFI_SUCCESS             Always returned.\r
 \r
 **/\r
 EFI_STATUS\r