PlatformBootManager.h 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /** @file
  2. Copyright (c) 2018, Linaro. All rights reserved.<BR>
  3. SPDX-License-Identifier: BSD-2-Clause-Patent
  4. **/
  5. #ifndef __PLATFORM_BOOT_MANAGER_PROTOCOL_H__
  6. #define __PLATFORM_BOOT_MANAGER_PROTOCOL_H__
  7. //
  8. // Protocol interface structure
  9. //
  10. typedef struct _PLATFORM_BOOT_MANAGER_PROTOCOL PLATFORM_BOOT_MANAGER_PROTOCOL;
  11. //
  12. // Function Prototypes
  13. //
  14. /*
  15. Get predefined boot options for platform.
  16. @param[out] Count The number of elements in each of
  17. BootOptions and BootKeys. On successful
  18. return, Count is at least one.
  19. @param[out] BootOptions An array of platform boot options.
  20. BootOptions is pool-allocated by
  21. GET_PLATFORM_BOOT_OPTIONS_AND_KEYS, and
  22. GET_PLATFORM_BOOT_OPTIONS_AND_KEYS populates
  23. every element in BootOptions with
  24. EfiBootManagerInitializeLoadOption().
  25. BootOptions shall not contain duplicate
  26. entries. The caller is responsible for
  27. releasing BootOptions after use with
  28. EfiBootManagerFreeLoadOptions().
  29. @param[out] BootKeys A pool-allocated array of platform boot
  30. hotkeys. For every 0 <= Index < Count, if
  31. BootOptions[Index] is not to be associated
  32. with a hotkey, then BootKeys[Index] is
  33. zero-filled. Otherwise, BootKeys[Index]
  34. specifies the boot hotkey for
  35. BootOptions[Index]. BootKeys shall not
  36. contain duplicate entries (other than
  37. zero-filled entries). The caller is
  38. responsible for releasing BootKeys with
  39. FreePool() after use.
  40. @retval EFI_SUCCESS Count, BootOptions and BootKeys have
  41. been set.
  42. @retval EFI_OUT_OF_RESOURCES Memory allocation failed.
  43. @retval EFI_UNSUPPORTED The platform doesn't provide boot options
  44. as a feature.
  45. @retval EFI_NOT_FOUND The platform could provide boot options
  46. as a feature, but none have been
  47. configured.
  48. @return Error codes propagated from underlying
  49. functions.
  50. */
  51. typedef
  52. EFI_STATUS
  53. (EFIAPI *GET_PLATFORM_BOOT_OPTIONS_AND_KEYS) (
  54. OUT UINTN *Count,
  55. OUT EFI_BOOT_MANAGER_LOAD_OPTION **BootOptions,
  56. OUT EFI_INPUT_KEY **BootKeys
  57. );
  58. struct _PLATFORM_BOOT_MANAGER_PROTOCOL {
  59. GET_PLATFORM_BOOT_OPTIONS_AND_KEYS GetPlatformBootOptionsAndKeys;
  60. };
  61. extern EFI_GUID gPlatformBootManagerProtocolGuid;
  62. #endif /* __PLATFORM_BOOT_MANAGER_PROTOCOL_H__ */