3 Copyright (c) 2004, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 Describes the protocol interface to the EBC interpreter.
25 #define EFI_EBC_INTERPRETER_PROTOCOL_GUID \
27 0x13AC6DD1, 0x73D0, 0x11D4, 0xB0, 0x6B, 0x00, 0xAA, 0x00, 0xBD, 0x6D, 0xE7 \
31 // Define for forward reference.
33 EFI_FORWARD_DECLARATION (EFI_EBC_PROTOCOL
);
39 Create a thunk for an image entry point. In short, given the physical address
40 of the entry point for a loaded image, create a thunk that does some
41 fixup of arguments (and perform any other necessary overhead) and then
42 calls the original entry point. The caller can then use the returned pointer
43 to the created thunk as the new entry point to image.
47 This - protocol instance pointer
48 ImageHandle - handle to the image. The EBC interpreter may use this to keep
49 track of any resource allocations performed in loading and
51 EbcEntryPoint - the entry point for the image (as defined in the file header)
52 Thunk - pointer to thunk pointer where the address of the created
62 (EFIAPI
*EFI_EBC_CREATE_THUNK
) (
63 IN EFI_EBC_PROTOCOL
* This
,
64 IN EFI_HANDLE ImageHandle
,
65 IN VOID
*EbcEntryPoint
,
73 Perform any cleanup necessary when an image is unloaded. Basically it gives
74 the EBC interpreter the chance to free up any resources allocated during
75 load and execution of an EBC image.
79 This - protocol instance pointer
80 ImageHandle - the handle of the image being unloaded.
89 (EFIAPI
*EFI_EBC_UNLOAD_IMAGE
) (
90 IN EFI_EBC_PROTOCOL
* This
,
91 IN EFI_HANDLE ImageHandle
98 The I-Cache-flush registration service takes a pointer to a function to
99 call to flush the I-Cache. Here's the prototype for that function pointer.
103 Start - physical start address of CPU instruction cache to flush.
104 Length - how many bytes to flush of the instruction cache.
113 (EFIAPI
*EBC_ICACHE_FLUSH
) (
114 IN EFI_PHYSICAL_ADDRESS Start
,
122 This routine is called by the core firmware to provide the EBC driver with
123 a function to call to flush the CPU's instruction cache following creation
124 of a thunk. It is not required.
128 This - protocol instance pointer
129 Flush - pointer to the function to call to flush the CPU instruction
139 (EFIAPI
*EFI_EBC_REGISTER_ICACHE_FLUSH
) (
140 IN EFI_EBC_PROTOCOL
* This
,
141 IN EBC_ICACHE_FLUSH Flush
148 This routine can be called to get the VM revision. It returns the same
149 value as the EBC BREAK 1 instruction returns.
153 This - protocol instance pointer
154 Version - pointer to where to return the VM version
163 (EFIAPI
*EFI_EBC_GET_VERSION
) (
164 IN EFI_EBC_PROTOCOL
* This
,
165 IN OUT UINT64
*Version
169 // Prototype for the actual EBC protocol interface
171 struct _EFI_EBC_PROTOCOL
{
172 EFI_EBC_CREATE_THUNK CreateThunk
;
173 EFI_EBC_UNLOAD_IMAGE UnloadImage
;
174 EFI_EBC_REGISTER_ICACHE_FLUSH RegisterICacheFlush
;
175 EFI_EBC_GET_VERSION GetVersion
;
179 // Extern the global EBC protocol GUID
181 extern EFI_GUID gEfiEbcProtocolGuid
;