summaryrefslogtreecommitdiff
path: root/SourceLevelDebugPkg/Library
diff options
context:
space:
mode:
authorniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>2012-02-07 01:58:30 +0000
committerniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>2012-02-07 01:58:30 +0000
commitb4ebbafff696b02c69ee3a6d293a39f9a7c2f58d (patch)
treecf447356054a247d0f703b6fdaa92a246ed4d012 /SourceLevelDebugPkg/Library
parent3e570e6e52bc5c2ea0fbe479c2a49107c754788c (diff)
downloadedk2-b4ebbafff696b02c69ee3a6d293a39f9a7c2f58d.zip
edk2-b4ebbafff696b02c69ee3a6d293a39f9a7c2f58d.tar.gz
edk2-b4ebbafff696b02c69ee3a6d293a39f9a7c2f58d.tar.bz2
Generic solution to handle reset failure in some special platforms.
Upon receiving RESET packet from HOST side, TARGET either sends OK packet and resets, or sends OK packet followed by TIMEOUT packet in 2 seconds indicating the reset failure. Signed-off-by: niruiyu Reviewed-by: vanjeff git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12984 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'SourceLevelDebugPkg/Library')
-rw-r--r--SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.c8
-rw-r--r--SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.h3
-rw-r--r--SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf3
-rw-r--r--SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgentLib.inf3
-rw-r--r--SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgentLib.inf3
5 files changed, 13 insertions, 7 deletions
diff --git a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.c b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.c
index 7834f88..369d47b 100644
--- a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.c
+++ b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.c
@@ -4,7 +4,7 @@
read/write debug packet to communication with HOST based on transfer
protocol.
- Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -637,9 +637,11 @@ CommandCommunication (
ResetCold ();
//
- // Wait for reset
+ // Assume system resets in 2 seconds, otherwise send TIMEOUT packet.
+ // PCD can be used if 2 seconds isn't long enough for some platforms.
//
- CpuDeadLoop ();
+ MicroSecondDelay (2000000);
+ SendAckPacket (DEBUG_COMMAND_TIMEOUT);
break;
case DEBUG_COMMAND_GO:
diff --git a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.h b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.h
index 2636050..22bdaa6 100644
--- a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.h
+++ b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.h
@@ -1,7 +1,7 @@
/** @file
Command header of for Debug Agent library instance.
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -30,6 +30,7 @@
#include <Library/SynchronizationLib.h>
#include <Library/LocalApicLib.h>
#include <Library/DebugLib.h>
+#include <Library/TimerLib.h>
#include <TransferProtocol.h>
#include <ImageDebugSupport.h>
diff --git a/SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf b/SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf
index b932437..96c6b00 100644
--- a/SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf
+++ b/SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf
@@ -1,7 +1,7 @@
## @file
# Debug Agent library instance for Dxe Core and Dxe modules.
#
-# Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -76,6 +76,7 @@
SynchronizationLib
MemoryAllocationLib
LocalApicLib
+ TimerLib
[Guids]
gEfiDebugAgentGuid ## PRODUCES ## Configuration Table
diff --git a/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgentLib.inf b/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgentLib.inf
index 4d8fc71..e1fcf2c 100644
--- a/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgentLib.inf
+++ b/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgentLib.inf
@@ -1,7 +1,7 @@
## @file
# Debug Agent library instance for SEC Core and PEI modules.
#
-# Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -72,6 +72,7 @@
SynchronizationLib
LocalApicLib
DebugLib
+ TimerLib
[Guids]
gEfiDebugAgentGuid ## PRODUCES ## HOB
diff --git a/SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgentLib.inf b/SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgentLib.inf
index 9dfdec1..a750430 100644
--- a/SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgentLib.inf
+++ b/SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgentLib.inf
@@ -1,7 +1,7 @@
## @file
# Debug Agent library instance for SMM modules.
#
-# Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -71,6 +71,7 @@
PcdLib
SynchronizationLib
LocalApicLib
+ TimerLib
[Guids]
gEfiDebugAgentGuid ## CONSUMES ## Configuration Table