summaryrefslogtreecommitdiffstats
path: root/SourceLevelDebugPkg/Library/DebugAgent
Commit message (Collapse)AuthorAgeFilesLines
* SourceLevelDebugPkg/DebugAgent: Fix various typosAntoine Coeur2020-02-1011-49/+49
| | | | | | | | | | | Fix various typos in documentation, comments and debug strings. Cc: Hao A Wu <hao.a.wu@intel.com> Signed-off-by: Antoine Coeur <coeur@gmx.fr> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com> Message-Id: <20200207010831.9046-72-philmd@redhat.com>
* SourceLevelDebugPkg: Replace BSD License with BSD+Patent LicenseMichael D Kinney2019-04-0927-183/+27
| | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=1373 Replace BSD 2-Clause License with BSD+Patent License. This change is based on the following emails: https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html RFCs with detailed process for the license change: V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com>
* SourceLevelDebugPkg/DebugAgent: Remove AsmFuncs.S in INFZhang, Shenglei2019-04-032-4/+0
| | | | | | | | | | AsmFuncs.S is removed at c7d22535f7dc90b8fef70153ef98549228569680. And also it should be removed in SecPeiDebugAgentLib.inf and SmmDebugAgentLib.inf. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com>
* SourceLevelDebugPkg/DebugAgentCommon: Remove .S filesShenglei Zhang2019-04-033-848/+0
| | | | | | | | | | | .nasm file has been added for X86 arch. .S assembly code is not required any more. https://bugzilla.tianocore.org/show_bug.cgi?id=1594 Cc: Hao Wu <hao.a.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* SourceLevelDebugPkg: Clean up source filesLiming Gao2018-06-2812-99/+99
| | | | | | | | | | 1. Do not use tab characters 2. No trailing white space in one line 3. All files must end with CRLF Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com>
* SourceLevelDebugPkg: Remove X86 ASM and S filesLiming Gao2018-06-075-836/+3
| | | | | | | | | | | | NASM has replaced ASM and S files. 1. Remove ASM from all modules. 2. Remove S files from the drivers only. 3. https://bugzilla.tianocore.org/show_bug.cgi?id=881 After NASM is updated, S files can be removed from Library. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
* SourceLevelDebugPkg DebugAgentLib: Rename IsBsp to DebugAgentIsBspStar Zeng2018-02-083-8/+8
| | | | | | | | | | | | For avoiding function name confliction, rename IsBsp to DebugAgentIsBsp. Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
* SourceLevelDebugPkg: Convert source file to DOS formatLiming Gao2017-12-281-2/+2
| | | | | | | Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Wu Hao A <hao.a.wu@intel.com> Reviewed-by: Wu Hao A <hao.a.wu@intel.com>
* SourceLevelDebugPkg/SecPeiDebugAgentLib: Fix duplicate symbolMichael Kinney2017-12-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=573 https://bugzilla.tianocore.org/show_bug.cgi?id=796 The same issue is reported again by GCC. Resend this patch again. This patch renames the duplicated function name to fix it. The SecPeiDebugAgentLib uses the global variable mMemoryDiscoveredNotifyList for a PPI notification on the Memory Discovered PPI. This same variable name is used in the DxeIplPeim for the same PPI notification. The XCODE5 tool chain detects this duplicate symbol when the OVMF platform is built with the flag -D SOURCE_DEBUG_ENABLE. The fix is to rename this global variable in the SecPeiDebugAgentLib library. Cc: Andrew Fish <afish@apple.com> Cc: Jeff Fan <jeff.fan@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* SourceLevelDebugPkg: Update SmmDebugAgentLib to restore APIC timerLiming Gao2017-10-161-5/+16
| | | | | | | | | | In enter SMI, APIC timer may be initialized. After exit SMI, APIC timer will be restore. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
* SourceLevelDebugPkg: Use Pcd for the revision of transfer protocolHao Wu2017-09-044-6/+9
| | | | | | | | | | | | | | | | | | | | | | V3 changes: Add detailed description for the usage of the Pcd in package DEC file. Update the comment for the introduced Pcd in module INF files. V2 changes: Instead of using a global variable, use a Pcd for transfer protocol revision. Previously, the revision of the debug agent transfer protocol is reflected by a macro. This commit introduces a Pcd to reflect the revision in order to avoid the comparison of two macros, which will generate a constant result detected by code checkers. Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
* PeCoffGetEntryPointLib: Fix spelling issueJeff Fan2017-04-261-1/+1
| | | | | | | | | | | *Serach* should be *Search* Cc: Liming Gao <liming.gao@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* SourceLevelDebugPkg/DebugAgent.c: Consume PeCoffSerachImageBase()Jeff Fan2017-04-071-44/+6
| | | | | | | | | Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
* SourceLevelDebugPkg: Refine casting expression result to bigger sizeHao Wu2017-03-063-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are cases that the operands of an expression are all with rank less than UINT64/INT64 and the result of the expression is explicitly cast to UINT64/INT64 to fit the target size. An example will be: UINT32 a,b; // a and b can be any unsigned int type with rank less than UINT64, like // UINT8, UINT16, etc. UINT64 c; c = (UINT64) (a + b); Some static code checkers may warn that the expression result might overflow within the rank of "int" (integer promotions) and the result is then cast to a bigger size. The commit refines codes by the following rules: 1). When the expression is possible to overflow the range of unsigned int/ int: c = (UINT64)a + b; 2). When the expression will not overflow within the rank of "int", remove the explicit type casts: c = a + b; 3). When the expression will be cast to pointer of possible greater size: UINT32 a,b; VOID *c; c = (VOID *)(UINTN)(a + b); --> c = (VOID *)((UINTN)a + b); 4). When one side of a comparison expression contains only operands with rank less than UINT32: UINT8 a; UINT16 b; UINTN c; if ((UINTN)(a + b) > c) {...} --> if (((UINT32)a + b) > c) {...} For rule 4), if we remove the 'UINTN' type cast like: if (a + b > c) {...} The VS compiler will complain with warning C4018 (signed/unsigned mismatch, level 3 warning) due to promoting 'a + b' to type 'int'. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com>
* SourceLevelDebugPkg: Avoid to re-init IDT table again at SMI entryJeff Fan2016-11-301-1/+9
| | | | | | | | | | | | | | | Current SmmDebugAgentLib will initialize IDT table to support source debugging at each time SMI entry on SMM BSP. Actually, we only need to initialize IDT table at first time SMI entry. Add one flag to avoid re-initializing IDT table. Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
* SourceLevelDebugPkg: Fix typos in commentsGary Lin2016-10-242-5/+5
| | | | | | | | | | | | | | | | - descrption -> description - Libary -> Library - funciton -> function - paramter -> parameter - triggerred -> triggered - hanlde -> handle Cc: Jeff Fan <jeff.fan@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Gary Lin <glin@suse.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com>
* UefiCpuPkg/LocalApic.h: Remove duplicated/conflicted definitionsJeff Fan2016-08-172-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | #define MSR_IA32_APIC_BASE_ADDRESS is duplicated with #define MSR_IA32_APIC_BASE defined in UefiCpuPkg/Include/Register/ArchitecturalMsr.h, so we could remove it and update the modules to use MSR_IA32_APIC_BASE from ArchitecturalMsr.h. Structure MSR_IA32_APIC_BASE conflicts with #define MSR_IA32_APIC_BASE defined in UefiCpuPkg/Include/Register/ArchitecturalMsr.h, so we could remove it and update the modules to use structure MSR_IA32_APIC_BASE_REGISTER from ArchitecturalMsr.h. v5: 1. Update SourceLevelDebugPkg to use APIC Base MSR from ArchitecturalMsr.h. Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Michael Kinney <michael.d.kinney@intel.com>
* SourceLevelDebugPkg DebugAgentLib: Add nasm source file into LIB INF files.Liming Gao2016-06-283-9/+15
| | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com>
* SourceLevelDebugPkg DebugAgentLib: Convert X64/AsmFuncs.asmLiming Gao2016-06-281-0/+405
| | | | | | | | | The BaseTools/Scripts/ConvertMasmToNasm.py script was used to convert X64/AsmFuncs.asm to X64/AsmFuncs.nasm. And, manually update the wrong replacement with 0H. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com>
* SourceLevelDebugPkg DebugAgentLib: Convert Ia32/AsmFuncs.asmLiming Gao2016-06-281-0/+419
| | | | | | | | | The BaseTools/Scripts/ConvertMasmToNasm.py script was used to convert Ia32/AsmFuncs.asm to Ia32/AsmFuncs.nasm. And, manually update the wrong replacement with 0H. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com>
* SourceLevelDebugPkg/SmmDebugAgent: mMailboxPointer is used before setJeff Fan2016-04-061-2/+2
| | | | | | | | | | | | mMailboxPointer is used before it is initialization. This issue only happens when SmmDebugAgent is initialized without PeiDebugAgent or DxeDebugAgent initialization. The fix is to use Mailbox instead. Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
* SourceLevelDebugPkg: DebugAgentCommon: remove set but unused variablesLaszlo Ersek2016-03-251-3/+0
| | | | | | | | | | Cc: Jeff Fan <jeff.fan@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com>
* SourceLevelDebugPkg: Correct gEfiDebugAgentGuid usage in DxeDebugAgentLibLiming Gao2015-12-171-1/+1
| | | | | | | | | | | DxeDebugAgentLib instance produces gEfiDebugAgentGuid system table. Its usage should be PRODUCES instead of SOMETIMES_PRODUCES. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19316 6f19259b-4bc3-4df7-8a09-765794883524
* SourceLevelDebugPkg: Convert all .uni files to utf-8Jordan Justen2015-12-153-0/+0
| | | | | | | | | | | | | To convert these files I ran: $ python3 BaseTools/Scripts/ConvertUni.py SourceLevelDebugPkg Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19263 6f19259b-4bc3-4df7-8a09-765794883524
* SourceLevelDebugPkg: DebugAgent: Set Local APIC SoftwareEnableMichael Kinney2015-10-303-0/+3
| | | | | | | | | | | | Update DebugAgent to make sure the Local APIC SoftwareEnable bit is set before using the Local APIC Timer. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18712 6f19259b-4bc3-4df7-8a09-765794883524
* SourceLevelDebugPkg: Change the debug message to "v1.5" from "v1.4"Ruiyu Ni2015-09-241-1/+1
| | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18534 6f19259b-4bc3-4df7-8a09-765794883524
* SourceLevelDebugPkg/DebugTimer: Timer count value 0 not calculatedJeff Fan2015-08-272-9/+9
| | | | | | | | | | | Actually, TimerCycle is APIC timer's initial count. Timer count value 0 is missed when calculating Delta value. 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@18329 6f19259b-4bc3-4df7-8a09-765794883524
* SourceLevelDebugPkg/DebugTimer: Fix the issue if CurrentTimer = TimerJeff Fan2015-08-271-1/+3
| | | | | | | | | | | | If CPU runs fast and timer runs slow, two GetApicTimerCurrentCount() may return the same timer count value. We need to consider timer roll-over not happened. Otherwise, one false timeout flag will be set. 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@18328 6f19259b-4bc3-4df7-8a09-765794883524
* SourceLevelDebugPkg/SecPeiDebugAgentLib: Restore CPU interrupt stateJeff Fan2015-07-101-10/+19
| | | | | | | | | | | | | | | In DEBUG_AGENT_INIT_POSTMEM_SEC case, caller may disable/restore CPU interrupt to protect the stack/heap migration. SecPeiDebugAgentLib cannot always enable CPU interrupt. Otherwise system may crash during stack/heap migration. SecPeiDebugAgentLib should restore original CPU interrupt state in DEBUG_AGENT_INIT_POSTMEM_SEC case. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Brian J. Johnson <bjohnson@sgi.com> Tested-by: Brian J. Johnson <bjohnson@sgi.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17916 6f19259b-4bc3-4df7-8a09-765794883524
* SourceLevelDebugPkg: Fix PEI timer interrupt regressionBrian J. Johnson2015-07-091-2/+4
| | | | | | | | | | | | | | | | | | | | | | | Recent changes to debug timer initialization (commit 2befbc82, svn 17572) modified the Sec/Pei InitializeDebugAgent() routine to enable debug timer interrupts. This causes problems in the DEBUG_AGENT_INIT_POSTMEM_SEC case: the callers appear to assume that if they block timer interrupts before the call, interrupts will remain blocked afterwards. It is not always safe to have interrupts enabled on return from InitializeDebugAgent(). For instance, after calling InitializeDebugAgent(), OvmfPkg's TemporaryRamMigration() moves the stack, heap, and IDT to RAM, then switches to the new stack. Only then does it reenable timer interrupts. Taking an interrupt during this process can corrupt state, causing crashes. Do not unmask the debug timer interrupt in the DEBUG_AGENT_INIT_POSTMEM_SEC case. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Brian J. Johnson <bjohnson@sgi.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17893 6f19259b-4bc3-4df7-8a09-765794883524
* SourceLevelDebugPkg: Fix PEI debug timer regressionBrian J. Johnson2015-07-031-0/+4
| | | | | | | | | | | | | Recent changes to debug timer handling ended up leaving the timer disabled in PEI. This made it impossible to stop execution in PEI externally via the debugger. Enable the timer when InitializeDebugAgent calls InitializeDebugAgentPhase2, as well as when it returns directly. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Brian J. Johnson <bjohnson@sgi.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17819 6f19259b-4bc3-4df7-8a09-765794883524
* SourceLevelDebugPkg/DebugAgent: Add typecast to fix sign extensionJeff Fan2015-06-263-3/+3
| | | | | | | | | | | | | OffsetHigh is 16bit value and its type is UINT32 and defined in structure. It will be 32bit int type after do 16-bit left-shift operation. Then it will sign extension if cast it to UINT64 if its high bit is 1. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Scott Duplichan <scott@notabs.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17716 6f19259b-4bc3-4df7-8a09-765794883524
* SourceLevelDebugPkg/DxeDebugAgent: Initialize Local APIC TimerJeff Fan2015-06-101-0/+10
| | | | | | | | | | | | Now Debug Agent library uses Local APIC Timer to implement time-out mechanism. For AP, its local APIC timer may not work. This fix is to initialize Local APIC timer if it doesn't work as expected when debugging AP function. 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@17604 6f19259b-4bc3-4df7-8a09-765794883524
* SourceLevelDebugPkg/DebugAgent: Disable Debug Timer as earlyJeff Fan2015-06-085-1/+22
| | | | | | | | | | | | | | | | InitializeApicTimer() will enable Local APIC timer interrupt. Even though we disable CPU interrupt at the beginning and enable CPU Interrupt after debug agent initialized completely, some Boot Service may invoke RestoreTpl () which may enable CPU interrupt. We should disable Local APIC timer in InitializeDebugTimer () to avoid Debug Timer interrupt happens during debug port and debug agent initialization phase. And enable Debug Timer interrupt after debug agent is initialized. 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@17572 6f19259b-4bc3-4df7-8a09-765794883524
* SourceLevelDebugPkg/DebugAgent: Check PcdDebugPortHandleBufferSizeJeff Fan2015-06-042-2/+2
| | | | | | | | | | | Check PcdDebugPortHandleBufferSize before allocate buffer. PeriodicMode is BOOLEAN type, needn't to use == TRUE in if condition. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17558 6f19259b-4bc3-4df7-8a09-765794883524
* SourceLevelDebugPkg/DebugTimer: Dump Debug Timer parameterJeff Fan2015-05-256-14/+19
| | | | | | | | | | | Add one parameter DumpFlag to indicate if need to dump Local APIC time's parameter. 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@17501 6f19259b-4bc3-4df7-8a09-765794883524
* SourceLevelDebugPkg/SmmDebugAgent: Initialize Local APIC TimerJeff Fan2015-05-251-1/+11
| | | | | | | | | | | | | Now Debug Agent library uses Local APIC Timer to implement time-out mechanism. In SMM, SMM BSP maybe not be the one in DXE phase, its local APIC timer may not work. This fix is to initialize Local APIC timer if it doesn't work as expected at SMM entry. 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@17500 6f19259b-4bc3-4df7-8a09-765794883524
* SourceLevelDebugPkg: Fix Serial Port connection cannot be setupRuiyu Ni2015-05-181-21/+25
| | | | | | | | | | | The root cause is SerialPortDebugCommunicationLib returns NULL debug port handle causing the CompressData() doesn't send the compressed data. The fix doesn't rely on the debug port handle value and uses Send parameter to indicate whether to send the compressed data. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17464 6f19259b-4bc3-4df7-8a09-765794883524
* SourceLevelDebugPkg/DebugAgentDxe: Move help info from DxeDebugAgentJeff Fan2015-05-181-29/+0
| | | | | | | | | | | | | | | Now DxeDebugAgent Library instance will print help information on how to load DebugAgentDxe.efi in UEFI shell. But it is printed after Target connected to Host side. This fix is to move help info print to DebugAgentDxe module before Target tries to connect HOST. It could help developer to get useful information as early as possible. 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@17458 6f19259b-4bc3-4df7-8a09-765794883524
* SourceLevelDebugPkg/DxeDebugAgent: Initialize Local APIC Timer earlyJeff Fan2015-05-181-20/+19
| | | | | | | | | | | | | | | | Now Debug Agent library uses Local APIC Timer to implement time-out mechanism. But it does not initialize Local APIC Timer before transfer data with HOST. This fix is to move Local APIC Timer initialization to SetupDebugAgentEnvironment(). This fix also updates function header and fixed one typo of SetupDebugAgentEnvironment() name. 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@17457 6f19259b-4bc3-4df7-8a09-765794883524
* SourceLevelDebugPkg/DebugAgent: Support IA32 processors without DE or ↵Michael Kinney2015-04-277-14/+71
| | | | | | | | | | | | | | | FXSAVE/FXRESTOR Use CPUID Leaf 01 to detect support for debug extensions and FXSAVE/FXRESTOR instructions. Do not enable those features in CR4 if they are not supported. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17220 6f19259b-4bc3-4df7-8a09-765794883524
* MdePkg/DebugAgent: Support IA32 processors without MSR_IA32_APIC_BASE_ADDRESSMichael Kinney2015-04-271-2/+11
| | | | | | | | | | | | Avoid use of Local APIC Base Address MSR (MSR_IA32_APIC_BASE_ADDRESS) if there is only 1 CPU present. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17218 6f19259b-4bc3-4df7-8a09-765794883524
* SourceLevelDebugPkg/DebugAgent: Add some comments and debug messageJeff Fan2015-04-271-4/+22
| | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17206 6f19259b-4bc3-4df7-8a09-765794883524
* SourceLevelDebugPkg/DebugAgent: Clear/Restore EFLAGS.IFJeff Fan2015-04-271-8/+41
| | | | | | | | | | | | | Clear EFLAGS.IF before executing Stepping command and save original value in DEBUG_AGENT_FLAG. It could avoid pending interrupt issued during executing Stepping command. Restore EFLAGS.IF after Stepping command execution finished. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17204 6f19259b-4bc3-4df7-8a09-765794883524
* SourceLevelDebugPkg/DebugAgent: Add InterruptFlag fieldJeff Fan2015-04-271-1/+3
| | | | | | | | | | | Add InterruptFlag field in DEBUG_AGENT_FLAG. This field is used to save/restore EFLAGS.IF across Stepping command execution. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17203 6f19259b-4bc3-4df7-8a09-765794883524
* SourceLevelDebugPkg: Clear Stepping flag as early as possibleJeff Fan2015-04-211-4/+4
| | | | | | | | | | | | It will avoid that exception issued by Debug Agent itself was skipped. 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@17190 6f19259b-4bc3-4df7-8a09-765794883524
* SourceLevelDebugPkg: Avoid NULL pointer reference.Jeff Fan2015-04-151-15/+16
| | | | | | | | | | | 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@17183 6f19259b-4bc3-4df7-8a09-765794883524
* SourceLevelDebugPkg: Fix calculate the checksum bug and add NULL pointer checkJeff Fan2015-04-102-1/+5
| | | | | | | | | | | | 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@17160 6f19259b-4bc3-4df7-8a09-765794883524
* Add missing parameter in function header.Jeff Fan2015-04-072-2/+2
| | | | | | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17125 6f19259b-4bc3-4df7-8a09-765794883524
* SourceLevelDebugPkg: Use CPU Local APIC timer to handle timeout.Jeff Fan2015-04-018-38/+235
| | | | | | | | | | | | | | | 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