]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmVirtPkg/PlatformBootManagerLib: init console vars in BeforeConsole()
authorLaszlo Ersek <lersek@redhat.com>
Thu, 5 May 2016 14:24:00 +0000 (16:24 +0200)
committerLaszlo Ersek <lersek@redhat.com>
Fri, 6 May 2016 08:04:49 +0000 (10:04 +0200)
With IntelFrameworkModulePkg BDS, the platform code is responsible for
updating console variables (e.g., with BdsLibUpdateConsoleVariable()), and
then connecting them (e.g., with BdsLibConnectAllDefaultConsoles()). This
is usually (although not necessarily) done in PlatformBdsPolicyBehavior().

With MdeModulePkg BDS, the platform is responsible for updating the
console variables in PlatformBootManagerBeforeConsole(). When that
function returns, BdsEntry() will automatically connect the consoles; the
platform is not responsible for the connection.

IntelFrameworkModulePkg               MdeModulePkg
  BdsEntry                              BdsEntry
    PlatformBdsInit                       PlatformBootManagerBeforeConsole
                                     +----> EfiBootManagerUpdateConsoleVariable
                                     |
    dispatch Driver####              |    dispatch Driver####
                                     | +> connect consoles
                                     | |
    PlatformBdsPolicyBehavior        | |  PlatformBootManagerAfterConsole
      BdsLibUpdateConsoleVariable <--+ |
      BdsLibConnectAllDefaultConsoles <+
      display splash screen                 display splash screen

Thus, move the console variable massaging from the beginning of
PlatformBootManagerAfterConsole() (originally PlatformBdsPolicyBehavior())
to the end of PlatformBootManagerBeforeConsole(), and drop the explicit
BdsLibConnectAllDefaultConsoles() call.

This patch parallels OvmfPkg commit e9e9ad644fab.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c

index 3157b89980b71f06e677e66e39b1df277660608a..81cee15af95b22d7a9a27e90205c569332597a4e 100644 (file)
@@ -122,32 +122,6 @@ STATIC PLATFORM_USB_KEYBOARD mUsbKeyboard = {
   }\r
 };\r
 \r
-//\r
-// BDS Platform Functions\r
-//\r
-/**\r
-  Do the platform init, can be customized by OEM/IBV\r
-  Possible things that can be done in PlatformBootManagerBeforeConsole:\r
-  > Update console variable: 1. include hot-plug devices;\r
-  >                          2. Clear ConIn and add SOL for AMT\r
-  > Register new Driver#### or Boot####\r
-  > Register new Key####: e.g.: F12\r
-  > Signal ReadyToLock event\r
-  > Authentication action: 1. connect Auth devices;\r
-  >                        2. Identify auto logon user.\r
-**/\r
-VOID\r
-EFIAPI\r
-PlatformBootManagerBeforeConsole (\r
-  VOID\r
-  )\r
-{\r
-  //\r
-  // Signal EndOfDxe PI Event\r
-  //\r
-  EfiEventGroupSignal (&gEfiEndOfDxeEventGroupGuid);\r
-}\r
-\r
 \r
 /**\r
   Check if the handle satisfies a particular condition.\r
@@ -349,23 +323,31 @@ AddOutput (
 }\r
 \r
 \r
+//\r
+// BDS Platform Functions\r
+//\r
 /**\r
-  Do the platform specific action after the console is ready\r
-  Possible things that can be done in PlatformBootManagerAfterConsole:\r
-  > Console post action:\r
-    > Dynamically switch output mode from 100x31 to 80x25 for certain senarino\r
-    > Signal console ready platform customized event\r
-  > Run diagnostics like memory testing\r
-  > Connect certain devices\r
-  > Dispatch aditional option roms\r
-  > Special boot: e.g.: USB boot, enter UI\r
+  Do the platform init, can be customized by OEM/IBV\r
+  Possible things that can be done in PlatformBootManagerBeforeConsole:\r
+  > Update console variable: 1. include hot-plug devices;\r
+  >                          2. Clear ConIn and add SOL for AMT\r
+  > Register new Driver#### or Boot####\r
+  > Register new Key####: e.g.: F12\r
+  > Signal ReadyToLock event\r
+  > Authentication action: 1. connect Auth devices;\r
+  >                        2. Identify auto logon user.\r
 **/\r
 VOID\r
 EFIAPI\r
-PlatformBootManagerAfterConsole (\r
+PlatformBootManagerBeforeConsole (\r
   VOID\r
   )\r
 {\r
+  //\r
+  // Signal EndOfDxe PI Event\r
+  //\r
+  EfiEventGroupSignal (&gEfiEndOfDxeEventGroupGuid);\r
+\r
   //\r
   // Locate the PCI root bridges and make the PCI bus driver connect each,\r
   // non-recursively. This will produce a number of child handles with PciIo on\r
@@ -408,12 +390,25 @@ PlatformBootManagerAfterConsole (
     (EFI_DEVICE_PATH_PROTOCOL *)&mSerialConsole, NULL);\r
   EfiBootManagerUpdateConsoleVariable (ErrOut,\r
     (EFI_DEVICE_PATH_PROTOCOL *)&mSerialConsole, NULL);\r
+}\r
 \r
-  //\r
-  // Connect the consoles based on the above variables.\r
-  //\r
-  BdsLibConnectAllDefaultConsoles ();\r
-\r
+/**\r
+  Do the platform specific action after the console is ready\r
+  Possible things that can be done in PlatformBootManagerAfterConsole:\r
+  > Console post action:\r
+    > Dynamically switch output mode from 100x31 to 80x25 for certain senarino\r
+    > Signal console ready platform customized event\r
+  > Run diagnostics like memory testing\r
+  > Connect certain devices\r
+  > Dispatch aditional option roms\r
+  > Special boot: e.g.: USB boot, enter UI\r
+**/\r
+VOID\r
+EFIAPI\r
+PlatformBootManagerAfterConsole (\r
+  VOID\r
+  )\r
+{\r
   //\r
   // Show the splash screen.\r
   //\r