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