]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
5 years agoMdeModulePkg CapsuleApp: Check Buffer against NULL before freeing it
Star Zeng [Thu, 26 Apr 2018 09:16:47 +0000 (17:16 +0800)]
MdeModulePkg CapsuleApp: Check Buffer against NULL before freeing it

If the capsule from command line is not present,
Buffer will be random value when freeing it in DumpCapsule(),
then ASSERT will happen or other memory pool may be freed.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
5 years agoBaseTools: Correct the variable name
Yonghong Zhu [Mon, 7 May 2018 05:41:27 +0000 (13:41 +0800)]
BaseTools: Correct the variable name

the commit bff74750 introduce a undefined variable name 'scope' cause build
failure, it should use 'Scope'.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: Retrieve /U and -U CC flags to structure PcdValueInit Makefile
Liming Gao [Fri, 4 May 2018 05:28:10 +0000 (13:28 +0800)]
BaseTools: Retrieve /U and -U CC flags to structure PcdValueInit Makefile

/D and -D flags have been added. So, /U and -U flags should be added.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoSecurityPkg/OpalPassword: Add support for pyrite 2.0 devices.
Eric Dong [Mon, 7 May 2018 05:27:40 +0000 (13:27 +0800)]
SecurityPkg/OpalPassword: Add support for pyrite 2.0 devices.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
5 years agoSecurityPkg/TcgStorageOpalLib: Add supports for pyrite 2.0 spec.
Eric Dong [Mon, 7 May 2018 05:31:43 +0000 (13:31 +0800)]
SecurityPkg/TcgStorageOpalLib: Add supports for pyrite 2.0 spec.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
5 years agoMdePkg: Add Feature definitions added in pyrite 2.0 spec.
Eric Dong [Thu, 3 May 2018 03:07:10 +0000 (11:07 +0800)]
MdePkg: Add Feature definitions added in pyrite 2.0 spec.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
5 years agoNetworkPkg/NetworkPkg.dsc: Add the instance of library class [SafeIntLib].
Jiaxin Wu [Fri, 4 May 2018 03:48:43 +0000 (11:48 +0800)]
NetworkPkg/NetworkPkg.dsc: Add the instance of library class [SafeIntLib].

This patch is to add the instance of library class [SafeIntLib] to fix the
NetworkPkg build error, which is caused by the commit of 2167c7f7 that the
TlsLib will always consume SafeIntLib.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Long Qin <qin.long@intel.com>
Cc: Bi Dandan <dandan.bi@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Long Qin <qin.long@intel.com>
5 years agoBaseTools/Conf: Add /Gw optimisation option for VS2017 IA32 and X64
Pete Batard [Tue, 24 Apr 2018 16:10:11 +0000 (00:10 +0800)]
BaseTools/Conf: Add /Gw optimisation option for VS2017 IA32 and X64

This option, which is used in VS2015 and earlier toolchains, was missing
for VS2017. Applying it greatly reduces the size of generated binaries.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Pete Batard <pete@akeo.ie>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: Ecc - add dict for config file to internal translation
Carsey, Jaben [Fri, 4 May 2018 20:25:16 +0000 (04:25 +0800)]
BaseTools: Ecc - add dict for config file to internal translation

Commit eece4292acc80 changed a variable name, which was tied directly to
a config file entry. This seperates the internal variable names from
the config file entries by having the internal dict accessed through a
translation of key words.

added a test when this is run straight from command line.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: dont make iterator into list if not needed
Carsey, Jaben [Fri, 27 Apr 2018 22:32:54 +0000 (06:32 +0800)]
BaseTools: dont make iterator into list if not needed

functions (like join) can use the iterator just as easily.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: use set instead of list
Carsey, Jaben [Fri, 27 Apr 2018 22:32:56 +0000 (06:32 +0800)]
BaseTools: use set instead of list

as we only do membership (in) testing for this, set is better

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: create base expression class
Carsey, Jaben [Fri, 27 Apr 2018 22:32:55 +0000 (06:32 +0800)]
BaseTools: create base expression class

this class has a fucntion to share between Exception and RangeExpression
change both classes to call this function init in their init

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: refactor Depex optomization
Carsey, Jaben [Fri, 27 Apr 2018 22:32:53 +0000 (06:32 +0800)]
BaseTools: refactor Depex optomization

No need to make a list from the set.  just pop the item off.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: Remove lists form set construction
Carsey, Jaben [Fri, 27 Apr 2018 22:32:52 +0000 (06:32 +0800)]
BaseTools: Remove lists form set construction

There is no need to make a list to make a set.  remove lists
that are only used in constructing sets.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: missed a copyright update
Carsey, Jaben [Fri, 27 Apr 2018 22:32:51 +0000 (06:32 +0800)]
BaseTools: missed a copyright update

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: GenFds - use existing shared string
Carsey, Jaben [Fri, 27 Apr 2018 22:32:50 +0000 (06:32 +0800)]
BaseTools: GenFds - use existing shared string

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: remove unused variable
Carsey, Jaben [Fri, 27 Apr 2018 22:32:49 +0000 (06:32 +0800)]
BaseTools: remove unused variable

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: standardize GUID and pack size
Carsey, Jaben [Fri, 27 Apr 2018 22:32:48 +0000 (06:32 +0800)]
BaseTools: standardize GUID and pack size

currently GUID packing and pack size determination is spread
throughout the code. This introduces a shared function and dict and
routes all code paths through them.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: AutoGen - add Opcode constants
Carsey, Jaben [Fri, 27 Apr 2018 22:32:47 +0000 (06:32 +0800)]
BaseTools: AutoGen - add Opcode constants

add constants for dependency expression opcode strings
use these new opcode string constants

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: remove redundant content in InfSectionParser
Carsey, Jaben [Fri, 27 Apr 2018 22:32:45 +0000 (06:32 +0800)]
BaseTools: remove redundant content in InfSectionParser

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: remove unused member variable
Carsey, Jaben [Fri, 27 Apr 2018 22:32:44 +0000 (06:32 +0800)]
BaseTools: remove unused member variable

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: AutoGen - refactor more functions only called in __init__
Carsey, Jaben [Fri, 27 Apr 2018 22:32:43 +0000 (06:32 +0800)]
BaseTools: AutoGen - refactor more functions only called in __init__

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: AutoGen - refactor function to remove extra variables
Carsey, Jaben [Fri, 27 Apr 2018 22:32:42 +0000 (06:32 +0800)]
BaseTools: AutoGen - refactor function to remove extra variables

we dont need to keep data we already have in different formats...

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: Refactor to share GUID packing function
Carsey, Jaben [Fri, 27 Apr 2018 22:32:41 +0000 (06:32 +0800)]
BaseTools: Refactor to share GUID packing function

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: AutoGen - remove another function no one calls
Carsey, Jaben [Fri, 27 Apr 2018 22:32:40 +0000 (06:32 +0800)]
BaseTools: AutoGen - remove another function no one calls

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: AutoGen - move function to clean file namespace
Carsey, Jaben [Fri, 27 Apr 2018 22:32:39 +0000 (06:32 +0800)]
BaseTools: AutoGen - move function to clean file namespace

the function is only used in one other function.
just move it there.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: AutoGen - remove function no one calls
Carsey, Jaben [Fri, 27 Apr 2018 22:32:38 +0000 (06:32 +0800)]
BaseTools: AutoGen - remove function no one calls

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: refactor __init__ functions to not compute temporary variable
Carsey, Jaben [Fri, 27 Apr 2018 22:32:37 +0000 (06:32 +0800)]
BaseTools: refactor __init__ functions to not compute temporary variable

just assign correct value to member variable in __init__ or call
parent __init__

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: AutoGen - no need to recompute
Carsey, Jaben [Fri, 27 Apr 2018 22:32:36 +0000 (06:32 +0800)]
BaseTools: AutoGen - no need to recompute

looping over a list and recomputing the same value has no impact on final value

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: AutoGen - refactor out a useless class
Carsey, Jaben [Fri, 27 Apr 2018 22:32:35 +0000 (06:32 +0800)]
BaseTools: AutoGen - refactor out a useless class

this class was never instantiated.  the static function was called.
save the function, remove the rest.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: AutoGen - refactor out a list
Carsey, Jaben [Fri, 27 Apr 2018 22:32:34 +0000 (06:32 +0800)]
BaseTools: AutoGen - refactor out a list

the lists were used in __init__ then converted to sets
instead just use the sets from the begining

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: AutoGen - refactor out functions only called in __init__
Carsey, Jaben [Fri, 27 Apr 2018 22:32:33 +0000 (06:32 +0800)]
BaseTools: AutoGen - refactor out functions only called in __init__

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: move PCD size calculation functions to PcdClassObject
Carsey, Jaben [Fri, 27 Apr 2018 22:32:32 +0000 (06:32 +0800)]
BaseTools: move PCD size calculation functions to PcdClassObject

move both GetPcdMaxSize and GetPcdSize to the PcdClassObject.
fix MAX_SIZE_TYPE to have int values

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: Workspace - refactor a dict
Carsey, Jaben [Fri, 27 Apr 2018 22:32:31 +0000 (06:32 +0800)]
BaseTools: Workspace - refactor a dict

change a dict to a set since we never examine the contents, just the keys.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: remove Compound statements
Carsey, Jaben [Fri, 27 Apr 2018 22:32:30 +0000 (06:32 +0800)]
BaseTools: remove Compound statements

split them into 2 seperate lines.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: eliminate {} from dictionary contructor call
Carsey, Jaben [Fri, 27 Apr 2018 22:32:29 +0000 (06:32 +0800)]
BaseTools: eliminate {} from dictionary contructor call

no need to construct 2 dictionaries.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: refactor to use list not dict
Carsey, Jaben [Fri, 27 Apr 2018 22:32:28 +0000 (06:32 +0800)]
BaseTools: refactor to use list not dict

since we never access the values in the copied dict, just use a list instead.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: AutoGen - UniClassObject refactor static methods
Carsey, Jaben [Fri, 27 Apr 2018 22:32:27 +0000 (06:32 +0800)]
BaseTools: AutoGen - UniClassObject refactor static methods

change methods which do not use self to @staticmethod
change their calls to use class name instead of instance

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: AutoGen - remove global line
Carsey, Jaben [Fri, 27 Apr 2018 22:32:26 +0000 (06:32 +0800)]
BaseTools: AutoGen - remove global line

this serves no purpose since we dont change the global or assign to it.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: Eot - refactor global data
Carsey, Jaben [Fri, 27 Apr 2018 22:32:25 +0000 (06:32 +0800)]
BaseTools: Eot - refactor global data

remove unused lists, dicts, and duplicate variables

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: Eot - remove unused lists
Carsey, Jaben [Fri, 27 Apr 2018 22:32:24 +0000 (06:32 +0800)]
BaseTools: Eot - remove unused lists

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: AutoGen - refactor class factory
Carsey, Jaben [Fri, 27 Apr 2018 22:32:23 +0000 (06:32 +0800)]
BaseTools: AutoGen - refactor class factory

since instances are not added to cache, the factory does nothing.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: AutoGen - share StripComments API
Carsey, Jaben [Fri, 27 Apr 2018 22:32:22 +0000 (06:32 +0800)]
BaseTools: AutoGen - share StripComments API

add the API root in one class file.
delete the static API out of both classes.
share it in the single location.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: AutoGen - GenVar refactor static methods
Carsey, Jaben [Fri, 27 Apr 2018 22:32:21 +0000 (06:32 +0800)]
BaseTools: AutoGen - GenVar refactor static methods

change methods which do not use self to @staticmethod
change their calls to use class name instead of instance

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: AutoGen - refactor dictionary access
Carsey, Jaben [Fri, 27 Apr 2018 22:32:20 +0000 (06:32 +0800)]
BaseTools: AutoGen - refactor dictionary access

dont use dict.get() inside loops of dictionary contents. its not needed.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: AutoGen - refactor assemble_variable
Carsey, Jaben [Fri, 27 Apr 2018 22:32:19 +0000 (06:32 +0800)]
BaseTools: AutoGen - refactor assemble_variable

make this function @staticmethod since self parameter is not used.
change valuelist to valuedict since it is a dictionary.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: this function has no purpose.
Carsey, Jaben [Fri, 27 Apr 2018 22:32:18 +0000 (06:32 +0800)]
BaseTools: this function has no purpose.

it looks like a old POC of the concepts then used to make the classes
in the file.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: check before accessing members in __eq__
Carsey, Jaben [Fri, 27 Apr 2018 22:32:17 +0000 (06:32 +0800)]
BaseTools: check before accessing members in __eq__

minimize risk for exceptions.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: AutoGen - update to remove duplicate constant value
Carsey, Jaben [Fri, 27 Apr 2018 22:32:16 +0000 (06:32 +0800)]
BaseTools: AutoGen - update to remove duplicate constant value

PCD size by type is shared.  just use it.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: FdfParser - update to remove duplicate constant value
Carsey, Jaben [Fri, 27 Apr 2018 22:32:15 +0000 (06:32 +0800)]
BaseTools: FdfParser - update to remove duplicate constant value

PCD size by type is shared so this change both removes duplication
and makes the function work for all numeric PCD types.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoMdeModulePkg/Terminal: Check status of OpenProtocol in BindingStart
Ruiyu Ni [Fri, 13 Apr 2018 04:13:52 +0000 (12:13 +0800)]
MdeModulePkg/Terminal: Check status of OpenProtocol in BindingStart

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=917

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Steven Shi <steven.shi@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
5 years agoSecurityPkg/UserProfileManagerDxe: Update RouteConfig function
Thomas Palmer [Wed, 18 Apr 2018 20:33:14 +0000 (04:33 +0800)]
SecurityPkg/UserProfileManagerDxe: Update RouteConfig function

According to UEFI spec, the RouteConfig protocol function should populate
the Progress pointer with an address inside Configuration.  This patch
ensures that these functions are compliant when EFI_NOT_FOUND is returned.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Thomas Palmer <thomas.palmer@hpe.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
5 years agoSecurityPkg/UserIdentifyManagerDxe: Update RouteConfig function
Thomas Palmer [Wed, 18 Apr 2018 20:33:13 +0000 (04:33 +0800)]
SecurityPkg/UserIdentifyManagerDxe: Update RouteConfig function

According to UEFI spec, the RouteConfig protocol function should populate
the Progress pointer with an address inside Configuration.  This patch
ensures that these functions are compliant when EFI_NOT_FOUND is returned.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Thomas Palmer <thomas.palmer@hpe.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
5 years agoSecurityPkg/PwdCredentialProviderDxe: Update RouteConfig function
Thomas Palmer [Wed, 18 Apr 2018 20:33:12 +0000 (04:33 +0800)]
SecurityPkg/PwdCredentialProviderDxe: Update RouteConfig function

According to UEFI spec, the RouteConfig protocol function should populate
the Progress pointer with an address inside Configuration.  This patch
ensures that these functions are compliant when EFI_NOT_FOUND is returned.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Thomas Palmer <thomas.palmer@hpe.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
5 years agoSecurityPkg/Tcg2Config: Update RouteConfig function
Thomas Palmer [Wed, 18 Apr 2018 20:33:11 +0000 (04:33 +0800)]
SecurityPkg/Tcg2Config: Update RouteConfig function

According to UEFI spec, the RouteConfig protocol function should populate
the Progress pointer with an address inside Configuration.  This patch
ensures that these functions are compliant when EFI_NOT_FOUND is returned.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Thomas Palmer <thomas.palmer@hpe.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
5 years agoMdeModulePkg/DriverHealthManagerDxe: Update RouteConfig function
Thomas Palmer [Wed, 18 Apr 2018 20:32:27 +0000 (04:32 +0800)]
MdeModulePkg/DriverHealthManagerDxe: Update RouteConfig function

According to UEFI spec, the RouteConfig protocol function should populate
the Progress pointer with an address inside Configuration.  This patch
ensures that these functions are compliant when EFI_NOT_FOUND is returned.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Thomas Palmer <thomas.palmer@hpe.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
5 years agoMdeModulePkg/RamDiskDxe: Update RouteConfig function
Thomas Palmer [Wed, 18 Apr 2018 20:32:26 +0000 (04:32 +0800)]
MdeModulePkg/RamDiskDxe: Update RouteConfig function

According to UEFI spec, the RouteConfig protocol function should populate
the Progress pointer with an address inside Configuration.  This patch
ensures that these functions are compliant when EFI_NOT_FOUND is returned.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Thomas Palmer <thomas.palmer@hpe.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
5 years agoMdeModulePkg/UiApp: Update RouteConfig function
Thomas Palmer [Wed, 18 Apr 2018 20:32:25 +0000 (04:32 +0800)]
MdeModulePkg/UiApp: Update RouteConfig function

According to UEFI spec, the RouteConfig protocol function should populate
the Progress pointer with an address inside Configuration.  This patch
ensures that these functions are compliant when EFI_NOT_FOUND is returned.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Thomas Palmer <thomas.palmer@hpe.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
5 years agoIntelFrameworkModulePkg/LegacyBootMaintUiLib: Update RouteConfig function
Thomas Palmer [Wed, 18 Apr 2018 20:31:35 +0000 (04:31 +0800)]
IntelFrameworkModulePkg/LegacyBootMaintUiLib: Update RouteConfig function

According to UEFI spec, the RouteConfig protocol function should populate
the Progress pointer with an address inside Configuration.  This patch
ensures that these functions are compliant when EFI_NOT_FOUND is returned.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Thomas Palmer <thomas.palmer@hpe.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
5 years agoMdePkg/DevicePathToText: Fix iSCSI.Lun byte order issue
Ruiyu Ni [Mon, 5 Mar 2018 03:27:34 +0000 (11:27 +0800)]
MdePkg/DevicePathToText: Fix iSCSI.Lun byte order issue

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
5 years agoBaseTools: remove unused MigrationUtilities.py
Carsey, Jaben [Fri, 20 Apr 2018 15:51:46 +0000 (23:51 +0800)]
BaseTools: remove unused MigrationUtilities.py

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: remove redundant if comparison
Carsey, Jaben [Fri, 20 Apr 2018 15:51:42 +0000 (23:51 +0800)]
BaseTools: remove redundant if comparison

inherently python will check string and list for None and having data

if <x> in [None, ''] and similar are superflous.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: replace string with predefined constant
Carsey, Jaben [Thu, 26 Apr 2018 16:57:57 +0000 (00:57 +0800)]
BaseTools: replace string with predefined constant

v2 - add missing namespace.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: Replace Binary File type strings with predefined constant
Carsey, Jaben [Thu, 26 Apr 2018 16:57:56 +0000 (00:57 +0800)]
BaseTools: Replace Binary File type strings with predefined constant

BINARY_FILE_TYPE_FW was 'FW'
BINARY_FILE_TYPE_GUID was 'GUID'
BINARY_FILE_TYPE_PREEFORM was 'PREEFORM'
BINARY_FILE_TYPE_UEFI_APP was 'UEFI_APP'
BINARY_FILE_TYPE_UNI_UI was 'UNI_UI'
BINARY_FILE_TYPE_UNI_VER was 'UNI_VER'
BINARY_FILE_TYPE_LIB was 'LIB'
BINARY_FILE_TYPE_PE32 was 'PE32'
BINARY_FILE_TYPE_PIC was 'PIC'
BINARY_FILE_TYPE_PEI_DEPEX was 'PEI_DEPEX'
BINARY_FILE_TYPE_DXE_DEPEX was 'DXE_DEPEX'
BINARY_FILE_TYPE_SMM_DEPEX was 'SMM_DEPEX'
BINARY_FILE_TYPE_TE was 'TE'
BINARY_FILE_TYPE_VER was 'VER'
BINARY_FILE_TYPE_UI was 'UI'
BINARY_FILE_TYPE_BIN was 'BIN'
BINARY_FILE_TYPE_FV was 'FV'

v2 - split apart FV and GUID types with different meanings.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: Replace PCD type strings with predefined constant
Carsey, Jaben [Thu, 26 Apr 2018 16:57:55 +0000 (00:57 +0800)]
BaseTools: Replace PCD type strings with predefined constant

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: DataType - cleanup list constants
Carsey, Jaben [Fri, 20 Apr 2018 15:51:37 +0000 (23:51 +0800)]
BaseTools: DataType - cleanup list constants

remove unused ones
convert lists used for membership testing to sets
use shared ones not local ones

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: Replace EDK Component strings with predefined constant
Carsey, Jaben [Fri, 27 Apr 2018 14:04:15 +0000 (22:04 +0800)]
BaseTools: Replace EDK Component strings with predefined constant

EDK_COMPONENT_TYPE_LIBRARY was 'LIBRARY'
EDK_COMPONENT_TYPE_SECURITY_CORE was 'SECURITY_CORE'
EDK_COMPONENT_TYPE_COMBINED_PEIM_DRIVER was 'COMBINED_PEIM_DRIVER'
EDK_COMPONENT_TYPE_PIC_PEIM was 'PIC_PEIM'
EDK_COMPONENT_TYPE_RELOCATABLE_PEIM was 'RELOCATABLE_PEIM'
EDK_COMPONENT_TYPE_BS_DRIVER was 'BS_DRIVER'
EDK_COMPONENT_TYPE_RT_DRIVER was 'RT_DRIVER'
EDK_COMPONENT_TYPE_SAL_RT_DRIVER was 'SAL_RT_DRIVER'
EDK_COMPONENT_TYPE_APPLICATION was 'APPLICATION'

v2 - revert 2 files.  will update later in own patches.
v3 - fix v2

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: Share a dictionary instead of keeping multiples
Carsey, Jaben [Fri, 20 Apr 2018 15:51:35 +0000 (23:51 +0800)]
BaseTools: Share a dictionary instead of keeping multiples

Move a dictionary to a shared location and use from there

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: Define and use a set for common list
Carsey, Jaben [Fri, 20 Apr 2018 15:51:34 +0000 (23:51 +0800)]
BaseTools: Define and use a set for common list

share a set for both PEI module types

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: replace string constants used for module types
Carsey, Jaben [Thu, 26 Apr 2018 16:57:53 +0000 (00:57 +0800)]
BaseTools: replace string constants used for module types

replace raw strings in the code (note: except UPT) with constants.
SUP_MODULE_BASE was 'BASE'
SUP_MODULE_SEC was 'SEC'
SUP_MODULE_PEI_CORE was 'PEI_CORE'
SUP_MODULE_PEIM was 'PEIM'
SUP_MODULE_DXE_CORE was 'DXE_CORE'
SUP_MODULE_DXE_DRIVER was 'DXE_DRIVER'
SUP_MODULE_DXE_RUNTIME_DRIVER was 'DXE_RUNTIME_DRIVER'
SUP_MODULE_DXE_SAL_DRIVER was 'DXE_SAL_DRIVER'
SUP_MODULE_DXE_SMM_DRIVER was 'DXE_SMM_DRIVER'
SUP_MODULE_UEFI_DRIVER was 'UEFI_DRIVER'
SUP_MODULE_UEFI_APPLICATION was 'UEFI_APPLICATION'
SUP_MODULE_USER_DEFINED was 'USER_DEFINED'
SUP_MODULE_SMM_CORE was 'SMM_CORE'
SUP_MODULE_MM_STANDALONE was 'MM_STANDALONE'
SUP_MODULE_MM_CORE_STANDALONE was 'MM_CORE_STANDALONE'

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: Workspace/MetaFileParser - refactor dicts
Carsey, Jaben [Fri, 27 Apr 2018 14:04:14 +0000 (22:04 +0800)]
BaseTools: Workspace/MetaFileParser - refactor dicts

make defaultdict to avoid initialize inner items
to empty the dict, call clear instead of making a new object

v2 - to empty the dict, dont re-run constructor, just call .clear()
in post process API also.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: Fix regression bug by 3378782691af
Yunhua Feng [Fri, 27 Apr 2018 01:15:56 +0000 (09:15 +0800)]
BaseTools: Fix regression bug by 3378782691af

Fix regression bug by 3378782691af

Fixes:https://bugzilla.tianocore.org/show_bug.cgi?id=941
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoEmbeddedPkg/Drivers: add virtual keyboard driver
Haojian Zhuang [Thu, 8 Mar 2018 13:28:22 +0000 (21:28 +0800)]
EmbeddedPkg/Drivers: add virtual keyboard driver

This driver is used to simulate a keyboard. For example, user
could read GPIO setting or data from RAM address. If the value
matches the expected pattern, it could trigger a key pressed
event.

User needs to implement hooks of PLATFORM_VIRTUAL_KBD_PROTOCOL.
There're 4 hooks in this protocol.
Register(): Quote the interface that user needs. For example, user
needs to locate GPIO protocol if he wants to simulate a GPIO value
as a key.
Reset(): Do the initialization before reading value.
Query(): Read value. If the value matches the expected pattern,
trigger a key pressed event.
Clear(): Clean the value if necessary.

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
5 years agoArmPkg: Fix bug in Generic Watchdog driver
AlexeiFedorov [Fri, 27 Apr 2018 13:58:43 +0000 (14:58 +0100)]
ArmPkg: Fix bug in Generic Watchdog driver

In ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c, the following
functions:

  WatchdogWriteOffsetRegister()
  WatchdogWriteCompareRegister()
  WatchdogEnable()
  WatchdogDisable()

provide write access to ARM Generic Watchdog registers and use the values
returned by MmioWrite32() and MmioWrite64() as EFI_STATUS return codes.

Because MmioWriteXY() return the value passed as its write parameter,
Generic Watchdog access functions can spuriously return error codes which
are different from EFI_SUCCESS, e.g. the following call

    Status = WatchdogWriteOffsetRegister (MAX_UINT32);
    if (EFI_ERROR (Status)) {
      return Status;
    }

will return MAX_UINT32 defined in MdePkg/Include/Base.h as

 #define MAX_UINT32  ((UINT32)0xFFFFFFFF)

This commit declares all the functions listed above as VOID
and removes the code for checking their return values.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Alexei Fedorov <alexei.fedorov@arm.com>
Reviewed-by: Evan Lloyd <evan.lloyd@arm.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
5 years agoArmVirtPkg: use protocol-based DevicePathLib instance for most DXE modules
Laszlo Ersek [Mon, 23 Apr 2018 23:36:27 +0000 (01:36 +0200)]
ArmVirtPkg: use protocol-based DevicePathLib instance for most DXE modules

Port OvmfPkg commit 5c3481b0b611e to ArmVirtPkg. Some explanation should
be in order (because 5c3481b0b611e doesn't offer any):

- The UefiDevicePathLibDevicePathProtocol instance uses the Device Path
  Utilities Protocol, produced by DevicePathDxe, for formatting and
  parsing the textual device path representation. This allows for a
  lighter weight lib instance that gets linked into several DXE modules.
  In comparison, the more standalone UefiDevicePathLib instance includes
  the formatting and parsing routines in every client module.

- The DXE core needs DevicePathLib before it dispatches DevicePathDxe, so
  it needs to stick with the standalone instance.

- DevicePathDxe itself also needs the standalone instance, for
  implementing the protocol.

- The DXE-phase PCD driver, "MdeModulePkg/Universal/PCD/Dxe/Pcd.inf",
  depends on DevicePathLib via UefiLib and DxeServicesLib at the least; so
  with this update, it inherits a dependency on the protocol. In reverse,
  DevicePathDxe depends on the PCD Protocol, via PcdLib. The cycle is
  broken by using BasePcdLibNull in DevicePathDxe. That restricts it to
  FixedAtBuild, Patch, and FeatureFlag PCDs, but that's fine.

Example space savings (using ArmVirtQemu and the GCC5 toolchain):
- NOOPT:   187KB in FVMAIN, 12KB in FVMAIN_COMPACT
- DEBUG:   147KB in FVMAIN, 20KB in FVMAIN_COMPACT
- RELEASE: 123KB in FVMAIN, 17KB in FVMAIN_COMPACT

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Julien Grall <julien.grall@linaro.org>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=940
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
5 years agoBaseTools: Fix regression issue by 1eb72acddd61
Yunhua Feng [Fri, 27 Apr 2018 03:21:17 +0000 (11:21 +0800)]
BaseTools: Fix regression issue by 1eb72acddd61

Fix regression issue by 1eb72acddd61
secRe not replace by secReGeneral

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoOvmfPkg/QemuVideoDxe: round up FrameBufferSize to full page
Gerd Hoffmann [Thu, 26 Apr 2018 07:02:07 +0000 (09:02 +0200)]
OvmfPkg/QemuVideoDxe: round up FrameBufferSize to full page

Guests do the same, because the framebuffer is mapped somewhere, which
obviously works with page granularity only.

When not rounding up to full page size we get messages like this one
(linux kernel):

    efifb: framebuffer at 0x80000000, using 1876k, total 1875k
                                            ^^^^^        ^^^^^
Also sysfb is confused and throws an error:

    sysfb: VRAM smaller than advertised

Cc: Phil Dennis-Jordan <phil@philjordan.eu>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
[lersek@redhat.com: fix coding style]

5 years agoCryptoPkg/OpensslLib: remove OpenSSL version number from OpenSSL-HOWTO.txt
Laszlo Ersek [Wed, 25 Apr 2018 17:44:18 +0000 (19:44 +0200)]
CryptoPkg/OpensslLib: remove OpenSSL version number from OpenSSL-HOWTO.txt

Remove any concrete OpenSSL version numbers from "OpenSSL-HOWTO.txt". That
information is out of date and there's no reason for us to refresh it:

We now track stable OpenSSL releases via a git submodule. CryptoPkg
maintainers push such submodule updates to edk2 that identify the correct
stable releases of OpenSSL. "OpenSSL-HOWTO.txt" already provides
instructions to users for updating their local submodules.

Cc: Qin Long <qin.long@intel.com>
Cc: Ting Ye <ting.ye@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Long Qin <qin.long@intel.com>
5 years agoBaseTools: Fix one invalid change in 6be94743
Yunhua Feng [Wed, 25 Apr 2018 00:46:36 +0000 (08:46 +0800)]
BaseTools: Fix one invalid change in 6be94743

Roll back one change in 6be94743, it was updated incorrect.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: CommonClass - remove unused classes
Carsey, Jaben [Fri, 20 Apr 2018 15:51:47 +0000 (23:51 +0800)]
BaseTools: CommonClass - remove unused classes

CommonDataClass/CommonClass has only 1 used class: SkuInfoClass
remove all unused classes

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: AutoGen - use defaultdict to auto initialize
Carsey, Jaben [Fri, 20 Apr 2018 15:51:45 +0000 (23:51 +0800)]
BaseTools: AutoGen - use defaultdict to auto initialize

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: GenFds - simplify testing for Hex number
Carsey, Jaben [Fri, 20 Apr 2018 15:51:44 +0000 (23:51 +0800)]
BaseTools: GenFds - simplify testing for Hex number

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: AutoGen - use dafultdict instead of dict
Carsey, Jaben [Fri, 20 Apr 2018 15:51:43 +0000 (23:51 +0800)]
BaseTools: AutoGen - use dafultdict instead of dict

since we manually make each entry a set(), just use defaultdict(set)

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: remove duplicate variable
Carsey, Jaben [Fri, 20 Apr 2018 15:51:40 +0000 (23:51 +0800)]
BaseTools: remove duplicate variable

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: remove dict from DscBuildData
Carsey, Jaben [Fri, 20 Apr 2018 15:51:32 +0000 (23:51 +0800)]
BaseTools: remove dict from DscBuildData

the dict is not needed as BaseTools can check the set

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: Remove extra .keys()
Carsey, Jaben [Fri, 20 Apr 2018 15:51:30 +0000 (23:51 +0800)]
BaseTools: Remove extra .keys()

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: AutoGen - remove unused variables.
Carsey, Jaben [Fri, 20 Apr 2018 15:51:29 +0000 (23:51 +0800)]
BaseTools: AutoGen - remove unused variables.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: AutoGen - remove dictionary populated, but never accessed
Carsey, Jaben [Fri, 20 Apr 2018 15:51:28 +0000 (23:51 +0800)]
BaseTools: AutoGen - remove dictionary populated, but never accessed

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: Workspace - refactor GetStructurePcdInfo
Carsey, Jaben [Fri, 20 Apr 2018 15:51:27 +0000 (23:51 +0800)]
BaseTools: Workspace - refactor GetStructurePcdInfo

the function doesn't use self and can be static
defaultdict replaces dict and removes the dict initialization code

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: simplify if call
Carsey, Jaben [Fri, 20 Apr 2018 15:51:26 +0000 (23:51 +0800)]
BaseTools: simplify if call

the variable is a string type since we just used .strip() on it.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: Autogen - replace string constants with those from DataType
Carsey, Jaben [Fri, 20 Apr 2018 15:51:25 +0000 (23:51 +0800)]
BaseTools: Autogen - replace string constants with those from DataType

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: Workspace - refactor RegEx to minimize multiple compiling
Carsey, Jaben [Fri, 20 Apr 2018 15:51:24 +0000 (23:51 +0800)]
BaseTools: Workspace - refactor RegEx to minimize multiple compiling

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoArmVirtPkg: reinstate timer unmask quirk for Xen
Ard Biesheuvel [Mon, 23 Apr 2018 14:55:18 +0000 (16:55 +0200)]
ArmVirtPkg: reinstate timer unmask quirk for Xen

Commit 411a373ed642 ("ArmPkg/TimerDxe: remove workaround for KVM timer
handling") removed the virtual timer handling quirk that cleared the
mask bit in the control register when enabling the timer, under the
assumption that only ancient KVM host implementations required it.
However, Julien reports that Xen also masks the timer interrupt in the
guest view of the timer control register, and therefore needs the same
quirk.

So let's reinstate it, but using a Xen specific implementation of the
timer support library, so that other virt platforms remain unchanged.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Julien Grall <julien.grall@arm.com>
Acked-by: Julien Grall <julien.grall@arm.com>
5 years agoArmPkg: add reenable hook to ArmGenericTimerCounterLib
Ard Biesheuvel [Mon, 23 Apr 2018 14:47:18 +0000 (16:47 +0200)]
ArmPkg: add reenable hook to ArmGenericTimerCounterLib

In preparation of selectively reinstating the timer enable quirk for Xen
that we removed in commit 411a373ed642 ("ArmPkg/TimerDxe: remove workaround
for KVM timer handling"), add a ArmGenericTimerReenableTimer() library
function to ArmGenericTimerCounterLib that we will populate for Xen only.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Julien Grall <julien.grall@arm.com>
Acked-by: Julien Grall <julien.grall@arm.com>
5 years agoBaseTools: Share RegEx between files
Carsey, Jaben [Fri, 20 Apr 2018 15:51:23 +0000 (23:51 +0800)]
BaseTools: Share RegEx between files

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: GenPatchPcdTable - refactor RegEx to minimize multiple compiling
Carsey, Jaben [Fri, 20 Apr 2018 15:51:22 +0000 (23:51 +0800)]
BaseTools: GenPatchPcdTable - refactor RegEx to minimize multiple compiling

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoBaseTools: Misc - refactor RegEx to minimize multiple compiling
Carsey, Jaben [Fri, 20 Apr 2018 15:51:21 +0000 (23:51 +0800)]
BaseTools: Misc - refactor RegEx to minimize multiple compiling

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
5 years agoSignedCapsulePkg SystemFirmwareUpdate: Fix typo EFI_SECURITY_VIOLATIO
Star Zeng [Tue, 3 Apr 2018 09:35:06 +0000 (17:35 +0800)]
SignedCapsulePkg SystemFirmwareUpdate: Fix typo EFI_SECURITY_VIOLATIO

Fix typo EFI_SECURITY_VIOLATIO to EFI_SECURITY_VIOLATION.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
5 years agoIntelSiliconPkg MicrocodeUpdate: Fix typo EFI_SECURITY_VIOLATIO
Star Zeng [Tue, 3 Apr 2018 09:33:05 +0000 (17:33 +0800)]
IntelSiliconPkg MicrocodeUpdate: Fix typo EFI_SECURITY_VIOLATIO

Fix typo EFI_SECURITY_VIOLATIO to EFI_SECURITY_VIOLATION.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
5 years agoMdePkg FirmwareManagement.h: Fix typo EFI_SECURITY_VIOLATIO
Star Zeng [Mon, 2 Apr 2018 07:39:04 +0000 (15:39 +0800)]
MdePkg FirmwareManagement.h: Fix typo EFI_SECURITY_VIOLATIO

Fix typo EFI_SECURITY_VIOLATIO to EFI_SECURITY_VIOLATION.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>