]>
Commit | Line | Data |
---|---|---|
fe92ab29 | 1 | /** @file\r |
2 | Debug Agent Library provide source-level debug capability.\r | |
3 | \r | |
6d4136f4 | 4 | Copyright (c) 2010 - 2012, 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 |
6d4136f4 | 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 | |
4cf7e038 | 29 | \r |
30 | //\r | |
31 | // Context for DEBUG_AGENT_INIT_POSTMEM_SEC\r | |
32 | //\r | |
33 | typedef struct {\r | |
34 | UINTN HeapMigrateOffset;\r | |
35 | UINTN StackMigrateOffset;\r | |
36 | } DEBUG_AGENT_CONTEXT_POSTMEM_SEC;\r | |
37 | \r | |
38 | /**\r | |
39 | Caller provided function to be invoked at the end of InitializeDebugAgent().\r | |
40 | \r | |
41 | Refer to the descrption for InitializeDebugAgent() for more details.\r | |
42 | \r | |
43 | @param[in] Context The first input parameter of InitializeDebugAgent().\r | |
44 | \r | |
45 | **/\r | |
46 | typedef\r | |
47 | VOID\r | |
48 | (EFIAPI * DEBUG_AGENT_CONTINUE)(\r | |
49 | IN VOID *Context\r | |
50 | );\r | |
51 | \r | |
fe92ab29 | 52 | \r |
53 | /**\r | |
54 | Initialize debug agent.\r | |
55 | \r | |
4cf7e038 | 56 | This function is used to set up debug environment to support source level debugging.\r |
57 | If certain Debug Agent Library instance has to save some private data in the stack,\r | |
58 | this function must work on the mode that doesn't return to the caller, then\r | |
59 | the caller needs to wrap up all rest of logic after InitializeDebugAgent() into one\r | |
60 | function and pass it into InitializeDebugAgent(). InitializeDebugAgent() is\r | |
61 | responsible to invoke the passing-in function at the end of InitializeDebugAgent().\r | |
62 | \r | |
63 | If the parameter Function is not NULL, Debug Agent Libary instance will invoke it by\r | |
64 | passing in the Context to be its parameter.\r | |
65 | \r | |
66 | If Function() is NULL, Debug Agent Library instance will return after setup debug\r | |
67 | environment.\r | |
fe92ab29 | 68 | \r |
4cf7e038 | 69 | @param[in] InitFlag Init flag is used to decide the initialize process.\r |
70 | @param[in] Context Context needed according to InitFlag; it was optional.\r | |
71 | @param[in] Function Continue function called by debug agent library; it was\r | |
72 | optional.\r | |
fe92ab29 | 73 | \r |
74 | **/\r | |
75 | VOID\r | |
76 | EFIAPI\r | |
77 | InitializeDebugAgent (\r | |
78 | IN UINT32 InitFlag,\r | |
4cf7e038 | 79 | IN VOID *Context, OPTIONAL\r |
80 | IN DEBUG_AGENT_CONTINUE Function OPTIONAL\r | |
fe92ab29 | 81 | );\r |
82 | \r | |
83 | /**\r | |
e7af83ae | 84 | Enable/Disable the interrupt of debug timer and return the interrupt state\r |
85 | prior to the operation.\r | |
fe92ab29 | 86 | \r |
87 | If EnableStatus is TRUE, enable the interrupt of debug timer.\r | |
88 | If EnableStatus is FALSE, disable the interrupt of debug timer.\r | |
89 | \r | |
90 | @param[in] EnableStatus Enable/Disable.\r | |
91 | \r | |
e7af83ae | 92 | @retval TRUE Debug timer interrupt were enabled on entry to this call.\r |
93 | @retval FALSE Debug timer interrupt were disabled on entry to this call.\r | |
94 | \r | |
fe92ab29 | 95 | **/\r |
e7af83ae | 96 | BOOLEAN\r |
fe92ab29 | 97 | EFIAPI\r |
e7af83ae | 98 | SaveAndSetDebugTimerInterrupt (\r |
fe92ab29 | 99 | IN BOOLEAN EnableStatus\r |
100 | );\r | |
101 | \r | |
102 | #endif\r |