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 |
|
---|
75 | Hooks in EbcSupport.c
|
---|
76 |
|
---|
77 | @param VmPtr - pointer to VM context.
|
---|
78 |
|
---|
79 | **/
|
---|
80 | VOID
|
---|
81 | EbcDebuggerHookExecuteEbcImageEntryPoint (
|
---|
82 | IN VM_CONTEXT *VmPtr
|
---|
83 | );
|
---|
84 |
|
---|
85 | /**
|
---|
86 |
|
---|
87 | The hook in ExecuteEbcImageEntryPoint.
|
---|
88 |
|
---|
89 | @param VmPtr - pointer to VM context.
|
---|
90 |
|
---|
91 | **/
|
---|
92 | VOID
|
---|
93 | EbcDebuggerHookEbcInterpret (
|
---|
94 | IN VM_CONTEXT *VmPtr
|
---|
95 | );
|
---|
96 |
|
---|
97 |
|
---|
98 | /**
|
---|
99 | The hook in EbcExecute, before ExecuteFunction.
|
---|
100 |
|
---|
101 | @param VmPtr - pointer to VM context.
|
---|
102 |
|
---|
103 | **/
|
---|
104 | VOID
|
---|
105 | EbcDebuggerHookExecuteStart (
|
---|
106 | IN VM_CONTEXT *VmPtr
|
---|
107 | );
|
---|
108 |
|
---|
109 | /**
|
---|
110 | The hook in EbcExecute, after ExecuteFunction.
|
---|
111 |
|
---|
112 | @param VmPtr - pointer to VM context.
|
---|
113 |
|
---|
114 | **/
|
---|
115 | VOID
|
---|
116 | EbcDebuggerHookExecuteEnd (
|
---|
117 | IN VM_CONTEXT *VmPtr
|
---|
118 | );
|
---|
119 |
|
---|
120 | /**
|
---|
121 | The hook in ExecuteCALL, before move IP.
|
---|
122 |
|
---|
123 | @param VmPtr - pointer to VM context.
|
---|
124 |
|
---|
125 | **/
|
---|
126 | VOID
|
---|
127 | EbcDebuggerHookCALLStart (
|
---|
128 | IN VM_CONTEXT *VmPtr
|
---|
129 | );
|
---|
130 |
|
---|
131 | /**
|
---|
132 |
|
---|
133 | The hook in ExecuteCALL, after move IP.
|
---|
134 |
|
---|
135 | @param VmPtr - pointer to VM context.
|
---|
136 |
|
---|
137 | **/
|
---|
138 | VOID
|
---|
139 | EbcDebuggerHookCALLEnd (
|
---|
140 | IN VM_CONTEXT *VmPtr
|
---|
141 | );
|
---|
142 |
|
---|
143 | /**
|
---|
144 |
|
---|
145 | The hook in ExecuteCALL, before call EbcLLCALLEX.
|
---|
146 |
|
---|
147 | @param VmPtr - pointer to VM context.
|
---|
148 |
|
---|
149 | **/
|
---|
150 | VOID
|
---|
151 | EbcDebuggerHookCALLEXStart (
|
---|
152 | IN VM_CONTEXT *VmPtr
|
---|
153 | );
|
---|
154 |
|
---|
155 | /**
|
---|
156 |
|
---|
157 | The hook in ExecuteCALL, after call EbcLLCALLEX.
|
---|
158 |
|
---|
159 | @param VmPtr - pointer to VM context.
|
---|
160 |
|
---|
161 | **/
|
---|
162 | VOID
|
---|
163 | EbcDebuggerHookCALLEXEnd (
|
---|
164 | IN VM_CONTEXT *VmPtr
|
---|
165 | );
|
---|
166 |
|
---|
167 | /**
|
---|
168 |
|
---|
169 | The hook in ExecuteRET, before move IP.
|
---|
170 |
|
---|
171 | @param VmPtr - pointer to VM context.
|
---|
172 |
|
---|
173 | **/
|
---|
174 | VOID
|
---|
175 | EbcDebuggerHookRETStart (
|
---|
176 | IN VM_CONTEXT *VmPtr
|
---|
177 | );
|
---|
178 |
|
---|
179 | /**
|
---|
180 |
|
---|
181 | The hook in ExecuteRET, after move IP.
|
---|
182 | It will record trace information.
|
---|
183 |
|
---|
184 | @param VmPtr - pointer to VM context.
|
---|
185 |
|
---|
186 | **/
|
---|
187 | VOID
|
---|
188 | EbcDebuggerHookRETEnd (
|
---|
189 | IN VM_CONTEXT *VmPtr
|
---|
190 | );
|
---|
191 |
|
---|
192 |
|
---|
193 | /**
|
---|
194 |
|
---|
195 | The hook in ExecuteJMP, before move IP.
|
---|
196 |
|
---|
197 | @param VmPtr - pointer to VM context.
|
---|
198 |
|
---|
199 | **/
|
---|
200 | VOID
|
---|
201 | EbcDebuggerHookJMPStart (
|
---|
202 | IN VM_CONTEXT *VmPtr
|
---|
203 | );
|
---|
204 |
|
---|
205 | /**
|
---|
206 |
|
---|
207 | The hook in ExecuteJMP, after move IP.
|
---|
208 |
|
---|
209 | @param VmPtr - pointer to VM context.
|
---|
210 |
|
---|
211 | **/
|
---|
212 | VOID
|
---|
213 | EbcDebuggerHookJMPEnd (
|
---|
214 | IN VM_CONTEXT *VmPtr
|
---|
215 | );
|
---|
216 |
|
---|
217 | /**
|
---|
218 |
|
---|
219 | The hook in ExecuteJMP8, before move IP.
|
---|
220 |
|
---|
221 | @param VmPtr - pointer to VM context.
|
---|
222 |
|
---|
223 | **/
|
---|
224 | VOID
|
---|
225 | EbcDebuggerHookJMP8Start (
|
---|
226 | IN VM_CONTEXT *VmPtr
|
---|
227 | );
|
---|
228 |
|
---|
229 | /**
|
---|
230 |
|
---|
231 | The hook in ExecuteJMP8, after move IP..
|
---|
232 |
|
---|
233 | @param VmPtr - pointer to VM context.
|
---|
234 |
|
---|
235 | **/
|
---|
236 | VOID
|
---|
237 | EbcDebuggerHookJMP8End (
|
---|
238 | IN VM_CONTEXT *VmPtr
|
---|
239 | );
|
---|
240 |
|
---|
241 | #endif
|
---|