legacyboot.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /*++
  2. Copyright (c) 1999 Intel Corporation
  3. Module Name:
  4. legacyboot
  5. Abstract:
  6. EFI support for legacy boot
  7. Revision History
  8. --*/
  9. #ifndef _LEGACY_BOOT_INCLUDE_
  10. #define _LEGACY_BOOT_INCLUDE_
  11. #define LEGACY_BOOT_PROTOCOL \
  12. { 0x376e5eb2, 0x30e4, 0x11d3, { 0xba, 0xe5, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } }
  13. #pragma pack(1)
  14. //
  15. // BBS 1.01 (See Appendix A) IPL and BCV Table Entry Data structure.
  16. // Seg:Off pointers have been converted to EFI pointers in this data structure
  17. // This is the structure that also maps to the EFI device path for the boot selection
  18. //
  19. typedef struct {
  20. UINT16 DeviceType;
  21. UINT16 StatusFlag;
  22. UINT32 Reserved;
  23. VOID *BootHandler; // Not an EFI entry point
  24. CHAR8 *DescString;
  25. } BBS_TABLE_ENTRY;
  26. #pragma pack()
  27. typedef
  28. EFI_STATUS
  29. (EFIAPI *LEGACY_BOOT_CALL) (
  30. IN EFI_DEVICE_PATH *DevicePath
  31. );
  32. //
  33. // BBS support functions
  34. // PnP Call numbers and BiosSelector hidden in implementation
  35. //
  36. typedef enum {
  37. IplRelative,
  38. BcvRelative
  39. } BBS_TYPE;
  40. INTERFACE_DECL(_LEGACY_BOOT_INTERFACE);
  41. //
  42. // == PnP Function 0x60 then BbsVersion == 0x0101 if this call fails then BbsVersion == 0x0000
  43. //
  44. //
  45. // == PnP Function 0x61
  46. //
  47. typedef
  48. EFI_STATUS
  49. (EFIAPI *GET_DEVICE_COUNT) (
  50. IN struct _LEGACY_BOOT_INTERFACE *This,
  51. IN BBS_TYPE *TableType,
  52. OUT UINTN *DeviceCount,
  53. OUT UINTN *MaxCount
  54. );
  55. //
  56. // == PnP Function 0x62
  57. //
  58. typedef
  59. EFI_STATUS
  60. (EFIAPI *GET_PRIORITY_AND_TABLE) (
  61. IN struct _LEGACY_BOOT_INTERFACE *This,
  62. IN BBS_TYPE *TableType,
  63. IN OUT UINTN *PrioritySize, // MaxCount * sizeof(UINT8)
  64. OUT UINTN *Priority,
  65. IN OUT UINTN *TableSize, // MaxCount * sizeof(BBS_TABLE_ENTRY)
  66. OUT BBS_TABLE_ENTRY *TableEntrySize
  67. );
  68. //
  69. // == PnP Function 0x63
  70. //
  71. typedef
  72. EFI_STATUS
  73. (EFIAPI *SET_PRIORITY) (
  74. IN struct _LEGACY_BOOT_INTERFACE *This,
  75. IN BBS_TYPE *TableType,
  76. IN OUT UINTN *PrioritySize,
  77. OUT UINTN *Priority
  78. );
  79. typedef struct _LEGACY_BOOT_INTERFACE {
  80. LEGACY_BOOT_CALL BootIt;
  81. //
  82. // New functions to allow BBS booting to be configured from EFI
  83. //
  84. UINTN BbsVersion; // Currently 0x0101
  85. GET_DEVICE_COUNT GetDeviceCount;
  86. GET_PRIORITY_AND_TABLE GetPriorityAndTable;
  87. SET_PRIORITY SetPriority;
  88. } LEGACY_BOOT_INTERFACE;
  89. EFI_STATUS
  90. PlInitializeLegacyBoot (
  91. VOID
  92. );
  93. #endif