]>
Commit | Line | Data |
---|---|---|
3eb9473e | 1 | /*++\r |
2 | \r | |
3 | Copyright (c) 2006, Intel Corporation \r | |
4 | All rights reserved. This program and the accompanying materials \r | |
5 | are licensed and made available under the terms and conditions of the BSD License \r | |
6 | which accompanies this distribution. The full text of the license may be found at \r | |
7 | http://opensource.org/licenses/bsd-license.php \r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
11 | \r | |
12 | Module Name:\r | |
13 | \r | |
14 | LegacyBiosThunk.h\r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
18 | The EFI Legacy BIOS Thunk Protocol is used to abstract Thunk16 call.\r | |
19 | \r | |
20 | Note: The names for EFI_IA32_REGISTER_SET elements were picked to follow \r | |
21 | well known naming conventions.\r | |
22 | \r | |
23 | Thunk - A thunk is a transition from one processor mode to another. A Thunk\r | |
24 | is a transition from native EFI mode to 16-bit mode. A reverse thunk\r | |
25 | would be a transition from 16-bit mode to native EFI mode.\r | |
26 | \r | |
27 | \r | |
28 | Note: Note: Note: Note: Note: Note: Note:\r | |
29 | \r | |
30 | You most likely should not use this protocol! Find the EFI way to solve the\r | |
31 | problem to make your code portable\r | |
32 | \r | |
33 | Note: Note: Note: Note: Note: Note: Note:\r | |
34 | \r | |
35 | Revision History\r | |
36 | \r | |
37 | --*/\r | |
38 | \r | |
39 | #ifndef _EFI_LEGACY_BIOS_THUNK_H_\r | |
40 | #define _EFI_LEGACY_BIOS_THUNK_H_\r | |
41 | \r | |
42 | #include EFI_PROTOCOL_DEFINITION (LegacyBios)\r | |
43 | \r | |
44 | #define EFI_LEGACY_BIOS_THUNK_PROTOCOL_GUID \\r | |
45 | { \\r | |
46 | 0x4c51a7ba, 0x7195, 0x442d, 0x87, 0x92, 0xbe, 0xea, 0x6e, 0x2f, 0xf6, 0xec \\r | |
47 | }\r | |
48 | \r | |
49 | EFI_FORWARD_DECLARATION (EFI_LEGACY_BIOS_THUNK_PROTOCOL);\r | |
50 | \r | |
51 | typedef\r | |
52 | BOOLEAN\r | |
53 | (EFIAPI *EFI_LEGACY_BIOS_THUNK_INT86) (\r | |
54 | IN EFI_LEGACY_BIOS_THUNK_PROTOCOL * This,\r | |
55 | IN UINT8 BiosInt,\r | |
56 | IN OUT EFI_IA32_REGISTER_SET * Regs\r | |
57 | )\r | |
58 | /*++\r | |
59 | \r | |
60 | Routine Description:\r | |
61 | Thunk to 16-bit real mode and execute a software interrupt with a vector \r | |
62 | of BiosInt. Regs will contain the 16-bit register context on entry and \r | |
63 | exit.\r | |
64 | \r | |
65 | Arguments:\r | |
66 | This - Protocol instance pointer.\r | |
67 | BiosInt - Processor interrupt vector to invoke\r | |
68 | Reg - Register contexted passed into (and returned) from thunk to \r | |
69 | 16-bit mode\r | |
70 | \r | |
71 | Returns:\r | |
72 | FALSE - Thunk completed, and there were no BIOS errors in the target code.\r | |
73 | See Regs for status.\r | |
74 | TRUE - There was a BIOS erro in the target code.\r | |
75 | \r | |
76 | --*/\r | |
77 | ;\r | |
78 | \r | |
79 | typedef\r | |
80 | BOOLEAN\r | |
81 | (EFIAPI *EFI_LEGACY_BIOS_THUNK_FARCALL86) (\r | |
82 | IN EFI_LEGACY_BIOS_THUNK_PROTOCOL * This,\r | |
83 | IN UINT16 Segment,\r | |
84 | IN UINT16 Offset,\r | |
85 | IN EFI_IA32_REGISTER_SET * Regs,\r | |
86 | IN VOID *Stack,\r | |
87 | IN UINTN StackSize\r | |
88 | )\r | |
89 | /*++\r | |
90 | \r | |
91 | Routine Description:\r | |
92 | Thunk to 16-bit real mode and call Segment:Offset. Regs will contain the \r | |
93 | 16-bit register context on entry and exit. Arguments can be passed on \r | |
94 | the Stack argument\r | |
95 | \r | |
96 | Arguments:\r | |
97 | This - Protocol instance pointer.\r | |
98 | Segment - Segemnt of 16-bit mode call\r | |
99 | Offset - Offset of 16-bit mdoe call\r | |
100 | Reg - Register contexted passed into (and returned) from thunk to \r | |
101 | 16-bit mode\r | |
102 | Stack - Caller allocated stack used to pass arguments\r | |
103 | StackSize - Size of Stack in bytes\r | |
104 | \r | |
105 | Returns:\r | |
106 | FALSE - Thunk completed, and there were no BIOS errors in the target code.\r | |
107 | See Regs for status.\r | |
108 | TRUE - There was a BIOS erro in the target code.\r | |
109 | \r | |
110 | --*/\r | |
111 | ;\r | |
112 | \r | |
113 | typedef struct _EFI_LEGACY_BIOS_THUNK_PROTOCOL {\r | |
114 | EFI_LEGACY_BIOS_THUNK_INT86 Int86;\r | |
115 | EFI_LEGACY_BIOS_THUNK_FARCALL86 FarCall86;\r | |
116 | } EFI_LEGACY_BIOS_THUNK_PROTOCOL;\r | |
117 | \r | |
118 | extern EFI_GUID gEfiLegacyBiosThunkProtocolGuid;\r | |
119 | \r | |
120 | #endif\r |