diff options
author | Haojian Zhuang <haojian.zhuang@linaro.org> | 2018-04-23 14:21:53 +0800 |
---|---|---|
committer | Leif Lindholm <leif.lindholm@linaro.org> | 2018-06-05 15:43:15 +0100 |
commit | 7e074d15e7b98c0101a17547cce2b464827df540 (patch) | |
tree | 099cd0b096604f63e21e094199e4b9ca5190c984 /EmbeddedPkg/Include | |
parent | 76022b02e867c7372c07d575a1733b8a84c6615a (diff) | |
download | edk2-7e074d15e7b98c0101a17547cce2b464827df540.tar.gz edk2-7e074d15e7b98c0101a17547cce2b464827df540.tar.bz2 edk2-7e074d15e7b98c0101a17547cce2b464827df540.zip |
EmbeddedPkg: add platform boot manager protocol
Create the PlatformBootManagerProtocol that is used to add
predefined boot options in platform driver. This interface
will be used in ArmPkg/PlatformBootManagerLib.
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Diffstat (limited to 'EmbeddedPkg/Include')
-rw-r--r-- | EmbeddedPkg/Include/Protocol/PlatformBootManager.h | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/EmbeddedPkg/Include/Protocol/PlatformBootManager.h b/EmbeddedPkg/Include/Protocol/PlatformBootManager.h new file mode 100644 index 0000000000..4175c854b6 --- /dev/null +++ b/EmbeddedPkg/Include/Protocol/PlatformBootManager.h @@ -0,0 +1,86 @@ +/** @file
+
+ Copyright (c) 2018, Linaro. All rights reserved.<BR>
+
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __PLATFORM_BOOT_MANAGER_PROTOCOL_H__
+#define __PLATFORM_BOOT_MANAGER_PROTOCOL_H__
+
+//
+// Protocol interface structure
+//
+typedef struct _PLATFORM_BOOT_MANAGER_PROTOCOL PLATFORM_BOOT_MANAGER_PROTOCOL;
+
+//
+// Function Prototypes
+//
+
+/*
+ Get predefined boot options for platform.
+
+ @param[out] Count The number of elements in each of
+ BootOptions and BootKeys. On successful
+ return, Count is at least one.
+
+ @param[out] BootOptions An array of platform boot options.
+ BootOptions is pool-allocated by
+ GET_PLATFORM_BOOT_OPTIONS_AND_KEYS, and
+ GET_PLATFORM_BOOT_OPTIONS_AND_KEYS populates
+ every element in BootOptions with
+ EfiBootManagerInitializeLoadOption().
+ BootOptions shall not contain duplicate
+ entries. The caller is responsible for
+ releasing BootOptions after use with
+ EfiBootManagerFreeLoadOptions().
+
+ @param[out] BootKeys A pool-allocated array of platform boot
+ hotkeys. For every 0 <= Index < Count, if
+ BootOptions[Index] is not to be associated
+ with a hotkey, then BootKeys[Index] is
+ zero-filled. Otherwise, BootKeys[Index]
+ specifies the boot hotkey for
+ BootOptions[Index]. BootKeys shall not
+ contain duplicate entries (other than
+ zero-filled entries). The caller is
+ responsible for releasing BootKeys with
+ FreePool() after use.
+
+ @retval EFI_SUCCESS Count, BootOptions and BootKeys have
+ been set.
+
+ @retval EFI_OUT_OF_RESOURCES Memory allocation failed.
+
+ @retval EFI_UNSUPPORTED The platform doesn't provide boot options
+ as a feature.
+
+ @retval EFI_NOT_FOUND The platform could provide boot options
+ as a feature, but none have been
+ configured.
+
+ @return Error codes propagated from underlying
+ functions.
+*/
+typedef
+EFI_STATUS
+(EFIAPI *GET_PLATFORM_BOOT_OPTIONS_AND_KEYS) (
+ OUT UINTN *Count,
+ OUT EFI_BOOT_MANAGER_LOAD_OPTION **BootOptions,
+ OUT EFI_INPUT_KEY **BootKeys
+ );
+
+struct _PLATFORM_BOOT_MANAGER_PROTOCOL {
+ GET_PLATFORM_BOOT_OPTIONS_AND_KEYS GetPlatformBootOptionsAndKeys;
+};
+
+extern EFI_GUID gPlatformBootManagerProtocolGuid;
+
+#endif /* __PLATFORM_BOOT_MANAGER_PROTOCOL_H__ */
|