]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
7 years agoShellPkg-UefiShellCommandLib: Add EFIAPI in VA_List library function
Shi, Steven [Wed, 3 Aug 2016 09:43:06 +0000 (17:43 +0800)]
ShellPkg-UefiShellCommandLib: Add EFIAPI in VA_List library function

Add EFIAPI in CatPrint library function. Every function which uses
variable list need explicit use EFIAPI to force use MS ABI. This change
is needed to pass CLANG38 build.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Steven Shi <steven.shi@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
7 years agoShellPkg-UefiShellTftpCommandLib: Replace compiler builtin
Shi, Steven [Wed, 3 Aug 2016 09:43:05 +0000 (17:43 +0800)]
ShellPkg-UefiShellTftpCommandLib: Replace compiler builtin

Use explicit CopyMem to replace compiler builtin to do the structure
values assignment. This change is needed to pass CLANG38 build.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Steven Shi <steven.shi@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
7 years agoBaseTools-Conf:Introduce CLANG38 new toolchain for x86
Shi, Steven [Wed, 3 Aug 2016 09:43:04 +0000 (17:43 +0800)]
BaseTools-Conf:Introduce CLANG38 new toolchain for x86

This adds support for LLVM 3.8.x in LTO mode for IA32 and X64.
CLANG38 enable LLVM Link Time Optimization (LTO) and code size
optimization flag (-Oz) by default for aggressive code size
improvement. CLANG38 X64 code is small code model + PIE.

CLANG LTO needs PIE in link flags to generate PIE code correctly,
otherwise the PIE is not really enabled. (e.g. OvmfPkgX64 will
hang in 64bits SEC at high address because of small model code
displacement overflow).

Test pass platforms: OVMF (OvmfPkgIa32.dsc, OvmfPkgX64.dsc and
OvmfPkgIa32X64.dsc).
Test compiler and linker version: LLVM 3.8, GNU ld 2.26.

Example steps to use the CLANG38 tool chain to build OVMF platform:
1. Download and extract the llvm 3.8.0 Pre-Built Binaries from
http://www.llvm.org/releases/ (e.g. http://www.llvm.org/releases/
3.8.0/clang+llvm-3.8.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz and
extract it as ~/clang38).
2. Copy LLVMgold.so from https://github.com/shijunjing/edk2/blob/
llvm/BaseTools/Bin/LLVMgold.so to above clang lib folder (e.g.
~/clang38/lib/LLVMgold.so)
3. Install new version linker with plugin support (e.g. ld 2.26 in
GNU Binutils 2.26 or Ubuntu16.04)
$ cd edk2
$ git checkout llvm
$ export CLANG38_BIN=path/to/your/clang38/
(e.g. export CLANG38_BIN=~/clang38/bin/)
$ source edksetup.sh
$ make -C BaseTools/Source/C
$ build -t CLANG38 -a X64 -p OvmfPkg/OvmfPkgX64.dsc -n 5 -b DEBUG
-DDEBUG_ON_SERIAL_PORT
$ cd edk2/Build/OvmfX64/DEBUG_CLANG38/FV
$ qemu-system-x86_64.exe -bios OVMF.fd -serial file:serial.log -m 4096
 -hda fat:.

If you want, you can build and install GNU Binutils 2.26 as below steps
in Ubuntu:
Download binutils-2.26 source code from http://ftp.gnu.org/gnu/binutils/
 and extract it to ~/binutils-2.26
$sudo apt-get install bison
$sudo apt-get install flex
Install other necessary binutils build tools if missing
$ mkdir build
$ cd build
$ ../binutils-2.26/configure --enable-gold --enable-plugins
--disable-werror --prefix=/usr
$ make -j 5
$ sudo make install

If you want, you can build LLVMgold.so as below steps
Download llvm-3.8.0 source code from http://www.llvm.org/releases/
3.8.0/llvm-3.8.0.src.tar.xz and extract it to ~/llvm-3.8.0.src
Download clang3.8.0 source code from http://www.llvm.org/releases/
3.8.0/cfe-3.8.0.src.tar.xz and extract it to ~/llvm-3.8.0.src/tools/clang
Refer http://clang.llvm.org/get_started.html to Install other necessary
clang build tools if missing
$ mkdir llvm38build
$ cd llvm38build
If your GNU Binutils 2.26 is in /home/jshi19/binutils-2.26,
$ cmake ../llvm-3.8.0.src -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="Release"
-DLLVM_TARGETS_TO_BUILD="X86" -DCMAKE_VERBOSE_MAKEFILE=ON
-DCMAKE_CXX_COMPILER="/usr/bin/g++" -DCMAKE_C_COMPILER="/usr/bin/gcc"
-DLLVM_BINUTILS_INCDIR=/home/jshi19/binutils-2.26/include
$ make -j 5 LLVMgold The LLVMgold.so is in ~/llvm38build/lib/LLVMgold.so

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Steven Shi <steven.shi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoBaseTools-Conf:Remove short dash in ar flag for LLVM
Shi, Steven [Wed, 3 Aug 2016 09:43:03 +0000 (17:43 +0800)]
BaseTools-Conf:Remove short dash in ar flag for LLVM

Both binutils ar and LLVM ar support "cr", but LLVM ar doens't
support add "-" in the flags, and llvm-ar cannot accept "-cr".
So remove the short dash "-" to make llvm archives work.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Steven Shi <steven.shi@intel.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
7 years agoShellPkg/ls: Display the correct directory path
Ruiyu Ni [Mon, 8 Aug 2016 10:21:32 +0000 (18:21 +0800)]
ShellPkg/ls: Display the correct directory path

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Tapan Shah <tapandshah@hpe.com>
7 years agoShellPkg/ls: Fix to support "ls fs0:File.txt"
Ruiyu Ni [Mon, 8 Aug 2016 07:02:44 +0000 (15:02 +0800)]
ShellPkg/ls: Fix to support "ls fs0:File.txt"

“ls fs0:\File.txt" can list the file correctly but
when the backslash is removed from colon, the file cannot
be listed.
The patch fixes this issue.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Tapan Shah <tapandshah@hpe.com>
7 years agoMdePkg: Enhance PathRemoveLastItem() to support "FS0:File.txt"
Ruiyu Ni [Mon, 8 Aug 2016 06:55:10 +0000 (14:55 +0800)]
MdePkg: Enhance PathRemoveLastItem() to support "FS0:File.txt"

The original implementation only looks for very last backslash
and removes the string after that.
But when the path is like "FS0:File.txt" which doesn't contain
backslash, the function cannot work well.
The patch enhances the code to look for very last backslash or
colon to support the path which doesn't contain backslash.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Tapan Shah <tapandshah@hpe.com>
7 years agoShellPkg: Fix FindFiles() to handle "fsx:EFI\BOOT" path
Ruiyu Ni [Fri, 5 Aug 2016 05:12:56 +0000 (13:12 +0800)]
ShellPkg: Fix FindFiles() to handle "fsx:EFI\BOOT" path

When the FilePattern is similar to "fsx:EFI\BOOT", FindFiles()
cannot handle it correctly because it always assumes there is
"\\" after "fsx:".

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Tapan Shah <tapandshah@hpe.com>
7 years agoShellPkg: TAB logic incorrectly shows files in CWD when typing \<TAB>
Ruiyu Ni [Fri, 5 Aug 2016 05:10:11 +0000 (13:10 +0800)]
ShellPkg: TAB logic incorrectly shows files in CWD when typing \<TAB>

It should shows files in root directory of current map.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Tapan Shah <tapandshah@hpe.com>
7 years agoShellPkg: TAB logic incorrectly chops out fs0: when typing fs0:<TAB>
Ruiyu Ni [Fri, 5 Aug 2016 02:24:48 +0000 (10:24 +0800)]
ShellPkg: TAB logic incorrectly chops out fs0: when typing fs0:<TAB>

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Tapan Shah <tapandshah@hpe.com>
7 years agoStdLib/LibC ARM AARCH64: do not redefine compiler intrinsics
Ard Biesheuvel [Mon, 8 Aug 2016 11:03:46 +0000 (13:03 +0200)]
StdLib/LibC ARM AARCH64: do not redefine compiler intrinsics

The memset() function is a compiler intrinsic on AARCH64 and ARM, and
so is memmove() on ARM. Usually, redefining them as LibC currently does
is not a problem since only one version will be selected at link time
from the various static libraries that provide implementations. However,
under LTO, this is slightly different, since explicit references (in the
C code) and implicit references (emitted by the compiler backend) may
resolve to different versions (LTO vs non-LTO), causing conflicts.

So simply omit them for ARM/AARCH64 resp. ARM.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
7 years agoStdLib/LibC: avoid LTO code for compiler intrinsics
Ard Biesheuvel [Mon, 8 Aug 2016 10:46:50 +0000 (12:46 +0200)]
StdLib/LibC: avoid LTO code for compiler intrinsics

The softfloat routines and some other routines supplied by LibC
will satisfy references to compiler intrinsics that are emitted
by the compiler backend, which under LTO means that the link-time
code generation may emit references to symbols that have been
optimized away already.

Work around this by building the ARM and AARCH64 versions of LibC
and the softfloat library without LTO.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Michael Zimmermann <sigmaepsilon92@gmail.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
7 years agoBaseTools ARM: impose strict alignment only for XIP modules
Ard Biesheuvel [Mon, 8 Aug 2016 10:33:06 +0000 (12:33 +0200)]
BaseTools ARM: impose strict alignment only for XIP modules

Given that we only support ARMv7 and up in Tianocore (due to the fact
that the PI spec mandates that the PEI services table pointer be stored
in the TPIDRURW register, which is not available on earlier CPUs), we can
assume that any code executing with the MMU on may perform unaligned
accesses (since the AArch32 bindings in the UEFI spec stipulate that
unaligned accesses should be allowed if supported by the CPU)

So relax the alignment restrictions to XIP modules only, i.e., BASE, SEC,
PEI_CORE and PEIM type modules, exactly like we do for AARCH64 already.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoBaseTools CLANG35: add missing XIP flags for AARCH64
Ard Biesheuvel [Mon, 8 Aug 2016 09:58:59 +0000 (11:58 +0200)]
BaseTools CLANG35: add missing XIP flags for AARCH64

When building for AARCH64, code that may execute with the MMU off should
not perform unaligned accesses, which is why we set -mstrict-align for
BASE, SEC, PEI_CORE and PEIM modules when building with GCCx. However,
this setting is missing from CLANG35 so set it there as well.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoBaseTools/UPT: Fix a install issue
Hess Chen [Mon, 8 Aug 2016 03:28:20 +0000 (11:28 +0800)]
BaseTools/UPT: Fix a install issue

Fix a corner case issue of installing a module without
any files which causes installing UNI file failure

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hess Chen <hesheng.chen@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
7 years agoArmPkg/ArmGicDxe: Fix double GIC EIOR write per interrupt
Alexei Fedorov [Mon, 8 Aug 2016 13:46:00 +0000 (15:46 +0200)]
ArmPkg/ArmGicDxe: Fix double GIC EIOR write per interrupt

This commit fixes a bug in the GIC v2 and v3 drivers where the GICC_EOIR
(End Of Interrupt Register) is written twice for a single interrupt.
GicV(2|3)IrqInterruptHandler() calls the Interrupt Handler and then
GicV(2|3)EndOfInterrupt() on exit:

 InterruptHandler = gRegisteredInterruptHandlers[GicInterrupt];
 if (InterruptHandler != NULL) {
   // Call the registered interrupt handler.
   InterruptHandler (GicInterrupt, SystemContext);
 } else {
   DEBUG ((EFI_D_ERROR, "Spurious GIC interrupt: 0x%x\n", GicInterrupt));
 }

 GicV2EndOfInterrupt (&gHardwareInterruptV2Protocol, GicInterrupt);

although gInterrupt->EndOfInterrupt() can be expected to have already
been called by InterruptHandler() [which is the case for the primary
in-tree handler in TimerDxe]

The fix moves the EndOfInterrupt() call inside the else case for
unregistered/spurious interrupts. This removes a potential race
condition that might have lost interrupts.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Alexei Fedorov <alexei.fedorov@arm.com>
Signed-off-by: Evan Lloyd <evan.lloyd@arm.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
7 years agoIntelFsp2Pkg: Converted PatchFvUserManual from .docx to .md format
Mudusuru, Giri P [Fri, 5 Aug 2016 19:55:29 +0000 (03:55 +0800)]
IntelFsp2Pkg: Converted PatchFvUserManual from .docx to .md format

Converted the the word format of the documentation into markdown format
for PatchFv.py

V2: updated the commit message descripton

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Satya Yarlagadda <satya.p.yarlagadda@intel.com>
Cc: Satya Yarlagadda <satya.p.yarlagadda@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
7 years agoIntelFsp2Pkg: Converted GenCfgOptUserManual from .docx to .md format
Mudusuru, Giri P [Fri, 5 Aug 2016 19:48:20 +0000 (03:48 +0800)]
IntelFsp2Pkg: Converted GenCfgOptUserManual from .docx to .md format

Converted the the word format of the documentation into markdown format
for GenCfgOpt.py

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Satya Yarlagadda <satya.p.yarlagadda@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
7 years agoShellPkg SmbiosView: Show "SocketDesignation" instead of "Socket" for Type 4
Star Zeng [Fri, 5 Aug 2016 03:07:19 +0000 (11:07 +0800)]
ShellPkg SmbiosView: Show "SocketDesignation" instead of "Socket" for Type 4

It is to make the info shown more aligned with SMBIOS spec.

Cc: Amy Chan <amy.chan@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Amy Chan <amy.chan@intel.com>
7 years agoBaseTools X64: fold PLT relocations into simple relative references
Ard Biesheuvel [Thu, 4 Aug 2016 08:39:29 +0000 (10:39 +0200)]
BaseTools X64: fold PLT relocations into simple relative references

For X64/GCC, we use position independent code with hidden visibility
to inform the compiler that symbol references are never resolved at
runtime, which removes the need for PLTs and GOTs. However, in some
cases, GCC has been reported to still emit PLT based relocations, which
we need to handle in the ELF to PE/COFF perform by GenFw.

Unlike GOT based relocations, which are non-trivial to handle since the
indirections in the code can not be fixed up easily (although relocation
types exist for X64 that annotate relocation targets as suitable for
relaxation), PLT relocations simply point to jump targets, and we can
relax such relocations by resolving them using the symbol directly rather
than via a PLT entry that does nothing more than tail call the function
we already know it is going to call (since all symbol references are
resolved in the same module).

So handle R_X86_64_PLT32 as a R_X86_64_PC32 relocation.

Suggested-by: Steven Shi <steven.shi@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoBaseTools/VfrCompile: Add two new option for VfrCompile
Dandan Bi [Mon, 1 Aug 2016 11:18:31 +0000 (19:18 +0800)]
BaseTools/VfrCompile: Add two new option for VfrCompile

1.--autodefault option
   VfrCompile will generate default opcodes for questions if some
   default are missing.
2 --checkdefault option
   VfrCompile will check whether every question has no default or
   has all default. If not, will generate an error to let user know
   the question misses default.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
7 years agoBaseTool/VfrCompile: Add missing question opcode
Dandan Bi [Mon, 1 Aug 2016 11:18:30 +0000 (19:18 +0800)]
BaseTool/VfrCompile: Add missing question opcode

The function CheckQuestionOpCode is to check whether the opcode
is question opcode, but it misses two question opcodes:
'EFI_IFR_REF_OP' and 'EFI_IFR_RESET_BUTTON'. Now add them.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
7 years agoCryptoPkg DSC: Add build option to disable deprecated APIs
Hao Wu [Mon, 1 Aug 2016 06:22:19 +0000 (14:22 +0800)]
CryptoPkg DSC: Add build option to disable deprecated APIs

Add the following definition in the [BuildOptions] section in package DSC
files to disable APIs that are deprecated:

[BuildOptions]
  *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES

Cc: Qin Long <qin.long@intel.com>
Cc: Ting Ye <ting.ye@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Qin Long <qin.long@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
7 years agoUefiCpuPkg DSC: Add build option to disable deprecated APIs
Hao Wu [Mon, 1 Aug 2016 06:15:30 +0000 (14:15 +0800)]
UefiCpuPkg DSC: Add build option to disable deprecated APIs

Add the following definition in the [BuildOptions] section in package DSC
files to disable APIs that are deprecated:

[BuildOptions]
  *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES

Cc: Jeff Fan <jeff.fan@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Feng Tian <feng.tian@Intel.com>
7 years agoSourceLevelDebugPkg DSC: Add build option to disable deprecated APIs
Hao Wu [Mon, 1 Aug 2016 06:14:57 +0000 (14:14 +0800)]
SourceLevelDebugPkg DSC: Add build option to disable deprecated APIs

Add the following definition in the [BuildOptions] section in package DSC
files to disable APIs that are deprecated:

[BuildOptions]
  *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES

Cc: Jeff Fan <jeff.fan@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
7 years agoShellPkg DSC: Add build option to disable deprecated APIs
Hao Wu [Mon, 1 Aug 2016 06:14:22 +0000 (14:14 +0800)]
ShellPkg DSC: Add build option to disable deprecated APIs

Add the following definition in the [BuildOptions] section in package DSC
files to disable APIs that are deprecated:

[BuildOptions]
  *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
7 years agoSecurityPkg DSC: Add build option to disable deprecated APIs
Hao Wu [Mon, 1 Aug 2016 06:13:48 +0000 (14:13 +0800)]
SecurityPkg DSC: Add build option to disable deprecated APIs

Add the following definition in the [BuildOptions] section in package DSC
files to disable APIs that are deprecated:

[BuildOptions]
  *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES

Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
7 years agoPerformancePkg DSC: Add build option to disable deprecated APIs
Hao Wu [Mon, 1 Aug 2016 06:12:14 +0000 (14:12 +0800)]
PerformancePkg DSC: Add build option to disable deprecated APIs

Add the following definition in the [BuildOptions] section in package DSC
files to disable APIs that are deprecated:

[BuildOptions]
  *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES

Cc: Daryl McDaniel <edk2-lists@mc2research.org>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoPcAtChipsetPkg DSC: Add build option to disable deprecated APIs
Hao Wu [Mon, 1 Aug 2016 06:10:57 +0000 (14:10 +0800)]
PcAtChipsetPkg DSC: Add build option to disable deprecated APIs

Add the following definition in the [BuildOptions] section in package DSC
files to disable APIs that are deprecated:

[BuildOptions]
  *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
7 years agoNetworkPkg DSC: Add build option to disable deprecated APIs
Hao Wu [Mon, 1 Aug 2016 06:10:20 +0000 (14:10 +0800)]
NetworkPkg DSC: Add build option to disable deprecated APIs

Add the following definition in the [BuildOptions] section in package DSC
files to disable APIs that are deprecated:

[BuildOptions]
  *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES

Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-By: Wu Jiaxin <jiaxin.wu@intel.com>
7 years agoMdePkg DSC: Add build option to disable deprecated APIs
Hao Wu [Mon, 1 Aug 2016 06:09:43 +0000 (14:09 +0800)]
MdePkg DSC: Add build option to disable deprecated APIs

Add the following definition in the [BuildOptions] section in package DSC
files to disable APIs that are deprecated:

[BuildOptions]
  *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoMdeModulePkg DSC: Add build option to disable deprecated APIs
Hao Wu [Mon, 1 Aug 2016 06:08:54 +0000 (14:08 +0800)]
MdeModulePkg DSC: Add build option to disable deprecated APIs

Add the following definition in the [BuildOptions] section in package DSC
files to disable APIs that are deprecated:

[BuildOptions]
  *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES

Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Feng Tian <feng.tian@Intel.com>
7 years agoIntelFspWrapperPkg DSC: Add build option to disable deprecated APIs
Hao Wu [Mon, 1 Aug 2016 06:08:13 +0000 (14:08 +0800)]
IntelFspWrapperPkg DSC: Add build option to disable deprecated APIs

Add the following definition in the [BuildOptions] section in package DSC
files to disable APIs that are deprecated:

[BuildOptions]
  *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES

Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
7 years agoIntelFspPkg DSC: Add build option to disable deprecated APIs
Hao Wu [Mon, 1 Aug 2016 06:07:36 +0000 (14:07 +0800)]
IntelFspPkg DSC: Add build option to disable deprecated APIs

Add the following definition in the [BuildOptions] section in package DSC
files to disable APIs that are deprecated:

[BuildOptions]
  *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES

Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
7 years agoIntelFsp2WrapperPkg DSC: Add build option to disable deprecated APIs
Hao Wu [Mon, 1 Aug 2016 06:06:31 +0000 (14:06 +0800)]
IntelFsp2WrapperPkg DSC: Add build option to disable deprecated APIs

Add the following definition in the [BuildOptions] section in package DSC
files to disable APIs that are deprecated:

[BuildOptions]
  *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES

Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
7 years agoIntelFsp2Pkg DSC: Add build option to disable deprecated APIs
Hao Wu [Mon, 1 Aug 2016 06:03:58 +0000 (14:03 +0800)]
IntelFsp2Pkg DSC: Add build option to disable deprecated APIs

Add the following definition in the [BuildOptions] section in package DSC
files to disable APIs that are deprecated:

[BuildOptions]
  *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES

Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
7 years agoIntelFrameworkPkg DSC: Add build option to disable deprecated APIs
Hao Wu [Mon, 1 Aug 2016 06:03:03 +0000 (14:03 +0800)]
IntelFrameworkPkg DSC: Add build option to disable deprecated APIs

Add the following definition in the [BuildOptions] section in package DSC
files to disable APIs that are deprecated:

[BuildOptions]
  *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES

Cc: Jeff Fan <jeff.fan@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoIntelFrameworkModulePkg DSC: Add build option to disable deprecated APIs
Hao Wu [Mon, 1 Aug 2016 05:54:48 +0000 (13:54 +0800)]
IntelFrameworkModulePkg DSC: Add build option to disable deprecated APIs

Add the following definition in the [BuildOptions] section in package DSC
files to disable APIs that are deprecated:

[BuildOptions]
  *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES

Cc: Jeff Fan <jeff.fan@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoFatPkg DSC: Add build option to disable deprecated APIs
Hao Wu [Mon, 1 Aug 2016 05:50:50 +0000 (13:50 +0800)]
FatPkg DSC: Add build option to disable deprecated APIs

Add the following definition in the [BuildOptions] section in package DSC
files to disable APIs that are deprecated:

[BuildOptions]
  *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
7 years agoBaseTools: Fix the bug when use FILE_GUID override the module in DSC
Yonghong Zhu [Wed, 3 Aug 2016 09:09:18 +0000 (17:09 +0800)]
BaseTools: Fix the bug when use FILE_GUID override the module in DSC

In last commit 2502b73, it doesn't cover the case that in the DSC file
use FILE_GUID to override the module.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoBaseTools: Allow string token identifier to use lower case letters
Yonghong Zhu [Tue, 2 Aug 2016 09:21:34 +0000 (17:21 +0800)]
BaseTools: Allow string token identifier to use lower case letters

This patch is to align the code behavior with UNI spec that string token
identifier can use upper case and lower case letters.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Felix <Felixp@ami.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoIntelFsp2Pkg: Only include required header files in FspEas.h
Maurice Ma [Fri, 5 Aug 2016 03:56:57 +0000 (20:56 -0700)]
IntelFsp2Pkg: Only include required header files in FspEas.h

Current FspEas.h file includes Uefi.h which also refers to lots of other
UEFI header files not used by FSP consumer. It caused many unnecessary
header file overhead for a bootloader that consumes FSP, such as coreboot.
This change reduces the required header file number down to 3.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
Reviewed by: Giri P Mudusuru <giri.p.mudusuru@intel.com>

7 years agoBaseTools GCC/ARM: add -fno-builtin to CC flags
Ard Biesheuvel [Thu, 4 Aug 2016 14:39:59 +0000 (16:39 +0200)]
BaseTools GCC/ARM: add -fno-builtin to CC flags

Avoid build errors when including OpensslLib, which may throw
undefined reference errors for builtin functions if -fno-builtin
is not specified (and it is already set for IA32, X64 and AARCH64)
So set it for ARM as well.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoArmPkg/CompilerIntrinsicsLib: make the default memset() weak
Ard Biesheuvel [Thu, 4 Aug 2016 14:37:13 +0000 (16:37 +0200)]
ArmPkg/CompilerIntrinsicsLib: make the default memset() weak

The ARM compiler intrinsics library defines __aeabi_memset() and
memset() in the same object, which means that both will be pulled
in if either is referenced.

The IntrinsicLib in CryptoPkg defines its own, preferred memset(),
which may clash with our memset(). So make our version weak.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
7 years agoArmPkg/ArmSoftFloatLib: disable LTO build for GCC
Ard Biesheuvel [Thu, 4 Aug 2016 14:32:16 +0000 (16:32 +0200)]
ArmPkg/ArmSoftFloatLib: disable LTO build for GCC

Building ArmSoftFloatLib with LTO results in errors like

  .../bin/ld: softfloat.obj: plugin needed to handle lto object
  .../bin/ld: __aeabi_dcmpge.obj: plugin needed to handle lto object
  .../bin/ld: __aeabi_dcmplt.obj: plugin needed to handle lto object
  .../bin/ld: internal error ../../ld/ldlang.c 6299

This library is only linked by OpensslLib at the moment, and only
marginally used at runtime, so just disable LTO for it.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
7 years agoArmPlatformPkg: change PcdBdsLinuxSupport default value
Daniil Egranov [Wed, 3 Aug 2016 23:10:48 +0000 (18:10 -0500)]
ArmPlatformPkg: change PcdBdsLinuxSupport default value

The built-in Linux Loader is obsolete and not included in most builds.
The patch sets the PcdBdsLinuxSupport default value to FALSE and prevents
ArmBds from looking for built-in Linux Loader by default and ASSERTing
when it cannot be found. Platforms which still using built-in loader have
to set this PCD in their platform description file.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daniil Egranov <daniil.egranov@arm.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
7 years agoCorebootModulePkg/SecCore: Adding NASM files in SecCore module
Ma, Maurice [Tue, 2 Aug 2016 19:56:56 +0000 (12:56 -0700)]
CorebootModulePkg/SecCore: Adding NASM files in SecCore module

Ported MASM/GAS assembly files into NASM files and updated the inf
file to refer to NASM files.

This change has been tested with GCC 4.8 and VS2013 build.

Cc: Prince Agyeman <prince.agyeman@intel.com>
Cc: Lee Leahy <leroy.p.leahy@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
Reviewed-by: Prince Agyeman <prince.agyeman@intel.com>
7 years agoBaseTools GCC: add the compiler flags to the linker command line
Ard Biesheuvel [Tue, 2 Aug 2016 14:31:26 +0000 (16:31 +0200)]
BaseTools GCC: add the compiler flags to the linker command line

Now that we invoke GCC as the linker for the GCC toolchain family,
we can pass the CC flags to the linker as well. This is only
required for LTO (which may involve code generation during the link
stage), but does not interfere with non-LTO builds.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoBaseTools GCC5: disable warnings-as-errors for now
Ard Biesheuvel [Tue, 2 Aug 2016 14:15:31 +0000 (16:15 +0200)]
BaseTools GCC5: disable warnings-as-errors for now

GCC5 runs in LTO mode, which means it may generate code from an
intermediate representation during the link stage, at which time
additional diagnostics are run that may emit warnings.

Some of these warnings seem to be spurious, e.g., the following
warning which is emitted when building OVMF for IA32 or ArmVirtQemu
for ARM (but not for X64 resp. AARCH64)

  .../MdeModulePkg/Library/UefiHiiLib/HiiLib.c:
                 In function 'HiiCreateGuidOpCode.constprop':
  .../MdeModulePkg/Library/UefiHiiLib/HiiLib.c:3228:10:
                 error: function may return address of local variable
                                            [-Werror=return-local-addr]
     return (UINT8 *)OpCodePointer;
            ^
  .../MdeModulePkg/Library/UefiHiiLib/HiiLib.c:3208:17: note: declared here
     EFI_IFR_GUID  OpCode;
                   ^
  lto1: all warnings being treated as errors
  lto-wrapper: fatal error: gcc returned 1 exit status

So before adding the contents of CC_FLAGS to the linker command line,
defuse the default '-Werror' by adding '-Wno-error' to DLINK2_FLAGS
for GCC5.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoBaseTools GCC: move -c compiler flag to build rules
Ard Biesheuvel [Tue, 2 Aug 2016 13:38:58 +0000 (15:38 +0200)]
BaseTools GCC: move -c compiler flag to build rules

In order to be able to share the compiler flags with the linker (which
is required for LTO since it involves the linker doing code generation
based on the LTO bytecode), move the -c GCC argument to the build rules,
and drop it from the GCC CC_FLAGS definitions in tools_def.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoArmVirtPkg ARM: make relocatable PrePi users build with CLANG35
Ard Biesheuvel [Wed, 3 Aug 2016 08:11:29 +0000 (10:11 +0200)]
ArmVirtPkg ARM: make relocatable PrePi users build with CLANG35

The clang developers have made a backward incompatible change to the
command line arguments, and have replaced '-mllvm -arm-use-movt=0'
with '-mno-movt'. This does not matter for most ARM platforms, and
therefore it has been removed from the default CLANG35/ARM CC flags
in patch 1c63516075b3 ("BaseTools CLANG35: drop problematic use-movt
and save-temps options"), but as it turns out, the relocatable PrePi
implementation used by ArmVirtQemuKernel and ArmVirtXen will fail to
build if it contains MOVT/MOVW pairs, due to the fact that these are
not runtime relocatable under ELF.

Since they are runtime relocatable under PE/COFF, and GenFw does the
right thing when encountering them, selectively controlling their
use is more appropriate than disabling them altogether. Therefore,
this patch adds the -mno-movt argument only for the platforms that
use the relocatable PrePi, and only for the module types that may
be pulled into its build.

In addition, switch to the SEC type version of ArmLib, so that
the relocatable PrePi only depends on BASE and SEC type libraries.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
7 years agoEmbeddedPkg: make PrePiMemoryAllocationLib a SEC type library
Ard Biesheuvel [Wed, 3 Aug 2016 08:10:17 +0000 (10:10 +0200)]
EmbeddedPkg: make PrePiMemoryAllocationLib a SEC type library

This library is only used by the various PrePi implementations, all of
which are of type SEC. So make this library SEC as well. This may affect
the build options used by the platform.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
7 years agoVlv2TbltDevicePkg/FvbRuntimeDxe: Remove unused variables
Gary Lin [Fri, 22 Jul 2016 09:47:12 +0000 (17:47 +0800)]
Vlv2TbltDevicePkg/FvbRuntimeDxe: Remove unused variables

Fix the following errors from gcc:

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

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

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

Cc: David Wei <david.wei@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
7 years agoMdeModulePkg LoadFileOnFv2: Fix the potential NULL pointer access
Liming Gao [Tue, 2 Aug 2016 05:37:55 +0000 (13:37 +0800)]
MdeModulePkg LoadFileOnFv2: Fix the potential NULL pointer access

Check NULL pointer before access it.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoMdeModulePkg LoadFileOnFv2: Correct copy right format
Liming Gao [Tue, 2 Aug 2016 02:33:53 +0000 (10:33 +0800)]
MdeModulePkg LoadFileOnFv2: Correct copy right format

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoMdeModulePkg UefiBootManagerLib: Fix VS2012 build failure
Liming Gao [Tue, 2 Aug 2016 02:26:50 +0000 (10:26 +0800)]
MdeModulePkg UefiBootManagerLib: Fix VS2012 build failure

Initialize local variable Description as NULL first.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoVlv2TbltDevicePkg/PpmPolicy: Remove the unused variable
Gary Lin [Fri, 29 Jul 2016 03:25:38 +0000 (11:25 +0800)]
Vlv2TbltDevicePkg/PpmPolicy: Remove the unused variable

Fix the following error from gcc:

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

Cc: David Wei <david.wei@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
Reviewed-by: David Wei <david.wei@intel.com>
7 years agoVlv2TbltDevicePkg/PpmPolicy: Remove the usage of global variables
Gary Lin [Fri, 29 Jul 2016 03:25:37 +0000 (11:25 +0800)]
Vlv2TbltDevicePkg/PpmPolicy: Remove the usage of global variables

gcc issued the error of "multiple deifintion" since gBS was also defined
in MdePkg/Library/UefiBootServicesTableLib. Actually those global variables,
gBS, pBS, and pRS, in PpmPolicy.h were only used in one function. Besides,
gBS and pRS were not really used. Remove gBS and pRS and declare pBS in
PpmPolicyEntry() to satisfy gcc.

Cc: David Wei <david.wei@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
Reviewed-by: David Wei <david.wei@intel.com>
7 years agoVlv2TbltDevicePkg/SmBiosMiscDxe: Remove unused variables
Gary Lin [Fri, 29 Jul 2016 03:25:36 +0000 (11:25 +0800)]
Vlv2TbltDevicePkg/SmBiosMiscDxe: Remove unused variables

Fix the following errors from gcc:

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

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

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

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

Cc: David Wei <david.wei@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
Reviewed-by: David Wei <david.wei@intel.com>
7 years agoVlv2TbltDevicePkg/Wpce791: Remove the unused variable
Gary Lin [Fri, 29 Jul 2016 03:25:35 +0000 (11:25 +0800)]
Vlv2TbltDevicePkg/Wpce791: Remove the unused variable

Fix the following error from gcc:

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

Cc: David Wei <david.wei@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
7 years agoVlv2TbltDevicePkg/PlatformDxe: Remove the unused variables
Gary Lin [Fri, 29 Jul 2016 03:25:34 +0000 (11:25 +0800)]
Vlv2TbltDevicePkg/PlatformDxe: Remove the unused variables

Fix the following errors from gcc:

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

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

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

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

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

Cc: David Wei <david.wei@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
Reviewed-by: David Wei <david.wei@intel.com>
7 years agoVlv2TbltDevicePkg/VlvPlatformInitDxe: Remove unused variables
Gary Lin [Fri, 29 Jul 2016 03:25:33 +0000 (11:25 +0800)]
Vlv2TbltDevicePkg/VlvPlatformInitDxe: Remove unused variables

Fix the following errors from gcc:

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

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

Cc: David Wei <david.wei@intel.com>
Cc: "Wu, Hao A" <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
Reviewed-by: David Wei <david.wei@intel.com>
7 years agoVlv2TbltDevicePkg/PlatformSetupDxe: Remove the unused variables
Gary Lin [Fri, 29 Jul 2016 03:25:32 +0000 (11:25 +0800)]
Vlv2TbltDevicePkg/PlatformSetupDxe: Remove the unused variables

Fix the following errors from gcc:

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

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

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

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

Cc: David Wei <david.wei@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
7 years agoVlv2DeviceRefCodePkg/ValleyView2Soc: Remove the unused code
Gary Lin [Fri, 29 Jul 2016 03:25:30 +0000 (11:25 +0800)]
Vlv2DeviceRefCodePkg/ValleyView2Soc: Remove the unused code

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

Cc: David Wei <david.wei@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
7 years agoVlv2TbltDevicePkg/PlatformGopPolicy: include UefiBootServicesTableLib.h
Gary Lin [Fri, 29 Jul 2016 03:25:29 +0000 (11:25 +0800)]
Vlv2TbltDevicePkg/PlatformGopPolicy: include UefiBootServicesTableLib.h

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

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

Suggested-by: David Wei <david.wei@intel.com>
Cc: David Wei <david.wei@intel.com>
Cc: "Wu, Hao A" <hao.a.wu@intel.com>
Cc: "Lu, ShifeiX A" <shifeix.a.lu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
7 years agoVlv2TbltDevicePkg/AcpiPlatform: Amend the declaration of mGlobalNvsArea
Gary Lin [Fri, 29 Jul 2016 03:25:28 +0000 (11:25 +0800)]
Vlv2TbltDevicePkg/AcpiPlatform: Amend the declaration of mGlobalNvsArea

mGlobalNvsArea wasn't declared as extern in AcpiPlatform.h and the header
was included in AcpiPlatform.c and AcpiPlatformHooks.c. Although it's
declared as extern in AcpiPlatformHooks.c, gcc still created an instance
of mGlobalNvsArea in AcpiPlatformHooks.c since the header was expanded
first and then the linker complained "multiple definition". This commit
rearrange the delaration of mGlobalNvsArea to satisfy gcc.

Cc: David Wei <david.wei@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
Reviewed-by: David Wei <david.wei@intel.com>
7 years agoVlv2TbltDevicePkg/AcpiPlatform: Remove unused variables
Gary Lin [Fri, 29 Jul 2016 03:25:27 +0000 (11:25 +0800)]
Vlv2TbltDevicePkg/AcpiPlatform: Remove unused variables

Fix the following errors from gcc:

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

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

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

Cc: David Wei <david.wei@intel.com>
Cc: "Wu, Hao A" <hao.a.wu@intel.com>
Cc: "Lu, ShifeiX A" <shifeix.a.lu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
Reviewed-by: David Wei <david.wei@intel.com>
7 years agoVlv2TbltDevicePkg/PlatformInitPei: Suppress the gcc error message
Gary Lin [Fri, 29 Jul 2016 03:25:26 +0000 (11:25 +0800)]
Vlv2TbltDevicePkg/PlatformInitPei: Suppress the gcc error message

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@intel.com>
Cc: "Wu, Hao A" <hao.a.wu@intel.com>
Cc: "Lu, ShifeiX A" <shifeix.a.lu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
Reviewed-by: David Wei <david.wei@intel.com>
7 years agoVlv2TbltDevicePkg/PlatformInitPei: Remove the unused variables
Gary Lin [Fri, 29 Jul 2016 03:25:25 +0000 (11:25 +0800)]
Vlv2TbltDevicePkg/PlatformInitPei: Remove the unused variables

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@intel.com>
Cc: "Lu, ShifeiX A" <shifeix.a.lu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
7 years agoVlv2TbltDevicePkg/PlatformBdsLib: Remove the unused variable
Gary Lin [Fri, 29 Jul 2016 03:25:24 +0000 (11:25 +0800)]
Vlv2TbltDevicePkg/PlatformBdsLib: Remove the unused variable

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@intel.com>
Cc: "Wu, Hao A" <hao.a.wu@intel.com>
Cc: "Lu, ShifeiX A" <shifeix.a.lu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
Reviewed-by: David Wei <david.wei@intel.com>
7 years agoVlv2TbltDevicePkg/PlatformPei: Remove the unused variable
Gary Lin [Fri, 29 Jul 2016 03:25:23 +0000 (11:25 +0800)]
Vlv2TbltDevicePkg/PlatformPei: Remove the unused variable

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@intel.com>
Cc: "Wu, Hao A" <hao.a.wu@intel.com>
Cc: "Lu, ShifeiX A" <shifeix.a.lu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
Reviewed-by: David Wei <david.wei@intel.com>
7 years agoVlv2TbltDevicePkg/MultiPlatformLib: Remove the unused variables
Gary Lin [Fri, 29 Jul 2016 03:25:22 +0000 (11:25 +0800)]
Vlv2TbltDevicePkg/MultiPlatformLib: Remove the unused variables

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@intel.com>
Cc: "Wu, Hao A" <hao.a.wu@intel.com>
Cc: "Lu, ShifeiX A" <shifeix.a.lu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
Reviewed-by: David Wei <david.wei@intel.com>
7 years agoVlv2TbltDevicePkg: Only define MDEPKG_NDEBUG for gcc release build
Gary Lin [Fri, 29 Jul 2016 03:25:21 +0000 (11:25 +0800)]
Vlv2TbltDevicePkg: Only define MDEPKG_NDEBUG for gcc release build

We only enable "-Wno-unused-but-set-variable" for the release build
and gcc would complain that the varible passed to ASSERT_EFI_ERROR
wasn't used in the debug build. Just don't define MDEPKG_NDEBUG for
the debug build to make gcc happy with ASSERT_EFI_ERROR.

Suggested-by: Laszlo Ersek <lersek@redhat.com>
Cc: David Wei <david.wei@intel.com>
CC: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
7 years agoVlv2TbltDevicePkg: Amend the build script
Gary Lin [Fri, 29 Jul 2016 03:25:20 +0000 (11:25 +0800)]
Vlv2TbltDevicePkg: Amend the build script

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

Cc: David Wei <david.wei@intel.com>
Cc: "Wu, Hao A" <hao.a.wu@intel.com>
Cc: "Lu, ShifeiX A" <shifeix.a.lu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
Reviewed-by: David Wei <david.wei@intel.com>
7 years agoBaseTool/Upt: Avoid UNI file name conflict
Hess Chen [Fri, 29 Jul 2016 06:09:00 +0000 (14:09 +0800)]
BaseTool/Upt: Avoid UNI file name conflict

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

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hess Chen <hesheng.chen@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
7 years agoBaseTool/UPT: Not expand macro for UserExtension
Hess Chen [Mon, 1 Aug 2016 15:25:34 +0000 (23:25 +0800)]
BaseTool/UPT: Not expand macro for UserExtension

All MACRO values defined by the DEFINE statements
n any section (except [Userextensions] sections
other than TianoCore."ExtraFiles) of the INF or
DEC file must be expanded before processing of the file.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hess Chen <hesheng.chen@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
7 years agoBaseTool/Upt: Add support for Private
Hess Chen [Fri, 29 Jul 2016 02:30:56 +0000 (10:30 +0800)]
BaseTool/Upt: Add support for Private

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: Hess Chen <hesheng.chen@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
7 years agoBaseTool/UPT: Add Test Install
Hess Chen [Fri, 29 Jul 2016 07:58:23 +0000 (15:58 +0800)]
BaseTool/UPT: Add Test Install

Add a new function to test if a DIST file list
one by one to see if they can meet the requirement
of Dependency.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hess Chen <hesheng.chen@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
7 years agoMdeModulePkg/UsbMass: Not retry if usb bot transfer execution fail
Feng Tian [Tue, 19 Jul 2016 05:56:03 +0000 (13:56 +0800)]
MdeModulePkg/UsbMass: Not retry if usb bot transfer execution fail

The retry mechanism will bring issue if the usb device is unplugged
from XHCI HC but s/w is trying to access it through BlockIo. The
current cmd will get device error return status, but the sequential
cmds will be timeout. This behavior will cause system unresponsive
for a long while and bring bad user experience.

So we break the retry loop if found device error.

Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
7 years agoMdeModulePkg: add generic SataController driver.
Feng Tian [Tue, 19 Jul 2016 05:57:49 +0000 (13:57 +0800)]
MdeModulePkg: add generic SataController driver.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Reviewed-by: Amy Chan <amy.chan@intel.com>
7 years agoMdeModulePkg/FvSimpleFileSystem: fix assertions when FV is empty
Feng Tian [Tue, 2 Aug 2016 08:07:23 +0000 (16:07 +0800)]
MdeModulePkg/FvSimpleFileSystem: fix assertions when FV is empty

The original code will assert when dealing with those empty FVs.
The fix is used to solve this bug.

Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
7 years agoMdePkg: Add DmaRemappingReportingTable.h
Giri P Mudusuru [Mon, 1 Aug 2016 23:16:30 +0000 (16:16 -0700)]
MdePkg: Add DmaRemappingReportingTable.h

DMA Remapping Reporting (DMAR) ACPI table definitions from Intel(R)
Virtualization Technology for Directed I/O (VT-D) Architecture
Specification v2.4 dated June 2016.

This replaces the DMARemappingReportingTable.h from
EdkCompatibilityPkg\Foundation\Include\IndustryStandard

Patch V2: added below defines and re-arranged the file.
  EFI_ACPI_DMAR_DRHD_FLAGS_INCLUDE_PCI_ALL
  EFI_ACPI_DMAR_ATSR_FLAGS_ALL_PORTS

Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
7 years agoSecurityPkg OpalPasswordDxe: Fix buffer overflow issue.
Dong, Eric [Tue, 2 Aug 2016 11:32:30 +0000 (19:32 +0800)]
SecurityPkg OpalPasswordDxe: Fix buffer overflow issue.

In current code, PSID is processed as string and the length is 0x20.
Current code only reserved 0x20 length buffer for it, no extra buffer
for the '\0'. When driver call UnicodeStrToAsciiStrS to convert PSID,
it search the '\0' for the end. So extra dirty data saved in PSID
info which caused PSID revert action failed. This patch reserved
extra 1 byte data for the '\0'.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
7 years agoOvmfPkg: use StatusCode Router and Handler from MdeModulePkg
Cinnamon Shia [Tue, 2 Aug 2016 17:25:10 +0000 (01:25 +0800)]
OvmfPkg: use StatusCode Router and Handler from MdeModulePkg

In the Platform Init v1.4a spec,
- Volume 1 "4.7 Status Code Service" defines the
  EFI_PEI_SERVICES.ReportStatusCode() service,
- Volume 1 "6.3.5 Status Code PPI (Optional)" defines the
  EFI_PEI_PROGRESS_CODE_PPI (equivalent to the above),
- Volume 2 "14.2 Status Code Runtime Protocol" defines the
  EFI_STATUS_CODE_PROTOCOL.

These allow PEIMs and DXE (and later) modules to report status codes.

Currently OvmfPkg uses modules from under
"IntelFrameworkModulePkg/Universal/StatusCode/", which produce the above
abstractions (PPI and PROTOCOL) directly, and write the status codes, as
they are reported, to the serial port or to a memory buffer. This is
called "handling" the status codes.

In the Platform Init v1.4a spec,
- Volume 3 "7.2.2 Report Status Code Handler PPI" defines
  EFI_PEI_RSC_HANDLER_PPI,
- Volume 3 "7.2.1 Report Status Code Handler Protocol" defines
  EFI_RSC_HANDLER_PROTOCOL.

These allow several PEIMs and runtime DXE drivers to register callbacks
for status code handling.

MdeModulePkg offers a PEIM under
"MdeModulePkg/Universal/ReportStatusCodeRouter/Pei" that produces both
EFI_PEI_PROGRESS_CODE_PPI and EFI_PEI_RSC_HANDLER_PPI, and a runtime DXE
driver under "MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe"
that produces both EFI_STATUS_CODE_PROTOCOL and EFI_RSC_HANDLER_PROTOCOL.

MdeModulePkg also offers status code handler modules under
MdeModulePkg/Universal/StatusCodeHandler/ that depend on
EFI_PEI_RSC_HANDLER_PPI and EFI_RSC_HANDLER_PROTOCOL, respectively.

The StatusCodeHandler modules register themselves with
ReportStatusCodeRouter through EFI_PEI_RSC_HANDLER_PPI /
EFI_RSC_HANDLER_PROTOCOL. When another module reports a status code
through EFI_PEI_PROGRESS_CODE_PPI / EFI_STATUS_CODE_PROTOCOL, it reaches
the phase-matching ReportStatusCodeRouter module first, which in turn
passes the status code to the pre-registered, phase-matching
StatusCodeHandler module.

The status code handling in the StatusCodeHandler modules is identical to
the one currently provided by the IntelFrameworkModulePkg modules. Replace
the IntelFrameworkModulePkg modules with the MdeModulePkg ones, so we can
decrease our dependency on IntelFrameworkModulePkg.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Cinnamon Shia <cinnamon.shia@hpe.com>
Suggested-by: Liming Gao <liming.gao@intel.com>
Fixes: https://tianocore.acgmultimedia.com/show_bug.cgi?id=63
[jordan.l.justen@intel.com: point out IntelFareworkModulePkg typos]
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
[lersek@redhat.com: rewrap to 74 cols; fix IntelFareworkModulePkg typos]
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
7 years agoIntelFsp2Pkg: Locate FSP Info Header dynamically
Yarlagadda, Satya P [Mon, 1 Aug 2016 11:41:34 +0000 (19:41 +0800)]
IntelFsp2Pkg: Locate FSP Info Header dynamically

we need to locate the FSP Info Header by calculating offset dynamically to
handle the scenario of FSP component is being rebased to different location.

Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Satya Yarlagadda <satya.p.yarlagadda@intel.com>
Reviewed-by: Maurice Ma <maurice.ma@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
7 years agoArmVirtPkg/ArmVirtPrePiUniCoreRelocatable: deal with relaxed XIP alignment
Ard Biesheuvel [Tue, 2 Aug 2016 10:08:03 +0000 (12:08 +0200)]
ArmVirtPkg/ArmVirtPrePiUniCoreRelocatable: deal with relaxed XIP alignment

Commit b89919ee8f8c ("BaseTools AARCH64: override XIP module linker
alignment to 32 bytes") updated the various AARCH64 toolchain definitions
to allow SEC, PEI_CORE and PEIM modules to be built with minimal alignment
requirements even when using the AArch64 small code model which normally
requires 4 KB section alignment.

This involves conversion of ADRP instructions into ADR instructions, which
can only be done reliably if the ELF and the PE/COFF sections appear at
the same offset modulo 4 KB.

The ArmVirtPrePiUniCoreRelocatable linker script did not yet take this
into account, so update it by starting the .text section at the next
appropriately aligned offset PECOFF_HEADER_SIZE bytes into the image.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Laszlo Ersek <lersek@redhat.com>
7 years agoBaseTools: Keep the Pcd order in the Asbuilt Inf is same with Source
Yonghong Zhu [Tue, 26 Jul 2016 07:17:15 +0000 (15:17 +0800)]
BaseTools: Keep the Pcd order in the Asbuilt Inf is same with Source

The original behavior is that in the Asbuilt inf Pcd's order is base on
the Pcd's offset. Now we change the order to keep it is same with the Pcd
order in the source inf file.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoShellBinPkg Arm/AArch64 Shell binary update
Ard Biesheuvel [Tue, 2 Aug 2016 09:16:44 +0000 (11:16 +0200)]
ShellBinPkg Arm/AArch64 Shell binary update

The binaries of ShellBinPkg are generated with ShellPkg from b89919ee8f8c
("BaseTools AARCH64: override XIP module linker alignment to 32 bytes")

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Tested-by: Leif Lindholm <leif.lindholm@linaro.org> # AArch64
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> # ARM
7 years agoBaseTools AARCH64: override XIP module linker alignment to 32 bytes
Ard Biesheuvel [Wed, 27 Jul 2016 10:08:20 +0000 (12:08 +0200)]
BaseTools AARCH64: override XIP module linker alignment to 32 bytes

Now that GenFw converts small code model ADRP instructions to ADR on
the fly, we can reduce the alignment for XIP modules, where large
alignment values may cause considerable waste of flash space due to
excessive padding. This limits the module size to 1 MB, but this is
not a concern in practice.

So set the XIP section alignment to 0x20 for DEBUG_GCC49, DEBUG_GCC5
and *_CLANG35, all of which use the small code model.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
7 years agoBaseTools/GenFw AARCH64: convert ADRP to ADR instructions if binary size allows it
Ard Biesheuvel [Tue, 26 Jul 2016 14:37:37 +0000 (16:37 +0200)]
BaseTools/GenFw AARCH64: convert ADRP to ADR instructions if binary size allows it

The ADRP instruction in the AArch64 ISA requires the link time and load time
offsets of a binary to be equal modulo 4 KB. The reason is that this instruction
always produces a multiple of 4 KB, and relies on a subsequent ADD or LDR
instruction to set the offset into the page. The resulting symbol reference
only produces the correct value if the symbol in question resides at that
exact offset into the page, and so loading the binary at arbitrary offsets
is not possible.

Due to the various levels of padding when packing FVs into FVs into FDs, this
alignment is very costly for XIP code, and so we would like to relax this
alignment requirement if possible.

Given that symbols that are sufficiently close (within 1 MB) of the reference
can also be reached using an ADR instruction which does not suffer from this
alignment issue, let's replace ADRP instructions with ADR after linking if
the offset can be encoded in this instruction's immediate field. Note that
this only makes sense if the section alignment is < 4 KB. Otherwise,
replacing the ADRP has no benefit, considering that the subsequent ADD or
LDR instruction is retained, and that micro-architectures are more likely
to be optimized for ADRP/ADD pairs (i.e., via micro op fusing) than for
ADR/ADD pairs, which are non-typical.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
7 years agoBaseTools GCC: introduce GCC5 toolchain to support GCC v5.x in LTO mode
Ard Biesheuvel [Sun, 17 Jul 2016 21:20:10 +0000 (23:20 +0200)]
BaseTools GCC: introduce GCC5 toolchain to support GCC v5.x in LTO mode

This adds support for GCC 5.x in LTO mode for IA32, X64, ARM and
AARCH64. Due to the fact that the GCC project switched to a new
numbering scheme where the first digit is now incremented for every
major release, the new toolchain is simply called 'GCC5', and is
intended to support all GCC v5.x releases.

Since IA32 and X64 enable compiler optimizations (-Os) for both DEBUG
and RELEASE builds, LTO support is equally enabled for both targets.
On ARM and AARCH64, DEBUG builds are not optimized, and so the LTO
optimizations are only enabled for RELEASE.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoBaseTools GCC: drop GNU notes section from EFI image
Ard Biesheuvel [Wed, 27 Jul 2016 09:13:58 +0000 (11:13 +0200)]
BaseTools GCC: drop GNU notes section from EFI image

Recent versions of GNU ld automatically emit a .notes section into
the ELF binary containing a build id. Since this is an allocatable
section by default, it will be identified by GenFw as a section
that requires PE/COFF conversion, which may cause sections to be
moved around unexpectedly.

So retain the section, but tag it as INFO, which tells the linker
that it should not be accounted for in the binary's memory layout.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoArmPkg: add prebuilt glue binaries for GCC5 LTO support
Ard Biesheuvel [Mon, 18 Jul 2016 10:19:34 +0000 (12:19 +0200)]
ArmPkg: add prebuilt glue binaries for GCC5 LTO support

GCC in LTO mode interoperates poorly with non-standard libraries that
provide implementations of compiler intrinsics such as memcpy/memset
or the stack protector entry points. Such libraries need to be built
in non-LTO mode, and then referenced explicitly on the linker command
line using a -plugin-opt=-pass-through=-lxxx linker option.

However, if these intrinsics are also referenced directly, the LTO
version of the code will be pulled in, and will happily satisfy all
other references to the same symbol.

So add a pair of glue libraries, for ARM and AARCH64, that reference
the known intrinsics. Since the binaries live under ArmPkg directly,
we can reference them in tools_def.txt. Under LD garbage collection,
the object itself will be pruned, and so will the intrinsics that end
up unused by the module.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
7 years agoBaseTools GCC: use 'gcc' as the linker command for GCC44 and later
Ard Biesheuvel [Sat, 23 Jul 2016 08:19:46 +0000 (10:19 +0200)]
BaseTools GCC: use 'gcc' as the linker command for GCC44 and later

To accommodate upcoming GCCx toolchain versions that require 'gcc' to
be used as the linker in order to support LTO, switch GCC44 and later
(including CLANG35) to a new DLINK build rule that invokes 'gcc' as the
linker instead of 'ld'. Since gcc expects its command line arguments in
a different format, and expects arguments that it needs to pass to the
linker to be prefixed with '-Wl,', this involves changes to most of the
DLINK_FLAGS definitions in tools_def.template, as well as some changes to
module .INF files that set their own linker options.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoBaseTools UNIXGCC ELFGCC CYGGCC: clone GCC build rule family into GCCLD
Ard Biesheuvel [Sat, 23 Jul 2016 06:18:31 +0000 (08:18 +0200)]
BaseTools UNIXGCC ELFGCC CYGGCC: clone GCC build rule family into GCCLD

Before we can make non-backward compatible changes to the GCC build rules
regarding the use of the 'gcc' binary as the linker, clone the existing
GCC build rules into a 'GCCLD' build rule family, and move the legacy
toolchains UNIXGCC, CYGGCC, CYGGCCxASL and ELFGCC over to it.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoArmVirtPkg/ArmVirtPrePiUniCoreRelocatable: ignore .hash and .note sections
Ard Biesheuvel [Sat, 23 Jul 2016 08:14:11 +0000 (10:14 +0200)]
ArmVirtPkg/ArmVirtPrePiUniCoreRelocatable: ignore .hash and .note sections

Newer versions of ld automatically emit .gnu.hash and .note.gnu.build-id
sections, which are not listed in the linker script, and will end up
breaking the build with an allocation conflict, e.g.,

  /usr/bin/aarch64-linux-gnu-ld: section .note.gnu.build-id loaded at
    [0000000000000000,0000000000000023] overlaps section .text loaded at
    [0000000000000000,0000000000017dbf]

Since we don't require or care about these sections, update the linker
script so that they are discarded. Note that this involves emitting the
.note.gnu.build-id section into a non-allocatable segment to prevent the
linker from noticing that it is being discarded (and subsequently
complaining about it)

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
7 years agoBaseTools CLANG35: drop problematic use-movt and save-temps options
Ard Biesheuvel [Sat, 23 Jul 2016 07:38:14 +0000 (09:38 +0200)]
BaseTools CLANG35: drop problematic use-movt and save-temps options

Some versions of Clang fail on every input file when using the
-save-temps options, and produces the following heplful error message:

  <unknown>:0: error: Undefined temporary symbol

Simply dropping the option for CLANG35 is the simplest way around this,
since the value of storing .i and .s files is dubious anyway.

Also, drop the arm-use-movt option, which does not appear to be
supported anymore by recent versions of clang.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
7 years agoMdePkg: move to 'hidden' visibility for all symbols under GCC/X64
Ard Biesheuvel [Mon, 1 Aug 2016 06:48:02 +0000 (08:48 +0200)]
MdePkg: move to 'hidden' visibility for all symbols under GCC/X64

When using GCC to build for X64, we switched to the position independent
small code model, which is much more efficient in terms of code generation
and runtime relocation footprint, and produces binaries that can execute
correctly from any offset.

However, the PIC routines are by default geared towards hosted binaries
containing symbol references that may resolve to definitions in other
dynamic objects, and for this reason, most symbol references are indirected
via a GOT entry (which also results in a .reloc fixup entry) unless we
annotate them.

For this reason, we introduced the 'protected' visibility annotation for
all symbol definitions and references, by setting the GCC visibility
pragma. However, as it turns out, this is not sufficient for all versions
of GCC, and in some cases (GCC 5.x using the GCC49 toolchain tag), may
still result in GOT based relocations.

So switch to 'hidden' visibility instead, which is slightly stronger, and
fixes this issue for the versions of GCC that exhibit the problem.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoArmPkg/Library: Add ArmReadSctlr for AArch64
Supreeth Venkatesh [Fri, 29 Jul 2016 23:06:32 +0000 (18:06 -0500)]
ArmPkg/Library: Add ArmReadSctlr for AArch64

ArmLib defines a prototype for the ArmReadSctlr() function, but the
AArch64 implementation is missing. So add it.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: John Powell <john.powell@arm.com>
Signed-off-by: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
[ardb: update commit log]
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
7 years agoNt32Pkg: Make Shell as the first boot option
Liming Gao [Mon, 25 Jul 2016 14:00:28 +0000 (22:00 +0800)]
Nt32Pkg: Make Shell as the first boot option

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>