]>
Commit | Line | Data |
---|---|---|
fe92ab29 | 1 | /** @file\r |
2 | Debug Agent Library provide source-level debug capability.\r | |
3 | \r | |
cd5ebaa0 | 4 | Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r |
4cf7e038 | 5 | This program and the accompanying materials are licensed and made available under\r |
6 | the terms and conditions of the BSD License that accompanies this distribution.\r | |
64a80549 | 7 | The full text of the license may be found at\r |
4cf7e038 | 8 | http://opensource.org/licenses/bsd-license.php.\r |
fe92ab29 | 9 | \r |
4cf7e038 | 10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r |
64a80549 | 11 | WITHOUT 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 | |
18 | #define DEBUG_AGENT_INIT_PREMEM_SEC 1\r | |
19 | #define DEBUG_AGENT_INIT_POSTMEM_SEC 2\r | |
213fecef | 20 | #define DEBUG_AGENT_INIT_DXE_CORE 3\r |
fe92ab29 | 21 | #define DEBUG_AGENT_INIT_SMM 4\r |
e7af83ae | 22 | #define DEBUG_AGENT_INIT_ENTER_SMI 5\r |
23 | #define DEBUG_AGENT_INIT_EXIT_SMI 6\r | |
213fecef | 24 | #define DEBUG_AGENT_INIT_S3 7\r |
4cf7e038 | 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 | |
31 | typedef 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 | |
44 | typedef\r | |
45 | VOID\r | |
46 | (EFIAPI * DEBUG_AGENT_CONTINUE)(\r | |
47 | IN VOID *Context\r | |
48 | );\r | |
49 | \r | |
fe92ab29 | 50 | \r |
51 | /**\r | |
52 | Initialize debug agent.\r | |
53 | \r | |
4cf7e038 | 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 | |
fe92ab29 | 66 | \r |
4cf7e038 | 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 | |
fe92ab29 | 71 | \r |
72 | **/\r | |
73 | VOID\r | |
74 | EFIAPI\r | |
75 | InitializeDebugAgent (\r | |
76 | IN UINT32 InitFlag,\r | |
4cf7e038 | 77 | IN VOID *Context, OPTIONAL\r |
78 | IN DEBUG_AGENT_CONTINUE Function OPTIONAL\r | |
fe92ab29 | 79 | );\r |
80 | \r | |
81 | /**\r | |
e7af83ae | 82 | Enable/Disable the interrupt of debug timer and return the interrupt state\r |
83 | prior to the operation.\r | |
fe92ab29 | 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 | |
e7af83ae | 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 | |
fe92ab29 | 93 | **/\r |
e7af83ae | 94 | BOOLEAN\r |
fe92ab29 | 95 | EFIAPI\r |
e7af83ae | 96 | SaveAndSetDebugTimerInterrupt (\r |
fe92ab29 | 97 | IN BOOLEAN EnableStatus\r |
98 | );\r | |
99 | \r | |
100 | #endif\r |