]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c
ArmVirtPkg/PlatformBootManagerLib: link against UefiBootManagerLib
[mirror_edk2.git] / ArmVirtPkg / Library / PlatformBootManagerLib / PlatformBm.c
index f841d7c1b5c6afe0639c827d17459c78810f2d82..3157b89980b71f06e677e66e39b1df277660608a 100644 (file)
@@ -18,8 +18,8 @@
 #include <IndustryStandard/Pci22.h>\r
 #include <Library/DevicePathLib.h>\r
 #include <Library/PcdLib.h>\r
-#include <Library/PlatformBdsLib.h>\r
 #include <Library/QemuBootOrderLib.h>\r
+#include <Library/UefiBootManagerLib.h>\r
 #include <Protocol/DevicePath.h>\r
 #include <Protocol/GraphicsOutput.h>\r
 #include <Protocol/PciIo.h>\r
@@ -126,13 +126,19 @@ STATIC PLATFORM_USB_KEYBOARD mUsbKeyboard = {
 // BDS Platform Functions\r
 //\r
 /**\r
-  Platform Bds init. Include the platform firmware vendor, revision\r
-  and so crc check.\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
-PlatformBdsInit (\r
+PlatformBootManagerBeforeConsole (\r
   VOID\r
   )\r
 {\r
@@ -324,14 +330,14 @@ AddOutput (
     return;\r
   }\r
 \r
-  Status = BdsLibUpdateConsoleVariable (L"ConOut", DevicePath, NULL);\r
+  Status = EfiBootManagerUpdateConsoleVariable (ConOut, DevicePath, NULL);\r
   if (EFI_ERROR (Status)) {\r
     DEBUG ((EFI_D_ERROR, "%a: %s: adding to ConOut: %r\n", __FUNCTION__,\r
       ReportText, Status));\r
     return;\r
   }\r
 \r
-  Status = BdsLibUpdateConsoleVariable (L"ErrOut", DevicePath, NULL);\r
+  Status = EfiBootManagerUpdateConsoleVariable (ErrOut, DevicePath, NULL);\r
   if (EFI_ERROR (Status)) {\r
     DEBUG ((EFI_D_ERROR, "%a: %s: adding to ErrOut: %r\n", __FUNCTION__,\r
       ReportText, Status));\r
@@ -344,23 +350,20 @@ AddOutput (
 \r
 \r
 /**\r
-  The function will execute with as the platform policy, current policy\r
-  is driven by boot mode. IBV/OEM can customize this code for their specific\r
-  policy action.\r
-\r
-  @param  DriverOptionList        The header of the driver option link list\r
-  @param  BootOptionList          The header of the boot option link list\r
-  @param  ProcessCapsules         A pointer to ProcessCapsules()\r
-  @param  BaseMemoryTest          A pointer to BaseMemoryTest()\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
-PlatformBdsPolicyBehavior (\r
-  IN LIST_ENTRY                      *DriverOptionList,\r
-  IN LIST_ENTRY                      *BootOptionList,\r
-  IN PROCESS_CAPSULES                ProcessCapsules,\r
-  IN BASEM_MEMORY_TEST               BaseMemoryTest\r
+PlatformBootManagerAfterConsole (\r
+  VOID\r
   )\r
 {\r
   //\r
@@ -391,7 +394,7 @@ PlatformBdsPolicyBehavior (
   //\r
   // Add the hardcoded short-form USB keyboard device path to ConIn.\r
   //\r
-  BdsLibUpdateConsoleVariable (L"ConIn",\r
+  EfiBootManagerUpdateConsoleVariable (ConIn,\r
     (EFI_DEVICE_PATH_PROTOCOL *)&mUsbKeyboard, NULL);\r
 \r
   //\r
@@ -399,11 +402,11 @@ PlatformBdsPolicyBehavior (
   //\r
   CopyGuid (&mSerialConsole.TermType.Guid,\r
     PcdGetPtr (PcdTerminalTypeGuidBuffer));\r
-  BdsLibUpdateConsoleVariable (L"ConIn",\r
+  EfiBootManagerUpdateConsoleVariable (ConIn,\r
     (EFI_DEVICE_PATH_PROTOCOL *)&mSerialConsole, NULL);\r
-  BdsLibUpdateConsoleVariable (L"ConOut",\r
+  EfiBootManagerUpdateConsoleVariable (ConOut,\r
     (EFI_DEVICE_PATH_PROTOCOL *)&mSerialConsole, NULL);\r
-  BdsLibUpdateConsoleVariable (L"ErrOut",\r
+  EfiBootManagerUpdateConsoleVariable (ErrOut,\r
     (EFI_DEVICE_PATH_PROTOCOL *)&mSerialConsole, NULL);\r
 \r
   //\r
@@ -489,3 +492,17 @@ PlatformBdsLockNonUpdatableFlash (
 {\r
   return;\r
 }\r
+\r
+/**\r
+  This function is called each second during the boot manager waits the\r
+  timeout.\r
+\r
+  @param TimeoutRemain  The remaining timeout.\r
+**/\r
+VOID\r
+EFIAPI\r
+PlatformBootManagerWaitCallback (\r
+  UINT16          TimeoutRemain\r
+  )\r
+{\r
+}\r