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