1 | /*++ |
---|
2 | |
---|
3 | Copyright (c) 1999 Intel Corporation |
---|
4 | |
---|
5 | Module Name: |
---|
6 | |
---|
7 | legacyboot |
---|
8 | |
---|
9 | Abstract: |
---|
10 | |
---|
11 | EFI support for legacy boot |
---|
12 | |
---|
13 | |
---|
14 | |
---|
15 | Revision 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 | // |
---|
32 | typedef 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 | |
---|
41 | typedef |
---|
42 | EFI_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 | |
---|
53 | typedef enum { |
---|
54 | IplRelative, |
---|
55 | BcvRelative |
---|
56 | } BBS_TYPE; |
---|
57 | |
---|
58 | INTERFACE_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 | // |
---|
67 | typedef |
---|
68 | EFI_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 | // |
---|
79 | typedef |
---|
80 | EFI_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 | // |
---|
93 | typedef |
---|
94 | EFI_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 | |
---|
102 | typedef 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 | |
---|
114 | EFI_STATUS |
---|
115 | PlInitializeLegacyBoot ( |
---|
116 | VOID |
---|
117 | ); |
---|
118 | |
---|
119 | #endif |
---|