2 Describes the protocol interface to the EBC interpreter.
4 Copyright (c) 2006, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #ifndef __EFI_EBC_PROTOCOL_H__
16 #define __EFI_EBC_PROTOCOL_H__
18 #define EFI_EBC_INTERPRETER_PROTOCOL_GUID \
20 0x13AC6DD1, 0x73D0, 0x11D4, {0xB0, 0x6B, 0x00, 0xAA, 0x00, 0xBD, 0x6D, 0xE7 } \
24 // Protocol Guid Name defined in spec.
26 #define EFI_EBC_PROTOCOL_GUID EFI_EBC_INTERPRETER_PROTOCOL_GUID
29 // Define for forward reference.
31 typedef struct _EFI_EBC_PROTOCOL EFI_EBC_PROTOCOL
;
34 Create a thunk for an image entry point. In short, given the physical address
35 of the entry point for a loaded image, create a thunk that does some
36 fixup of arguments (and perform any other necessary overhead) and then
37 calls the original entry point. The caller can then use the returned pointer
38 to the created thunk as the new entry point to image.
40 @param This protocol instance pointer
41 @param ImageHandle handle to the image. The EBC interpreter may use this to keep
42 track of any resource allocations performed in loading and
44 @param EbcEntryPoint the entry point for the image (as defined in the file header)
45 @param Thunk pointer to thunk pointer where the address of the created
48 @return Standard EFI_STATUS
53 (EFIAPI
*EFI_EBC_CREATE_THUNK
) (
54 IN EFI_EBC_PROTOCOL
*This
,
55 IN EFI_HANDLE ImageHandle
,
56 IN VOID
*EbcEntryPoint
,
61 Perform any cleanup necessary when an image is unloaded. Basically it gives
62 the EBC interpreter the chance to free up any resources allocated during
63 load and execution of an EBC image.
65 @param This protocol instance pointer
66 @param ImageHandle the handle of the image being unloaded.
68 @return Standard EFI_STATUS.
73 (EFIAPI
*EFI_EBC_UNLOAD_IMAGE
) (
74 IN EFI_EBC_PROTOCOL
*This
,
75 IN EFI_HANDLE ImageHandle
79 The I-Cache-flush registration service takes a pointer to a function to
80 call to flush the I-Cache. Here's the prototype for that function pointer.
82 @param Start physical start address of CPU instruction cache to flush.
83 @param Length how many bytes to flush of the instruction cache.
85 @return Standard EFI_STATUS.
90 (EFIAPI
*EBC_ICACHE_FLUSH
) (
91 IN EFI_PHYSICAL_ADDRESS Start
,
96 This routine is called by the core firmware to provide the EBC driver with
97 a function to call to flush the CPU's instruction cache following creation
98 of a thunk. It is not required.
100 @param This protocol instance pointer
101 @param Flush pointer to the function to call to flush the CPU instruction
104 @return Standard EFI_STATUS.
109 (EFIAPI
*EFI_EBC_REGISTER_ICACHE_FLUSH
) (
110 IN EFI_EBC_PROTOCOL
*This
,
111 IN EBC_ICACHE_FLUSH Flush
115 This routine can be called to get the VM revision. It returns the same
116 value as the EBC BREAK 1 instruction returns.
118 @param This protocol instance pointer
119 @param Version pointer to where to return the VM version
121 @return Standard EFI_STATUS.
126 (EFIAPI
*EFI_EBC_GET_VERSION
) (
127 IN EFI_EBC_PROTOCOL
*This
,
128 IN OUT UINT64
*Version
132 // Prototype for the actual EBC protocol interface
134 struct _EFI_EBC_PROTOCOL
{
135 EFI_EBC_CREATE_THUNK CreateThunk
;
136 EFI_EBC_UNLOAD_IMAGE UnloadImage
;
137 EFI_EBC_REGISTER_ICACHE_FLUSH RegisterICacheFlush
;
138 EFI_EBC_GET_VERSION GetVersion
;
142 // Extern the global EBC protocol GUID
144 extern EFI_GUID gEfiEbcProtocolGuid
;