summaryrefslogtreecommitdiff
path: root/SourceLevelDebugPkg
AgeCommit message (Collapse)AuthorFilesLines
2017-12-08SourceLevelDebugPkg/SecPeiDebugAgentLib: Fix duplicate symbolMichael Kinney1-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>
2017-10-16SourceLevelDebugPkg: Update SmmDebugAgentLib to restore APIC timerLiming Gao1-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>
2017-09-04SourceLevelDebugPkg/DebugCommLibUsb3: Remove IntelFrameworkPkg.decStar Zeng2-3/+1
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>
2017-09-04SourceLevelDebugPkg/DebugCommLibUsb3Pei: Make sure alloc physical memStar Zeng2-9/+24
PI 1.6 has supported pre permanent memory page allocation, to make sure the allocated memory is physical memory for DMA, the patch is to check memory discovered PPI installed or not first before calling AllocatePages. 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: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com>
2017-09-04SourceLevelDebugPkg: Use Pcd for the revision of transfer protocolHao Wu7-10/+26
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>
2017-08-03edk2: Move License.txt file to rootMichael D Kinney1-25/+0
https://bugzilla.tianocore.org/show_bug.cgi?id=642 Add top level License.txt file with the BSD 2-Clause License that is used by the majority of the EKD II open source project content. Merge copyright statements from the BSD 2-Clause License files in each package directory and remove the duplication License.txt file from package directories. Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Andrew Fish <afish@apple.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2017-08-03edk2: Move TianoCore Contribution Agreement to rootMichael D Kinney1-218/+0
https://bugzilla.tianocore.org/show_bug.cgi?id=629 Move Contributions.txt that contains the TianoCore Contribution Agreement 1.0 to the root of the edk2 repository and remove the duplicate Contributions.txt files from all packages. Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Andrew Fish <afish@apple.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2017-04-26PeCoffGetEntryPointLib: Fix spelling issueJeff Fan1-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>
2017-04-07SourceLevelDebugPkg/DebugAgent.c: Consume PeCoffSerachImageBase()Jeff Fan1-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>
2017-03-06SourceLevelDebugPkg: Refine casting expression result to bigger sizeHao Wu4-19/+19
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>
2016-11-30SourceLevelDebugPkg: Avoid to re-init IDT table again at SMI entryJeff Fan1-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>
2016-10-24SourceLevelDebugPkg: Fix typos in commentsGary Lin6-16/+16
- 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>
2016-08-17UefiCpuPkg/LocalApic.h: Remove duplicated/conflicted definitionsJeff Fan2-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>
2016-08-08SourceLevelDebugPkg DSC: Add build option to disable deprecated APIsHao Wu1-0/+3
Add the following definition in the [BuildOptions] section in package DSC files to disable APIs that are deprecated: [BuildOptions] *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES Cc: Jeff Fan <jeff.fan@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
2016-06-28SourceLevelDebugPkg DebugAgentLib: Add nasm source file into LIB INF files.Liming Gao3-9/+15
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com>
2016-06-28SourceLevelDebugPkg DebugAgentLib: Convert X64/AsmFuncs.asmLiming Gao1-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>
2016-06-28SourceLevelDebugPkg DebugAgentLib: Convert Ia32/AsmFuncs.asmLiming Gao1-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>
2016-06-28SourceLevelDebugPkg PeCoffExtraActionLibDebug: Add nasm source file into INFLiming Gao1-3/+5
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com>
2016-06-28SourceLevelDebugPkg PeCoffExtraActionLibDebug: Convert X64/IntHandler.asmLiming Gao1-0/+29
The BaseTools/Scripts/ConvertMasmToNasm.py script was used to convert X64/IntHandler.asm to X64/IntHandler.nasm. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com>
2016-06-28SourceLevelDebugPkg PeCoffExtraActionLibDebug: Convert Ia32/IntHandler.asmLiming Gao1-0/+28
The BaseTools/Scripts/ConvertMasmToNasm.py script was used to convert Ia32/IntHandler.asm to Ia32/IntHandler.nasm. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com>
2016-04-06SourceLevelDebugPkg/SmmDebugAgent: mMailboxPointer is used before setJeff Fan1-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>
2016-03-25SourceLevelDebugPkg: DebugCommunicationLibUsb: remove set but unused variablesLaszlo Ersek1-13/+1
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>
2016-03-25SourceLevelDebugPkg: DebugAgentCommon: remove set but unused variablesLaszlo Ersek1-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>
2016-01-25SourceLevelDebugPkg: DebugCommunicationLibUsb3: Update local variable type.Eric Dong1-9/+14
Update the local variable type to avoid potential data overflow. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Hao Wu <hao.wu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19734 6f19259b-4bc3-4df7-8a09-765794883524
2016-01-19SourceLevelDebugPkg: Add NOOPT target in SourceLevelDebugPkg.dscHao Wu1-2/+2
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19680 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-17SourceLevelDebugPkg: Correct gEfiDebugAgentGuid usage in DxeDebugAgentLibLiming Gao1-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
2015-12-15SourceLevelDebugPkg: Convert all .uni files to utf-8Jordan Justen14-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
2015-10-30SourceLevelDebugPkg: DebugAgent: Set Local APIC SoftwareEnableMichael Kinney3-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
2015-09-24SourceLevelDebugPkg: Change revision to 4 to compress packetRuiyu Ni1-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@18535 6f19259b-4bc3-4df7-8a09-765794883524
2015-09-24SourceLevelDebugPkg: Change the debug message to "v1.5" from "v1.4"Ruiyu Ni1-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
2015-08-27SourceLevelDebugPkg/DebugTimer: Timer count value 0 not calculatedJeff Fan2-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
2015-08-27SourceLevelDebugPkg/DebugTimer: Fix the issue if CurrentTimer = TimerJeff Fan1-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
2015-08-24SourceLevelDebugPkg: Update package version to 0.96 to reflect new changesRuiyu Ni2-2/+2
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Fan Jeff <jeff.fan@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18275 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-28SourceLevelDebugPkg: Add missing PCD usage information in UNI files.Qiu Shumin1-0/+0
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18085 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-10SourceLevelDebugPkg/SecPeiDebugAgentLib: Restore CPU interrupt stateJeff Fan1-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
2015-07-09SourceLevelDebugPkg: Fix PEI timer interrupt regressionBrian J. Johnson1-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
2015-07-03SourceLevelDebugPkg: Fix PEI debug timer regressionBrian J. Johnson1-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
2015-06-26SourceLevelDebugPkg/DebugAgent: Add typecast to fix sign extensionJeff Fan3-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
2015-06-10SourceLevelDebugPkg/DxeDebugAgent: Initialize Local APIC TimerJeff Fan1-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
2015-06-08SourceLevelDebugPkg/DebugAgent: Disable Debug Timer as earlyJeff Fan5-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
2015-06-04SourceLevelDebugPkg/DebugAgent: Check PcdDebugPortHandleBufferSizeJeff Fan2-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
2015-05-25SourceLevelDebugPkg/DebugTimer: Dump Debug Timer parameterJeff Fan6-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
2015-05-25SourceLevelDebugPkg/SmmDebugAgent: Initialize Local APIC TimerJeff Fan1-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
2015-05-18SourceLevelDebugPkg: Fix Serial Port connection cannot be setupRuiyu Ni1-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
2015-05-18SourceLevelDebugPkg/DebugAgentDxe: Move help info from DxeDebugAgentJeff Fan2-30/+41
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
2015-05-18SourceLevelDebugPkg/DxeDebugAgent: Initialize Local APIC Timer earlyJeff Fan1-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
2015-04-27SourceLevelDebugPkg/DebugAgent: Support IA32 processors without DE or ↵Michael Kinney7-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
2015-04-27SourceLevelDebugPkg/PeCoffExtraActionLibDebug: Support IA32 processors ↵Michael Kinney2-3/+14
without debug extensions Use CPUID Leaf 01 to detect support for debug extensions. Force use of software breakpoints if debug extensions 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@17219 6f19259b-4bc3-4df7-8a09-765794883524
2015-04-27MdePkg/DebugAgent: Support IA32 processors without MSR_IA32_APIC_BASE_ADDRESSMichael Kinney1-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
2015-04-27SourceLevelDebugPkg/DebugAgent: Add some comments and debug messageJeff Fan1-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