]> git.proxmox.com Git - mirror_edk2.git/blame - DuetPkg/Include/Protocol/LegacyBiosThunk.h
enhanced security check.
[mirror_edk2.git] / DuetPkg / Include / Protocol / LegacyBiosThunk.h
CommitLineData
1ec25923 1/*++\r
2\r
3Copyright (c) 2006, Intel Corporation \r
4All rights reserved. This program and the accompanying materials \r
5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12Module Name:\r
13\r
14 LegacyBiosThunk.h\r
15 \r
16Abstract:\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
35Revision 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\r
43#define EFI_LEGACY_BIOS_THUNK_PROTOCOL_GUID \\r
44 { \\r
45 0x4c51a7ba, 0x7195, 0x442d, 0x87, 0x92, 0xbe, 0xea, 0x6e, 0x2f, 0xf6, 0xec \\r
46 }\r
47\r
48typedef struct _EFI_LEGACY_BIOS_THUNK_PROTOCOL EFI_LEGACY_BIOS_THUNK_PROTOCOL;\r
49\r
50typedef\r
51BOOLEAN\r
52(EFIAPI *EFI_LEGACY_BIOS_THUNK_INT86) (\r
53 IN EFI_LEGACY_BIOS_THUNK_PROTOCOL * This,\r
54 IN UINT8 BiosInt,\r
55 IN OUT EFI_IA32_REGISTER_SET * Regs\r
56 )\r
57/*++\r
58\r
59 Routine Description:\r
60 Thunk to 16-bit real mode and execute a software interrupt with a vector \r
61 of BiosInt. Regs will contain the 16-bit register context on entry and \r
62 exit.\r
63\r
64 Arguments:\r
65 This - Protocol instance pointer.\r
66 BiosInt - Processor interrupt vector to invoke\r
67 Reg - Register contexted passed into (and returned) from thunk to \r
68 16-bit mode\r
69\r
70 Returns:\r
71 FALSE - Thunk completed, and there were no BIOS errors in the target code.\r
72 See Regs for status.\r
73 TRUE - There was a BIOS erro in the target code.\r
74\r
75--*/\r
76;\r
77\r
78typedef\r
79BOOLEAN\r
80(EFIAPI *EFI_LEGACY_BIOS_THUNK_FARCALL86) (\r
81 IN EFI_LEGACY_BIOS_THUNK_PROTOCOL * This,\r
82 IN UINT16 Segment,\r
83 IN UINT16 Offset,\r
84 IN EFI_IA32_REGISTER_SET * Regs,\r
85 IN VOID *Stack,\r
86 IN UINTN StackSize\r
87 )\r
88/*++\r
89\r
90 Routine Description:\r
91 Thunk to 16-bit real mode and call Segment:Offset. Regs will contain the \r
92 16-bit register context on entry and exit. Arguments can be passed on \r
93 the Stack argument\r
94\r
95 Arguments:\r
96 This - Protocol instance pointer.\r
97 Segment - Segemnt of 16-bit mode call\r
98 Offset - Offset of 16-bit mdoe call\r
99 Reg - Register contexted passed into (and returned) from thunk to \r
100 16-bit mode\r
101 Stack - Caller allocated stack used to pass arguments\r
102 StackSize - Size of Stack in bytes\r
103\r
104 Returns:\r
105 FALSE - Thunk completed, and there were no BIOS errors in the target code.\r
106 See Regs for status.\r
107 TRUE - There was a BIOS erro in the target code.\r
108\r
109--*/\r
110;\r
111\r
112struct _EFI_LEGACY_BIOS_THUNK_PROTOCOL {\r
113 EFI_LEGACY_BIOS_THUNK_INT86 Int86;\r
114 EFI_LEGACY_BIOS_THUNK_FARCALL86 FarCall86;\r
115};\r
116\r
117extern EFI_GUID gEfiLegacyBiosThunkProtocolGuid;\r
118\r
119#endif\r