From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 0C2D881FA6 for ; Sun, 4 Dec 2016 17:56:38 -0800 (PST) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP; 04 Dec 2016 17:56:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,302,1477983600"; d="scan'208";a="38842032" Received: from ray-dev.ccr.corp.intel.com ([10.239.9.25]) by fmsmga005.fm.intel.com with ESMTP; 04 Dec 2016 17:56:36 -0800 From: Ruiyu Ni To: edk2-devel@lists.01.org Cc: Eric Dong , Chao B Zhang Date: Mon, 5 Dec 2016 09:56:34 +0800 Message-Id: <20161205015634.487520-1-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.9.0.windows.1 Subject: [PATCH] MdeModulePkg/BdsDxe: Initialize gConnectConInEvent earlier X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Dec 2016 01:56:38 -0000 PlatformBootManagerBeforeConsole() might want to display UI and ReadKeyStroke() call from UI depends on this event to connect ConIn so BdsDxe initializes this event before PlatformBootManagerBeforeConsole(). Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni Cc: Eric Dong Cc: Chao B Zhang --- MdeModulePkg/Universal/BdsDxe/BdsEntry.c | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c index 98b3931..b5e6ef6 100644 --- a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c +++ b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c @@ -874,6 +874,23 @@ BdsEntry ( ); // + // Initialize ConnectConIn event before calling platform code. + // + if (PcdGetBool (PcdConInConnectOnDemand)) { + Status = gBS->CreateEventEx ( + EVT_NOTIFY_SIGNAL, + TPL_CALLBACK, + BdsDxeOnConnectConInCallBack, + NULL, + &gConnectConInEventGuid, + &gConnectConInEvent + ); + if (EFI_ERROR (Status)) { + gConnectConInEvent = NULL; + } + } + + // // Do the platform init, can be customized by OEM/IBV // Possible things that can be done in PlatformBootManagerBeforeConsole: // > Update console variable: 1. include hot-plug devices; 2. Clear ConIn and add SOL for AMT @@ -905,21 +922,9 @@ BdsEntry ( if (PcdGetBool (PcdConInConnectOnDemand)) { EfiBootManagerConnectConsoleVariable (ConOut); EfiBootManagerConnectConsoleVariable (ErrOut); - // - // Initialize ConnectConIn event + // Do not connect ConIn devices when lazy ConIn feature is ON. // - Status = gBS->CreateEventEx ( - EVT_NOTIFY_SIGNAL, - TPL_CALLBACK, - BdsDxeOnConnectConInCallBack, - NULL, - &gConnectConInEventGuid, - &gConnectConInEvent - ); - if (EFI_ERROR (Status)) { - gConnectConInEvent = NULL; - } } else { EfiBootManagerConnectAllDefaultConsoles (); } -- 2.9.0.windows.1