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