Reviewed-by: Ruiyu Ni <ruiyu...@intel.com>

> -----Original Message-----
> From: Fan, Jeff
> Sent: Tuesday, June 9, 2015 10:21 AM
> To: edk2-devel@lists.sourceforge.net
> Cc: Ni, Ruiyu
> Subject: [Patch] SourceLevelDebugPkg/DxeDebugAgent: Initialize Local APIC
> Timer
> 
> 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....@intel.com>
> CC: Ruiyu Ni <ruiyu...@intel.com>
> ---
>  .../Library/DebugAgent/DxeDebugAgent/DxeDebugAgentLib.c        |
> 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git
> a/SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgent/DxeDebugAg
> entLib.c
> b/SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgent/DxeDebugAg
> entLib.c
> index 56a5e1a..f7fbb3c 100644
> ---
> a/SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgent/DxeDebugAg
> entLib.c
> +++
> b/SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgent/DxeDebugAg
> entLib.c
> @@ -365,9 +365,19 @@ InitializeDebugAgent (
>    IA32_DESCRIPTOR              IdtDescriptor;
>    IA32_DESCRIPTOR              *Ia32Idtr;
>    IA32_IDT_ENTRY               *Ia32IdtEntry;
> +  BOOLEAN                      PeriodicMode;
> +  UINTN                        TimerCycle;
> 
>    if (InitFlag == DEBUG_AGENT_INIT_DXE_AP) {
>      //
> +    // Check if CPU APIC Timer is working, otherwise initialize it.
> +    //
> +    GetApicTimerState (NULL, &PeriodicMode, NULL);
> +    TimerCycle = GetApicTimerInitCount ();
> +    if (!PeriodicMode || TimerCycle == 0) {
> +      InitializeDebugTimer (NULL, FALSE);
> +    }
> +    //
>      // Invoked by AP, enable interrupt to let AP could receive IPI from
> other processors
>      //
>      EnableInterrupts ();
> --
> 1.9.5.msysgit.0


------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to