]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.h
UefiPayloadPkg: Enhance UEFI payload for coreboot and Slim Bootloader
[mirror_edk2.git] / UefiPayloadPkg / Library / PlatformBootManagerLib / PlatformBootManager.h
diff --git a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.h b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.h
new file mode 100644 (file)
index 0000000..2f600c7
--- /dev/null
@@ -0,0 +1,132 @@
+/**@file\r
+   Head file for BDS Platform specific code\r
+\r
+Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
+**/\r
+\r
+#ifndef _PLATFORM_BOOT_MANAGER_H\r
+#define _PLATFORM_BOOT_MANAGER_H\r
+\r
+#include <PiDxe.h>\r
+#include <Protocol/LoadedImage.h>\r
+\r
+#include <Library/DebugLib.h>\r
+#include <Library/BaseMemoryLib.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/UefiRuntimeServicesTableLib.h>\r
+#include <Library/MemoryAllocationLib.h>\r
+#include <Library/BaseLib.h>\r
+#include <Library/UefiRuntimeServicesTableLib.h>\r
+#include <Library/UefiLib.h>\r
+#include <Library/UefiBootManagerLib.h>\r
+#include <Library/PcdLib.h>\r
+#include <Library/DevicePathLib.h>\r
+#include <Library/HiiLib.h>\r
+#include <Library/PrintLib.h>\r
+#include <Library/DxeServicesLib.h>\r
+#include <Library/BootLogoLib.h>\r
+#include <Protocol/SmmAccess2.h>\r
+\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL  *DevicePath;\r
+  UINTN                     ConnectType;\r
+} PLATFORM_CONSOLE_CONNECT_ENTRY;\r
+\r
+extern PLATFORM_CONSOLE_CONNECT_ENTRY  gPlatformConsole[];\r
+\r
+#define gEndEntire \\r
+  { \\r
+    END_DEVICE_PATH_TYPE,\\r
+    END_ENTIRE_DEVICE_PATH_SUBTYPE,\\r
+    { END_DEVICE_PATH_LENGTH, 0 },\\r
+  }\r
+\r
+#define CONSOLE_OUT BIT0\r
+#define CONSOLE_IN  BIT1\r
+#define STD_ERROR   BIT2\r
+\r
+#define CLASS_HID           3\r
+#define SUBCLASS_BOOT       1\r
+#define PROTOCOL_KEYBOARD   1\r
+\r
+typedef struct {\r
+  USB_CLASS_DEVICE_PATH           UsbClass;\r
+  EFI_DEVICE_PATH_PROTOCOL        End;\r
+} USB_CLASS_FORMAT_DEVICE_PATH;\r
+\r
+typedef struct {\r
+  VENDOR_DEVICE_PATH  VendorDevicePath;\r
+  UINT32              Instance;\r
+} WIN_NT_VENDOR_DEVICE_PATH_NODE;\r
+\r
+//\r
+// Below is the platform console device path\r
+//\r
+typedef struct {\r
+  VENDOR_DEVICE_PATH              NtBus;\r
+  WIN_NT_VENDOR_DEVICE_PATH_NODE  SerialDevice;\r
+  UART_DEVICE_PATH                Uart;\r
+  VENDOR_DEVICE_PATH              TerminalType;\r
+  EFI_DEVICE_PATH_PROTOCOL        End;\r
+} NT_ISA_SERIAL_DEVICE_PATH;\r
+\r
+typedef struct {\r
+  VENDOR_DEVICE_PATH              NtBus;\r
+  WIN_NT_VENDOR_DEVICE_PATH_NODE  NtGopDevice;\r
+  EFI_DEVICE_PATH_PROTOCOL        End;\r
+} NT_PLATFORM_GOP_DEVICE_PATH;\r
+\r
+extern USB_CLASS_FORMAT_DEVICE_PATH              gUsbClassKeyboardDevicePath;\r
+\r
+/**\r
+  Use SystemTable Conout to stop video based Simple Text Out consoles from going\r
+  to the video device. Put up LogoFile on every video device that is a console.\r
+\r
+  @param[in]  LogoFile   File name of logo to display on the center of the screen.\r
+\r
+  @retval EFI_SUCCESS     ConsoleControl has been flipped to graphics and logo displayed.\r
+  @retval EFI_UNSUPPORTED Logo not found\r
+\r
+**/\r
+EFI_STATUS\r
+PlatformBootManagerEnableQuietBoot (\r
+  IN  EFI_GUID  *LogoFile\r
+);\r
+\r
+/**\r
+  Use SystemTable Conout to turn on video based Simple Text Out consoles. The\r
+  Simple Text Out screens will now be synced up with all non video output devices\r
+\r
+  @retval EFI_SUCCESS     UGA devices are back in text mode and synced up.\r
+\r
+**/\r
+EFI_STATUS\r
+PlatformBootManagerDisableQuietBoot (\r
+  VOID\r
+);\r
+\r
+/**\r
+  Show progress bar with title above it. It only works in Graphics mode.\r
+\r
+  @param TitleForeground Foreground color for Title.\r
+  @param TitleBackground Background color for Title.\r
+  @param Title           Title above progress bar.\r
+  @param ProgressColor   Progress bar color.\r
+  @param Progress        Progress (0-100)\r
+  @param PreviousValue   The previous value of the progress.\r
+\r
+  @retval  EFI_STATUS       Success update the progress bar\r
+\r
+**/\r
+EFI_STATUS\r
+PlatformBootManagerShowProgress (\r
+  IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL TitleForeground,\r
+  IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL TitleBackground,\r
+  IN CHAR16                        *Title,\r
+  IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL ProgressColor,\r
+  IN UINTN                         Progress,\r
+  IN UINTN                         PreviousValue\r
+);\r
+\r
+#endif // _PLATFORM_BOOT_MANAGER_H\r