]> git.proxmox.com Git - mirror_edk2.git/blame - SourceLevelDebugPkg/DebugAgentDxe/DebugAgentDxe.c
Fix the return status when physical presence variable and MemoryOverwriteRequestContr...
[mirror_edk2.git] / SourceLevelDebugPkg / DebugAgentDxe / DebugAgentDxe.c
CommitLineData
b422b62c 1/** @file\r
2 Initialize Debug Agent in DXE by invoking Debug Agent Library.\r
3\r
4Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>\r
5This program and the accompanying materials \r
6are licensed and made available under the terms and conditions of the BSD License \r
7which accompanies this distribution. The 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#include <PiDxe.h>\r
16#include <Guid/EventGroup.h>\r
17#include <Library/UefiBootServicesTableLib.h>\r
18#include <Library/DebugAgentLib.h>\r
19\r
20EFI_EVENT mExitBootServiceEvent; \r
21\r
22/**\r
23 One notified function to disable Debug Timer interrupt when gBS->ExitBootServices() called.\r
24\r
25 @param[in] Event Pointer to this event\r
26 @param[in] Context Event hanlder private data\r
27\r
28**/\r
29VOID\r
30EFIAPI\r
31DisableDebugTimerExitBootService (\r
32 EFI_EVENT Event,\r
33 VOID *Context\r
34 )\r
35\r
36{\r
37 SaveAndSetDebugTimerInterrupt (FALSE);\r
38}\r
39\r
40/**\r
41 The Entry Point for Debug Agent Dxe driver.\r
42\r
43 It will invoke Debug Agent Library to enable source debugging feature in DXE phase.\r
44\r
45 @param[in] ImageHandle The firmware allocated handle for the EFI image.\r
46 @param[in] SystemTable A pointer to the EFI System Table.\r
47\r
48 @retval EFI_SUCCESS The entry point is executed successfully.\r
49 @retval other Some error occurs when initialzed Debug Agent.\r
50\r
51**/\r
52EFI_STATUS\r
53EFIAPI\r
54DebugAgentDxeInitialize(\r
55 IN EFI_HANDLE ImageHandle,\r
56 IN EFI_SYSTEM_TABLE *SystemTable\r
57 )\r
58{\r
59 EFI_STATUS Status;\r
60\r
61 InitializeDebugAgent (DEBUG_AGENT_INIT_DXE_LOAD, &Status, NULL);\r
62 if (EFI_ERROR (Status)) {\r
63 return Status;\r
64 }\r
65 //\r
66 // Create event to disable Debug Timer interrupt when exit boot service.\r
67 //\r
68 Status = gBS->CreateEventEx (\r
69 EVT_NOTIFY_SIGNAL,\r
70 TPL_NOTIFY,\r
71 DisableDebugTimerExitBootService,\r
72 NULL,\r
73 &gEfiEventExitBootServicesGuid,\r
74 &mExitBootServiceEvent\r
75 );\r
76 return Status;\r
77}\r
78\r
79/**\r
80 This is the unload handle for Debug Agent Dxe driver.\r
81\r
82 It will invoke Debug Agent Library to disable source debugging feature.\r
83\r
84 @param[in] ImageHandle The drivers' driver image.\r
85\r
86 @retval EFI_SUCCESS The image is unloaded.\r
87 @retval Others Failed to unload the image.\r
88\r
89**/\r
90EFI_STATUS\r
91EFIAPI\r
92DebugAgentDxeUnload (\r
93 IN EFI_HANDLE ImageHandle\r
94 )\r
95{\r
96 EFI_STATUS Status;\r
97\r
98 InitializeDebugAgent (DEBUG_AGENT_INIT_DXE_UNLOAD, &Status, NULL);\r
99\r
100 return Status;\r
101}\r