TianoCore EDK2 master
Loading...
Searching...
No Matches
DebugAgentDxe.c
Go to the documentation of this file.
1
9#include <PiDxe.h>
10#include <Guid/EventGroup.h>
13#include <Library/UefiLib.h>
14
15EFI_EVENT mExitBootServiceEvent;
16
24VOID
25EFIAPI
27 EFI_EVENT Event,
28 VOID *Context
29 )
30
31{
33}
34
48EFIAPI
50 IN EFI_HANDLE ImageHandle,
51 IN EFI_SYSTEM_TABLE *SystemTable
52 )
53{
54 EFI_STATUS Status;
55
56 if (gST->ConOut != NULL) {
57 Print (L"If the Debug Port is serial port, please make sure this serial port isn't connected by");
58 Print (L" ISA Serial driver\r\n");
59 Print (L"You could do the following steps to disconnect the serial port:\r\n");
60 Print (L"1: Shell> drivers\r\n");
61 Print (L" ...\r\n");
62 Print (L" V VERSION E G G #D #C DRIVER NAME IMAGE NAME\r\n");
63 Print (L" == ======== = = = == == =================================== ===================\r\n");
64 Print (L" 8F 0000000A B - - 1 14 PCI Bus Driver PciBusDxe\r\n");
65 Print (L" 91 00000010 ? - - - - ATA Bus Driver AtaBusDxe\r\n");
66 Print (L" ...\r\n");
67 Print (L" A7 0000000A B - - 1 1 ISA Serial Driver IsaSerialDxe\r\n");
68 Print (L" ...\r\n");
69 Print (L"2: Shell> dh -d A7\r\n");
70 Print (L" A7: Image(IsaSerialDxe) ImageDevPath (..9FB3-11D4-9A3A-0090273FC14D))DriverBinding");
71 Print (L" ComponentName ComponentName2\r\n");
72 Print (L" Driver Name : ISA Serial Driver\r\n");
73 Print (L" Image Name : FvFile(93B80003-9FB3-11D4-9A3A-0090273FC14D)\r\n");
74 Print (L" Driver Version : 0000000A\r\n");
75 Print (L" Driver Type : BUS\r\n");
76 Print (L" Configuration : NO\r\n");
77 Print (L" Diagnostics : NO\r\n");
78 Print (L" Managing :\r\n");
79 Print (L" Ctrl[EA] : PciRoot(0x0)/Pci(0x1F,0x0)/Serial(0x0)\r\n");
80 Print (L" Child[EB] : PciRoot(0x0)/Pci(0x1F,0x0)/Serial(0x0)/Uart(115200,8,N,1)\r\n");
81 Print (L"3: Shell> disconnect EA\r\n");
82 Print (L"4: Shell> load -nc DebugAgentDxe.efi\r\n\r\n");
83 }
84
85 Status = EFI_UNSUPPORTED;
86 InitializeDebugAgent (DEBUG_AGENT_INIT_DXE_LOAD, &Status, NULL);
87 if (EFI_ERROR (Status)) {
88 return Status;
89 }
90
91 if (gST->ConOut != NULL) {
92 Print (L"Debug Agent: Initialized successfully!\r\n\r\n");
93 }
94
95 //
96 // Create event to disable Debug Timer interrupt when exit boot service.
97 //
98 Status = gBS->CreateEventEx (
99 EVT_NOTIFY_SIGNAL,
100 TPL_NOTIFY,
102 NULL,
103 &gEfiEventExitBootServicesGuid,
104 &mExitBootServiceEvent
105 );
106 return Status;
107}
108
121EFIAPI
123 IN EFI_HANDLE ImageHandle
124 )
125{
126 EFI_STATUS Status;
127
128 Status = EFI_UNSUPPORTED;
129 InitializeDebugAgent (DEBUG_AGENT_INIT_DXE_UNLOAD, &Status, NULL);
130 switch (Status) {
131 case EFI_ACCESS_DENIED:
132 Print (L"Debug Agent: Host is still connected, please de-attach TARGET firstly!\r\n");
133 break;
134 case EFI_NOT_STARTED:
135 Print (L"Debug Agent: It hasn't been initialized, cannot unload it!\r\n");
136 break;
137 }
138
139 return Status;
140}
EFI_STATUS EFIAPI DebugAgentDxeUnload(IN EFI_HANDLE ImageHandle)
VOID EFIAPI DisableDebugTimerExitBootService(EFI_EVENT Event, VOID *Context)
Definition: DebugAgentDxe.c:26
EFI_STATUS EFIAPI DebugAgentDxeInitialize(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
Definition: DebugAgentDxe.c:49
BOOLEAN EFIAPI SaveAndSetDebugTimerInterrupt(IN BOOLEAN EnableStatus)
VOID EFIAPI InitializeDebugAgent(IN UINT32 InitFlag, IN VOID *Context OPTIONAL, IN DEBUG_AGENT_CONTINUE Function OPTIONAL)
#define NULL
Definition: Base.h:319
#define FALSE
Definition: Base.h:307
#define IN
Definition: Base.h:279
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_EVENT
Definition: UefiBaseType.h:37
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
EFI_SYSTEM_TABLE * gST
EFI_BOOT_SERVICES * gBS
UINTN EFIAPI Print(IN CONST CHAR16 *Format,...)
Definition: UefiLibPrint.c:113
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * ConOut
Definition: UefiSpec.h:2064