VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/SourceLevelDebugPkg/DebugAgentDxe/DebugAgentDxe.c@ 58466

Last change on this file since 58466 was 58466, checked in by vboxsync, 9 years ago

EFI/Firmware: Merged in the svn:eol-style, svn:mime-type and trailing whitespace cleanup that was done after the initial UDK2014.SP1 import: svn merge /vendor/edk2/UDK2014.SP1 /vendor/edk2/current .

  • Property svn:eol-style set to native
File size: 2.7 KB
Line 
1/** @file
2 Initialize Debug Agent in DXE by invoking Debug Agent Library.
3
4Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
5This program and the accompanying materials
6are licensed and made available under the terms and conditions of the BSD License
7which accompanies this distribution. The full text of the license may be found at
8http://opensource.org/licenses/bsd-license.php
9
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13**/
14
15#include <PiDxe.h>
16#include <Guid/EventGroup.h>
17#include <Library/UefiBootServicesTableLib.h>
18#include <Library/DebugAgentLib.h>
19
20EFI_EVENT mExitBootServiceEvent;
21
22/**
23 One notified function to disable Debug Timer interrupt when gBS->ExitBootServices() called.
24
25 @param[in] Event Pointer to this event
26 @param[in] Context Event handler private data
27
28**/
29VOID
30EFIAPI
31DisableDebugTimerExitBootService (
32 EFI_EVENT Event,
33 VOID *Context
34 )
35
36{
37 SaveAndSetDebugTimerInterrupt (FALSE);
38}
39
40/**
41 The Entry Point for Debug Agent Dxe driver.
42
43 It will invoke Debug Agent Library to enable source debugging feature in DXE phase.
44
45 @param[in] ImageHandle The firmware allocated handle for the EFI image.
46 @param[in] SystemTable A pointer to the EFI System Table.
47
48 @retval EFI_SUCCESS The entry point is executed successfully.
49 @retval other Some error occurs when initialzed Debug Agent.
50
51**/
52EFI_STATUS
53EFIAPI
54DebugAgentDxeInitialize(
55 IN EFI_HANDLE ImageHandle,
56 IN EFI_SYSTEM_TABLE *SystemTable
57 )
58{
59 EFI_STATUS Status;
60
61 Status = EFI_UNSUPPORTED;
62 InitializeDebugAgent (DEBUG_AGENT_INIT_DXE_LOAD, &Status, NULL);
63 if (EFI_ERROR (Status)) {
64 return Status;
65 }
66 //
67 // Create event to disable Debug Timer interrupt when exit boot service.
68 //
69 Status = gBS->CreateEventEx (
70 EVT_NOTIFY_SIGNAL,
71 TPL_NOTIFY,
72 DisableDebugTimerExitBootService,
73 NULL,
74 &gEfiEventExitBootServicesGuid,
75 &mExitBootServiceEvent
76 );
77 return Status;
78}
79
80/**
81 This is the unload handle for Debug Agent Dxe driver.
82
83 It will invoke Debug Agent Library to disable source debugging feature.
84
85 @param[in] ImageHandle The drivers' driver image.
86
87 @retval EFI_SUCCESS The image is unloaded.
88 @retval Others Failed to unload the image.
89
90**/
91EFI_STATUS
92EFIAPI
93DebugAgentDxeUnload (
94 IN EFI_HANDLE ImageHandle
95 )
96{
97 EFI_STATUS Status;
98
99 Status = EFI_UNSUPPORTED;
100 InitializeDebugAgent (DEBUG_AGENT_INIT_DXE_UNLOAD, &Status, NULL);
101
102 return Status;
103}
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette