diff options
author | Jeff Fan <jeff.fan@intel.com> | 2015-04-01 07:51:15 +0000 |
---|---|---|
committer | vanjeff <vanjeff@Edk2> | 2015-04-01 07:51:15 +0000 |
commit | 08021523f8a581437b07986d2c1876a7b6f0d282 (patch) | |
tree | 5a6684e3bcb26373da7ef36a7a2a818e67de0e0c /SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent | |
parent | 206f412113e8be0da9bd6fd16f89c045ce0d8366 (diff) | |
download | edk2-08021523f8a581437b07986d2c1876a7b6f0d282.zip edk2-08021523f8a581437b07986d2c1876a7b6f0d282.tar.gz edk2-08021523f8a581437b07986d2c1876a7b6f0d282.tar.bz2 |
SourceLevelDebugPkg: Use CPU Local APIC timer to handle timeout.
Use CPU Local APIC timer to handle timeout when read data from debug port, instead of the TimerLib in Debug Communication lib instances.
It could remove much duplicated code in Debug Communication Lib instances.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17089 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent')
-rw-r--r-- | SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentLib.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentLib.c b/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentLib.c index 6e7ff8e..b718e82 100644 --- a/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentLib.c +++ b/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentLib.c @@ -1,7 +1,7 @@ /** @file
SEC Core Debug Agent Library instance implementition.
- Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2010 - 2015, 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
@@ -93,7 +93,7 @@ DebugReadBreakSymbol ( //
// Try to read the start symbol
//
- DebugPortReadBuffer (Handle, Data8, 1, 0);
+ DebugAgentReadBuffer (Handle, Data8, 1, 0);
if (*Data8 == DEBUG_STARTING_SYMBOL_ATTACH) {
*BreakSymbol = *Data8;
DebugAgentMsgPrint (DEBUG_AGENT_INFO, "Debug Timer attach symbol received %x", *BreakSymbol);
@@ -375,6 +375,7 @@ InitializeDebugAgent ( UINT64 MailboxLocation;
UINT64 *MailboxLocationPointer;
EFI_PHYSICAL_ADDRESS Address;
+ UINT32 DebugTimerFrequency;
DisableInterrupts ();
@@ -399,8 +400,11 @@ InitializeDebugAgent ( // Save init arch type when debug agent initialized
//
SetDebugFlag (DEBUG_AGENT_FLAG_INIT_ARCH, DEBUG_ARCH_SYMBOL);
-
- InitializeDebugTimer ();
+ //
+ // Initialize Debug Timer hardware and save its frequency
+ //
+ InitializeDebugTimer (&DebugTimerFrequency);
+ UpdateMailboxContent (Mailbox, DEBUG_MAILBOX_DEBUG_TIMER_FREQUENCY, DebugTimerFrequency);
Phase2Context.InitFlag = InitFlag;
Phase2Context.Context = Context;
@@ -524,8 +528,11 @@ InitializeDebugAgent ( &MailboxLocation,
sizeof (UINT64)
);
-
- InitializeDebugTimer ();
+ //
+ // Initialize Debug Timer hardware and save its frequency
+ //
+ InitializeDebugTimer (&DebugTimerFrequency);
+ UpdateMailboxContent (Mailbox, DEBUG_MAILBOX_DEBUG_TIMER_FREQUENCY, DebugTimerFrequency);
//
// Update IDT entry to save the location pointer saved mailbox pointer
//
|