REF: https://bugzilla.tianocore.org/show_bug.cgi?id=370
Use GLOBAL_REMOVE_IF_UNREFERENCED for some SMRAM profile global variables,
then their symbols could be removed when SMRAM profile is disabled.
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
/** @file\r
Support routines for SMRAM profile.\r
\r
/** @file\r
Support routines for SMRAM profile.\r
\r
- Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
};\r
GLOBAL_REMOVE_IF_UNREFERENCED MEMORY_PROFILE_CONTEXT_DATA *mSmramProfileContextPtr = NULL;\r
\r
};\r
GLOBAL_REMOVE_IF_UNREFERENCED MEMORY_PROFILE_CONTEXT_DATA *mSmramProfileContextPtr = NULL;\r
\r
-BOOLEAN mSmramReadyToLock;\r
-BOOLEAN mSmramProfileGettingStatus = FALSE;\r
-BOOLEAN mSmramProfileRecordingEnable = MEMORY_PROFILE_RECORDING_DISABLE;\r
-EFI_DEVICE_PATH_PROTOCOL *mSmramProfileDriverPath;\r
-UINTN mSmramProfileDriverPathSize;\r
+GLOBAL_REMOVE_IF_UNREFERENCED BOOLEAN mSmramReadyToLock;\r
+GLOBAL_REMOVE_IF_UNREFERENCED BOOLEAN mSmramProfileGettingStatus = FALSE;\r
+GLOBAL_REMOVE_IF_UNREFERENCED BOOLEAN mSmramProfileRecordingEnable = MEMORY_PROFILE_RECORDING_DISABLE;\r
+GLOBAL_REMOVE_IF_UNREFERENCED EFI_DEVICE_PATH_PROTOCOL *mSmramProfileDriverPath;\r
+GLOBAL_REMOVE_IF_UNREFERENCED UINTN mSmramProfileDriverPathSize;\r
\r
/**\r
Dump SMRAM infromation.\r
\r
/**\r
Dump SMRAM infromation.\r
IN CHAR8 *ActionString OPTIONAL\r
);\r
\r
IN CHAR8 *ActionString OPTIONAL\r
);\r
\r
-EDKII_SMM_MEMORY_PROFILE_PROTOCOL mSmmProfileProtocol = {\r
+GLOBAL_REMOVE_IF_UNREFERENCED EDKII_SMM_MEMORY_PROFILE_PROTOCOL mSmmProfileProtocol = {\r
SmramProfileProtocolGetData,\r
SmramProfileProtocolRegisterImage,\r
SmramProfileProtocolUnregisterImage,\r
SmramProfileProtocolGetData,\r
SmramProfileProtocolRegisterImage,\r
SmramProfileProtocolUnregisterImage,\r
CHAR8 *String;\r
} ACTION_STRING;\r
\r
CHAR8 *String;\r
} ACTION_STRING;\r
\r
-ACTION_STRING mExtActionString[] = {\r
+GLOBAL_REMOVE_IF_UNREFERENCED ACTION_STRING mExtActionString[] = {\r
{MEMORY_PROFILE_ACTION_LIB_ALLOCATE_PAGES, "Lib:AllocatePages"},\r
{MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RUNTIME_PAGES, "Lib:AllocateRuntimePages"},\r
{MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RESERVED_PAGES, "Lib:AllocateReservedPages"},\r
{MEMORY_PROFILE_ACTION_LIB_ALLOCATE_PAGES, "Lib:AllocatePages"},\r
{MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RUNTIME_PAGES, "Lib:AllocateRuntimePages"},\r
{MEMORY_PROFILE_ACTION_LIB_ALLOCATE_RESERVED_PAGES, "Lib:AllocateReservedPages"},\r
{MEMORY_PROFILE_ACTION_LIB_REALLOCATE_RESERVED_POOL, "Lib:ReallocateReservedPool"},\r
};\r
\r
{MEMORY_PROFILE_ACTION_LIB_REALLOCATE_RESERVED_POOL, "Lib:ReallocateReservedPool"},\r
};\r
\r
-GLOBAL_REMOVE_IF_UNREFERENCED CHAR8 mUserDefinedActionString[] = {"UserDefined-0x80000000"};\r
-\r
typedef struct {\r
EFI_MEMORY_TYPE MemoryType;\r
CHAR8 *MemoryTypeStr;\r
typedef struct {\r
EFI_MEMORY_TYPE MemoryType;\r
CHAR8 *MemoryTypeStr;\r