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