Date   

Re: Ingebrigtsen: The End of Gmane?

Michael D Kinney
 

Bruce,

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

Mike

-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@...] On Behalf Of Bruce Cran
Sent: Thursday, July 28, 2016 5:18 PM
To: Laszlo Ersek <lersek@...>; edk2-devel-01 <edk2-devel@...>
Subject: Re: [edk2] Ingebrigtsen: The End of Gmane?

On 7/28/16 1:13 PM, Laszlo Ersek wrote:

The direct (and less important) issue is that we might have to find a
new archival service. And that our gmane links captured in various
places would break.
Since this ML is on Mailman, maybe Intel (i.e. owners of 01.org) can
enable the built-in archives feature?

--
Bruce
_______________________________________________
edk2-devel mailing list
edk2-devel@...
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [Patch 2/3] MdePkg PeiDxePostCodeLibReportStatusCode: Correct files with CRLF line ending

Fan, Jeff <jeff.fan@...>
 

Reviewed-by: Jeff Fan <jeff.fan@...>

-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@...] On Behalf Of Liming Gao
Sent: Thursday, July 28, 2016 4:46 PM
To: edk2-devel@...
Subject: [edk2] [Patch 2/3] MdePkg PeiDxePostCodeLibReportStatusCode: Correct files with CRLF line ending

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@...>
---
.../PeiDxePostCodeLibReportStatusCode.inf | 4 ++--
.../PeiDxePostCodeLibReportStatusCode.uni | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/MdePkg/Library/PeiDxePostCodeLibReportStatusCode/PeiDxePostCodeLibReportStatusCode.inf b/MdePkg/Library/PeiDxePostCodeLibReportStatusCode/PeiDxePostCodeLibReportStatusCode.inf
index 6189cf2..dc162c2 100644
--- a/MdePkg/Library/PeiDxePostCodeLibReportStatusCode/PeiDxePostCodeLibReportStatusCode.inf
+++ b/MdePkg/Library/PeiDxePostCodeLibReportStatusCode/PeiDxePostCodeLib
+++ ReportStatusCode.inf
@@ -1,7 +1,7 @@
## @file
-# Instance of Post Code Library based on Report Status Code Library.
+# Instance of Post Code Library based on Report Status Code Library.
#
-# Post Code Library that layers on top of a Report Status Code Library instance.
+# Post Code Library that layers on top of a Report Status Code Library instance.
#
# Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> # diff --git a/MdePkg/Library/PeiDxePostCodeLibReportStatusCode/PeiDxePostCodeLibReportStatusCode.uni b/MdePkg/Library/PeiDxePostCodeLibReportStatusCode/PeiDxePostCodeLibReportStatusCode.uni
index bc7387c..165f27f 100644
--- a/MdePkg/Library/PeiDxePostCodeLibReportStatusCode/PeiDxePostCodeLibReportStatusCode.uni
+++ b/MdePkg/Library/PeiDxePostCodeLibReportStatusCode/PeiDxePostCodeLib
+++ ReportStatusCode.uni
@@ -1,7 +1,7 @@
// /** @file
-// Instance of Post Code Library based on Report Status Code Library.
+// Instance of Post Code Library based on Report Status Code Library.
//
-// Post Code Library that layers on top of a Report Status Code Library instance.
+// Post Code Library that layers on top of a Report Status Code Library instance.
//
// Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> //
--
2.8.0.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@...
https://lists.01.org/mailman/listinfo/edk2-devel


Re: inconsistency between the UNI spec and the Build tool

Liming Gao
 

Felix:
Thanks for your report. We will fix it in BaseTools to align to UNI spec.

Thanks
Liming

-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@...] On Behalf Of
Felix Poludov
Sent: Wednesday, July 27, 2016 9:50 PM
To: Kinney, Michael D <michael.d.kinney@...>; edk2-
devel@...
Subject: Re: [edk2] inconsistency between the UNI spec and the Build tool

No, STR_Xyz or str_x triggers the same error.

-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@...] On Behalf Of
Kinney, Michael D
Sent: Tuesday, July 26, 2016 7:04 PM
To: Felix Poludov; edk2-devel@...; Kinney, Michael D
Subject: Re: [edk2] inconsistency between the UNI spec and the Build tool

Felix,

Does STR_Xyz work? I am wondering if the build tools are trying to enforce
Camel case between the '_'.

Mike

-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@...] On Behalf Of
Felix Poludov
Sent: Tuesday, July 26, 2016 3:00 PM
To: edk2-devel@...
Subject: [edk2] inconsistency between the UNI spec and the Build tool

According to UNI specification string token identifier can use upper case
and lower
case letters:
From section 2.1:
<Token> ::= <CtrlChar> "string" <MS> <Identifier>
<Identifier> ::= <Letter> [{<Letter>} {<Digit>} {<UN>}]*
<Letter> ::= {(\u0041-\u005A)} ; Characters A - Z
{(\u0061-\u007A)} ; Characters a - z

However, when I'm trying to use lower case characters in string token
identifier,
I'm getting a build error.

Here is a test UNI statement I use:
#string STR_x #language eng "Test"

Here is the build error I'm getting:
build...
: error 3000: The string token name STR_x defined in UNI file x.uni contains
the
invalid lower case character.

Is it an implementation bug or the specification inaccuracy?

Thanks
Felix

Please consider the environment before printing this email.

The information contained in this message may be confidential and
proprietary to
American Megatrends, Inc. This communication is intended to be read only
by the
individual or entity to whom it is addressed or by their designee. If the
reader of
this message is not the intended recipient, you are on notice that any
distribution of
this message, in any form, is strictly prohibited. Please promptly notify the
sender
by reply e-mail or by telephone at 770-246-8600, and then delete or
destroy all copies
of the transmission.
_______________________________________________
edk2-devel mailing list
edk2-devel@...
https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
edk2-devel@...
https://lists.01.org/mailman/listinfo/edk2-devel

Please consider the environment before printing this email.

The information contained in this message may be confidential and
proprietary to American Megatrends, Inc. This communication is intended to
be read only by the individual or entity to whom it is addressed or by their
designee. If the reader of this message is not the intended recipient, you are
on notice that any distribution of this message, in any form, is strictly
prohibited. Please promptly notify the sender by reply e-mail or by
telephone at 770-246-8600, and then delete or destroy all copies of the
transmission.
_______________________________________________
edk2-devel mailing list
edk2-devel@...
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [Patch V2] BaseTools: Add build info for binary modules that only list in FDF file

Liming Gao
 

Reviewed-by: Liming Gao <liming.gao@...>

-----Original Message-----
From: Zhu, Yonghong
Sent: Thursday, July 28, 2016 9:33 AM
To: edk2-devel@...
Cc: Gao, Liming <liming.gao@...>
Subject: [Patch V2] BaseTools: Add build info for binary modules that only list
in FDF file

If the binary module is list in the FDF file but not list in the DSC
file, current build report would not include these binary module's info
in the report "Module section". The patch fix this issue.

Cc: Liming Gao <liming.gao@...>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@...>
---
BaseTools/Source/Python/AutoGen/AutoGen.py | 4 ++++
BaseTools/Source/Python/build/BuildReport.py | 18 +++++++++++++++++-
2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py
b/BaseTools/Source/Python/AutoGen/AutoGen.py
index 9a95014..9c548be 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -1940,10 +1940,14 @@ class PlatformAutoGen(AutoGen):
# @param Module The module from which the library classes will be
resolved
#
# @retval library_list List of library instances sorted
#
def ApplyLibraryInstance(self, Module):
+ # Cover the case that the binary INF file is list in the FDF file but not DSC
file, return empty list directly
+ if str(Module) not in self.Platform.Modules:
+ return []
+
ModuleType = Module.ModuleType

# for overridding library instances with module specific setting
PlatformModule = self.Platform.Modules[str(Module)]

diff --git a/BaseTools/Source/Python/build/BuildReport.py
b/BaseTools/Source/Python/build/BuildReport.py
index ef99989..4c57754 100644
--- a/BaseTools/Source/Python/build/BuildReport.py
+++ b/BaseTools/Source/Python/build/BuildReport.py
@@ -45,10 +45,13 @@ from Common.DataType import TAB_BRG_PCD
from Common.DataType import TAB_BRG_LIBRARY
from Common.DataType import TAB_BACK_SLASH
from Common.LongFilePathSupport import OpenLongFilePath as open
from Common.MultipleWorkspace import MultipleWorkspace as mws
import Common.GlobalData as GlobalData
+from AutoGen.AutoGen import ModuleAutoGen
+from Common.Misc import PathClass
+from Common.String import NormPath

## Pattern to extract contents in EDK DXS files
gDxsDependencyPattern =
re.compile(r"DEPENDENCY_START(.+)DEPENDENCY_END", re.DOTALL)

## Pattern to find total FV total size, occupied size in flash report
intermediate file
@@ -1645,12 +1648,25 @@ class PlatformReport(object):
for Ma in MaList:
self.ModuleReportList.append(ModuleReport(Ma, ReportType))
else:
self._IsModuleBuild = False
for Pa in Wa.AutoGenObjectList:
+ ModuleAutoGenList = []
for ModuleKey in Pa.Platform.Modules:
-
self.ModuleReportList.append(ModuleReport(Pa.Platform.Modules[Module
Key].M, ReportType))
+
ModuleAutoGenList.append(Pa.Platform.Modules[ModuleKey].M)
+ if GlobalData.gFdfParser != None:
+ if Pa.Arch in GlobalData.gFdfParser.Profile.InfDict:
+ INFList = GlobalData.gFdfParser.Profile.InfDict[Pa.Arch]
+ for InfName in INFList:
+ InfClass = PathClass(NormPath(InfName), Wa.WorkspaceDir,
Pa.Arch)
+ Ma = ModuleAutoGen(Wa, InfClass, Pa.BuildTarget,
Pa.ToolChain, Pa.Arch, Wa.MetaFile)
+ if Ma == None:
+ continue
+ if Ma not in ModuleAutoGenList:
+ ModuleAutoGenList.append(Ma)
+ for MGen in ModuleAutoGenList:
+ self.ModuleReportList.append(ModuleReport(MGen,
ReportType))



##
# Generate report for the whole platform.
--
2.6.1.windows.1


[Patch] Vlv2TbltDevicePkg:Signal EndOfDxe Event.

lushifex <shifeix.a.lu@...>
 

According to PI spec,EndOfDxe Event should be signaled
before DxeSmmReadyToLock protocol installation.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: lushifex <shifeix.a.lu@...>
---
.../Library/PlatformBdsLib/BdsPlatform.c | 37 +++++++++++++++++++++-
.../Library/PlatformBdsLib/PlatformBdsLib.inf | 3 +-
2 files changed, 38 insertions(+), 2 deletions(-)

diff --git a/Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.c b/Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.c
index 195d734..5df3396 100644
--- a/Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.c
+++ b/Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.c
@@ -1,8 +1,8 @@
/** @file

- Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2004 - 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 that accompanies this distribution.

The full text of the license may be found at

http://opensource.org/licenses/bsd-license.php.

@@ -203,10 +203,29 @@ ShellImageCallback (
{
BdsSetConsoleMode (TRUE);
DEBUG ((EFI_D_INFO, "BdsEntry ShellImageCallback \n"));
}

+/**
+ An empty function to pass error checking of CreateEventEx ().
+
+ @param Event Event whose notification function is being invoked.
+ @param Context Pointer to the notification function's context,
+ which is implementation-dependent.
+
+**/
+STATIC
+VOID
+EFIAPI
+EmptyCallbackFunction (
+ IN EFI_EVENT Event,
+ IN VOID *Context
+ )
+{
+ return;
+}
+
//
// BDS Platform Functions
//
/**
Platform Bds init. Incude the platform firmware vendor, revision
@@ -223,12 +242,28 @@ PlatformBdsInit (
VOID
)
{
EFI_STATUS Status;
EFI_EVENT ShellImageEvent;
+ EFI_EVENT EndOfDxeEvent;
EFI_GUID ShellEnvProtocol = SHELL_ENVIRONMENT_INTERFACE_PROTOCOL;

+ //
+ // Signal EndOfDxe PI Event
+ //
+ Status = gBS->CreateEventEx (
+ EVT_NOTIFY_SIGNAL,
+ TPL_CALLBACK,
+ EmptyCallbackFunction,
+ NULL,
+ &gEfiEndOfDxeEventGroupGuid,
+ &EndOfDxeEvent
+ );
+ if (!EFI_ERROR (Status)) {
+ gBS->SignalEvent (EndOfDxeEvent);
+ }
+
#ifdef __GNUC__
SerialPortWrite((UINT8 *)">>>>BdsEntry[GCC]\r\n", 19);
#else
SerialPortWrite((UINT8 *)">>>>BdsEntry\r\n", 14);
#endif
diff --git a/Vlv2TbltDevicePkg/Library/PlatformBdsLib/PlatformBdsLib.inf b/Vlv2TbltDevicePkg/Library/PlatformBdsLib/PlatformBdsLib.inf
index 45578e8..c64bab9 100644
--- a/Vlv2TbltDevicePkg/Library/PlatformBdsLib/PlatformBdsLib.inf
+++ b/Vlv2TbltDevicePkg/Library/PlatformBdsLib/PlatformBdsLib.inf
@@ -1,9 +1,9 @@
#/** @file
# Component name for module PlatformBootManagerLib
#
-# Copyright (c) 2008 - 2015, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2008 - 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 that accompanies this distribution.

# The full text of the license may be found at

# http://opensource.org/licenses/bsd-license.php.

@@ -95,10 +95,11 @@
gEfiMemoryTypeInformationGuid
gEfiCapsuleVendorGuid
gEfiGlobalVariableGuid
gEfiNormalSetupGuid
gEfiPartTypeSystemPartGuid
+ gEfiEndOfDxeEventGroupGuid

[Pcd]
gPlatformModuleTokenSpaceGuid.PcdFlashFvRecovery2Base
gPlatformModuleTokenSpaceGuid.PcdFlashFvMainBase
gPlatformModuleTokenSpaceGuid.PcdFlashFvRecoveryBase
--
2.6.2.windows.1


[patch 2/2] BaseTool/Upt: Add support for Private

hesschen <hesheng.chen@...>
 

Support new syntax in package DEC file as below:
[Includes.Common.Private]
[Ppis.Common.Private]
[Guids.Common.Private]
[Protocols.Common.Private]

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: hesschen <hesheng.chen@...>
---
.../Source/Python/UPT/GenMetaFile/GenDecFile.py | 9 +++++++-
BaseTools/Source/Python/UPT/Library/DataType.py | 4 +++-
.../Source/Python/UPT/Library/UniClassObject.py | 16 +++++++-------
BaseTools/Source/Python/UPT/Parser/DecParser.py | 25 ++++++++++++++++++++--
.../Python/UPT/PomAdapter/DecPomAlignment.py | 11 +++++++++-
5 files changed, 52 insertions(+), 13 deletions(-)

diff --git a/BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py b/BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py
index f22363b..31abd23 100644
--- a/BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py
+++ b/BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py
@@ -2,7 +2,7 @@
#
# This file contained the logical of transfer package object to DEC 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
@@ -63,6 +63,7 @@ from Library.DataType import TAB_PCD_ERROR
from Library.DataType import TAB_SECTION_START
from Library.DataType import TAB_SECTION_END
from Library.DataType import TAB_SPLIT
+import Library.DataType as DT
from Library.UniClassObject import FormatUniEntry

def GenPcd(Package, Content):
@@ -487,6 +488,12 @@ def PackageToDec(Package, DistHeader = None):
if UserExtension.GetUserID() == TAB_BINARY_HEADER_USERID and \
UserExtension.GetIdentifier() == TAB_BINARY_HEADER_IDENTIFIER:
continue
+
+ # Generate Private Section first
+ if UserExtension.GetUserID() == DT.TAB_INTEL and UserExtension.GetIdentifier() == DT.TAB_PRIVATE:
+ Content += '\n' + UserExtension.GetStatement()
+ continue
+
Statement = UserExtension.GetStatement()
if not Statement:
continue
diff --git a/BaseTools/Source/Python/UPT/Library/DataType.py b/BaseTools/Source/Python/UPT/Library/DataType.py
index 8449dc8..c151be3 100644
--- a/BaseTools/Source/Python/UPT/Library/DataType.py
+++ b/BaseTools/Source/Python/UPT/Library/DataType.py
@@ -1,7 +1,7 @@
## @file
# This file is used to define class for data type structure
#
-# 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
@@ -680,6 +680,8 @@ TAB_DEFINE = 'DEFINE'
TAB_NMAKE = 'Nmake'
TAB_USER_EXTENSIONS = 'UserExtensions'
TAB_INCLUDE = '!include'
+TAB_PRIVATE = 'Private'
+TAB_INTEL = 'Intel'

#
# Common Define
diff --git a/BaseTools/Source/Python/UPT/Library/UniClassObject.py b/BaseTools/Source/Python/UPT/Library/UniClassObject.py
index 1e73d3e..27804cc 100644
--- a/BaseTools/Source/Python/UPT/Library/UniClassObject.py
+++ b/BaseTools/Source/Python/UPT/Library/UniClassObject.py
@@ -328,11 +328,11 @@ class UniFileClassObject(object):
Lang = distutils.util.split_quoted((Line.split(u"//")[0]))
if len(Lang) != 3:
try:
- FileIn = codecs.open(File.Path, mode='rb', encoding='utf_8').read()
+ FileIn = codecs.open(File.Path, mode='rb', encoding='utf_8').readlines()
except UnicodeError, Xstr:
- FileIn = codecs.open(File.Path, mode='rb', encoding='utf_16').read()
+ FileIn = codecs.open(File.Path, mode='rb', encoding='utf_16').readlines()
except UnicodeError, Xstr:
- FileIn = codecs.open(File.Path, mode='rb', encoding='utf_16_le').read()
+ FileIn = codecs.open(File.Path, mode='rb', encoding='utf_16_le').readlines()
except:
EdkLogger.Error("Unicode File Parser",
ToolError.FILE_OPEN_FAILURE,
@@ -437,7 +437,7 @@ class UniFileClassObject(object):
# ExtraData='The file %s is either invalid UTF-16LE or it is missing the BOM.' % File.Path)

try:
- FileIn = codecs.open(File.Path, mode='rb', encoding='utf_8').read()
+ FileIn = codecs.open(File.Path, mode='rb', encoding='utf_8').readlines()
except UnicodeError, Xstr:
FileIn = codecs.open(File.Path, mode='rb', encoding='utf_16').readlines()
except UnicodeError:
@@ -579,9 +579,9 @@ class UniFileClassObject(object):
#
if Line.startswith(u'"'):
if StringEntryExistsFlag == 2:
- EdkLogger.Error("Unicode File Parser", ToolError.FORMAT_INVALID,
+ EdkLogger.Error("Unicode File Parser", ToolError.FORMAT_INVALID,
Message=ST.ERR_UNIPARSE_LINEFEED_UP_EXIST % Line, ExtraData=File.Path)
-
+
StringEntryExistsFlag = 1
if not Line.endswith('"'):
EdkLogger.Error("Unicode File Parser", ToolError.FORMAT_INVALID,
@@ -589,7 +589,7 @@ class UniFileClassObject(object):
% (LineCount, File.Path))
elif Line.startswith(u'#language'):
if StringEntryExistsFlag == 2:
- EdkLogger.Error("Unicode File Parser", ToolError.FORMAT_INVALID,
+ EdkLogger.Error("Unicode File Parser", ToolError.FORMAT_INVALID,
Message=ST.ERR_UNI_MISS_STRING_ENTRY % Line, ExtraData=File.Path)
StringEntryExistsFlag = 0
else:
@@ -1050,7 +1050,7 @@ class UniFileClassObject(object):
ToolError.FILE_NOT_FOUND,
ExtraData=FilaPath)
try:
- FileIn = codecs.open(FilaPath, mode='rb', encoding='utf_8').read()
+ FileIn = codecs.open(FilaPath, mode='rb', encoding='utf_8').readlines()
except UnicodeError, Xstr:
FileIn = codecs.open(FilaPath, mode='rb', encoding='utf_16').readlines()
except UnicodeError:
diff --git a/BaseTools/Source/Python/UPT/Parser/DecParser.py b/BaseTools/Source/Python/UPT/Parser/DecParser.py
index 23d1ed4..e6658a9 100644
--- a/BaseTools/Source/Python/UPT/Parser/DecParser.py
+++ b/BaseTools/Source/Python/UPT/Parser/DecParser.py
@@ -1,7 +1,7 @@
## @file
# This file is used to parse DEC file. It will consumed by DecParser
#
-# 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
@@ -742,7 +742,26 @@ class Dec(_DecBase, _DecComments):
except BaseException:
Logger.Error(TOOL_NAME, FILE_OPEN_FAILURE, File=DecFile,
ExtraData=ST.ERR_DECPARSE_FILEOPEN % DecFile)
- RawData = FileContent(DecFile, Content)
+
+ #
+ # Pre-parser for Private section
+ #
+ self._Private = ''
+ __IsFoundPrivate = False
+ NewContent = []
+ for Line in Content:
+ Line = Line.strip()
+ if Line.startswith(DT.TAB_SECTION_START) and Line.endswith(DT.TAB_PRIVATE + DT.TAB_SECTION_END):
+ __IsFoundPrivate = True
+ if Line.startswith(DT.TAB_SECTION_START) and Line.endswith(DT.TAB_SECTION_END)\
+ and not Line.endswith(DT.TAB_PRIVATE + DT.TAB_SECTION_END):
+ __IsFoundPrivate = False
+ if __IsFoundPrivate:
+ self._Private += Line + '\r'
+ if not __IsFoundPrivate:
+ NewContent.append(Line + '\r')
+
+ RawData = FileContent(DecFile, NewContent)

_DecComments.__init__(self)
_DecBase.__init__(self, RawData)
@@ -1060,3 +1079,5 @@ class Dec(_DecBase, _DecComments):
return self._Define.GetDataObject().GetPackageVersion()
def GetPackageUniFile(self):
return self._Define.GetDataObject().GetPackageUniFile()
+ def GetPrivateSections(self):
+ return self._Private
diff --git a/BaseTools/Source/Python/UPT/PomAdapter/DecPomAlignment.py b/BaseTools/Source/Python/UPT/PomAdapter/DecPomAlignment.py
index 11b0359..88edf35 100644
--- a/BaseTools/Source/Python/UPT/PomAdapter/DecPomAlignment.py
+++ b/BaseTools/Source/Python/UPT/PomAdapter/DecPomAlignment.py
@@ -1,7 +1,7 @@
## @file DecPomAlignment.py
# This file contained the adapter for convert INF parser object to POM Object
#
-# 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
@@ -63,6 +63,7 @@ from Library.DataType import TAB_STR_TOKENHELP
from Library.DataType import TAB_STR_TOKENERR
from Library.DataType import TAB_HEX_START
from Library.DataType import TAB_SPLIT
+import Library.DataType as DT
from Library.CommentParsing import ParseHeaderCommentSection
from Library.CommentParsing import ParseGenericComment
from Library.CommentParsing import ParseDecPcdGenericComment
@@ -221,6 +222,14 @@ class DecPomAlignment(PackageObject):
self.SetUserExtensionList(
self.GetUserExtensionList() + [UserExtension]
)
+
+ # Add Private sections to UserExtension
+ if self.DecParser.GetPrivateSections():
+ PrivateUserExtension = UserExtensionObject()
+ PrivateUserExtension.SetStatement(self.DecParser.GetPrivateSections())
+ PrivateUserExtension.SetIdentifier(DT.TAB_PRIVATE)
+ PrivateUserExtension.SetUserID(DT.TAB_INTEL)
+ self.SetUserExtensionList(self.GetUserExtensionList() + [PrivateUserExtension])

## Generate miscellaneous files on DEC file
#
--
2.7.2.windows.1


Re: [Patch] Vlv2TbltDevicePkg:Signal EndOfDxe Event.

Wei, David <david.wei@...>
 

Reviewed-by: David Wei <david.wei@...>



Thanks,
David Wei

Intel SSG BIOS Team

-----Original Message-----
From: Lu, ShifeiX A
Sent: Friday, July 29, 2016 10:27 AM
To: edk2-devel@...
Cc: Wei; Wei, David <david.wei@...>
Subject: [Patch] Vlv2TbltDevicePkg:Signal EndOfDxe Event.

According to PI spec,EndOfDxe Event should be signaled
before DxeSmmReadyToLock protocol installation.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: lushifex <shifeix.a.lu@...>
---
.../Library/PlatformBdsLib/BdsPlatform.c | 37 +++++++++++++++++++++-
.../Library/PlatformBdsLib/PlatformBdsLib.inf | 3 +-
2 files changed, 38 insertions(+), 2 deletions(-)

diff --git a/Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.c b/Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.c
index 195d734..5df3396 100644
--- a/Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.c
+++ b/Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.c
@@ -1,8 +1,8 @@
/** @file

- Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2004 - 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 that accompanies this distribution.

The full text of the license may be found at

http://opensource.org/licenses/bsd-license.php.

@@ -203,10 +203,29 @@ ShellImageCallback (
{
BdsSetConsoleMode (TRUE);
DEBUG ((EFI_D_INFO, "BdsEntry ShellImageCallback \n"));
}

+/**
+ An empty function to pass error checking of CreateEventEx ().
+
+ @param Event Event whose notification function is being invoked.
+ @param Context Pointer to the notification function's context,
+ which is implementation-dependent.
+
+**/
+STATIC
+VOID
+EFIAPI
+EmptyCallbackFunction (
+ IN EFI_EVENT Event,
+ IN VOID *Context
+ )
+{
+ return;
+}
+
//
// BDS Platform Functions
//
/**
Platform Bds init. Incude the platform firmware vendor, revision
@@ -223,12 +242,28 @@ PlatformBdsInit (
VOID
)
{
EFI_STATUS Status;
EFI_EVENT ShellImageEvent;
+ EFI_EVENT EndOfDxeEvent;
EFI_GUID ShellEnvProtocol = SHELL_ENVIRONMENT_INTERFACE_PROTOCOL;

+ //
+ // Signal EndOfDxe PI Event
+ //
+ Status = gBS->CreateEventEx (
+ EVT_NOTIFY_SIGNAL,
+ TPL_CALLBACK,
+ EmptyCallbackFunction,
+ NULL,
+ &gEfiEndOfDxeEventGroupGuid,
+ &EndOfDxeEvent
+ );
+ if (!EFI_ERROR (Status)) {
+ gBS->SignalEvent (EndOfDxeEvent);
+ }
+
#ifdef __GNUC__
SerialPortWrite((UINT8 *)">>>>BdsEntry[GCC]\r\n", 19);
#else
SerialPortWrite((UINT8 *)">>>>BdsEntry\r\n", 14);
#endif
diff --git a/Vlv2TbltDevicePkg/Library/PlatformBdsLib/PlatformBdsLib.inf b/Vlv2TbltDevicePkg/Library/PlatformBdsLib/PlatformBdsLib.inf
index 45578e8..c64bab9 100644
--- a/Vlv2TbltDevicePkg/Library/PlatformBdsLib/PlatformBdsLib.inf
+++ b/Vlv2TbltDevicePkg/Library/PlatformBdsLib/PlatformBdsLib.inf
@@ -1,9 +1,9 @@
#/** @file
# Component name for module PlatformBootManagerLib
#
-# Copyright (c) 2008 - 2015, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2008 - 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 that accompanies this distribution.

# The full text of the license may be found at

# http://opensource.org/licenses/bsd-license.php.

@@ -95,10 +95,11 @@
gEfiMemoryTypeInformationGuid
gEfiCapsuleVendorGuid
gEfiGlobalVariableGuid
gEfiNormalSetupGuid
gEfiPartTypeSystemPartGuid
+ gEfiEndOfDxeEventGroupGuid

[Pcd]
gPlatformModuleTokenSpaceGuid.PcdFlashFvRecovery2Base
gPlatformModuleTokenSpaceGuid.PcdFlashFvMainBase
gPlatformModuleTokenSpaceGuid.PcdFlashFvRecoveryBase
--
2.6.2.windows.1


Re: [Patch] Vlv2DeviceRefCodePkg&Vlv2DevicePkg:Add sample WSMT table.

Wei, David <david.wei@...>
 

Reviewed-by: David Wei <david.wei@...>



Thanks,
David Wei

Intel SSG BIOS Team

-----Original Message-----
From: Lu, ShifeiX A
Sent: Thursday, July 28, 2016 4:21 PM
To: edk2-devel@...
Cc: Wei; Wei, David <david.wei@...>
Subject: [Patch] Vlv2DeviceRefCodePkg&Vlv2DevicePkg:Add sample WSMT table.

This is an sample WSMT table, which we only
update BIT0 and BIT1 of Protections flags fields.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: lushifex <shifeix.a.lu@...>
---
Vlv2DeviceRefCodePkg/AcpiTablesPCAT/AcpiTables.inf | 3 +-
Vlv2DeviceRefCodePkg/AcpiTablesPCAT/Wsmt/Wsmt.aslc | 60 ++++++++++++++++++++++
Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c | 13 +++++
3 files changed, 75 insertions(+), 1 deletion(-)
create mode 100644 Vlv2DeviceRefCodePkg/AcpiTablesPCAT/Wsmt/Wsmt.aslc

diff --git a/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/AcpiTables.inf b/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/AcpiTables.inf
index 9c00651..e9a7d80 100644
--- a/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/AcpiTables.inf
+++ b/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/AcpiTables.inf
@@ -3,11 +3,11 @@
#
# Build acpi table data required by system boot.
# All .asi files tagged with "ToolCode="DUMMY"" in following file list are device description and are included
# by top level ASL file which will be dealed with by asl.exe application.
#
-# Copyright (c) 1999 - 2015, Intel Corporation. All rights reserved
+# Copyright (c) 1999 - 2016, Intel Corporation. All rights reserved
#
# This program and the accompanying materials are licensed and made available under
# the terms and conditions of the BSD License that accompanies this distribution.
# The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php.
@@ -35,10 +35,11 @@
Facp/Facp.aslc
Madt/Madt30.aslc
Mcfg/Mcfg.aslc
Hpet/Hpet.aslc
Lpit/Lpit.aslc
+ Wsmt/Wsmt.aslc


[Packages]
MdePkg/MdePkg.dec
Vlv2TbltDevicePkg/PlatformPkg.dec
diff --git a/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/Wsmt/Wsmt.aslc b/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/Wsmt/Wsmt.aslc
new file mode 100644
index 0000000..4142201
--- /dev/null
+++ b/Vlv2DeviceRefCodePkg/AcpiTablesPCAT/Wsmt/Wsmt.aslc
@@ -0,0 +1,60 @@
+/*++
+ Copyright (c) 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 that accompanies this distribution.
+ The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php.
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+
+
+Module Name:
+
+ Wsmt.c
+
+Abstract:
+
+ This file contains a structure definition for the Windows SMM Security
+ Mitigations Table (WSMT).
+
+++*/
+
+//
+// Statements that include other files
+//
+#include "AcpiTablePlatform.h"
+#include <IndustryStandard/WindowsSmmSecurityMitigationTable.h>
+
+//
+// WSMT Table definition
+//
+EFI_ACPI_WSMT_TABLE WSMT = {
+ EFI_ACPI_WINDOWS_SMM_SECURITY_MITIGATION_TABLE_SIGNATURE,
+ sizeof (EFI_ACPI_WSMT_TABLE),
+ EFI_WSMT_TABLE_REVISION,
+ //
+ // Checksum will be updated at runtime
+ //
+ 0,
+ EFI_ACPI_OEM_ID, // OEMID is a 6 bytes long field
+ EFI_ACPI_OEM_TABLE_ID, // OEM table identification(8 bytes long)
+ EFI_ACPI_OEM_REVISION, // OEM revision
+ EFI_ACPI_CREATOR_ID, // ASL compiler vendor ID
+ EFI_ACPI_CREATOR_REVISION, // ASL compiler revision number
+ 0x00000000, // Protection flag
+};
+
+VOID*
+ReferenceAcpiTable (
+ VOID
+ )
+{
+ //
+ // Reference the table being generated to prevent the optimizer from
+ // removing the data structure from the executable
+ //
+ return (VOID*)&WSMT;
+}
diff --git a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
index db1b5a5..8a883f2 100644
--- a/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
+++ b/Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c
@@ -56,10 +56,11 @@ Abstract:
#include <Guid/AcpiTableStorage.h>
#include <Guid/EfiVpdData.h>
#include <PchAccess.h>
#include <Guid/Vlv2Variable.h>
#include <Guid/PlatformCpuInfo.h>
+#include <IndustryStandard/WindowsSmmSecurityMitigationTable.h>


CHAR16 EfiPlatformCpuInfoVariable[] = L"PlatformCpuInfo";
CHAR16 gACPIOSFRModelStringVariableName[] = ACPI_OSFR_MODEL_STRING_VARIABLE_NAME;
CHAR16 gACPIOSFRRefDataBlockVariableName[] = ACPI_OSFR_REF_DATA_BLOCK_VARIABLE_NAME;
@@ -236,10 +237,11 @@ PlatformUpdateTables (
UINTN LocalApicCounter;
EFI_PROCESSOR_INFORMATION ProcessorInfoBuffer;
UINT8 TempVal;
EFI_ACPI_3_0_IO_APIC_STRUCTURE *IOApicType;
EFI_ACPI_3_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER *APICTableHeader;
+ EFI_ACPI_WSMT_TABLE *WsmtTable;

CurrPtr = NULL;
EndPtr = NULL;
ApicPtr = NULL;
LocalApicCounter = 0;
@@ -597,10 +599,21 @@ PlatformUpdateTables (
}
gBS->FreePool (OcurMfgStringBuffer);
gBS->FreePool (OcurModelStringBuffer);
gBS->FreePool (OcurRefDataBlockBuffer);
break;
+
+
+ case EFI_ACPI_WINDOWS_SMM_SECURITY_MITIGATION_TABLE_SIGNATURE:
+ WsmtTable = (EFI_ACPI_WSMT_TABLE *) Table;
+ //
+ // Update Microsoft WSMT table Protections flags.
+ //
+ WsmtTable->ProtectionFlags = ((WsmtTable->ProtectionFlags) | (EFI_WSMT_PROTECTION_FLAGS_FIXED_COMM_BUFFERS | EFI_WSMT_PROTECTION_FLAGS_COMM_BUFFER_NESTED_PTR_PROTECTION ));
+ break;
+
+
default:
break;
}

//
--
2.6.2.windows.1


[PATCH v2 00/19] Fix Vlv2TbltDevicePkg gcc build

Gary Lin
 

This series amend the build script of Vlv2TbltDevicePkg and fix the
error messages from gcc. I've built the firmware with gcc 6.1.1 on openSUSE
Tumbleweed, and the firmware binary[*] was generated successfully (but not
guaranteed to work).

[*] Vlv2TbltDevicePkg/Stitch/MNW2MAX_X64_D_0093_01_GCC.bin

The patches are also available in my github branch:
https://github.com/lcp/edk2/tree/Vlv2-gcc-fix-v2-platforms

Changes in v2:
1. Instead of removing MDEPKG_NDEBUG completely, amend the CFLAG to define
MDEPKG_NDEBUG only for the gcc release build.
2. Remove the variable Hob and the related code from IchRcrbInit() in
Vlv2TbltDevicePkg/PlatformInitPei/PchInitPeim.c.
3. Include UefiBootServicesTableLib.h in PlatformGopPolicy/PlatformGopPolicy.c
so that we don't have to declare gBS.
4. Rebase the patchset on minnowboard-max-udk2015 of
https://github.com/tianocore/edk2-platforms.git instead of the master of
https://github.com/tianocore/edk2.git. Besides the patches of this series,
minnowboard-max-udk2015 needs a few more commits from edk2.git to make it
work with gcc6:
* NetworkPkg: fix ASSERT_EFI_ERROR() typos
* EdkCompatibilityPkg: fix ASSERT_EFI_ERROR() typos
* Vlv2TbltDevicePkg: fix ASSERT_EFI_ERROR() typos
* CryptoPkg/BaseCryptLib: Add missing OpenSSL includes
* CryptoPkg/OpensslLib: Undefine NO_BUILTIN_VA_FUNCS to fix varargs breakage
* CryptoPkg: Fix OpenSSL BN wordsize and OPENSSL_SYS_UEFI handling
For convenience, I merged all the patches before and include openssl 1.0.2h
update in my branch.

Gary Lin (19):
Vlv2TbltDevicePkg: Amend the build script
Vlv2TbltDevicePkg: Only define MDEPKG_NDEBUG for gcc release build
Vlv2TbltDevicePkg/MultiPlatformLib: Remove the unused variables
Vlv2TbltDevicePkg/PlatformPei: Remove the unused variable
Vlv2TbltDevicePkg/PlatformBdsLib: Remove the unused variable
Vlv2TbltDevicePkg/PlatformInitPei: Remove the unused variables
Vlv2TbltDevicePkg/PlatformInitPei: Suppress the gcc error message
Vlv2TbltDevicePkg/AcpiPlatform: Remove unused variables
Vlv2TbltDevicePkg/AcpiPlatform: Amend the declaration of mGlobalNvsArea
Vlv2TbltDevicePkg/PlatformGopPolicy: include UefiBootServicesTableLib.h
Vlv2DeviceRefCodePkg/ValleyView2Soc: Remove the unused code
Vlv2TbltDevicePkg/FvbRuntimeDxe: Remove unused variables
Vlv2TbltDevicePkg/PlatformSetupDxe: Remove the unused variables
Vlv2TbltDevicePkg/VlvPlatformInitDxe: Remove unused variables
Vlv2TbltDevicePkg/PlatformDxe: Remove the unused variables
Vlv2TbltDevicePkg/Wpce791: Remove the unused variable
Vlv2TbltDevicePkg/SmBiosMiscDxe: Remove unused variables
Vlv2TbltDevicePkg/PpmPolicy: Remove the usage of global variables
Vlv2TbltDevicePkg/PpmPolicy: Remove the unused variable

.../SouthCluster/Include/PchAccess.h | 49 -----
Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.c | 9 +-
Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatform.h | 2 +-
Vlv2TbltDevicePkg/AcpiPlatform/AcpiPlatformHooks.c | 4 +-
Vlv2TbltDevicePkg/FvbRuntimeDxe/FvbService.c | 11 --
.../MultiPlatformLib/BoardClkGens/BoardClkGens.c | 5 +-
.../Library/MultiPlatformLib/MultiPlatformLib.c | 53 ++---
.../Library/PlatformBdsLib/BdsPlatform.c | 3 +-
Vlv2TbltDevicePkg/PlatformDxe/IchRegTable.c | 2 -
Vlv2TbltDevicePkg/PlatformDxe/PciDevice.c | 214 ++++++++++-----------
Vlv2TbltDevicePkg/PlatformDxe/Platform.c | 40 ++--
.../PlatformGopPolicy/PlatformGopPolicy.c | 4 +-
Vlv2TbltDevicePkg/PlatformInitPei/MemoryCallback.c | 2 -
Vlv2TbltDevicePkg/PlatformInitPei/PchInitPeim.c | 12 --
.../PlatformInitPei/PlatformEarlyInit.c | 1 +
Vlv2TbltDevicePkg/PlatformPei/MemoryCallback.c | 9 +-
Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc | 2 +-
.../PlatformSetupDxe/SetupInfoRecords.c | 41 ++--
Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c | 13 +-
Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.h | 6 +-
.../SmBiosMiscDxe/MiscOemType0x90Function.c | 5 -
.../SmBiosMiscDxe/MiscProcessorCacheFunction.c | 2 -
.../MiscProcessorInformationFunction.c | 2 -
Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c | 4 -
Vlv2TbltDevicePkg/Wpce791/LpcDriver.c | 4 -
Vlv2TbltDevicePkg/bld_vlv.sh | 24 ++-
26 files changed, 203 insertions(+), 320 deletions(-)

--
2.9.2


[PATCH v2 01/19] Vlv2TbltDevicePkg: Amend the build script

Gary Lin
 

Take the gcc version detection from OvmfPkg/build.sh instead of the
hardcoded GCC46.

Cc: David Wei <david.wei@...>
Cc: "Wu, Hao A" <hao.a.wu@...>
Cc: "Lu, ShifeiX A" <shifeix.a.lu@...>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@...>
Reviewed-by: David Wei <david.wei@...>
---
Vlv2TbltDevicePkg/bld_vlv.sh | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/Vlv2TbltDevicePkg/bld_vlv.sh b/Vlv2TbltDevicePkg/bld_vlv.sh
index 569865f..538b3ef 100755
--- a/Vlv2TbltDevicePkg/bld_vlv.sh
+++ b/Vlv2TbltDevicePkg/bld_vlv.sh
@@ -177,8 +177,30 @@ sed -i '/^TARGET_ARCH/d' Conf/target.txt
sed -i '/^TOOL_CHAIN_TAG/d' Conf/target.txt
sed -i '/^MAX_CONCURRENT_THREAD_NUMBER/d' Conf/target.txt

+gcc_version=$(gcc -v 2>&1 | tail -1 | awk '{print $3}')
+case $gcc_version in
+ 4.5.*)
+ TARGET_TOOLS=GCC45
+ ;;
+ 4.6.*)
+ TARGET_TOOLS=GCC46
+ ;;
+ 4.7.*)
+ TARGET_TOOLS=GCC47
+ ;;
+ 4.8.*)
+ TARGET_TOOLS=GCC48
+ ;;
+ 4.9.*|4.1[0-9].*|5.*.*|6.*.*)
+ TARGET_TOOLS=GCC49
+ ;;
+ *)
+ TARGET_TOOLS=GCC44
+ ;;
+esac
+
ACTIVE_PLATFORM=$PLATFORM_PACKAGE/PlatformPkgGcc"$Arch".dsc
-TOOL_CHAIN_TAG=GCC46
+TOOL_CHAIN_TAG=$TARGET_TOOLS
MAX_CONCURRENT_THREAD_NUMBER=1
echo ACTIVE_PLATFORM = $ACTIVE_PLATFORM >> Conf/target.txt
echo TARGET = $TARGET >> Conf/target.txt
--
2.9.2


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

Gary Lin
 

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@...>
Cc: David Wei <david.wei@...>
CC: Laszlo Ersek <lersek@...>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@...>
---
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>
--
2.9.2


[PATCH v2 03/19] Vlv2TbltDevicePkg/MultiPlatformLib: Remove the unused variables

Gary Lin
 

Fix the following errors from gcc:

Vlv2TbltDevicePkg/Library/MultiPlatformLib/MultiPlatformLib.c: In function ‘MultiPlatformInfoInit’:
Vlv2TbltDevicePkg/Library/MultiPlatformLib/MultiPlatformLib.c:47:14: error: variable ‘Status’ set but not used [-Werror=unused-but-set-variable]

Vlv2TbltDevicePkg/Library/MultiPlatformLib/BoardClkGens/BoardClkGens.c: In function ‘ReadClockGeneratorID’:
Vlv2TbltDevicePkg/Library/MultiPlatformLib/BoardClkGens/BoardClkGens.c:222:33: error: variable ‘Status’ set but not used [-Werror=unused-but-set-variable]

Vlv2TbltDevicePkg/Library/MultiPlatformLib/BoardClkGens/BoardClkGens.c: In function ‘ConfigurePlatformClocks’:
Vlv2TbltDevicePkg/Library/MultiPlatformLib/BoardClkGens/BoardClkGens.c:283:33: error: variable ‘ClockGenID’ set but not used [-Werror=unused-but-set-variable]

Also fix the coding style of MultiPlatformInfoInit()

Cc: David Wei <david.wei@...>
Cc: "Wu, Hao A" <hao.a.wu@...>
Cc: "Lu, ShifeiX A" <shifeix.a.lu@...>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@...>
Reviewed-by: David Wei <david.wei@...>
---
.../MultiPlatformLib/BoardClkGens/BoardClkGens.c | 5 +-
.../Library/MultiPlatformLib/MultiPlatformLib.c | 53 ++++++++++++----------
2 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/Vlv2TbltDevicePkg/Library/MultiPlatformLib/BoardClkGens/BoardClkGens.c b/Vlv2TbltDevicePkg/Library/MultiPlatformLib/BoardClkGens/BoardClkGens.c
index 6d3bd77..000c864 100644
--- a/Vlv2TbltDevicePkg/Library/MultiPlatformLib/BoardClkGens/BoardClkGens.c
+++ b/Vlv2TbltDevicePkg/Library/MultiPlatformLib/BoardClkGens/BoardClkGens.c
@@ -210,7 +210,6 @@ ReadClockGeneratorID (
IN UINT8 ClockAddress
)
{
- EFI_STATUS Status;
EFI_SMBUS_DEVICE_ADDRESS SlaveAddress;
UINT8 Buffer[MAX_CLOCK_GENERATOR_BUFFER_LENGTH];
UINTN Length;
@@ -222,7 +221,7 @@ ReadClockGeneratorID (
SlaveAddress.SmbusDeviceAddress = ClockAddress >> 1;
Length = sizeof (Buffer);
Command = 0;
- Status = SmbusPpi->Execute (
+ SmbusPpi->Execute (
PeiServices,
SmbusPpi,
SlaveAddress,
@@ -271,7 +270,6 @@ ConfigurePlatformClocks (

EFI_PLATFORM_INFO_HOB *PlatformInfoHob;
BOOLEAN EnableSpreadSpectrum;
- UINT8 ClockGenID=0;
SYSTEM_CONFIGURATION SystemConfiguration;

UINTN Length;
@@ -324,7 +322,6 @@ ConfigurePlatformClocks (
DEBUG((EFI_D_ERROR, "Clock Generator CK505 Not Present, vendor ID on board is %x\n",(Data & 0x0F)));
return EFI_SUCCESS;
}
- ClockGenID = Data & 0x0F;

EnableSpreadSpectrum = FALSE;
VariableSize = sizeof (SYSTEM_CONFIGURATION);
diff --git a/Vlv2TbltDevicePkg/Library/MultiPlatformLib/MultiPlatformLib.c b/Vlv2TbltDevicePkg/Library/MultiPlatformLib/MultiPlatformLib.c
index d32deb5..dedcbe4 100644
--- a/Vlv2TbltDevicePkg/Library/MultiPlatformLib/MultiPlatformLib.c
+++ b/Vlv2TbltDevicePkg/Library/MultiPlatformLib/MultiPlatformLib.c
@@ -34,8 +34,7 @@ MultiPlatformInfoInit (
IN OUT EFI_PLATFORM_INFO_HOB *PlatformInfoHob
)
{
- UINT32 PcieLength;
- EFI_STATUS Status;
+ UINT32 PcieLength;


PlatformInfoHob->IohSku = MmPci16(0, MC_BUS, MC_DEV, MC_FUN, PCI_DEVICE_ID_OFFSET);
@@ -52,10 +51,10 @@ MultiPlatformInfoInit (

PlatformInfoHob->IchRevision = PchLpcPciCfg8(PCI_REVISION_ID_OFFSET);

- //
- //64MB
- //
- PcieLength = 0x04000000;
+ //
+ //64MB
+ //
+ PcieLength = 0x04000000;

//
// Don't support BASE above 4GB currently.
@@ -95,28 +94,32 @@ MultiPlatformInfoInit (
//
PlatformInfoHob->SysData.SysIoApicEnable = ICH_IOAPIC;

- DEBUG ((EFI_D_ERROR, "PlatformFlavor is %x (%x=tablet,%x=mobile,%x=desktop)\n", PlatformInfoHob->PlatformFlavor,FlavorTablet,FlavorMobile,FlavorDesktop));
+ DEBUG ((EFI_D_ERROR, "PlatformFlavor is %x (%x=tablet,%x=mobile,%x=desktop)\n",
+ PlatformInfoHob->PlatformFlavor,
+ FlavorTablet,
+ FlavorMobile,
+ FlavorDesktop));

- //
- // Get Platform Info and fill the Hob.
- //
- PlatformInfoHob->RevisonId = PLATFORM_INFO_HOB_REVISION;
+ //
+ // Get Platform Info and fill the Hob.
+ //
+ PlatformInfoHob->RevisonId = PLATFORM_INFO_HOB_REVISION;

- //
- // Get GPIO table
- //
- Status = MultiPlatformGpioTableInit (PeiServices, PlatformInfoHob);
+ //
+ // Get GPIO table
+ //
+ MultiPlatformGpioTableInit (PeiServices, PlatformInfoHob);

- //
- // Program GPIO
- //
- Status = MultiPlatformGpioProgram (PeiServices, PlatformInfoHob);
+ //
+ // Program GPIO
+ //
+ MultiPlatformGpioProgram (PeiServices, PlatformInfoHob);

- //
- // Update OemId
- //
- Status = InitializeBoardOemId (PeiServices, PlatformInfoHob);
- Status = InitializeBoardSsidSvid (PeiServices, PlatformInfoHob);
+ //
+ // Update OemId
+ //
+ InitializeBoardOemId (PeiServices, PlatformInfoHob);
+ InitializeBoardSsidSvid (PeiServices, PlatformInfoHob);

- return EFI_SUCCESS;
+ return EFI_SUCCESS;
}
--
2.9.2


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

Gary Lin
 

Fix the following error from gcc:

Vlv2TbltDevicePkg/PlatformPei/MemoryCallback.c: In function ‘MemoryDiscoveredPpiNotifyCallback’:
Vlv2TbltDevicePkg/PlatformPei/MemoryCallback.c:115:20: error: variable ‘Status’ set but not used [-Werror=unused-but-set-variable]

Cc: David Wei <david.wei@...>
Cc: "Wu, Hao A" <hao.a.wu@...>
Cc: "Lu, ShifeiX A" <shifeix.a.lu@...>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@...>
Reviewed-by: David Wei <david.wei@...>
---
Vlv2TbltDevicePkg/PlatformPei/MemoryCallback.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/Vlv2TbltDevicePkg/PlatformPei/MemoryCallback.c b/Vlv2TbltDevicePkg/PlatformPei/MemoryCallback.c
index 82954d3..9c769bf 100644
--- a/Vlv2TbltDevicePkg/PlatformPei/MemoryCallback.c
+++ b/Vlv2TbltDevicePkg/PlatformPei/MemoryCallback.c
@@ -103,7 +103,6 @@ MemoryDiscoveredPpiNotifyCallback (
)
{

- EFI_STATUS Status;
EFI_BOOT_MODE BootMode;
UINT32 Pages;
VOID* Memory;
@@ -113,10 +112,10 @@ MemoryDiscoveredPpiNotifyCallback (
// Allocate LM memory and configure PDM if enabled by user.
// ConfigureLM(PeiServices);
//
- Status = (*PeiServices)->GetBootMode (
- (const EFI_PEI_SERVICES **)PeiServices,
- &BootMode
- );
+ (*PeiServices)->GetBootMode (
+ (const EFI_PEI_SERVICES **)PeiServices,
+ &BootMode
+ );

if (BootMode != BOOT_ON_S3_RESUME) {
Size = (PcdGet32 (PcdFlashFvRecovery2Base) - PcdGet32 (PcdFlashFvMainBase)) + FixedPcdGet32(PcdFlashFvRecovery2Size);
--
2.9.2


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

Gary Lin
 

Fix the following error from gcc:

Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.c: In function ‘BdsLockFv’:
Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.c:2170:31: error: variable ‘Data’ set but not used [-Werror=unused-but-set-variable]

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

diff --git a/Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.c b/Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.c
index 1a3a306..6e8364b 100644
--- a/Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.c
+++ b/Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.c
@@ -2226,7 +2226,6 @@ BdsLockFv (
EFI_FV_BLOCK_MAP_ENTRY *BlockMap;
EFI_FIRMWARE_VOLUME_HEADER *FvHeader;
EFI_PHYSICAL_ADDRESS BaseAddress;
- UINT8 Data;
UINT32 BlockLength;
UINTN Index;

@@ -2237,7 +2236,7 @@ BdsLockFv (
while ((BlockMap->NumBlocks != 0) && (BlockMap->Length != 0)) {
BlockLength = BlockMap->Length;
for (Index = 0; Index < BlockMap->NumBlocks; Index++) {
- Data = MmioOr8 ((UINTN) BaseAddress, 0x03);
+ MmioOr8 ((UINTN) BaseAddress, 0x03);
BaseAddress += BlockLength;
}
BlockMap++;
--
2.9.2


[PATCH v2 06/19] Vlv2TbltDevicePkg/PlatformInitPei: Remove the unused variables

Gary Lin
 

Fix the following errors from gcc:

Vlv2TbltDevicePkg/PlatformInitPei/PchInitPeim.c: In function 'IchRcrbInit':
Vlv2TbltDevicePkg/PlatformInitPei/PchInitPeim.c:513:36: error: variable 'PlatformCpuInfo' set but not used [-Werror=unused-but-set-variable]
Vlv2TbltDevicePkg/PlatformInitPei/PchInitPeim.c:512:35: error: variable 'LpcRevisionID' set but not used [-Werror=unused-but-set-variable]

Vlv2TbltDevicePkg/PlatformInitPei/MemoryCallback.c: In function 'EndOfPeiPpiNotifyCallback':
Vlv2TbltDevicePkg/PlatformInitPei/MemoryCallback.c:64:31: error: variable 'MemoryTop' set but not used [-Werror=unused-but-set-variable]

v2:
Also remove the variable, Hob, in PchInitPeim.c:IchRcrbInit() since
no one really uses it.

Cc: David Wei <david.wei@...>
Cc: "Lu, ShifeiX A" <shifeix.a.lu@...>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@...>
---
Vlv2TbltDevicePkg/PlatformInitPei/MemoryCallback.c | 2 --
Vlv2TbltDevicePkg/PlatformInitPei/PchInitPeim.c | 12 ------------
2 files changed, 14 deletions(-)

diff --git a/Vlv2TbltDevicePkg/PlatformInitPei/MemoryCallback.c b/Vlv2TbltDevicePkg/PlatformInitPei/MemoryCallback.c
index 31cc88a..9d9c0e5 100644
--- a/Vlv2TbltDevicePkg/PlatformInitPei/MemoryCallback.c
+++ b/Vlv2TbltDevicePkg/PlatformInitPei/MemoryCallback.c
@@ -52,7 +52,6 @@ EndOfPeiPpiNotifyCallback (
)
{
EFI_STATUS Status;
- UINT64 MemoryTop;
UINT64 LowUncableBase;
EFI_PLATFORM_INFO_HOB *PlatformInfo;
UINT32 HecBaseHigh;
@@ -100,7 +99,6 @@ EndOfPeiPpiNotifyCallback (

LowUncableBase = PlatformInfo->MemData.MemMaxTolm;
LowUncableBase &= (0x0FFF00000);
- MemoryTop = (0x100000000);

if (BootMode != BOOT_ON_S3_RESUME) {
//
diff --git a/Vlv2TbltDevicePkg/PlatformInitPei/PchInitPeim.c b/Vlv2TbltDevicePkg/PlatformInitPei/PchInitPeim.c
index 30f87c1..18ecda4 100644
--- a/Vlv2TbltDevicePkg/PlatformInitPei/PchInitPeim.c
+++ b/Vlv2TbltDevicePkg/PlatformInitPei/PchInitPeim.c
@@ -500,18 +500,8 @@ IchRcrbInit (
IN SYSTEM_CONFIGURATION *SystemConfiguration
)
{
- UINT8 LpcRevisionID;
- EFI_PLATFORM_CPU_INFO *PlatformCpuInfo;
- EFI_PEI_HOB_POINTERS Hob;
EFI_BOOT_MODE BootMode;

- //
- // Get Platform Info HOB
- //
- Hob.Raw = GetFirstGuidHob (&gEfiPlatformCpuInfoGuid);
- ASSERT (Hob.Raw != NULL);
- PlatformCpuInfo = GET_GUID_HOB_DATA(Hob.Raw);
-
(*PeiServices)->GetBootMode(PeiServices, &BootMode);

//
@@ -530,8 +520,6 @@ IchRcrbInit (
//
// Initial RCBA according to the PeiRCBA table
//
- LpcRevisionID = PchLpcPciCfg8 (R_PCH_LPC_RID_CC);
-
if ((BootMode == BOOT_ON_S3_RESUME)) {
//
// We are resuming from S3
--
2.9.2


[PATCH v2 07/19] Vlv2TbltDevicePkg/PlatformInitPei: Suppress the gcc error message

Gary Lin
 

Fix the following error from gcc:

Vlv2TbltDevicePkg/PlatformInitPei/PlatformEarlyInit.c: In function 'GetWakeupEventAndSaveToHob':
Vlv2TbltDevicePkg/PlatformInitPei/PlatformEarlyInit.c:147:11: error: variable 'WakeEventData' set but not used [-Werror=unused-but-set-variable]

Although the function name is "GetWakeupEventAndSaveToHob",
WakeEventData was never really used or passed to any other function.
Given the fact that the function is served as an example, it'd better to
keep the code related to WakeEventData. Just add a debug statement to
suppress the error message.

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

diff --git a/Vlv2TbltDevicePkg/PlatformInitPei/PlatformEarlyInit.c b/Vlv2TbltDevicePkg/PlatformInitPei/PlatformEarlyInit.c
index 27a6b07..5d3fde6 100644
--- a/Vlv2TbltDevicePkg/PlatformInitPei/PlatformEarlyInit.c
+++ b/Vlv2TbltDevicePkg/PlatformInitPei/PlatformEarlyInit.c
@@ -157,6 +157,7 @@ GetWakeupEventAndSaveToHob (
}

DEBUG ((EFI_D_ERROR, "ACPI Wake Status Register: %04x\n", Pm1Sts));
+ DEBUG ((EFI_D_ERROR, "ACPI Wake Event Data: %02x\n", WakeEventData));

return EFI_SUCCESS;
}
--
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@...>
Cc: "Wu, Hao A" <hao.a.wu@...>
Cc: "Lu, ShifeiX A" <shifeix.a.lu@...>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@...>
Reviewed-by: David Wei <david.wei@...>
---
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


[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@...>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@...>
Reviewed-by: David Wei <david.wei@...>
---
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 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@...>
Cc: David Wei <david.wei@...>
Cc: "Wu, Hao A" <hao.a.wu@...>
Cc: "Lu, ShifeiX A" <shifeix.a.lu@...>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@...>
---
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 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@...>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@...>
---
.../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