diff options
author | Gary Lin <glin@suse.com> | 2016-07-29 11:25:37 +0800 |
---|---|---|
committer | david wei <david.wei@intel.com> | 2016-08-10 10:38:37 +0800 |
commit | b7c5355db5b860327f43a3e2c2e548c46bd4148b (patch) | |
tree | 58c3508bd30fa46e9872274f13c9b88221d5e1f6 /Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c | |
parent | 8f3d5a6fd84f338d645d25dd5943b232184e340c (diff) | |
download | edk2-platforms-b7c5355db5b860327f43a3e2c2e548c46bd4148b.tar.xz |
Vlv2TbltDevicePkg/PpmPolicy: Remove the usage of global variables
gcc issued the error of "multiple deifintion" since gBS was also defined
in MdePkg/Library/UefiBootServicesTableLib. Actually those global variables,
gBS, pBS, and pRS, in PpmPolicy.h were only used in one function. Besides,
gBS and pRS were not really used. Remove gBS and pRS and declare pBS in
PpmPolicyEntry() to satisfy gcc.
Cc: David Wei <david.wei@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
Reviewed-by: David Wei <david.wei@intel.com>
Diffstat (limited to 'Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c')
-rw-r--r-- | Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c b/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c index 2f8996bc1a..fb4e7fc87b 100644 --- a/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c +++ b/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c @@ -33,8 +33,6 @@ Abstract: #define EFI_CPUID_MODEL 0x00F0
#define EFI_CPUID_STEPPING 0x000F
-
-
EFI_STATUS
EFIAPI
PpmPolicyEntry(
@@ -42,6 +40,7 @@ PpmPolicyEntry( IN EFI_SYSTEM_TABLE *SystemTable
)
{
+ EFI_BOOT_SERVICES *pBS;
EFI_MP_SERVICES_PROTOCOL *MpService;
EFI_CPUID_REGISTER Cpuid01 = { 0, 0, 0, 0};
EFI_HANDLE Handle;
@@ -52,15 +51,12 @@ PpmPolicyEntry( PCH_STEPPING Stepping;
-
- gBS = SystemTable->BootServices;
pBS = SystemTable->BootServices;
- pRS = SystemTable->RuntimeServices;
//
// Set PPM policy structure to known value
//
- gBS->SetMem (&mDxePlatformPpmPolicy, sizeof(PPM_PLATFORM_POLICY_PROTOCOL), 0);
+ pBS->SetMem (&mDxePlatformPpmPolicy, sizeof(PPM_PLATFORM_POLICY_PROTOCOL), 0);
//
// Find the MpService Protocol
@@ -147,7 +143,7 @@ PpmPolicyEntry( mDxePlatformPpmPolicy.S3RestoreMsrSwSmiNumber = S3_RESTORE_MSR_SW_SMI;
Handle = NULL;
- Status = gBS->InstallMultipleProtocolInterfaces (
+ Status = pBS->InstallMultipleProtocolInterfaces (
&Handle,
&gPpmPlatformPolicyProtocolGuid,
&mDxePlatformPpmPolicy,
|