1. Remove any references on other files from DebugTimer.c, to avoid un-used symbols linked.

2. Add GLOBAL_REMOVE_IF_UNREFERENCED for all global variables.

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@16298 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Jeff Fan 2014-11-04 01:29:20 +00:00 committed by vanjeff
parent 26830e8579
commit 4fe43eb3e9
6 changed files with 118 additions and 118 deletions

View File

@ -18,16 +18,16 @@
#include "DebugAgent.h"
#include "Ia32/DebugException.h"
CHAR8 mErrorMsgVersionAlert[] = "\rThe SourceLevelDebugPkg you are using requires a newer version of the Intel(R) UDK Debugger Tool.\r\n";
CHAR8 mErrorMsgSendInitPacket[] = "\rSend INIT break packet and try to connect the HOST (Intel(R) UDK Debugger Tool v1.4) ...\r\n";
CHAR8 mErrorMsgConnectOK[] = "HOST connection is successful!\r\n";
CHAR8 mErrorMsgConnectFail[] = "HOST connection is failed!\r\n";
CHAR8 mWarningMsgIngoreBreakpoint[] = "Ignore break point in SMM for SMI issued during DXE debugging!\r\n";
GLOBAL_REMOVE_IF_UNREFERENCED CHAR8 mErrorMsgVersionAlert[] = "\rThe SourceLevelDebugPkg you are using requires a newer version of the Intel(R) UDK Debugger Tool.\r\n";
GLOBAL_REMOVE_IF_UNREFERENCED CHAR8 mErrorMsgSendInitPacket[] = "\rSend INIT break packet and try to connect the HOST (Intel(R) UDK Debugger Tool v1.4) ...\r\n";
GLOBAL_REMOVE_IF_UNREFERENCED CHAR8 mErrorMsgConnectOK[] = "HOST connection is successful!\r\n";
GLOBAL_REMOVE_IF_UNREFERENCED CHAR8 mErrorMsgConnectFail[] = "HOST connection is failed!\r\n";
GLOBAL_REMOVE_IF_UNREFERENCED CHAR8 mWarningMsgIngoreBreakpoint[] = "Ignore break point in SMM for SMI issued during DXE debugging!\r\n";
//
// Vector Handoff Info list used by Debug Agent for persist
//
EFI_VECTOR_HANDOFF_INFO mVectorHandoffInfoDebugAgent[] = {
GLOBAL_REMOVE_IF_UNREFERENCED EFI_VECTOR_HANDOFF_INFO mVectorHandoffInfoDebugAgent[] = {
{
DEBUG_EXCEPT_DIVIDE_ERROR, // Vector 0
EFI_VECTOR_HANDOFF_HOOK_BEFORE,
@ -130,7 +130,7 @@ EFI_VECTOR_HANDOFF_INFO mVectorHandoffInfoDebugAgent[] = {
}
};
UINTN mVectorHandoffInfoCount = sizeof (mVectorHandoffInfoDebugAgent) / sizeof (EFI_VECTOR_HANDOFF_INFO);
GLOBAL_REMOVE_IF_UNREFERENCED UINTN mVectorHandoffInfoCount = sizeof (mVectorHandoffInfoDebugAgent) / sizeof (EFI_VECTOR_HANDOFF_INFO);
/**
Calculate CRC16 for target data.

View File

@ -1,7 +1,7 @@
/** @file
Multi-Processor support functions implementation.
Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2010 - 2014, 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
@ -14,9 +14,9 @@
#include "DebugAgent.h"
DEBUG_MP_CONTEXT volatile mDebugMpContext = {0,0,0,{0},{0},0,0,0,0,FALSE,FALSE};
GLOBAL_REMOVE_IF_UNREFERENCED DEBUG_MP_CONTEXT volatile mDebugMpContext = {0,0,0,{0},{0},0,0,0,0,FALSE,FALSE};
DEBUG_CPU_DATA volatile mDebugCpuData = {0};
GLOBAL_REMOVE_IF_UNREFERENCED DEBUG_CPU_DATA volatile mDebugCpuData = {0};
/**
Acquire a spin lock when Multi-processor supported.

View File

@ -1,7 +1,7 @@
/** @file
Code for debug timer to support debug agent library implementation.
Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2010 - 2014, 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
@ -17,8 +17,9 @@
/**
Initialize CPU local APIC timer.
@return 32-bit Local APIC timer init count.
**/
VOID
UINT32
InitializeDebugTimer (
VOID
)
@ -41,9 +42,7 @@ InitializeDebugTimer (
InitializeApicTimer (ApicTimerDivisor, InitialCount, TRUE, DEBUG_TIMER_VECTOR);
if (MultiProcessorDebugSupport()) {
mDebugMpContext.DebugTimerInitCount = InitialCount;
}
return InitialCount;
}
/**

View File

@ -1,7 +1,7 @@
/** @file
Header file for debug timer to support debug agent library implementation.
Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2010 - 2014, 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
@ -16,10 +16,11 @@
#define _DEBUG_TIMER_H_
/**
Initialize debug timer.
Initialize CPU local APIC timer.
@return 32-bit Local APIC timer init count.
**/
VOID
UINT32
InitializeDebugTimer (
VOID
);

View File

@ -398,9 +398,9 @@ InitializeDebugAgent (
mSaveIdtTableSize = IdtDescriptor.Limit + 1;
mSavedIdtTable = AllocateCopyPool (mSaveIdtTableSize, (VOID *) IdtDescriptor.Base);
//
// Initialize Debug Timer hardware
// Initialize Debug Timer hardware and save its initial count
//
InitializeDebugTimer ();
mDebugMpContext.DebugTimerInitCount = InitializeDebugTimer ();
//
// Check if Debug Agent initialized in DXE phase
//
@ -496,9 +496,9 @@ InitializeDebugAgent (
mDxeCoreFlag = TRUE;
mMultiProcessorDebugSupport = TRUE;
//
// Initialize Debug Timer hardware
// Initialize Debug Timer hardware and its initial count
//
InitializeDebugTimer ();
mDebugMpContext.DebugTimerInitCount = InitializeDebugTimer ();
//
// Try to get mailbox from GUIDed HOB build in PEI
//

View File

@ -1,7 +1,7 @@
/** @file
SEC Core Debug Agent Library instance implementition.
Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2010 - 2014, 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
@ -14,17 +14,17 @@
#include "SecPeiDebugAgentLib.h"
BOOLEAN mSkipBreakpoint = FALSE;
GLOBAL_REMOVE_IF_UNREFERENCED BOOLEAN mSkipBreakpoint = FALSE;
EFI_PEI_VECTOR_HANDOFF_INFO_PPI mVectorHandoffInfoPpi = {
GLOBAL_REMOVE_IF_UNREFERENCED EFI_PEI_VECTOR_HANDOFF_INFO_PPI mVectorHandoffInfoPpi = {
&mVectorHandoffInfoDebugAgent[0]
};
//
// Ppis to be installed
//
EFI_PEI_PPI_DESCRIPTOR mVectorHandoffInfoPpiList[] = {
GLOBAL_REMOVE_IF_UNREFERENCED EFI_PEI_PPI_DESCRIPTOR mVectorHandoffInfoPpiList[] = {
{
(EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
&gEfiVectorHandoffInfoPpiGuid,
@ -32,7 +32,7 @@ EFI_PEI_PPI_DESCRIPTOR mVectorHandoffInfoPpiList[] = {
}
};
EFI_PEI_NOTIFY_DESCRIPTOR mMemoryDiscoveredNotifyList[1] = {
GLOBAL_REMOVE_IF_UNREFERENCED EFI_PEI_NOTIFY_DESCRIPTOR mMemoryDiscoveredNotifyList[1] = {
{
(EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
&gEfiPeiMemoryDiscoveredPpiGuid,