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