]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EmbeddedPkg/Include/Protocol/PlatformBootManager.h
EmbeddedPkg: add platform boot manager protocol
[mirror_edk2.git] / EmbeddedPkg / Include / Protocol / PlatformBootManager.h
diff --git a/EmbeddedPkg/Include/Protocol/PlatformBootManager.h b/EmbeddedPkg/Include/Protocol/PlatformBootManager.h
new file mode 100644 (file)
index 0000000..4175c85
--- /dev/null
@@ -0,0 +1,86 @@
+/** @file\r
+\r
+  Copyright (c) 2018, Linaro. All rights reserved.<BR>\r
+\r
+  This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#ifndef __PLATFORM_BOOT_MANAGER_PROTOCOL_H__\r
+#define __PLATFORM_BOOT_MANAGER_PROTOCOL_H__\r
+\r
+//\r
+// Protocol interface structure\r
+//\r
+typedef struct _PLATFORM_BOOT_MANAGER_PROTOCOL    PLATFORM_BOOT_MANAGER_PROTOCOL;\r
+\r
+//\r
+// Function Prototypes\r
+//\r
+\r
+/*\r
+  Get predefined boot options for platform.\r
+\r
+  @param[out] Count            The number of elements in each of\r
+                               BootOptions and BootKeys. On successful\r
+                               return, Count is at least one.\r
+\r
+  @param[out] BootOptions      An array of platform boot options.\r
+                               BootOptions is pool-allocated by\r
+                               GET_PLATFORM_BOOT_OPTIONS_AND_KEYS, and\r
+                               GET_PLATFORM_BOOT_OPTIONS_AND_KEYS populates\r
+                               every element in BootOptions with\r
+                               EfiBootManagerInitializeLoadOption().\r
+                               BootOptions shall not contain duplicate\r
+                               entries. The caller is responsible for\r
+                               releasing BootOptions after use with\r
+                               EfiBootManagerFreeLoadOptions().\r
+\r
+  @param[out] BootKeys         A pool-allocated array of platform boot\r
+                               hotkeys. For every 0 <= Index < Count, if\r
+                               BootOptions[Index] is not to be associated\r
+                               with a hotkey, then BootKeys[Index] is\r
+                               zero-filled. Otherwise, BootKeys[Index]\r
+                               specifies the boot hotkey for\r
+                               BootOptions[Index]. BootKeys shall not\r
+                               contain duplicate entries (other than\r
+                               zero-filled entries). The caller is\r
+                               responsible for releasing BootKeys with\r
+                               FreePool() after use.\r
+\r
+  @retval EFI_SUCCESS          Count, BootOptions and BootKeys have\r
+                               been set.\r
+\r
+  @retval EFI_OUT_OF_RESOURCES Memory allocation failed.\r
+\r
+  @retval EFI_UNSUPPORTED      The platform doesn't provide boot options\r
+                               as a feature.\r
+\r
+  @retval EFI_NOT_FOUND        The platform could provide boot options\r
+                               as a feature, but none have been\r
+                               configured.\r
+\r
+  @return                      Error codes propagated from underlying\r
+                               functions.\r
+*/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *GET_PLATFORM_BOOT_OPTIONS_AND_KEYS) (\r
+  OUT UINTN                              *Count,\r
+  OUT EFI_BOOT_MANAGER_LOAD_OPTION       **BootOptions,\r
+  OUT EFI_INPUT_KEY                      **BootKeys\r
+  );\r
+\r
+struct _PLATFORM_BOOT_MANAGER_PROTOCOL {\r
+  GET_PLATFORM_BOOT_OPTIONS_AND_KEYS     GetPlatformBootOptionsAndKeys;\r
+};\r
+\r
+extern EFI_GUID gPlatformBootManagerProtocolGuid;\r
+\r
+#endif /* __PLATFORM_BOOT_MANAGER_PROTOCOL_H__ */\r