]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Fix some corner case for LazyConIn feature
authorczhang46 <czhang46@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 10 Oct 2012 07:29:45 +0000 (07:29 +0000)
committerczhang46 <czhang46@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 10 Oct 2012 07:29:45 +0000 (07:29 +0000)
Signed-off-by: chao zhang <chao.b.zhang@intel.com>
Reviewed-by  : Ni Ruiyu   <ruiyu.ni@intel.com>

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

IntelFrameworkModulePkg/Universal/BdsDxe/Bds.h
IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf
IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c

index 008d13e41bff93e37f3762741058a37d83cad9d2..0929f1d27bdc7c6b03c95fdbad28f50479a63dc8 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Head file for BDS Architectural Protocol implementation\r
 \r
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2012, 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
@@ -34,6 +34,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Guid/StatusCodeDataTypeId.h>\r
 #include <Guid/LegacyDevOrder.h>\r
 #include <Guid/BdsHii.h>\r
+#include <Guid/ConnectConInEvent.h>\r
 #include <Protocol/GenericMemoryTest.h>\r
 #include <Protocol/FormBrowser2.h>\r
 #include <Protocol/HiiConfigAccess.h>\r
index 0134f9b7d1495ed2a166930bcfb78ddc88345bb7..8eb22add21b4208c631a8b6a474cbeafe9023246 100644 (file)
   gBootManagerFormSetGuid                       ## SOMETIMES_PRODUCES ## BootManager HII Package\r
   gDeviceManagerFormSetGuid                     ## SOMETIMES_PRODUCES ## DeviceManager HII Package\r
   gDriverHealthFormSetGuid                      ## SOMETIMES_PRODUCES ## DriverHealth HII Package\r
+  gConnectConInEventGuid                        ## CONSUMES ## GUID (Connect ConIn Event)\r
 \r
 [Protocols]\r
   gEfiSimpleFileSystemProtocolGuid              ## PROTOCOL CONSUMES\r
index 7949d0995f81e543ac7dfd536b7cda58ded2841b..a91962537935a4470fc83b019535ff7d142140cc 100644 (file)
@@ -72,6 +72,24 @@ BdsInitialize (
   return Status;\r
 }\r
 \r
+\r
+/**\r
+  An empty function to pass error checking of CreateEventEx ().\r
+\r
+  @param  Event                 Event whose notification function is being invoked.\r
+  @param  Context               Pointer to the notification function's context,\r
+                                which is implementation-dependent.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+BdsEmptyCallbackFunction (\r
+  IN EFI_EVENT                Event,\r
+  IN VOID                     *Context\r
+  )\r
+{\r
+}\r
+\r
 /**\r
 \r
   This function attempts to boot for the boot order specified\r
@@ -93,12 +111,14 @@ BdsBootDeviceSelect (
   CHAR16            Buffer[20];\r
   BOOLEAN           BootNextExist;\r
   LIST_ENTRY        *LinkBootNext;\r
+  EFI_EVENT         ConnectConInEvent;\r
 \r
   //\r
   // Got the latest boot option\r
   //\r
   BootNextExist = FALSE;\r
   LinkBootNext  = NULL;\r
+  ConnectConInEvent = NULL;\r
   InitializeListHead (&BootLists);\r
 \r
   //\r
@@ -106,6 +126,23 @@ BdsBootDeviceSelect (
   //\r
   ZeroMem (Buffer, sizeof (Buffer));\r
 \r
+  //\r
+  // Create Event to signal ConIn connection request\r
+  //\r
+  if (PcdGetBool (PcdConInConnectOnDemand)) {\r
+    Status = gBS->CreateEventEx (\r
+                    EVT_NOTIFY_SIGNAL,\r
+                    TPL_CALLBACK,\r
+                    BdsEmptyCallbackFunction,\r
+                    NULL,\r
+                    &gConnectConInEventGuid,\r
+                    &ConnectConInEvent\r
+                    );\r
+    if (EFI_ERROR(Status)) {\r
+      ConnectConInEvent = NULL;\r
+    }\r
+  }\r
+\r
   if (mBootNext != NULL) {\r
     //\r
     // Indicate we have the boot next variable, so this time\r
@@ -171,6 +208,13 @@ BdsBootDeviceSelect (
     // Check the boot option list first\r
     //\r
     if (Link == &BootLists) {\r
+      //\r
+      // When LazyConIn enabled, signal connect ConIn event before enter UI\r
+      //\r
+      if (PcdGetBool (PcdConInConnectOnDemand) && ConnectConInEvent != NULL) {\r
+        gBS->SignalEvent (ConnectConInEvent);\r
+      }\r
+\r
       //\r
       // There are two ways to enter here:\r
       // 1. There is no active boot option, give user chance to\r
@@ -248,6 +292,14 @@ BdsBootDeviceSelect (
       // Boot success, then stop process the boot order, and\r
       // present the boot manager menu, front page\r
       //\r
+\r
+      //\r
+      // When LazyConIn enabled, signal connect ConIn Event before enter UI\r
+      //\r
+      if (PcdGetBool (PcdConInConnectOnDemand) && ConnectConInEvent != NULL) {\r
+        gBS->SignalEvent (ConnectConInEvent);\r
+      }\r
+\r
       Timeout = 0xffff;\r
       PlatformBdsEnterFrontPage (Timeout, FALSE);\r
 \r