]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Efi/Protocol/Ebc/Ebc.h
Add in the 1st version of ECP.
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Efi / Protocol / Ebc / Ebc.h
CommitLineData
3eb9473e 1/*++\r
2\r
3Copyright (c) 2004, 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 Ebc.h\r
15 \r
16Abstract:\r
17\r
18 Describes the protocol interface to the EBC interpreter.\r
19 \r
20--*/\r
21\r
22#ifndef _EBC_H_\r
23#define _EBC_H_\r
24\r
25#define EFI_EBC_INTERPRETER_PROTOCOL_GUID \\r
26 { \\r
27 0x13AC6DD1, 0x73D0, 0x11D4, 0xB0, 0x6B, 0x00, 0xAA, 0x00, 0xBD, 0x6D, 0xE7 \\r
28 }\r
29\r
30//\r
31// Define for forward reference.\r
32//\r
33EFI_FORWARD_DECLARATION (EFI_EBC_PROTOCOL);\r
34\r
35/*++\r
36\r
37Routine Description:\r
38 \r
39 Create a thunk for an image entry point. In short, given the physical address\r
40 of the entry point for a loaded image, create a thunk that does some \r
41 fixup of arguments (and perform any other necessary overhead) and then\r
42 calls the original entry point. The caller can then use the returned pointer\r
43 to the created thunk as the new entry point to image.\r
44\r
45Arguments:\r
46\r
47 This - protocol instance pointer\r
48 ImageHandle - handle to the image. The EBC interpreter may use this to keep\r
49 track of any resource allocations performed in loading and\r
50 executing the image.\r
51 EbcEntryPoint - the entry point for the image (as defined in the file header)\r
52 Thunk - pointer to thunk pointer where the address of the created\r
53 thunk is returned.\r
54\r
55Returns:\r
56\r
57 Standard EFI_STATUS\r
58\r
59--*/\r
60typedef\r
61EFI_STATUS\r
62(EFIAPI *EFI_EBC_CREATE_THUNK) (\r
63 IN EFI_EBC_PROTOCOL * This,\r
64 IN EFI_HANDLE ImageHandle,\r
65 IN VOID *EbcEntryPoint,\r
66 OUT VOID **Thunk\r
67 );\r
68\r
69/*++\r
70\r
71Routine Description:\r
72 \r
73 Perform any cleanup necessary when an image is unloaded. Basically it gives\r
74 the EBC interpreter the chance to free up any resources allocated during\r
75 load and execution of an EBC image.\r
76\r
77Arguments:\r
78\r
79 This - protocol instance pointer\r
80 ImageHandle - the handle of the image being unloaded.\r
81\r
82Returns:\r
83\r
84 Standard EFI_STATUS.\r
85\r
86--*/\r
87typedef\r
88EFI_STATUS\r
89(EFIAPI *EFI_EBC_UNLOAD_IMAGE) (\r
90 IN EFI_EBC_PROTOCOL * This,\r
91 IN EFI_HANDLE ImageHandle\r
92 );\r
93\r
94/*++\r
95\r
96Routine Description:\r
97 \r
98 The I-Cache-flush registration service takes a pointer to a function to\r
99 call to flush the I-Cache. Here's the prototype for that function pointer.\r
100\r
101Arguments:\r
102\r
103 Start - physical start address of CPU instruction cache to flush.\r
104 Length - how many bytes to flush of the instruction cache.\r
105\r
106Returns:\r
107\r
108 Standard EFI_STATUS.\r
109\r
110--*/\r
111typedef\r
112EFI_STATUS\r
113(EFIAPI *EBC_ICACHE_FLUSH) (\r
114 IN EFI_PHYSICAL_ADDRESS Start,\r
115 IN UINT64 Length\r
116 );\r
117\r
118/*++\r
119\r
120Routine Description:\r
121 \r
122 This routine is called by the core firmware to provide the EBC driver with\r
123 a function to call to flush the CPU's instruction cache following creation\r
124 of a thunk. It is not required.\r
125\r
126Arguments:\r
127\r
128 This - protocol instance pointer\r
129 Flush - pointer to the function to call to flush the CPU instruction\r
130 cache.\r
131\r
132Returns:\r
133\r
134 Standard EFI_STATUS.\r
135\r
136--*/\r
137typedef\r
138EFI_STATUS\r
139(EFIAPI *EFI_EBC_REGISTER_ICACHE_FLUSH) (\r
140 IN EFI_EBC_PROTOCOL * This,\r
141 IN EBC_ICACHE_FLUSH Flush\r
142 );\r
143\r
144/*++\r
145\r
146Routine Description:\r
147 \r
148 This routine can be called to get the VM revision. It returns the same\r
149 value as the EBC BREAK 1 instruction returns.\r
150\r
151Arguments:\r
152\r
153 This - protocol instance pointer\r
154 Version - pointer to where to return the VM version\r
155\r
156Returns:\r
157\r
158 Standard EFI_STATUS.\r
159\r
160--*/\r
161typedef\r
162EFI_STATUS\r
163(EFIAPI *EFI_EBC_GET_VERSION) (\r
164 IN EFI_EBC_PROTOCOL * This,\r
165 IN OUT UINT64 *Version\r
166 );\r
167\r
168//\r
169// Prototype for the actual EBC protocol interface\r
170//\r
171typedef struct _EFI_EBC_PROTOCOL {\r
172 EFI_EBC_CREATE_THUNK CreateThunk;\r
173 EFI_EBC_UNLOAD_IMAGE UnloadImage;\r
174 EFI_EBC_REGISTER_ICACHE_FLUSH RegisterICacheFlush;\r
175 EFI_EBC_GET_VERSION GetVersion;\r
176} EFI_EBC_PROTOCOL;\r
177\r
178//\r
179// Extern the global EBC protocol GUID\r
180//\r
181extern EFI_GUID gEfiEbcProtocolGuid;\r
182\r
183#endif\r