summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuiyu Ni <ruiyu.ni@intel.com>2016-12-05 09:49:24 +0800
committerRuiyu Ni <ruiyu.ni@intel.com>2016-12-08 10:11:01 +0800
commit8537bd7ef64f2ccf3b0db515f30813d5c3311a5c (patch)
tree8c485d2e098b53c24674b25af2799537022db981
parentc497dcc8e5a3af7b00a85013ec5fec9ee0b2699d (diff)
downloadedk2-platforms-8537bd7ef64f2ccf3b0db515f30813d5c3311a5c.tar.xz
MdeModulePkg/BdsDxe: Initialize gConnectConInEvent earlier
PlatformBootManagerBeforeConsole() might want to trigger this event to connect ConIn so BdsDxe initializes this event before PlatformBootManagerBeforeConsole(). Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Sunny Wang <sunnywang@hpe.com> Cc: Chao B Zhang <chao.b.zhang@intel.com>
-rw-r--r--MdeModulePkg/Universal/BdsDxe/BdsEntry.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
index 98b3931093..b5e6ef61e1 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 ();
}