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