From: Ruiyu Ni Date: Mon, 5 Dec 2016 01:49:24 +0000 (+0800) Subject: MdeModulePkg/BdsDxe: Initialize gConnectConInEvent earlier X-Git-Tag: edk2-stable201903~4971 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=8537bd7ef64f2ccf3b0db515f30813d5c3311a5c;hp=c497dcc8e5a3af7b00a85013ec5fec9ee0b2699d 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 Reviewed-by: Eric Dong Reviewed-by: Sunny Wang Cc: Chao B Zhang --- 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 @@ -873,6 +873,23 @@ BdsEntry ( (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_DXE_BS_PC_BEGIN_CONNECTING_DRIVERS) ); + // + // 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: @@ -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 (); }