]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Include/Library/DebugAgentLib.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdeModulePkg / Include / Library / DebugAgentLib.h
CommitLineData
fe92ab29 1/** @file\r
2 Debug Agent Library provide source-level debug capability.\r
3\r
6d4136f4 4Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>\r
9d510e61 5SPDX-License-Identifier: BSD-2-Clause-Patent\r
fe92ab29 6\r
7**/\r
8\r
9#ifndef __DEBUG_AGENT_LIB_H__\r
10#define __DEBUG_AGENT_LIB_H__\r
11\r
1436aea4
MK
12#define DEBUG_AGENT_INIT_PREMEM_SEC 1\r
13#define DEBUG_AGENT_INIT_POSTMEM_SEC 2\r
14#define DEBUG_AGENT_INIT_DXE_CORE 3\r
15#define DEBUG_AGENT_INIT_SMM 4\r
16#define DEBUG_AGENT_INIT_ENTER_SMI 5\r
17#define DEBUG_AGENT_INIT_EXIT_SMI 6\r
18#define DEBUG_AGENT_INIT_S3 7\r
19#define DEBUG_AGENT_INIT_DXE_AP 8\r
20#define DEBUG_AGENT_INIT_PEI 9\r
21#define DEBUG_AGENT_INIT_DXE_LOAD 10\r
22#define DEBUG_AGENT_INIT_DXE_UNLOAD 11\r
23#define DEBUG_AGENT_INIT_THUNK_PEI_IA32TOX64 12\r
4cf7e038 24\r
25//\r
26// Context for DEBUG_AGENT_INIT_POSTMEM_SEC\r
27//\r
28typedef struct {\r
1436aea4
MK
29 UINTN HeapMigrateOffset;\r
30 UINTN StackMigrateOffset;\r
4cf7e038 31} DEBUG_AGENT_CONTEXT_POSTMEM_SEC;\r
32\r
33/**\r
34 Caller provided function to be invoked at the end of InitializeDebugAgent().\r
35\r
86ac8fb2 36 Refer to the description for InitializeDebugAgent() for more details.\r
4cf7e038 37\r
38 @param[in] Context The first input parameter of InitializeDebugAgent().\r
39\r
40**/\r
41typedef\r
42VOID\r
1436aea4 43(EFIAPI *DEBUG_AGENT_CONTINUE)(\r
4cf7e038 44 IN VOID *Context\r
45 );\r
46\r
fe92ab29 47/**\r
48 Initialize debug agent.\r
49\r
4cf7e038 50 This function is used to set up debug environment to support source level debugging.\r
51 If certain Debug Agent Library instance has to save some private data in the stack,\r
52 this function must work on the mode that doesn't return to the caller, then\r
53 the caller needs to wrap up all rest of logic after InitializeDebugAgent() into one\r
54 function and pass it into InitializeDebugAgent(). InitializeDebugAgent() is\r
55 responsible to invoke the passing-in function at the end of InitializeDebugAgent().\r
56\r
86ac8fb2 57 If the parameter Function is not NULL, Debug Agent Library instance will invoke it by\r
4cf7e038 58 passing in the Context to be its parameter.\r
59\r
60 If Function() is NULL, Debug Agent Library instance will return after setup debug\r
61 environment.\r
fe92ab29 62\r
4cf7e038 63 @param[in] InitFlag Init flag is used to decide the initialize process.\r
64 @param[in] Context Context needed according to InitFlag; it was optional.\r
65 @param[in] Function Continue function called by debug agent library; it was\r
66 optional.\r
fe92ab29 67\r
68**/\r
69VOID\r
70EFIAPI\r
71InitializeDebugAgent (\r
72 IN UINT32 InitFlag,\r
e3917e22 73 IN VOID *Context OPTIONAL,\r
4cf7e038 74 IN DEBUG_AGENT_CONTINUE Function OPTIONAL\r
fe92ab29 75 );\r
76\r
77/**\r
e7af83ae 78 Enable/Disable the interrupt of debug timer and return the interrupt state\r
79 prior to the operation.\r
fe92ab29 80\r
81 If EnableStatus is TRUE, enable the interrupt of debug timer.\r
82 If EnableStatus is FALSE, disable the interrupt of debug timer.\r
83\r
84 @param[in] EnableStatus Enable/Disable.\r
85\r
e7af83ae 86 @retval TRUE Debug timer interrupt were enabled on entry to this call.\r
87 @retval FALSE Debug timer interrupt were disabled on entry to this call.\r
88\r
fe92ab29 89**/\r
e7af83ae 90BOOLEAN\r
fe92ab29 91EFIAPI\r
e7af83ae 92SaveAndSetDebugTimerInterrupt (\r
1436aea4 93 IN BOOLEAN EnableStatus\r
fe92ab29 94 );\r
95\r
96#endif\r