]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Include/Library/DebugAgentLib.h
MdeModulePkg: Add match2 opcode support in SetupBrowserDxe and sample code in DriverS...
[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
4cf7e038 5This program and the accompanying materials are licensed and made available under\r
6the terms and conditions of the BSD License that accompanies this distribution.\r
64a80549 7The full text of the license may be found at\r
4cf7e038 8http://opensource.org/licenses/bsd-license.php.\r
fe92ab29 9\r
4cf7e038 10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
64a80549 11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
fe92ab29 12\r
13**/\r
14\r
15#ifndef __DEBUG_AGENT_LIB_H__\r
16#define __DEBUG_AGENT_LIB_H__\r
17\r
933d80a1 18#define DEBUG_AGENT_INIT_PREMEM_SEC 1\r
19#define DEBUG_AGENT_INIT_POSTMEM_SEC 2\r
20#define DEBUG_AGENT_INIT_DXE_CORE 3\r
21#define DEBUG_AGENT_INIT_SMM 4\r
22#define DEBUG_AGENT_INIT_ENTER_SMI 5\r
23#define DEBUG_AGENT_INIT_EXIT_SMI 6\r
24#define DEBUG_AGENT_INIT_S3 7\r
25#define DEBUG_AGENT_INIT_DXE_AP 8\r
26#define DEBUG_AGENT_INIT_PEI 9\r
27#define DEBUG_AGENT_INIT_DXE_LOAD 10\r
28#define DEBUG_AGENT_INIT_DXE_UNLOAD 11\r
29#define DEBUG_AGENT_INIT_THUNK_PEI_IA32TOX64 12\r
4cf7e038 30\r
31//\r
32// Context for DEBUG_AGENT_INIT_POSTMEM_SEC\r
33//\r
34typedef struct {\r
35 UINTN HeapMigrateOffset;\r
36 UINTN StackMigrateOffset;\r
37} DEBUG_AGENT_CONTEXT_POSTMEM_SEC;\r
38\r
39/**\r
40 Caller provided function to be invoked at the end of InitializeDebugAgent().\r
41\r
42 Refer to the descrption for InitializeDebugAgent() for more details.\r
43\r
44 @param[in] Context The first input parameter of InitializeDebugAgent().\r
45\r
46**/\r
47typedef\r
48VOID\r
49(EFIAPI * DEBUG_AGENT_CONTINUE)(\r
50 IN VOID *Context\r
51 );\r
52\r
fe92ab29 53\r
54/**\r
55 Initialize debug agent.\r
56\r
4cf7e038 57 This function is used to set up debug environment to support source level debugging.\r
58 If certain Debug Agent Library instance has to save some private data in the stack,\r
59 this function must work on the mode that doesn't return to the caller, then\r
60 the caller needs to wrap up all rest of logic after InitializeDebugAgent() into one\r
61 function and pass it into InitializeDebugAgent(). InitializeDebugAgent() is\r
62 responsible to invoke the passing-in function at the end of InitializeDebugAgent().\r
63\r
64 If the parameter Function is not NULL, Debug Agent Libary instance will invoke it by\r
65 passing in the Context to be its parameter.\r
66\r
67 If Function() is NULL, Debug Agent Library instance will return after setup debug\r
68 environment.\r
fe92ab29 69\r
4cf7e038 70 @param[in] InitFlag Init flag is used to decide the initialize process.\r
71 @param[in] Context Context needed according to InitFlag; it was optional.\r
72 @param[in] Function Continue function called by debug agent library; it was\r
73 optional.\r
fe92ab29 74\r
75**/\r
76VOID\r
77EFIAPI\r
78InitializeDebugAgent (\r
79 IN UINT32 InitFlag,\r
4cf7e038 80 IN VOID *Context, OPTIONAL\r
81 IN DEBUG_AGENT_CONTINUE Function OPTIONAL\r
fe92ab29 82 );\r
83\r
84/**\r
e7af83ae 85 Enable/Disable the interrupt of debug timer and return the interrupt state\r
86 prior to the operation.\r
fe92ab29 87\r
88 If EnableStatus is TRUE, enable the interrupt of debug timer.\r
89 If EnableStatus is FALSE, disable the interrupt of debug timer.\r
90\r
91 @param[in] EnableStatus Enable/Disable.\r
92\r
e7af83ae 93 @retval TRUE Debug timer interrupt were enabled on entry to this call.\r
94 @retval FALSE Debug timer interrupt were disabled on entry to this call.\r
95\r
fe92ab29 96**/\r
e7af83ae 97BOOLEAN\r
fe92ab29 98EFIAPI\r
e7af83ae 99SaveAndSetDebugTimerInterrupt (\r
fe92ab29 100 IN BOOLEAN EnableStatus\r
101 );\r
102\r
103#endif\r