VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Universal/EbcDxe/EbcExecute.h@ 107020

Last change on this file since 107020 was 101291, checked in by vboxsync, 19 months ago

EFI/FirmwareNew: Make edk2-stable202308 build on all supported platforms (using gcc at least, msvc not tested yet), bugref:4643

  • Property svn:eol-style set to native
File size: 3.6 KB
Line 
1/** @file
2 Header file for Virtual Machine support. Contains EBC defines that can
3 be of use to a disassembler for the most part. Also provides function
4 prototypes for VM functions.
5
6Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
7SPDX-License-Identifier: BSD-2-Clause-Patent
8
9**/
10
11#ifndef _EBC_EXECUTE_H_
12#define _EBC_EXECUTE_H_
13
14//
15// Macros to check and set alignment
16//
17#define ASSERT_ALIGNED(addr, size) ASSERT (ADDRESS_IS_ALIGNED (addr, size))
18
19//
20// Debug macro
21//
22#define EBCMSG(s) gST->ConOut->OutputString (gST->ConOut, s)
23
24/**
25 Execute an EBC image from an entry point or from a published protocol.
26
27 @param VmPtr A pointer to a VM context.
28
29 @retval EFI_UNSUPPORTED At least one of the opcodes is not supported.
30 @retval EFI_SUCCESS All of the instructions are executed successfully.
31
32**/
33EFI_STATUS
34EbcExecute (
35 IN VM_CONTEXT *VmPtr
36 );
37
38/**
39 Returns the version of the EBC virtual machine.
40
41 @return The 64-bit version of EBC virtual machine.
42
43**/
44UINT64
45GetVmVersion (
46 VOID
47 );
48
49/**
50 Writes UINTN data to memory address.
51
52 This routine is called by the EBC data
53 movement instructions that write to memory. Since these writes
54 may be to the stack, which looks like (high address on top) this,
55
56 [EBC entry point arguments]
57 [VM stack]
58 [EBC stack]
59
60 we need to detect all attempts to write to the EBC entry point argument
61 stack area and adjust the address (which will initially point into the
62 VM stack) to point into the EBC entry point arguments.
63
64 @param VmPtr A pointer to a VM context.
65 @param Addr Address to write to.
66 @param Data Value to write to Addr.
67
68 @retval EFI_SUCCESS The instruction is executed successfully.
69 @retval Other Some error occurs when writing data to the address.
70
71**/
72EFI_STATUS
73VmWriteMemN (
74 IN VM_CONTEXT *VmPtr,
75 IN UINTN Addr,
76 IN UINTN Data
77 );
78
79/**
80 Writes 64-bit data to memory address.
81
82 This routine is called by the EBC data
83 movement instructions that write to memory. Since these writes
84 may be to the stack, which looks like (high address on top) this,
85
86 [EBC entry point arguments]
87 [VM stack]
88 [EBC stack]
89
90 we need to detect all attempts to write to the EBC entry point argument
91 stack area and adjust the address (which will initially point into the
92 VM stack) to point into the EBC entry point arguments.
93
94 @param VmPtr A pointer to a VM context.
95 @param Addr Address to write to.
96 @param Data Value to write to Addr.
97
98 @retval EFI_SUCCESS The instruction is executed successfully.
99 @retval Other Some error occurs when writing data to the address.
100
101**/
102EFI_STATUS
103VmWriteMem64 (
104 IN VM_CONTEXT *VmPtr,
105 IN UINTN Addr,
106 IN UINT64 Data
107 );
108
109/**
110 Given a pointer to a new VM context, execute one or more instructions. This
111 function is only used for test purposes via the EBC VM test protocol.
112
113 @param This A pointer to the EFI_EBC_VM_TEST_PROTOCOL structure.
114 @param VmPtr A pointer to a VM context.
115 @param InstructionCount A pointer to a UINTN value holding the number of
116 instructions to execute. If it holds value of 0,
117 then the instruction to be executed is 1.
118
119 @retval EFI_UNSUPPORTED At least one of the opcodes is not supported.
120 @retval EFI_SUCCESS All of the instructions are executed successfully.
121
122**/
123EFI_STATUS
124EFIAPI
125EbcExecuteInstructions (
126 IN EFI_EBC_VM_TEST_PROTOCOL *This,
127 IN VM_CONTEXT *VmPtr,
128 IN OUT UINTN *InstructionCount
129 );
130
131#endif // ifndef _EBC_EXECUTE_H_
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette