Date   

Re: [PATCH v2 02/19] Vlv2TbltDevicePkg: Only define MDEPKG_NDEBUG for gcc release build

Laszlo Ersek
 

On 07/29/16 05:25, Gary Lin wrote:
We only enable "-Wno-unused-but-set-variable" for the release build
and gcc would complain that the varible passed to ASSERT_EFI_ERROR
wasn't used in the debug build. Just don't define MDEPKG_NDEBUG for
the debug build to make gcc happy with ASSERT_EFI_ERROR.

Suggested-by: Laszlo Ersek <lersek@redhat.com>
Cc: David Wei <david.wei@intel.com>
CC: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
---
Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc b/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc
index a3f4c9a..e57d2ad 100644
--- a/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc
+++ b/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc
@@ -1117,7 +1117,7 @@ [Components.X64]
!endif
<BuildOptions>
ICC:*_*_*_CC_FLAGS = -D MDEPKG_NDEBUG
- GCC:*_*_*_CC_FLAGS = -D MDEPKG_NDEBUG
+ GCC:RELEASE_*_*_CC_FLAGS = -D MDEPKG_NDEBUG
}
MdeModulePkg/Universal/PCD/Dxe/Pcd.inf {
<LibraryClasses>
Acked-by: Laszlo Ersek <lersek@redhat.com>


bugzilla whining

Laszlo Ersek
 

Hello Mike,

I got my first ever bugzilla whine today. It says "All of these bugs are
in the CONFIRMED state, and have not been touched in 7 days or more."

I'm not amused. :) I keep a very close eye on my BZs and I don't welcome
automated whines.

I checked the Bugzilla 5 documentation about whines:

http://bugzilla.readthedocs.io/en/5.0/administering/whining.html#whining
http://bugzilla.readthedocs.io/en/5.0/using/preferences.html?highlight=whine#permissions
http://bugzilla.readthedocs.io/en/5.0/administering/parameters.html?highlight=whine#email

I confirmed on my account (under Preferences | Permissions) that I have
the "bz_canusewhines" permission (--> "User can configure whine reports
for self"). However, when I go to Administration | Whining, it seems
that I can only create new whines -- I don't seem to have any personal
whines set up at the moment.

Which makes me think that this is a central default. Can we please make
it a personal setting instead?

Thank you,
Laszlo


Re: [PATCH v4 0/7] BaseTools: add support for GCC5 in LTO mode

Ard Biesheuvel
 

On 29 July 2016 at 08:09, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
On 29 July 2016 at 06:47, Gao, Liming <liming.gao@intel.com> wrote:
Ard:
Thanks for your update. I have some comments for them.
1) It uses GCC as Link for GCC44-GCC49. Have you done verification on them? I verify GCC49 in OVMFIa32X64 platform. It works.
Yes, I tested all of them.

2) After this change, how to append new link option in platform DSC? Use style -Wl, ?
It depends. Some options (like -z) don't need it, but others do.

3) I see GCC5 uses gcc-ar as its SLINK, and GCC49 uses ar as its SLINK. Is gcc-ar required only by LTO?
Yes

4) Before GCC49 optimization, GCC49 means GCC49 or later, GCC5 can work with GCC49 tool chain configuration. But now, I configure gcc to point to GCC5, and build OVMF with GCC49 tool chain, it reports GenFw failure. I expect GCC5 work with GCC49 and GCC5 tool chain both. GCC49 for no lto, GCC5 for lto. I know Steven has provided the patch to fix this GenFw issue.

GenFw: ERROR 3000: Invalid
/home/hwu/work/lgao4/AllPkg/Build/Ovmf3264/DEBUG_GCC49/X64/MdeModulePkg/Core/Dxe/DxeMain/DEBUG/DxeCore.dll unsupported ELF EM_X86_64 relocation 0x9.
GenFw: ERROR 3000: Invalid
/home/hwu/work/lgao4/AllPkg/Build/Ovmf3264/DEBUG_GCC49/X64/MdeModulePkg/Core/Dxe/DxeMain/DEBUG/DxeCore.dll unsupported ELF EM_X86_64 relocation 0x9.
GenFw: ERROR 3000: Invalid
Which GCC version are you using?
I cannot reproduce this with gcc version 5.4.0 20160609 (Ubuntu
5.4.0-6ubuntu1~16.04.1)

In any case, I think we should merge Steven's patch that adds handling
to the relocation types to GenFw. The issue is only that having a GOT
does not make a lot of sense for UEFI executables, since it forces a
symbol reference to be absolute, which uses more space in the code,
but also in the .reloc section. The visibility pragma I introduced for
GCC4x was intended to prevent GOT based relocations from being
emitted.


Re: [PATCH v4 0/7] BaseTools: add support for GCC5 in LTO mode

Ard Biesheuvel
 

On 29 July 2016 at 06:47, Gao, Liming <liming.gao@intel.com> wrote:
Ard:
Thanks for your update. I have some comments for them.
1) It uses GCC as Link for GCC44-GCC49. Have you done verification on them? I verify GCC49 in OVMFIa32X64 platform. It works.
Yes, I tested all of them.

2) After this change, how to append new link option in platform DSC? Use style -Wl, ?
It depends. Some options (like -z) don't need it, but others do.

3) I see GCC5 uses gcc-ar as its SLINK, and GCC49 uses ar as its SLINK. Is gcc-ar required only by LTO?
Yes

4) Before GCC49 optimization, GCC49 means GCC49 or later, GCC5 can work with GCC49 tool chain configuration. But now, I configure gcc to point to GCC5, and build OVMF with GCC49 tool chain, it reports GenFw failure. I expect GCC5 work with GCC49 and GCC5 tool chain both. GCC49 for no lto, GCC5 for lto. I know Steven has provided the patch to fix this GenFw issue.

GenFw: ERROR 3000: Invalid
/home/hwu/work/lgao4/AllPkg/Build/Ovmf3264/DEBUG_GCC49/X64/MdeModulePkg/Core/Dxe/DxeMain/DEBUG/DxeCore.dll unsupported ELF EM_X86_64 relocation 0x9.
GenFw: ERROR 3000: Invalid
/home/hwu/work/lgao4/AllPkg/Build/Ovmf3264/DEBUG_GCC49/X64/MdeModulePkg/Core/Dxe/DxeMain/DEBUG/DxeCore.dll unsupported ELF EM_X86_64 relocation 0x9.
GenFw: ERROR 3000: Invalid
Which GCC version are you using?


-----Original Message-----
From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org]
Sent: Wednesday, July 27, 2016 7:14 PM
To: edk2-devel@lists.01.org; lersek@redhat.com; Gao, Liming
<liming.gao@intel.com>; Shi, Steven <steven.shi@intel.com>; Zhu,
Yonghong <yonghong.zhu@intel.com>; Justen, Jordan L
<jordan.l.justen@intel.com>
Cc: leif.lindholm@linaro.org; Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: [PATCH v4 0/7] BaseTools: add support for GCC5 in LTO mode

This v4 to introduce GCC5 is now a 7 piece series, including some
preparatory cleanup patches that allow all GCC4x and CLANG35 toolchains
to switch to using 'gcc' as the linker. This allows us to get rid of
the wrapper script to marshall ld arguments in order to make them
understandable by gcc, which is fragile and likely to cause problems in
the future.

Since there appears to be a natural split between the 'legacy' GCC
toolchains UNIXGCC, ELFGCC, and CYGGCC[xASL], both in term of supported
architectures [IA32, X64, IPF] vs [IA32, X64, ARM, AARCH64], and in
terms of maintenance, these toolchains are not moved to using 'gcc' as
the linker, and instead, a new BUILDRULEFAMILY is introduced called GCCLD
that will retain the old behavior.

The result is that GCC5 can align much more closely with its predecessors,
making the expected maintenance burden of supporting GCC back to v4.4
much lower.

Changes since v3:
- like Steven does in his GCC5LTO patch, add -fno-builtin to IA32 and X64
CC_FLAGS; this addresses a build issue reported by Liming
- add -Os the the linker flags as well, for AARCH64 this does not seem to
make
a difference, but it is arguably correct since the LTO processing at link
time involves code generation as well
- add Laszlo's ack to #2
- new patch #6 to omit the autogenerated build-id from the PE/COFF binary

Changes since v2:
- add license headers to LTO glue files for ARM and AARCH64 (#5)
- get rid of lto-ld-wrapper script

Ard Biesheuvel (7):
BaseTools CLANG35: drop problematic use-movt and save-temps options
ArmVirtPkg/ArmVirtPrePiUniCoreRelocatable: ignore .hash and .note
sections
BaseTools UNIXGCC ELFGCC CYGGCC: clone GCC build rule family into
GCCLD
BaseTools GCC: use 'gcc' as the linker command for GCC44 and later
ArmPkg: add prebuilt glue binaries for GCC5 LTO support
BaseTools GCC: drop GNU notes section from EFI image
BaseTools GCC: add support for GCC v5.x in LTO mode

ArmPkg/GccLto/liblto-aarch64.a | Bin 0 -> 1016 bytes
ArmPkg/GccLto/liblto-aarch64.s | 27 ++
ArmPkg/GccLto/liblto-arm.a | Bin 0 -> 2096 bytes
ArmPkg/GccLto/liblto-arm.s | 61 ++++
ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf | 2 +-
ArmVirtPkg/PrePi/Scripts/PrePi-PIE.lds | 3 +
BaseTools/Conf/build_rule.template | 31 +-
BaseTools/Conf/tools_def.template | 344 ++++++++++++++------
BaseTools/Scripts/GccBase.lds | 6 +
EmulatorPkg/Unix/Host/Host.inf | 6 +-
10 files changed, 372 insertions(+), 108 deletions(-)
create mode 100644 ArmPkg/GccLto/liblto-aarch64.a
create mode 100644 ArmPkg/GccLto/liblto-aarch64.s
create mode 100644 ArmPkg/GccLto/liblto-arm.a
create mode 100644 ArmPkg/GccLto/liblto-arm.s

--
2.7.4


[patch] BaseTool/Upt: Avoid UNI file name conflict

hesschen <hesheng.chen@...>
 

When creating a UNI file if there is a name conflict, add an index from 0 to the file name

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: hesschen <hesheng.chen@intel.com>
---
.../Source/Python/UPT/GenMetaFile/GenDecFile.py | 5 +++--
.../Source/Python/UPT/GenMetaFile/GenInfFile.py | 7 +++---
BaseTools/Source/Python/UPT/Library/String.py | 26 +++++++++++++++++++++-
3 files changed, 32 insertions(+), 6 deletions(-)

diff --git a/BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py b/BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py
index 31abd23..d39c182 100644
--- a/BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py
+++ b/BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py
@@ -65,6 +65,7 @@ from Library.DataType import TAB_SECTION_END
from Library.DataType import TAB_SPLIT
import Library.DataType as DT
from Library.UniClassObject import FormatUniEntry
+from Library.String import GetUniFileName

def GenPcd(Package, Content):
#
@@ -586,9 +587,9 @@ def GenPackageUNIEncodeFile(PackageObject, UniFileHeader = '', Encoding=TAB_ENCO

if not os.path.exists(os.path.dirname(PackageObject.GetFullPath())):
os.makedirs(os.path.dirname(PackageObject.GetFullPath()))
- ContainerFile = os.path.normpath(os.path.join(os.path.dirname(PackageObject.GetFullPath()),
- (PackageObject.GetBaseName() + '.uni')))

+ ContainerFile = GetUniFileName(os.path.dirname(PackageObject.GetFullPath()), PackageObject.GetBaseName())
+
Content = UniFileHeader + '\r\n'
Content += '\r\n'

diff --git a/BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py b/BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py
index a131f98..c1362e6 100644
--- a/BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py
+++ b/BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py
@@ -2,7 +2,7 @@
#
# This file contained the logical of transfer package object to INF files.
#
-# Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2011 - 2016, 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
@@ -41,6 +41,7 @@ import Logger.Log as Logger
from Library import DataType as DT
from GenMetaFile import GenMetaFileMisc
from Library.UniClassObject import FormatUniEntry
+from Library.String import GetUniFileName


## Transfer Module Object to Inf files
@@ -225,8 +226,8 @@ def GenModuleUNIEncodeFile(ModuleObject, UniFileHeader='', Encoding=DT.TAB_ENCOD
return
else:
ModuleObject.UNIFlag = True
- ContainerFile = os.path.normpath(os.path.join(os.path.dirname(ModuleObject.GetFullPath()),
- (ModuleObject.GetBaseName() + '.uni')))
+ ContainerFile = GetUniFileName(os.path.dirname(ModuleObject.GetFullPath()), ModuleObject.GetBaseName())
+
if not os.path.exists(os.path.dirname(ModuleObject.GetFullPath())):
os.makedirs(os.path.dirname(ModuleObject.GetFullPath()))

diff --git a/BaseTools/Source/Python/UPT/Library/String.py b/BaseTools/Source/Python/UPT/Library/String.py
index 37ce141..05b5fb1 100644
--- a/BaseTools/Source/Python/UPT/Library/String.py
+++ b/BaseTools/Source/Python/UPT/Library/String.py
@@ -2,7 +2,7 @@
# This file is used to define common string related functions used in parsing
# process
#
-# Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2011 - 2016, 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
@@ -957,3 +957,27 @@ def IsMatchArch(Arch1, Arch2):
return True

return False
+
+# Search all files in FilePath to find the FileName with the largest index
+# Return the FileName with index +1 under the FilePath
+#
+def GetUniFileName(FilePath, FileName):
+ Files = os.listdir(FilePath)
+ LargestIndex = -1
+ for File in Files:
+ if File.upper().startswith(FileName.upper()) and File.upper().endswith('.UNI'):
+ Index = File.upper().replace(FileName.upper(), '').replace('.UNI', '')
+ if Index:
+ try:
+ Index = int(Index)
+ except Exception:
+ Index = -1
+ else:
+ Index = 0
+ if Index > LargestIndex:
+ LargestIndex = Index + 1
+
+ if LargestIndex > -1:
+ return os.path.normpath(os.path.join(FilePath, FileName + str(LargestIndex) + '.uni'))
+ else:
+ return os.path.normpath(os.path.join(FilePath, FileName + '.uni'))
--
2.7.2.windows.1


Re: [Patch 1/3] BaseTools: Correct ReadMe.txt file with CRLF line ending

Zhu, Yonghong <yonghong.zhu@...>
 

Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>

Best Regards,
Zhu Yonghong

-----Original Message-----
From: Gao, Liming
Sent: Thursday, July 28, 2016 4:46 PM
To: edk2-devel@lists.01.org
Cc: Zhu, Yonghong <yonghong.zhu@intel.com>
Subject: [Patch 1/3] BaseTools: Correct ReadMe.txt file with CRLF line ending

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
---
BaseTools/ReadMe.txt | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/BaseTools/ReadMe.txt b/BaseTools/ReadMe.txt index 6330b14..be9ff2a 100644
--- a/BaseTools/ReadMe.txt
+++ b/BaseTools/ReadMe.txt
@@ -7,9 +7,9 @@ directory contatins tools source.

=== Windows/Visual Studio Notes ===

-To build the BaseTools, you should run the standard vsvars32.bat script -from your preferred Visual Studio installation or you can run get_vsvars.bat -to use latest automatically detected version.
+To build the BaseTools, you should run the standard vsvars32.bat script
+from your preferred Visual Studio installation or you can run
+get_vsvars.bat to use latest automatically detected version.

In addition to this, you should set the following environment variables:

--
2.8.0.windows.1


Re: [PATCH v4 0/7] BaseTools: add support for GCC5 in LTO mode

Liming Gao
 

Ard:
Thanks for your update. I have some comments for them.
1) It uses GCC as Link for GCC44-GCC49. Have you done verification on them? I verify GCC49 in OVMFIa32X64 platform. It works.
2) After this change, how to append new link option in platform DSC? Use style -Wl, ?
3) I see GCC5 uses gcc-ar as its SLINK, and GCC49 uses ar as its SLINK. Is gcc-ar required only by LTO?
4) Before GCC49 optimization, GCC49 means GCC49 or later, GCC5 can work with GCC49 tool chain configuration. But now, I configure gcc to point to GCC5, and build OVMF with GCC49 tool chain, it reports GenFw failure. I expect GCC5 work with GCC49 and GCC5 tool chain both. GCC49 for no lto, GCC5 for lto. I know Steven has provided the patch to fix this GenFw issue.

GenFw: ERROR 3000: Invalid
/home/hwu/work/lgao4/AllPkg/Build/Ovmf3264/DEBUG_GCC49/X64/MdeModulePkg/Core/Dxe/DxeMain/DEBUG/DxeCore.dll unsupported ELF EM_X86_64 relocation 0x9.
GenFw: ERROR 3000: Invalid
/home/hwu/work/lgao4/AllPkg/Build/Ovmf3264/DEBUG_GCC49/X64/MdeModulePkg/Core/Dxe/DxeMain/DEBUG/DxeCore.dll unsupported ELF EM_X86_64 relocation 0x9.
GenFw: ERROR 3000: Invalid

Thanks
Liming

-----Original Message-----
From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org]
Sent: Wednesday, July 27, 2016 7:14 PM
To: edk2-devel@lists.01.org; lersek@redhat.com; Gao, Liming
<liming.gao@intel.com>; Shi, Steven <steven.shi@intel.com>; Zhu,
Yonghong <yonghong.zhu@intel.com>; Justen, Jordan L
<jordan.l.justen@intel.com>
Cc: leif.lindholm@linaro.org; Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: [PATCH v4 0/7] BaseTools: add support for GCC5 in LTO mode

This v4 to introduce GCC5 is now a 7 piece series, including some
preparatory cleanup patches that allow all GCC4x and CLANG35 toolchains
to switch to using 'gcc' as the linker. This allows us to get rid of
the wrapper script to marshall ld arguments in order to make them
understandable by gcc, which is fragile and likely to cause problems in
the future.

Since there appears to be a natural split between the 'legacy' GCC
toolchains UNIXGCC, ELFGCC, and CYGGCC[xASL], both in term of supported
architectures [IA32, X64, IPF] vs [IA32, X64, ARM, AARCH64], and in
terms of maintenance, these toolchains are not moved to using 'gcc' as
the linker, and instead, a new BUILDRULEFAMILY is introduced called GCCLD
that will retain the old behavior.

The result is that GCC5 can align much more closely with its predecessors,
making the expected maintenance burden of supporting GCC back to v4.4
much lower.

Changes since v3:
- like Steven does in his GCC5LTO patch, add -fno-builtin to IA32 and X64
CC_FLAGS; this addresses a build issue reported by Liming
- add -Os the the linker flags as well, for AARCH64 this does not seem to
make
a difference, but it is arguably correct since the LTO processing at link
time involves code generation as well
- add Laszlo's ack to #2
- new patch #6 to omit the autogenerated build-id from the PE/COFF binary

Changes since v2:
- add license headers to LTO glue files for ARM and AARCH64 (#5)
- get rid of lto-ld-wrapper script

Ard Biesheuvel (7):
BaseTools CLANG35: drop problematic use-movt and save-temps options
ArmVirtPkg/ArmVirtPrePiUniCoreRelocatable: ignore .hash and .note
sections
BaseTools UNIXGCC ELFGCC CYGGCC: clone GCC build rule family into
GCCLD
BaseTools GCC: use 'gcc' as the linker command for GCC44 and later
ArmPkg: add prebuilt glue binaries for GCC5 LTO support
BaseTools GCC: drop GNU notes section from EFI image
BaseTools GCC: add support for GCC v5.x in LTO mode

ArmPkg/GccLto/liblto-aarch64.a | Bin 0 -> 1016 bytes
ArmPkg/GccLto/liblto-aarch64.s | 27 ++
ArmPkg/GccLto/liblto-arm.a | Bin 0 -> 2096 bytes
ArmPkg/GccLto/liblto-arm.s | 61 ++++
ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf | 2 +-
ArmVirtPkg/PrePi/Scripts/PrePi-PIE.lds | 3 +
BaseTools/Conf/build_rule.template | 31 +-
BaseTools/Conf/tools_def.template | 344 ++++++++++++++------
BaseTools/Scripts/GccBase.lds | 6 +
EmulatorPkg/Unix/Host/Host.inf | 6 +-
10 files changed, 372 insertions(+), 108 deletions(-)
create mode 100644 ArmPkg/GccLto/liblto-aarch64.a
create mode 100644 ArmPkg/GccLto/liblto-aarch64.s
create mode 100644 ArmPkg/GccLto/liblto-arm.a
create mode 100644 ArmPkg/GccLto/liblto-arm.s

--
2.7.4


Re: Ingebrigtsen: The End of Gmane?

Bruce Cran <bruce@...>
 

On 7/28/16 6:46 PM, Kinney, Michael D wrote:

Built-in archives for edk2-devel and edk2-bugs and now enabled.
Thanks!

--
Bruce


[PATCH v2 19/19] Vlv2TbltDevicePkg/PpmPolicy: Remove the unused variable

Gary Lin
 

Fix the following error from gcc:

Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c: In function ‘PpmPolicyEntry’:
Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c:50:29: error: variable ‘MaxRatio’ set but not used [-Werror=unused-but-set-variable]

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>
---
Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c | 3 ---
1 file changed, 3 deletions(-)

diff --git a/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c b/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c
index fb4e7fc..ec0c0f5 100644
--- a/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c
+++ b/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c
@@ -46,7 +46,6 @@ PpmPolicyEntry(
EFI_HANDLE Handle;
EFI_STATUS Status;
UINTN CpuCount;
- UINT64 MaxRatio;
UINT8 CPUMobileFeature;

PCH_STEPPING Stepping;
@@ -77,8 +76,6 @@ PpmPolicyEntry(
// Store the CPUID for use by SETUP items.
//
AsmCpuid (EFI_CPUID_VERSION_INFO, &Cpuid01.RegEax, &Cpuid01.RegEbx, &Cpuid01.RegEcx, &Cpuid01.RegEdx);
- MaxRatio = ((RShiftU64 (AsmReadMsr64(EFI_MSR_IA32_PLATFORM_ID), 8)) & 0x1F);
-

mDxePlatformPpmPolicy.Revision = PPM_PLATFORM_POLICY_PROTOCOL_REVISION_4;

--
2.9.2


[PATCH v2 18/19] Vlv2TbltDevicePkg/PpmPolicy: Remove the usage of global variables

Gary Lin
 

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>
---
Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c | 10 +++-------
Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.h | 6 +-----
2 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c b/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c
index 2f8996b..fb4e7fc 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,
diff --git a/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.h b/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.h
index cd3676b..cc7bed7 100644
--- a/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.h
+++ b/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.h
@@ -31,10 +31,6 @@ PPM_PLATFORM_POLICY_PROTOCOL mDxePlatformPpmPolicy;
#define ICH_DEVICE_ENABLE 1
#define ICH_DEVICE_DISABLE 0

-EFI_BOOT_SERVICES *gBS;
-EFI_BOOT_SERVICES *pBS;
-EFI_RUNTIME_SERVICES *pRS;
-
#define POWER_STATE_SWITCH_SMI 43
#define ENABLE_C_STATE_IO_REDIRECTION_SMI 70
#define DISABLE_C_STATE_IO_REDIRECTION_SMI 71
@@ -43,4 +39,4 @@ EFI_RUNTIME_SERVICES *pRS;
#define ENABLE_P_STATE_HARDWARE_COORDINATION_SMI 74
#define DISABLE_P_STATE_HARDWARE_COORDINATION_SMI 75
#define S3_RESTORE_MSR_SW_SMI 48
-#define ENABLE_C6_RESIDENCY_SMI 76
\ No newline at end of file
+#define ENABLE_C6_RESIDENCY_SMI 76
--
2.9.2


[PATCH v2 17/19] Vlv2TbltDevicePkg/SmBiosMiscDxe: Remove unused variables

Gary Lin
 

Fix the following errors from gcc:

Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOemType0x90Function.c: In function ‘JudgeHandleIsPCIDevice’:
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOemType0x90Function.c:164:22: error: variable ‘DevicePath’ set but not used [-Werror=unused-but-set-variable]

Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOemType0x90Function.c: In function ‘AddSmbiosT0x90Callback’:
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOemType0x90Function.c:292:28: error: variable ‘ForType90InputData’ set but not used [-Werror=unused-but-set-variable]

Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorInformationFunction.c: In function ‘MiscProcessorInformationFunction’:
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorInformationFunction.c:191:37: error: variable ‘SrcDataSize’ set but not used [-Werror=unused-but-set-variable]

Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorCacheFunction.c: In function ‘MiscProcessorCacheFunction’:
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorCacheFunction.c:78:34: error: variable ‘SrcDataSize’ set but not used [-Werror=unused-but-set-variable]

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>
---
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOemType0x90Function.c | 5 -----
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorCacheFunction.c | 2 --
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorInformationFunction.c | 2 --
3 files changed, 9 deletions(-)

diff --git a/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOemType0x90Function.c b/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOemType0x90Function.c
index 2d0bf8b..9e04907 100644
--- a/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOemType0x90Function.c
+++ b/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOemType0x90Function.c
@@ -152,7 +152,6 @@ JudgeHandleIsPCIDevice(
{
EFI_STATUS Status;
EFI_DEVICE_PATH *DPath;
- EFI_DEVICE_PATH *DevicePath;

Status = gBS->HandleProtocol (
Handle,
@@ -160,7 +159,6 @@ JudgeHandleIsPCIDevice(
(VOID **) &DPath
);
if(!EFI_ERROR(Status)) {
- DevicePath = DPath;
while(!IsDevicePathEnd(DPath)) {
if((DPath->Type == HARDWARE_DEVICE_PATH) && (DPath->SubType == HW_PCI_DP)) {
PCI_DEVICE_PATH *PCIPath;
@@ -280,7 +278,6 @@ AddSmbiosT0x90Callback (
UINTN SteppingStrLen = 0;
SMBIOS_TABLE_TYPE90 *SmbiosRecord;
EFI_SMBIOS_HANDLE SmbiosHandle;
- EFI_MISC_OEM_TYPE_0x90 *ForType90InputData;
CHAR16 *SECVer;
CHAR16 *uCodeVer;
CHAR16 *GOPVer;
@@ -289,8 +286,6 @@ AddSmbiosT0x90Callback (
CHAR8 *OptionalStrStart;
EFI_SMBIOS_PROTOCOL *SmbiosProtocol;

- ForType90InputData = (EFI_MISC_OEM_TYPE_0x90 *)Context;
-
DEBUG ((EFI_D_INFO, "Executing SMBIOS T0x90 callback.\n"));

gBS->CloseEvent (Event); // Unload this event.
diff --git a/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorCacheFunction.c b/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorCacheFunction.c
index cbed988..b18a6aa 100644
--- a/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorCacheFunction.c
+++ b/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorCacheFunction.c
@@ -66,7 +66,6 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscProcessorCache)
EFI_DATA_RECORD_HEADER *Record;
EFI_SUBCLASS_TYPE1_HEADER *DataHeader;
UINT8 *SrcData;
- UINT32 SrcDataSize;
EFI_STATUS Status;

//
@@ -113,7 +112,6 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscProcessorCache)
if (Record->DataRecordClass == EFI_DATA_RECORD_CLASS_DATA) {
DataHeader = (EFI_SUBCLASS_TYPE1_HEADER *)(Record + 1);
SrcData = (UINT8 *)(DataHeader + 1);
- SrcDataSize = Record->RecordSize - Record->HeaderSize - sizeof (EFI_SUBCLASS_TYPE1_HEADER);
if (CompareGuid(&Record->DataRecordGuid, &gEfiCacheSubClassGuid) && (DataHeader->RecordType == CacheSizeRecordType)) {
if (DataHeader->SubInstance == EFI_CACHE_L1) {
SmbiosRecordL1->InstalledSize += (UINT16) (ConvertBase2ToRaw((EFI_EXP_BASE2_DATA *)SrcData) >> 10);
diff --git a/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorInformationFunction.c b/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorInformationFunction.c
index 005b43c..bd988db 100644
--- a/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorInformationFunction.c
+++ b/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorInformationFunction.c
@@ -179,7 +179,6 @@ MISC_SMBIOS_TABLE_FUNCTION (MiscProcessorInformation)
EFI_DATA_RECORD_HEADER *Record;
EFI_SUBCLASS_TYPE1_HEADER *DataHeader;
UINT8 *SrcData;
- UINT32 SrcDataSize;
EFI_PROCESSOR_VERSION_DATA *ProcessorVersion;
CHAR16 *NewStringToken;
STRING_REF TokenToUpdate;
@@ -225,7 +224,6 @@ MISC_SMBIOS_TABLE_FUNCTION (MiscProcessorInformation)

DataHeader = (EFI_SUBCLASS_TYPE1_HEADER *)(Record + 1);
SrcData = (UINT8 *)(DataHeader + 1);
- SrcDataSize = Record->RecordSize - Record->HeaderSize - sizeof (EFI_SUBCLASS_TYPE1_HEADER);

//
// Processor
--
2.9.2


[PATCH v2 16/19] Vlv2TbltDevicePkg/Wpce791: Remove the unused variable

Gary Lin
 

Fix the following error from gcc:

Vlv2TbltDevicePkg/Wpce791/LpcDriver.c: In function ‘LpcDriverStart’:
Vlv2TbltDevicePkg/Wpce791/LpcDriver.c:239:27: error: variable ‘LpcDev’ set but not used [-Werror=unused-but-set-variable]

Cc: David Wei <david.wei@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
---
Vlv2TbltDevicePkg/Wpce791/LpcDriver.c | 4 ----
1 file changed, 4 deletions(-)

diff --git a/Vlv2TbltDevicePkg/Wpce791/LpcDriver.c b/Vlv2TbltDevicePkg/Wpce791/LpcDriver.c
index be99b4c..5b0c25c 100644
--- a/Vlv2TbltDevicePkg/Wpce791/LpcDriver.c
+++ b/Vlv2TbltDevicePkg/Wpce791/LpcDriver.c
@@ -227,10 +227,6 @@ LpcDriverStart (
{
EFI_STATUS Status;
EFI_PCI_IO_PROTOCOL *PciIo;
- LPC_DEV *LpcDev;
-
-
- LpcDev = NULL;

//
// Get Pci IO
--
2.9.2


[PATCH v2 15/19] Vlv2TbltDevicePkg/PlatformDxe: Remove the unused variables

Gary Lin
 

Fix the following errors from gcc:

Vlv2TbltDevicePkg/PlatformDxe/Platform.c: In function ‘InitPciDevPME’:
Vlv2TbltDevicePkg/PlatformDxe/Platform.c:516:26: error: variable ‘Status’ set but not used [-Werror=unused-but-set-variable]

Vlv2TbltDevicePkg/PlatformDxe/Platform.c: In function ‘InitThermalZone’:
Vlv2TbltDevicePkg/PlatformDxe/Platform.c:575:26: error: variable ‘Status’ set but not used [-Werror=unused-but-set-variable]

Vlv2TbltDevicePkg/PlatformDxe/IchRegTable.c: In function ‘InitializeSubsystemIds’:
Vlv2TbltDevicePkg/PlatformDxe/IchRegTable.c:111:10: error: variable ‘SubsystemAudioVidDid’ set but not used [-Werror=unused-but-set-variable]

Vlv2TbltDevicePkg/PlatformDxe/PciDevice.c: In function ‘InitBadBars’:
Vlv2TbltDevicePkg/PlatformDxe/PciDevice.c:115:40: error: variable ‘PciIoDevice’ set but not used [-Werror=unused-but-set-variable]
Vlv2TbltDevicePkg/PlatformDxe/PciDevice.c:114:39: error: variable ‘Status’ set but not used [-Werror=unused-but-set-variable]

Vlv2TbltDevicePkg/PlatformDxe/PciDevice.c: In function ‘ProgramPciLatency’:
Vlv2TbltDevicePkg/PlatformDxe/PciDevice.c:320:39: error: variable ‘Status’ set but not used [-Werror=unused-but-set-variable]

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>
---
Vlv2TbltDevicePkg/PlatformDxe/IchRegTable.c | 2 -
Vlv2TbltDevicePkg/PlatformDxe/PciDevice.c | 214 ++++++++++++++--------------
Vlv2TbltDevicePkg/PlatformDxe/Platform.c | 40 +++---
3 files changed, 123 insertions(+), 133 deletions(-)

diff --git a/Vlv2TbltDevicePkg/PlatformDxe/IchRegTable.c b/Vlv2TbltDevicePkg/PlatformDxe/IchRegTable.c
index 06d325c..4569ce5 100644
--- a/Vlv2TbltDevicePkg/PlatformDxe/IchRegTable.c
+++ b/Vlv2TbltDevicePkg/PlatformDxe/IchRegTable.c
@@ -99,10 +99,8 @@ InitializeSubsystemIds (

EFI_REG_TABLE *RegTablePtr;
UINT32 SubsystemVidDid;
- UINT32 SubsystemAudioVidDid;

SubsystemVidDid = mPlatformInfo.SsidSvid;
- SubsystemAudioVidDid = mPlatformInfo.SsidSvid;

RegTablePtr = mSubsystemIdRegs;

diff --git a/Vlv2TbltDevicePkg/PlatformDxe/PciDevice.c b/Vlv2TbltDevicePkg/PlatformDxe/PciDevice.c
index 16aaa18..8c2bfff 100644
--- a/Vlv2TbltDevicePkg/PlatformDxe/PciDevice.c
+++ b/Vlv2TbltDevicePkg/PlatformDxe/PciDevice.c
@@ -102,8 +102,6 @@ InitBadBars(
)
{

- EFI_STATUS Status;
- PCI_IO_DEVICE *PciIoDevice;
UINT64 BaseAddress = 0;
UINT64 TempBaseAddress = 0;
UINT8 RevId = 0;
@@ -112,8 +110,6 @@ InitBadBars(
UINT64 MemSize;
UINTN MemSizeBits;

-
- PciIoDevice = PCI_IO_DEVICE_FROM_PCI_IO_THIS (PciIo);
switch ( VendorId) {
case ATI_VENDOR_ID:
//
@@ -124,31 +120,31 @@ InitBadBars(
//
// Get original BAR address
//
- Status = PciIo->Pci.Read (
- PciIo,
- EfiPciIoWidthUint32,
- Bar,
- 1,
- (VOID *) &BaseAddress
- );
+ PciIo->Pci.Read (
+ PciIo,
+ EfiPciIoWidthUint32,
+ Bar,
+ 1,
+ (VOID *) &BaseAddress
+ );
//
// Find BAR size
//
TempBaseAddress = 0xffffffff;
- Status = PciIo->Pci.Write (
- PciIo,
- EfiPciIoWidthUint32,
- Bar,
- 1,
- (VOID *) &TempBaseAddress
- );
- Status = PciIo->Pci.Read (
- PciIo,
- EfiPciIoWidthUint32,
- Bar,
- 1,
- (VOID *) &TempBaseAddress
- );
+ PciIo->Pci.Write (
+ PciIo,
+ EfiPciIoWidthUint32,
+ Bar,
+ 1,
+ (VOID *) &TempBaseAddress
+ );
+ PciIo->Pci.Read (
+ PciIo,
+ EfiPciIoWidthUint32,
+ Bar,
+ 1,
+ (VOID *) &TempBaseAddress
+ );
TempBaseAddress &= 0xfffffffe;
MemSize = 1;
while ((TempBaseAddress & 0x01) == 0) {
@@ -159,32 +155,32 @@ InitBadBars(
//
// Free up allocated memory memory and re-allocate with increased size.
//
- Status = gDS->FreeMemorySpace (
- BaseAddress,
- MemSize
- );
+ gDS->FreeMemorySpace (
+ BaseAddress,
+ MemSize
+ );
//
// Force new alignment
//
MemSize = 0x8000000;
MemSizeBits = 28;

- Status = gDS->AllocateMemorySpace (
- EfiGcdAllocateAnySearchBottomUp,
- EfiGcdMemoryTypeMemoryMappedIo,
- MemSizeBits, // Alignment
- MemSize,
- &BaseAddress,
- mImageHandle,
- NULL
- );
- Status = PciIo->Pci.Write (
- PciIo,
- EfiPciIoWidthUint32,
- Bar,
- 1,
- (VOID *) &BaseAddress
- );
+ gDS->AllocateMemorySpace (
+ EfiGcdAllocateAnySearchBottomUp,
+ EfiGcdMemoryTypeMemoryMappedIo,
+ MemSizeBits, // Alignment
+ MemSize,
+ &BaseAddress,
+ mImageHandle,
+ NULL
+ );
+ PciIo->Pci.Write (
+ PciIo,
+ EfiPciIoWidthUint32,
+ Bar,
+ 1,
+ (VOID *) &BaseAddress
+ );

break;
case NCR_VENDOR_ID:
@@ -195,22 +191,22 @@ InitBadBars(
//
for (Bar = 0x10; Bar < 0x28; Bar+= 4) {

- Status = PciIo->Pci.Read (
- PciIo,
- EfiPciIoWidthUint32,
- Bar,
- 1,
- (VOID *) &BaseAddress
- );
+ PciIo->Pci.Read (
+ PciIo,
+ EfiPciIoWidthUint32,
+ Bar,
+ 1,
+ (VOID *) &BaseAddress
+ );
if (BaseAddress && 0x01) {
TempBaseAddress = 0xffffffff;
- Status = PciIo->Pci.Write (
- PciIo,
- EfiPciIoWidthUint32,
- Bar,
- 1,
- (VOID *) &TempBaseAddress
- );
+ PciIo->Pci.Write (
+ PciIo,
+ EfiPciIoWidthUint32,
+ Bar,
+ 1,
+ (VOID *) &TempBaseAddress
+ );
TempBaseAddress &= 0xfffffffc;
IoSize = 1;
while ((TempBaseAddress & 0x01) == 0) {
@@ -218,28 +214,28 @@ InitBadBars(
IoSize = IoSize << 1;
}
if (IoSize < MIN_NCR_IO_SIZE) {
- Status = gDS->FreeIoSpace (
- BaseAddress,
- IoSize
- );
-
- Status = gDS->AllocateIoSpace (
- EfiGcdAllocateAnySearchTopDown,
- EfiGcdIoTypeIo,
- NCR_GRAN, // Alignment
- MIN_NCR_IO_SIZE,
- &BaseAddress,
- mImageHandle,
- NULL
- );
+ gDS->FreeIoSpace (
+ BaseAddress,
+ IoSize
+ );
+
+ gDS->AllocateIoSpace (
+ EfiGcdAllocateAnySearchTopDown,
+ EfiGcdIoTypeIo,
+ NCR_GRAN, // Alignment
+ MIN_NCR_IO_SIZE,
+ &BaseAddress,
+ mImageHandle,
+ NULL
+ );
TempBaseAddress = BaseAddress + 1;
- Status = PciIo->Pci.Write (
- PciIo,
- EfiPciIoWidthUint32,
- Bar,
- 1,
- (VOID *) &TempBaseAddress
- );
+ PciIo->Pci.Write (
+ PciIo,
+ EfiPciIoWidthUint32,
+ Bar,
+ 1,
+ (VOID *) &TempBaseAddress
+ );
}
}
}
@@ -255,13 +251,13 @@ InitBadBars(
// Controller.
// All Tekoa A2 or earlier step chips for now.
//
- Status = PciIo->Pci.Read (
- PciIo,
- EfiPciIoWidthUint8,
- PCI_REVISION_ID_OFFSET,
- 1,
- &RevId
- );
+ PciIo->Pci.Read (
+ PciIo,
+ EfiPciIoWidthUint8,
+ PCI_REVISION_ID_OFFSET,
+ 1,
+ &RevId
+ );
if (RevId <= 0x02) {
for (Bar = 0x14; Bar < 0x24; Bar+= 4) {
//
@@ -269,13 +265,13 @@ InitBadBars(
// Bars don't worry aboyut freeing up thge allocs.
//
TempBaseAddress = 0x0;
- Status = PciIo->Pci.Write (
- PciIo,
- EfiPciIoWidthUint32,
- Bar,
- 1,
- (VOID *) &TempBaseAddress
- );
+ PciIo->Pci.Write (
+ PciIo,
+ EfiPciIoWidthUint32,
+ Bar,
+ 1,
+ (VOID *) &TempBaseAddress
+ );
} // end for
}
else
@@ -286,13 +282,13 @@ InitBadBars(
//since Tekoa does not fully support IDE Bus Mastering
//
TempBaseAddress = 0x0;
- Status = PciIo->Pci.Write (
- PciIo,
- EfiPciIoWidthUint32,
- 0x20,
- 1,
- (VOID *) &TempBaseAddress
- );
+ PciIo->Pci.Write (
+ PciIo,
+ EfiPciIoWidthUint32,
+ 0x20,
+ 1,
+ (VOID *) &TempBaseAddress
+ );
}
}
break;
@@ -308,19 +304,17 @@ ProgramPciLatency(
IN EFI_PCI_IO_PROTOCOL *PciIo
)
{
- EFI_STATUS Status;
-
//
// Program Master Latency Timer
//
if (mSystemConfiguration.PciLatency != 0) {
- Status = PciIo->Pci.Write (
- PciIo,
- EfiPciIoWidthUint8,
- PCI_LATENCY_TIMER_OFFSET,
- 1,
- &mSystemConfiguration.PciLatency
- );
+ PciIo->Pci.Write (
+ PciIo,
+ EfiPciIoWidthUint8,
+ PCI_LATENCY_TIMER_OFFSET,
+ 1,
+ &mSystemConfiguration.PciLatency
+ );
}
return;
}
diff --git a/Vlv2TbltDevicePkg/PlatformDxe/Platform.c b/Vlv2TbltDevicePkg/PlatformDxe/Platform.c
index 439b6d9..3d8cbe0 100644
--- a/Vlv2TbltDevicePkg/PlatformDxe/Platform.c
+++ b/Vlv2TbltDevicePkg/PlatformDxe/Platform.c
@@ -518,16 +518,15 @@ InitPciDevPME (
)
{
UINTN VarSize;
- EFI_STATUS Status;

VarSize = sizeof(SYSTEM_CONFIGURATION);
- Status = gRT->GetVariable(
- NORMAL_SETUP_NAME,
- &gEfiNormalSetupGuid,
- NULL,
- &VarSize,
- &mSystemConfiguration
- );
+ gRT->GetVariable(
+ NORMAL_SETUP_NAME,
+ &gEfiNormalSetupGuid,
+ NULL,
+ &VarSize,
+ &mSystemConfiguration
+ );

//
//Program HDA PME_EN
@@ -577,21 +576,20 @@ InitThermalZone (
)
{
UINTN VarSize;
- EFI_STATUS Status;
EFI_GLOBAL_NVS_AREA_PROTOCOL *GlobalNvsArea;
VarSize = sizeof(SYSTEM_CONFIGURATION);
- Status = gRT->GetVariable(
- NORMAL_SETUP_NAME,
- &gEfiNormalSetupGuid,
- NULL,
- &VarSize,
- &mSystemConfiguration
- );
- Status = gBS->LocateProtocol (
- &gEfiGlobalNvsAreaProtocolGuid,
- NULL,
- (void **)&GlobalNvsArea
- );
+ gRT->GetVariable(
+ NORMAL_SETUP_NAME,
+ &gEfiNormalSetupGuid,
+ NULL,
+ &VarSize,
+ &mSystemConfiguration
+ );
+ gBS->LocateProtocol (
+ &gEfiGlobalNvsAreaProtocolGuid,
+ NULL,
+ (void **)&GlobalNvsArea
+ );
GlobalNvsArea->Area->CriticalThermalTripPoint = mSystemConfiguration.CriticalThermalTripPoint;
GlobalNvsArea->Area->PassiveThermalTripPoint = mSystemConfiguration.PassiveThermalTripPoint;
}
--
2.9.2


[PATCH v2 14/19] Vlv2TbltDevicePkg/VlvPlatformInitDxe: Remove unused variables

Gary Lin
 

Fix the following errors from gcc:

Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c: In function ‘GetIntegratedIntelVbtPtr’:
Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c:145:33: error: variable ‘VbtSize’ set but not used [-Werror=unused-but-set-variable]

Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c: In function ‘JudgeHandleIsPCIDevice’:
Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c:418:22: error: variable ‘DevicePath’ set but not used [-Werror=unused-but-set-variable]

Cc: David Wei <david.wei@intel.com>
Cc: "Wu, Hao A" <hao.a.wu@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>
---
Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c | 4 ----
1 file changed, 4 deletions(-)

diff --git a/Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c b/Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c
index 2200e6c..f8dc3f1 100644
--- a/Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c
+++ b/Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c
@@ -133,7 +133,6 @@ GetIntegratedIntelVbtPtr (
{
EFI_STATUS Status;
EFI_PHYSICAL_ADDRESS VbtAddress = 0;
- UINT32 VbtSize = 0;
UINTN FvProtocolCount;
EFI_HANDLE *FvHandles;
EFI_FIRMWARE_VOLUME_PROTOCOL *Fv;
@@ -174,7 +173,6 @@ GetIntegratedIntelVbtPtr (

if (!EFI_ERROR (Status)) {
VbtAddress = (EFI_PHYSICAL_ADDRESS)(UINTN)Buffer;
- VbtSize = (UINT32)VbtBufferSize;
Status = EFI_SUCCESS;
break;
}
@@ -406,7 +404,6 @@ JudgeHandleIsPCIDevice(
{
EFI_STATUS Status;
EFI_DEVICE_PATH *DPath;
- EFI_DEVICE_PATH *DevicePath;

Status = gBS->HandleProtocol (
Handle,
@@ -414,7 +411,6 @@ JudgeHandleIsPCIDevice(
(VOID **) &DPath
);
if(!EFI_ERROR(Status)) {
- DevicePath = DPath;
while(!IsDevicePathEnd(DPath)) {
if((DPath->Type == HARDWARE_DEVICE_PATH) && (DPath->SubType == HW_PCI_DP)) {
PCI_DEVICE_PATH *PCIPath;
--
2.9.2


[PATCH v2 13/19] Vlv2TbltDevicePkg/PlatformSetupDxe: Remove the unused variables

Gary Lin
 

Fix the following errors from gcc:

Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c: In function ‘PrepareSetupInformation’:
Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c:540:31: error: variable ‘EeState’ set but not used [-Werror=unused-but-set-variable]
Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c:532:31: error: variable ‘SrcDataSize’ set but not used [-Werror=unused-but-set-variable]

Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c: In function ‘UpdateAdditionalInformation’:
Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c:818:35: error: variable ‘Size’ set but not used [-Werror=unused-but-set-variable]
Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c:817:36: error: variable ‘SystemManufacturer’ set but not used [-Werror=unused-but-set-variable]

Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c: In function ‘JudgeHandleIsPCIDevice’:
Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c:1094:22: error: variable ‘DevicePath’ set but not used [-Werror=unused-but-set-variable]

Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c: In function ‘GetChipsetSataPortSpeed’:
Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c:1470:31: error: variable ‘DwordReg’ set but not used [-Werror=unused-but-set-variable]
Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c:1469:31: error: variable ‘Status’ set but not used [-Werror=unused-but-set-variable]

Cc: David Wei <david.wei@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
---
.../PlatformSetupDxe/SetupInfoRecords.c | 41 +++++++---------------
1 file changed, 13 insertions(+), 28 deletions(-)

diff --git a/Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c b/Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c
index c7f85b9..8979b41 100644
--- a/Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c
+++ b/Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c
@@ -521,7 +521,6 @@ PrepareSetupInformation (
EFI_DATA_HUB_PROTOCOL *DataHub;
EFI_DATA_RECORD_HEADER *Record;
UINT8 *SrcData;
- UINT32 SrcDataSize;
EFI_SUBCLASS_TYPE1_HEADER *DataHeader;
CHAR16 *NewString;
CHAR16 *NewString2;
@@ -529,7 +528,6 @@ PrepareSetupInformation (
STRING_REF TokenToUpdate;
EFI_PROCESSOR_VERSION_DATA *ProcessorVersion;
UINTN Index;
- UINT16 EeState;
UINTN DataOutput;

EFI_PROCESSOR_MICROCODE_REVISION_DATA *CpuUcodeRevisionData;
@@ -548,11 +546,6 @@ PrepareSetupInformation (
SetMem(ReleaseTime, sizeof(ReleaseTime), 0);

//
- // Initialize EE state for not to show EE related setup options
- //
- EeState = 0;
-
- //
// Get the Data Hub Protocol. Assume only one instance
//
Status = gBS->LocateProtocol (&gEfiDataHubProtocolGuid, NULL, (void **)&DataHub);
@@ -570,7 +563,6 @@ PrepareSetupInformation (
if (Record->DataRecordClass == EFI_DATA_RECORD_CLASS_DATA) {
DataHeader = (EFI_SUBCLASS_TYPE1_HEADER *)(Record + 1);
SrcData = (UINT8 *)(DataHeader + 1);
- SrcDataSize = Record->RecordSize - Record->HeaderSize - sizeof (EFI_SUBCLASS_TYPE1_HEADER);

//
// Processor
@@ -806,8 +798,6 @@ UpdateAdditionalInformation (
EFI_DATA_HUB_PROTOCOL *DataHub;
EFI_DATA_RECORD_HEADER *Record;
EFI_SUBCLASS_TYPE1_HEADER *DataHeader;
- EFI_MISC_SYSTEM_MANUFACTURER *SystemManufacturer;
- UINTN Size;
EFI_SMBIOS_PROTOCOL *Smbios;
EFI_SMBIOS_HANDLE SmbiosHandle;
EFI_SMBIOS_TABLE_HEADER *SmbiosRecord;
@@ -817,6 +807,9 @@ UpdateAdditionalInformation (
CHAR16 *IfwiVersion = NULL;
UINT16 SearchIndex;
EFI_STRING_ID TokenToUpdate;
+#if defined( RVP_SUPPORT ) && RVP_SUPPORT
+ EFI_MISC_SYSTEM_MANUFACTURER *SystemManufacturer;
+#endif

Status = gBS->LocateProtocol (
&gEfiDataHubProtocolGuid,
@@ -826,8 +819,6 @@ UpdateAdditionalInformation (

ASSERT_EFI_ERROR(Status);

- Size = 3;
-
MonotonicCount = 0;
Record = NULL;
do {
@@ -842,12 +833,12 @@ UpdateAdditionalInformation (

if (CompareGuid(&Record->DataRecordGuid, &gEfiMiscSubClassGuid) &&
(DataHeader->RecordType == EFI_MISC_SYSTEM_MANUFACTURER_RECORD_NUMBER)) {
+#if defined( RVP_SUPPORT ) && RVP_SUPPORT
//
// System Information
//
SystemManufacturer = (EFI_MISC_SYSTEM_MANUFACTURER *)(DataHeader + 1);

-#if defined( RVP_SUPPORT ) && RVP_SUPPORT
//
// UUID (System Information)
//
@@ -1083,7 +1074,6 @@ JudgeHandleIsPCIDevice(
{
EFI_STATUS Status;
EFI_DEVICE_PATH *DPath;
- EFI_DEVICE_PATH *DevicePath;

Status = gBS->HandleProtocol (
Handle,
@@ -1092,7 +1082,6 @@ JudgeHandleIsPCIDevice(
);
if(!EFI_ERROR(Status))
{
- DevicePath = DPath;
while(!IsDevicePathEnd(DPath))
{
if((DPath->Type == HARDWARE_DEVICE_PATH) && (DPath->SubType == HW_PCI_DP))
@@ -1458,9 +1447,6 @@ GetChipsetSataPortSpeed (
UINT32 IdeAhciBar;
EFI_PHYSICAL_ADDRESS MemBaseAddress = 0;
UINT8 FunNum;
- EFI_STATUS Status;
- UINT32 DwordReg;
-

DeviceSpeed = 0x01; // generation 1

@@ -1470,15 +1456,15 @@ GetChipsetSataPortSpeed (
//
FunNum = PCI_FUNCTION_NUMBER_PCH_SATA;
MemBaseAddress = 0x0ffffffff;
- Status = gDS->AllocateMemorySpace (
- EfiGcdAllocateMaxAddressSearchBottomUp,
- EfiGcdMemoryTypeMemoryMappedIo,
- N_PCH_SATA_ABAR_ALIGNMENT, // 2^11: 2K Alignment
- V_PCH_SATA_ABAR_LENGTH, // 2K Length
- &MemBaseAddress,
- mImageHandle,
- NULL
- );
+ gDS->AllocateMemorySpace (
+ EfiGcdAllocateMaxAddressSearchBottomUp,
+ EfiGcdMemoryTypeMemoryMappedIo,
+ N_PCH_SATA_ABAR_ALIGNMENT, // 2^11: 2K Alignment
+ V_PCH_SATA_ABAR_LENGTH, // 2K Length
+ &MemBaseAddress,
+ mImageHandle,
+ NULL
+ );
IdeAhciBar = MmioRead32 (
MmPciAddress (
0,
@@ -1508,7 +1494,6 @@ GetChipsetSataPortSpeed (
// Program the "Ports Implemented Register"
//
MmioAndThenOr32 (IdeAhciBar + R_PCH_SATA_AHCI_PI, (UINT32)~(B_PCH_SATA_PORT0_IMPLEMENTED + B_PCH_SATA_PORT1_IMPLEMENTED), (UINT32)(B_PCH_SATA_PORT0_IMPLEMENTED + B_PCH_SATA_PORT1_IMPLEMENTED));
- DwordReg = MmioRead32 (IdeAhciBar + R_PCH_SATA_AHCI_PI);
}

switch (PortNum)
--
2.9.2


[PATCH v2 12/19] Vlv2TbltDevicePkg/FvbRuntimeDxe: Remove unused variables

Gary Lin
 

Fix the following errors from gcc:

Vlv2TbltDevicePkg/FvbRuntimeDxe/FvbService.c: In function ‘FvbWriteBlock’:
Vlv2TbltDevicePkg/FvbRuntimeDxe/FvbService.c:368:44: error: variable ‘FwhInstance’ set but not used [-Werror=unused-but-set-variable]

Vlv2TbltDevicePkg/FvbRuntimeDxe/FvbService.c: In function ‘FvbEraseBlock’:
Vlv2TbltDevicePkg/FvbRuntimeDxe/FvbService.c:448:44: error: variable ‘FwhInstance’ set but not used [-Werror=unused-but-set-variable]

Vlv2TbltDevicePkg/FvbRuntimeDxe/FvbService.c: In function ‘FvbInitialize’:
Vlv2TbltDevicePkg/FvbRuntimeDxe/FvbService.c:1028:41: error: variable ‘FvHeaderValid’ set but not used [-Werror=unused-but-set-variable]

Cc: David Wei <david.wei@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
---
Vlv2TbltDevicePkg/FvbRuntimeDxe/FvbService.c | 11 -----------
1 file changed, 11 deletions(-)

diff --git a/Vlv2TbltDevicePkg/FvbRuntimeDxe/FvbService.c b/Vlv2TbltDevicePkg/FvbRuntimeDxe/FvbService.c
index 5c3d6dc..1cb5e9b 100644
--- a/Vlv2TbltDevicePkg/FvbRuntimeDxe/FvbService.c
+++ b/Vlv2TbltDevicePkg/FvbRuntimeDxe/FvbService.c
@@ -356,12 +356,9 @@ FvbWriteBlock (
EFI_FVB_ATTRIBUTES_2 Attributes;
UINTN LbaAddress;
UINTN LbaLength;
- EFI_FW_VOL_INSTANCE *FwhInstance;
EFI_STATUS Status;
EFI_STATUS Status1;

- FwhInstance = GetFvbInstance (Instance);
-
if ( (NumBytes == NULL) || (Buffer == NULL)) {
return (EFI_INVALID_PARAMETER);
}
@@ -436,16 +433,10 @@ FvbEraseBlock (
{
EFI_FVB_ATTRIBUTES_2 Attributes;
UINTN LbaAddress;
- EFI_FW_VOL_INSTANCE *FwhInstance;
UINTN LbaLength;
EFI_STATUS Status;

//
- // Find the right instance of the FVB private data.
- //
- FwhInstance = GetFvbInstance (Instance);
-
- //
// Check if the FV is write enabled.
//
Attributes = FvbGetVolumeAttributes (Instance);
@@ -1016,7 +1007,6 @@ FvbInitialize (
UINTN TmpHeaderLength;
UINTN Idx;
UINT32 MaxLbaSize;
- BOOLEAN FvHeaderValid;
EFI_BOOT_MODE BootMode;
UINT32 PlatformFvBaseAddress[3];
UINT32 PlatformFvBaseAddressCount;
@@ -1072,7 +1062,6 @@ FvbInitialize (
FwVolHeader = (EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) BaseAddress;

if (!IsFvHeaderValid (BaseAddress, FwVolHeader)) {
- FvHeaderValid = FALSE;
//
// If not valid, get FvbInfo from the information carried in
// FVB driver.
--
2.9.2


[PATCH v2 11/19] Vlv2DeviceRefCodePkg/ValleyView2Soc: Remove the unused code

Gary Lin
 

The code in _S3SUPPORT_ in PchAccess.h wasn't used in anywhere. Also,
The declaration of MCRX and MCR made gcc generate the error of
"multiple definition". Just remove the unused code to avoid any
potential issue.

Cc: David Wei <david.wei@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
---
.../SouthCluster/Include/PchAccess.h | 49 ----------------------
1 file changed, 49 deletions(-)

diff --git a/Vlv2DeviceRefCodePkg/ValleyView2Soc/SouthCluster/Include/PchAccess.h b/Vlv2DeviceRefCodePkg/ValleyView2Soc/SouthCluster/Include/PchAccess.h
index 3f44d2b..d080e1b 100644
--- a/Vlv2DeviceRefCodePkg/ValleyView2Soc/SouthCluster/Include/PchAccess.h
+++ b/Vlv2DeviceRefCodePkg/ValleyView2Soc/SouthCluster/Include/PchAccess.h
@@ -474,53 +474,4 @@ typedef struct _PCH_MSG_BUS_TABLE_STRUCT {
UINT32 WriteOpCode;
} PCH_MSG_BUS_TABLE_STRUCT_TABLE_STRUCT;

-#ifndef _S3SUPPORT_
-#define _S3SUPPORT_
-UINTN MCRX;
-UINTN MCR;
-//
-// In S3 execute, we should follow the MSG BUS access procedure to restore the saving data.
-// To do so, we adopt READ ->> SAVE
-// Indirect IO access: (According BayTrail-M EDS chapter 3.6)
-// 1. Write Index port into MSG BUS_MCRX first.
-// 2. Write content to data register which is called MSG BUS_MDR.
-// 3. Send "message bus control" to complete the procedure.
-//
-#define S3BootScriptSaveMsgBusToMemWrite(PortId, Register, Dbuff, ReadOpCode, WriteOpCode) \
-{ \
- MCRX = (UINTN) Register & MSGBUS_MASKHI; \
- MCR = (UINTN) ((ReadOpCode << 24) | (PortId << 16) | ((Register & MSGBUS_MASKLO) << 8) | MESSAGE_DWORD_EN); \
- MmioWrite32 ((UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MCRX), (UINT32) MCRX); \
- S3BootScriptSaveMemWrite(EfiBootScriptWidthUint32, (UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MCRX),1, (VOID *) (UINTN) &MCRX); \
- MmioWrite32 ((UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MCR ), (UINT32) MCR); \
- (Dbuff) = (UINT32) MmioRead32 ((UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MDR)); \
- S3BootScriptSaveMemWrite(EfiBootScriptWidthUint32, (UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MDR),1, (VOID *) &Dbuff); \
- MCR = (UINTN) ((WriteOpCode << 24) | (PortId << 16) | ((Register & MSGBUS_MASKLO) << 8) | MESSAGE_DWORD_EN); \
- S3BootScriptSaveMemWrite(EfiBootScriptWidthUint32, (UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MCR),1, (VOID *) (UINTN) &MCR); \
-}
-
-//
-// This macro combines two function: 1. PchMsgBusAndThenOr32 () 2. S3 boot script save
-//
-#define PchMsgBusAndThenOr32AddToS3Save(PortId, Register, Dbuff, AndData, OrData, ReadOpCode, WriteOpCode) \
-{ \
- MmioWrite32 ((UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MCRX), (UINT32) (Register & MSGBUS_MASKHI)); \
- MmioWrite32 ((UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MCR ), (UINT32) ((ReadOpCode << 24) | (PortId << 16) | ((Register & MSGBUS_MASKLO) << 8) | MESSAGE_DWORD_EN)); \
- (Dbuff) = (UINT32) MmioRead32 ((UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MDR)); \
- MmioWrite32 ((UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MCRX), (UINT32) (Register & MSGBUS_MASKHI)); \
- MmioWrite32 ((UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MDR ), (UINT32) ((Dbuff & AndData) | OrData)); \
- MmioWrite32 ((UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MCR ), (UINT32) ((WriteOpCode << 24) | (PortId << 16) | ((Register & MSGBUS_MASKLO) << 8) | MESSAGE_DWORD_EN)); \
- MCRX = (UINTN) Register & MSGBUS_MASKHI; \
- MCR = (UINTN) ((ReadOpCode << 24) | (PortId << 16) | ((Register & MSGBUS_MASKLO) << 8) | MESSAGE_DWORD_EN); \
- MmioWrite32 ((UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MCRX), (UINT32) MCRX); \
- S3BootScriptSaveMemWrite(EfiBootScriptWidthUint32, (UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MCRX),1,(VOID *) (UINTN) &MCRX); \
- MmioWrite32 ((UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MCR ), (UINT32) MCR); \
- (Dbuff) = (UINT32) MmioRead32 ((UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MDR)); \
- S3BootScriptSaveMemWrite(EfiBootScriptWidthUint32, (UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MDR),1,(VOID *) &Dbuff); \
- MCR = (UINTN) ((WriteOpCode << 24) | (PortId << 16) | ((Register & MSGBUS_MASKLO) << 8) | MESSAGE_DWORD_EN); \
- S3BootScriptSaveMemWrite(EfiBootScriptWidthUint32, (UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MCR),1,(VOID *) (UINTN) &MCR); \
-}
-
-#endif
-
#endif
--
2.9.2


[PATCH v2 10/19] Vlv2TbltDevicePkg/PlatformGopPolicy: include UefiBootServicesTableLib.h

Gary Lin
 

gBS is already defined in
MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.c

Remove the declaration of gBS and include the proper header file to
access the variable.

Suggested-by: David Wei <david.wei@intel.com>
Cc: David Wei <david.wei@intel.com>
Cc: "Wu, Hao A" <hao.a.wu@intel.com>
Cc: "Lu, ShifeiX A" <shifeix.a.lu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
---
Vlv2TbltDevicePkg/PlatformGopPolicy/PlatformGopPolicy.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/Vlv2TbltDevicePkg/PlatformGopPolicy/PlatformGopPolicy.c b/Vlv2TbltDevicePkg/PlatformGopPolicy/PlatformGopPolicy.c
index 62cd188..86084b1 100644
--- a/Vlv2TbltDevicePkg/PlatformGopPolicy/PlatformGopPolicy.c
+++ b/Vlv2TbltDevicePkg/PlatformGopPolicy/PlatformGopPolicy.c
@@ -23,13 +23,11 @@ Copyright (c) 1999 - 2014, Intel Corporation. All rights reserved

#include <Guid/SetupVariable.h>
#include <SetupMode.h>
+#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include "PchAccess.h"
#include <Library/PchPlatformLib.h>

-EFI_BOOT_SERVICES *gBS;
-
-
PLATFORM_GOP_POLICY_PROTOCOL mPlatformGOPPolicy;

//
--
2.9.2


[PATCH v2 09/19] Vlv2TbltDevicePkg/AcpiPlatform: Amend the declaration of mGlobalNvsArea

Gary Lin
 

mGlobalNvsArea wasn't declared as extern in AcpiPlatform.h and the header
was included in AcpiPlatform.c and AcpiPlatformHooks.c. Although it's
declared as extern in AcpiPlatformHooks.c, gcc still created an instance
of mGlobalNvsArea in AcpiPlatformHooks.c since the header was expanded
first and then the linker complained "multiple definition". This commit
rearrange the delaration of mGlobalNvsArea 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>
---
Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c | 1 +
Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.h | 2 +-
Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatformHooks.c | 1 -
3 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
index bb9cee5..70ad07e 100644
--- a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
+++ b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
@@ -66,6 +66,7 @@ CHAR16 gACPIOSFRRefDataBlockVariableName[] = ACPI_OSFR_REF_DATA_BLOCK_VARIABL
CHAR16 gACPIOSFRMfgStringVariableName[] = ACPI_OSFR_MFG_STRING_VARIABLE_NAME;

EFI_CPU_IO_PROTOCOL *mCpuIo;
+EFI_GLOBAL_NVS_AREA_PROTOCOL mGlobalNvsArea;
#ifndef __GNUC__
#pragma optimize("", off)
#endif
diff --git a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.h b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.h
index fbc9272..8587beb 100644
--- a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.h
+++ b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.h
@@ -59,7 +59,7 @@ Abstract:
//
// Global variables.
//
-EFI_GLOBAL_NVS_AREA_PROTOCOL mGlobalNvsArea;
+extern EFI_GLOBAL_NVS_AREA_PROTOCOL mGlobalNvsArea;

//
// ACPI table information used to initialize tables.
diff --git a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatformHooks.c b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatformHooks.c
index c89c07f..2dc9657 100644
--- a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatformHooks.c
+++ b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatformHooks.c
@@ -33,7 +33,6 @@ Abstract:
//
#include "AcpiPlatformHooksLib.h"

-extern EFI_GLOBAL_NVS_AREA_PROTOCOL mGlobalNvsArea;
extern SYSTEM_CONFIGURATION mSystemConfiguration;

ENHANCED_SPEEDSTEP_PROTOCOL *mEistProtocol = NULL;
--
2.9.2


[PATCH v2 08/19] Vlv2TbltDevicePkg/AcpiPlatform: Remove unused variables

Gary Lin
 

Fix the following errors from gcc:

Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c: In function 'PlatformUpdateTables':
Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c:236:63: warning: variable 'LocalApicCounter' set but not used [-Wunused-but-set-variable]
Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c:214:64: warning: variable 'ProcessorLocalApicEntry' set but not used [-Wunused-but-set-variable]
Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c:213:63: warning: variable 'BufferSize' set but not used [-Wunused-but-set-variable]

Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c: In function 'AcpiPlatformEntryPoint':
Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c:797:33: warning: variable 'Data32' set but not used [-Wunused-but-set-variable]

Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatformHooks.c: In function ‘PatchGv3SsdtTable’:
Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatformHooks.c:243:31: error: variable ‘Status’ set but not used [-Werror=unused-but-set-variable]

Cc: David Wei <david.wei@intel.com>
Cc: "Wu, Hao A" <hao.a.wu@intel.com>
Cc: "Lu, ShifeiX A" <shifeix.a.lu@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>
---
Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c | 8 --------
Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatformHooks.c | 3 +--
2 files changed, 1 insertion(+), 10 deletions(-)

diff --git a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
index 691a9d1..bb9cee5 100644
--- a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
+++ b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
@@ -210,8 +210,6 @@ PlatformUpdateTables (
EFI_MP_SERVICES_PROTOCOL *MpService;
UINTN MaximumNumberOfCPUs;
UINTN NumberOfEnabledCPUs;
- UINTN BufferSize;
- ACPI_APIC_STRUCTURE_PTR *ProcessorLocalApicEntry;
UINTN BspIndex;
EFI_ACPI_1_0_ASF_DESCRIPTION_TABLE *AsfEntry;
EFI_ACPI_HIGH_PRECISION_EVENT_TIMER_TABLE_HEADER *HpetTbl;
@@ -233,7 +231,6 @@ PlatformUpdateTables (
UINT16 NumberOfHpets;
UINT16 HpetCapIdValue;
UINT32 HpetBlockID;
- UINTN LocalApicCounter;
EFI_PROCESSOR_INFORMATION ProcessorInfoBuffer;
UINT8 TempVal;
EFI_ACPI_3_0_IO_APIC_STRUCTURE *IOApicType;
@@ -242,9 +239,7 @@ PlatformUpdateTables (
CurrPtr = NULL;
EndPtr = NULL;
ApicPtr = NULL;
- LocalApicCounter = 0;
CurrProcessor = 0;
- ProcessorLocalApicEntry = NULL;


if (Table->Signature != EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE) {
@@ -372,7 +367,6 @@ PlatformUpdateTables (
ApicPtr->AcpiLocalApic.AcpiProcessorId = (UINT8)MaximumNumberOfCPUs;
}

- BufferSize = 0;
ApicPtr->AcpiLocalApic.Flags = 0;

for (CurrProcessor = 0; CurrProcessor < MaximumNumberOfCPUs; CurrProcessor++) {
@@ -797,7 +791,6 @@ AcpiPlatformEntryPoint (
EFI_MP_SERVICES_PROTOCOL *MpService;
UINTN MaximumNumberOfCPUs;
UINTN NumberOfEnabledCPUs;
- UINT32 Data32;
PCH_STEPPING pchStepping;
UINT32 DxeGpioValue;

@@ -807,7 +800,6 @@ AcpiPlatformEntryPoint (
Instance = 0;
CurrentTable = NULL;
TableHandle = 0;
- Data32 = 0;

//
// Update HOB variable for PCI resource information.
diff --git a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatformHooks.c b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatformHooks.c
index 3489650..c89c07f 100644
--- a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatformHooks.c
+++ b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatformHooks.c
@@ -232,7 +232,6 @@ PatchGv3SsdtTable (
IN OUT EFI_ACPI_DESCRIPTION_HEADER *TableHeader
)
{
- EFI_STATUS Status;
UINT8 *CurrPtr;
UINT8 *SsdtPointer;
UINT32 Signature;
@@ -328,7 +327,7 @@ PatchGv3SsdtTable (
continue;
}

- Status = EistProt->GetEistTable (EistProt, &EistInfo, (VOID **) &PssState);
+ EistProt->GetEistTable (EistProt, &EistInfo, (VOID **) &PssState);

AdjustSize = PssTable->NumEntries * sizeof (EFI_PSS_PACKAGE);
AdjustSize -= EistInfo->NumStates * sizeof (EFI_PSS_PACKAGE);
--
2.9.2

84041 - 84060 of 84076