1 | /** @file
|
---|
2 | Prototypes for the EBC Debugger hooks.
|
---|
3 |
|
---|
4 | Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
|
---|
5 | SPDX-License-Identifier: BSD-2-Clause-Patent
|
---|
6 |
|
---|
7 | **/
|
---|
8 |
|
---|
9 | #ifndef _EFI_EBC_DEBUGGER_HOOK_H_
|
---|
10 | #define _EFI_EBC_DEBUGGER_HOOK_H_
|
---|
11 |
|
---|
12 | #include <Uefi.h>
|
---|
13 |
|
---|
14 | #include <Protocol/DebugSupport.h>
|
---|
15 | #include <Protocol/EbcVmTest.h>
|
---|
16 |
|
---|
17 | /**
|
---|
18 | The VM interpreter calls this function when an exception is detected.
|
---|
19 |
|
---|
20 | @param ExceptionType Specifies the processor exception detected.
|
---|
21 | @param ExceptionFlags Specifies the exception context.
|
---|
22 | @param VmPtr Pointer to a VM context for passing info to the
|
---|
23 | EFI debugger.
|
---|
24 |
|
---|
25 | @retval EFI_SUCCESS This function completed successfully.
|
---|
26 |
|
---|
27 | **/
|
---|
28 | EFI_STATUS
|
---|
29 | EbcDebugSignalException (
|
---|
30 | IN EFI_EXCEPTION_TYPE ExceptionType,
|
---|
31 | IN EXCEPTION_FLAGS ExceptionFlags,
|
---|
32 | IN VM_CONTEXT *VmPtr
|
---|
33 | );
|
---|
34 |
|
---|
35 | /**
|
---|
36 |
|
---|
37 | The hook in InitializeEbcDriver.
|
---|
38 |
|
---|
39 | @param Handle - The EbcDebugProtocol handle.
|
---|
40 | @param EbcDebugProtocol - The EbcDebugProtocol interface.
|
---|
41 |
|
---|
42 | **/
|
---|
43 | VOID
|
---|
44 | EbcDebuggerHookInit (
|
---|
45 | IN EFI_HANDLE Handle,
|
---|
46 | IN EFI_DEBUG_SUPPORT_PROTOCOL *EbcDebugProtocol
|
---|
47 | );
|
---|
48 |
|
---|
49 | /**
|
---|
50 |
|
---|
51 | The hook in UnloadImage for EBC Interpreter.
|
---|
52 |
|
---|
53 | **/
|
---|
54 | VOID
|
---|
55 | EbcDebuggerHookUnload (
|
---|
56 | VOID
|
---|
57 | );
|
---|
58 |
|
---|
59 | /**
|
---|
60 |
|
---|
61 | The hook in EbcUnloadImage.
|
---|
62 | Currently do nothing here.
|
---|
63 |
|
---|
64 | @param Handle The EbcImage handle.
|
---|
65 |
|
---|
66 | **/
|
---|
67 | VOID
|
---|
68 | EbcDebuggerHookEbcUnloadImage (
|
---|
69 | IN EFI_HANDLE Handle
|
---|
70 | );
|
---|
71 |
|
---|
72 | /**
|
---|
73 |
|
---|
74 | Hooks in EbcSupport.c
|
---|
75 |
|
---|
76 | @param VmPtr - pointer to VM context.
|
---|
77 |
|
---|
78 | **/
|
---|
79 | VOID
|
---|
80 | EbcDebuggerHookExecuteEbcImageEntryPoint (
|
---|
81 | IN VM_CONTEXT *VmPtr
|
---|
82 | );
|
---|
83 |
|
---|
84 | /**
|
---|
85 |
|
---|
86 | The hook in ExecuteEbcImageEntryPoint.
|
---|
87 |
|
---|
88 | @param VmPtr - pointer to VM context.
|
---|
89 |
|
---|
90 | **/
|
---|
91 | VOID
|
---|
92 | EbcDebuggerHookEbcInterpret (
|
---|
93 | IN VM_CONTEXT *VmPtr
|
---|
94 | );
|
---|
95 |
|
---|
96 | /**
|
---|
97 | The hook in EbcExecute, before ExecuteFunction.
|
---|
98 |
|
---|
99 | @param VmPtr - pointer to VM context.
|
---|
100 |
|
---|
101 | **/
|
---|
102 | VOID
|
---|
103 | EbcDebuggerHookExecuteStart (
|
---|
104 | IN VM_CONTEXT *VmPtr
|
---|
105 | );
|
---|
106 |
|
---|
107 | /**
|
---|
108 | The hook in EbcExecute, after ExecuteFunction.
|
---|
109 |
|
---|
110 | @param VmPtr - pointer to VM context.
|
---|
111 |
|
---|
112 | **/
|
---|
113 | VOID
|
---|
114 | EbcDebuggerHookExecuteEnd (
|
---|
115 | IN VM_CONTEXT *VmPtr
|
---|
116 | );
|
---|
117 |
|
---|
118 | /**
|
---|
119 | The hook in ExecuteCALL, before move IP.
|
---|
120 |
|
---|
121 | @param VmPtr - pointer to VM context.
|
---|
122 |
|
---|
123 | **/
|
---|
124 | VOID
|
---|
125 | EbcDebuggerHookCALLStart (
|
---|
126 | IN VM_CONTEXT *VmPtr
|
---|
127 | );
|
---|
128 |
|
---|
129 | /**
|
---|
130 |
|
---|
131 | The hook in ExecuteCALL, after move IP.
|
---|
132 |
|
---|
133 | @param VmPtr - pointer to VM context.
|
---|
134 |
|
---|
135 | **/
|
---|
136 | VOID
|
---|
137 | EbcDebuggerHookCALLEnd (
|
---|
138 | IN VM_CONTEXT *VmPtr
|
---|
139 | );
|
---|
140 |
|
---|
141 | /**
|
---|
142 |
|
---|
143 | The hook in ExecuteCALL, before call EbcLLCALLEX.
|
---|
144 |
|
---|
145 | @param VmPtr - pointer to VM context.
|
---|
146 |
|
---|
147 | **/
|
---|
148 | VOID
|
---|
149 | EbcDebuggerHookCALLEXStart (
|
---|
150 | IN VM_CONTEXT *VmPtr
|
---|
151 | );
|
---|
152 |
|
---|
153 | /**
|
---|
154 |
|
---|
155 | The hook in ExecuteCALL, after call EbcLLCALLEX.
|
---|
156 |
|
---|
157 | @param VmPtr - pointer to VM context.
|
---|
158 |
|
---|
159 | **/
|
---|
160 | VOID
|
---|
161 | EbcDebuggerHookCALLEXEnd (
|
---|
162 | IN VM_CONTEXT *VmPtr
|
---|
163 | );
|
---|
164 |
|
---|
165 | /**
|
---|
166 |
|
---|
167 | The hook in ExecuteRET, before move IP.
|
---|
168 |
|
---|
169 | @param VmPtr - pointer to VM context.
|
---|
170 |
|
---|
171 | **/
|
---|
172 | VOID
|
---|
173 | EbcDebuggerHookRETStart (
|
---|
174 | IN VM_CONTEXT *VmPtr
|
---|
175 | );
|
---|
176 |
|
---|
177 | /**
|
---|
178 |
|
---|
179 | The hook in ExecuteRET, after move IP.
|
---|
180 | It will record trace information.
|
---|
181 |
|
---|
182 | @param VmPtr - pointer to VM context.
|
---|
183 |
|
---|
184 | **/
|
---|
185 | VOID
|
---|
186 | EbcDebuggerHookRETEnd (
|
---|
187 | IN VM_CONTEXT *VmPtr
|
---|
188 | );
|
---|
189 |
|
---|
190 | /**
|
---|
191 |
|
---|
192 | The hook in ExecuteJMP, before move IP.
|
---|
193 |
|
---|
194 | @param VmPtr - pointer to VM context.
|
---|
195 |
|
---|
196 | **/
|
---|
197 | VOID
|
---|
198 | EbcDebuggerHookJMPStart (
|
---|
199 | IN VM_CONTEXT *VmPtr
|
---|
200 | );
|
---|
201 |
|
---|
202 | /**
|
---|
203 |
|
---|
204 | The hook in ExecuteJMP, after move IP.
|
---|
205 |
|
---|
206 | @param VmPtr - pointer to VM context.
|
---|
207 |
|
---|
208 | **/
|
---|
209 | VOID
|
---|
210 | EbcDebuggerHookJMPEnd (
|
---|
211 | IN VM_CONTEXT *VmPtr
|
---|
212 | );
|
---|
213 |
|
---|
214 | /**
|
---|
215 |
|
---|
216 | The hook in ExecuteJMP8, before move IP.
|
---|
217 |
|
---|
218 | @param VmPtr - pointer to VM context.
|
---|
219 |
|
---|
220 | **/
|
---|
221 | VOID
|
---|
222 | EbcDebuggerHookJMP8Start (
|
---|
223 | IN VM_CONTEXT *VmPtr
|
---|
224 | );
|
---|
225 |
|
---|
226 | /**
|
---|
227 |
|
---|
228 | The hook in ExecuteJMP8, after move IP..
|
---|
229 |
|
---|
230 | @param VmPtr - pointer to VM context.
|
---|
231 |
|
---|
232 | **/
|
---|
233 | VOID
|
---|
234 | EbcDebuggerHookJMP8End (
|
---|
235 | IN VM_CONTEXT *VmPtr
|
---|
236 | );
|
---|
237 |
|
---|
238 | #endif
|
---|