]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdeModulePkg/Include/Library/DebugAgentLib.h
Patch from open source community for CryptoPkg to allow it to build for ARM using...
[mirror_edk2.git] / MdeModulePkg / Include / Library / DebugAgentLib.h
... / ...
CommitLineData
1/** @file\r
2 Debug Agent Library provide source-level debug capability.\r
3\r
4Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
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
7The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php.\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#ifndef __DEBUG_AGENT_LIB_H__\r
16#define __DEBUG_AGENT_LIB_H__\r
17\r
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\r
27\r
28//\r
29// Context for DEBUG_AGENT_INIT_POSTMEM_SEC\r
30//\r
31typedef struct {\r
32 UINTN HeapMigrateOffset;\r
33 UINTN StackMigrateOffset;\r
34} DEBUG_AGENT_CONTEXT_POSTMEM_SEC;\r
35\r
36/**\r
37 Caller provided function to be invoked at the end of InitializeDebugAgent().\r
38\r
39 Refer to the descrption for InitializeDebugAgent() for more details.\r
40\r
41 @param[in] Context The first input parameter of InitializeDebugAgent().\r
42\r
43**/\r
44typedef\r
45VOID\r
46(EFIAPI * DEBUG_AGENT_CONTINUE)(\r
47 IN VOID *Context\r
48 );\r
49\r
50\r
51/**\r
52 Initialize debug agent.\r
53\r
54 This function is used to set up debug environment to support source level debugging.\r
55 If certain Debug Agent Library instance has to save some private data in the stack,\r
56 this function must work on the mode that doesn't return to the caller, then\r
57 the caller needs to wrap up all rest of logic after InitializeDebugAgent() into one\r
58 function and pass it into InitializeDebugAgent(). InitializeDebugAgent() is\r
59 responsible to invoke the passing-in function at the end of InitializeDebugAgent().\r
60\r
61 If the parameter Function is not NULL, Debug Agent Libary instance will invoke it by\r
62 passing in the Context to be its parameter.\r
63\r
64 If Function() is NULL, Debug Agent Library instance will return after setup debug\r
65 environment.\r
66\r
67 @param[in] InitFlag Init flag is used to decide the initialize process.\r
68 @param[in] Context Context needed according to InitFlag; it was optional.\r
69 @param[in] Function Continue function called by debug agent library; it was\r
70 optional.\r
71\r
72**/\r
73VOID\r
74EFIAPI\r
75InitializeDebugAgent (\r
76 IN UINT32 InitFlag,\r
77 IN VOID *Context, OPTIONAL\r
78 IN DEBUG_AGENT_CONTINUE Function OPTIONAL\r
79 );\r
80\r
81/**\r
82 Enable/Disable the interrupt of debug timer and return the interrupt state\r
83 prior to the operation.\r
84\r
85 If EnableStatus is TRUE, enable the interrupt of debug timer.\r
86 If EnableStatus is FALSE, disable the interrupt of debug timer.\r
87\r
88 @param[in] EnableStatus Enable/Disable.\r
89\r
90 @retval TRUE Debug timer interrupt were enabled on entry to this call.\r
91 @retval FALSE Debug timer interrupt were disabled on entry to this call.\r
92\r
93**/\r
94BOOLEAN\r
95EFIAPI\r
96SaveAndSetDebugTimerInterrupt (\r
97 IN BOOLEAN EnableStatus\r
98 );\r
99\r
100#endif\r