]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
6 years agoUefiCpuPkg: Modify GetProcessorLocationByApicId() to support AMD.
Leo Duran [Sat, 17 Jun 2017 00:41:49 +0000 (08:41 +0800)]
UefiCpuPkg: Modify GetProcessorLocationByApicId() to support AMD.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Leo Duran <leo.duran@amd.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
6 years agoUefiCpuPkg: Add CPUID definitions for AMD.
Leo Duran [Sat, 17 Jun 2017 00:41:48 +0000 (08:41 +0800)]
UefiCpuPkg: Add CPUID definitions for AMD.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Leo Duran <leo.duran@amd.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
6 years agoUefiCpuPkg: Define AMD Memory Encryption specific CPUID and MSR
Brijesh Singh [Thu, 22 Jun 2017 20:37:32 +0000 (04:37 +0800)]
UefiCpuPkg: Define AMD Memory Encryption specific CPUID and MSR

The patch defines AMD's Memory Encryption Information CPUID leaf and SEV
status MSR. The complete description for CPUID leaf is available in APM
volume 2, Section 15.34.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Leo Duran <leo.duran@amd.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
6 years agoMdeModulePkg DxeCore: Only free ScratchBuffer when it is not NULL
Star Zeng [Fri, 23 Jun 2017 09:44:12 +0000 (17:44 +0800)]
MdeModulePkg DxeCore: Only free ScratchBuffer when it is not NULL

There is a case that ExtractGuidedSectionGetInfo return 0 for
ScratchBufferSize and ScratchBuffer will be NULL, after AllocatePool
fails to allocate buffer for AllocatedOutputBuffer, the code will
call FreePool (ScratchBuffer), but ScratchBuffer == NULL.

This patch is to only free ScratchBuffer when it is not NULL.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoMdeModulePkg/DxeCore: Fixed Interface returned by CoreOpenProtocol
Amit Kumar [Fri, 23 Jun 2017 10:09:47 +0000 (18:09 +0800)]
MdeModulePkg/DxeCore: Fixed Interface returned by CoreOpenProtocol

Change since v3:
1) Fixed issue when Attributes = EFI_OPEN_PROTOCOL_TEST_PROTOCOL
and Inteface = NULL case. [Reported by:star.zeng at intel.com]

Change Since v2:
1) Modified to use EFI_ERROR to get status code

Change since v1:
1) Fixed typo protocal to protocol
2) Fixed coding style

Modified source code to update Interface as per spec.
1) In case of Protocol is un-supported, interface should be returned NULL.
2) In case of any error, interface should not be modified.
3) In case of Test Protocol, interface is optional.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Amit Kumar <amit.ak@samsung.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoIntelSiliconPkg: Add package DSC file
Hao Wu [Thu, 22 Jun 2017 02:38:59 +0000 (10:38 +0800)]
IntelSiliconPkg: Add package DSC file

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

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>
6 years agoBaseTools/PatchCheck.py: Add warning info for new binary files
Hao Wu [Thu, 8 Jun 2017 06:57:48 +0000 (14:57 +0800)]
BaseTools/PatchCheck.py: Add warning info for new binary files

The commit adds the detection of adding new binary files in a patch file
or in a commit.

The following warning messages will be appended at the end of the script
output:

WARNING - The following binary files will be added into the repository:
  <BinaryFile1>
  <BinaryFile2>
  ...

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>
6 years agoBaseTools/PatchCheck.py: Fix misreport for binary changes in patch
Hao Wu [Thu, 8 Jun 2017 02:58:22 +0000 (10:58 +0800)]
BaseTools/PatchCheck.py: Fix misreport for binary changes in patch

For a patch file that:
1. Contains a binary change
2. Contains any other changes after the binary change

PatchCheck.py will complains with the following error:
* Patch format error: diff found after end of patch
   Line: literal XXXX

This commit resolves this misreport.

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>
6 years agoBaseTools: support building the same INF more than once with -m option
Yonghong Zhu [Thu, 8 Jun 2017 13:54:23 +0000 (21:54 +0800)]
BaseTools: support building the same INF more than once with -m option

Currently DSC file [Components] Section can support building the same
INF more than once for the same arch, this patch support build with -m
option to generate multiple instances.

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>
6 years agoBaseTools: report error HiiString in HII format PCD must not be empty
Yonghong Zhu [Fri, 23 Jun 2017 06:34:32 +0000 (14:34 +0800)]
BaseTools: report error HiiString in HII format PCD must not be empty

Add a check that HiiString field in the HII format PCD entry must not
be an empty string.

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>
6 years agoBaseTools: Fix the bug that use '|' or '||' in DSC file's Pcd value
Yunhua Feng [Tue, 20 Jun 2017 05:55:53 +0000 (13:55 +0800)]
BaseTools: Fix the bug that use '|' or '||' in DSC file's Pcd value

Fix the bug to support use '|' or '||' in DSC file's Pcd value.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoBaseTools: Enhance the report to not show the empty section
Yonghong Zhu [Thu, 8 Jun 2017 02:14:02 +0000 (10:14 +0800)]
BaseTools: Enhance the report to not show the empty section

Enhance the report to not show the empty section, eg: Module Library
Sub-section, if there is nothing in this section, we will not show it
in the report.

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>
6 years agoBaseTools: Enhance DEC Defines section format check
Yunhua Feng [Thu, 22 Jun 2017 03:19:47 +0000 (11:19 +0800)]
BaseTools: Enhance DEC Defines section format check

1. break if Dec Defines Section is missing
2. break if Dec have more than one Defines Section
3. break if Dec Defines Section have arch attribute
4. break if no section head, like as:
#[Defines]
 DEC_SPECIFICATION              = 0x00010005
 PACKAGE_NAME                   = Nt32Pkg

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoBaseTools: Copy "TianoCore" userextensions into As Built Inf
Yonghong Zhu [Thu, 13 Apr 2017 06:33:05 +0000 (14:33 +0800)]
BaseTools: Copy "TianoCore" userextensions into As Built Inf

Per build spec to update the tool to copy "TianoCore" userextensions to
As Built 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>
6 years agoBaseTools: Copy "MODULE_UNI_FILE" file into OUTPUT directory
Yonghong Zhu [Thu, 13 Apr 2017 06:37:40 +0000 (14:37 +0800)]
BaseTools: Copy "MODULE_UNI_FILE" file into OUTPUT directory

Current the "MODULE_UNI_FILE" item defined in the [Defines] section will
be copied into As Built INF file, but tool doesn't copy the real file into
same directory with the As Built 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>
6 years agoMdePkg/Cper.h: Update Firmware Error Record per UEFI 2.7
Hao Wu [Thu, 15 Jun 2017 00:59:40 +0000 (08:59 +0800)]
MdePkg/Cper.h: Update Firmware Error Record per UEFI 2.7

This commit updates the Firmware Error Record related definitions
according to UEFI 2.7 spec Section N.2.10 Table 281:

a. Adds definitions for 2 Firmware Error Record types
b. Update the structure EFI_FIRMWARE_ERROR_DATA

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>
6 years agoMdeModulePkg: Enhance the debug message for InstallProtocolInterface
Star Zeng [Wed, 21 Jun 2017 05:28:26 +0000 (13:28 +0800)]
MdeModulePkg: Enhance the debug message for InstallProtocolInterface

Current code is using debug message like below for
InstallProtocolInterface.
InstallProtocolInterface: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX XXX

User could not know whether the installation is failed or not by the
debug message, for example, the code below does not initialize Handle
before calling InstallProtocolInterface, EFI_INVALID_PARAMETER will be
returned.
  EFI_HANDLE Handle;
  Status = gBS->InstallProtocolInterface (
                  &Handle,
                  &XXX,
                  EFI_NATIVE_INTERFACE,
                  XXX
                  );

This patch is to add additional debug message if the installation
is failed and specific debug message for the case that the input
handle is invalid.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoMdePkg: update Base.h in MdePkg to check the _MSC_VER
Yonghong Zhu [Wed, 14 Jun 2017 03:50:56 +0000 (11:50 +0800)]
MdePkg: update Base.h in MdePkg to check the _MSC_VER

update Base.h in MdePkg to check the _MSC_VER and define
GLOBAL_REMOVE_IF_UNREFERENCED to nothing for VS2013 and higher tool
chain tags.

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: Michael D Kinney <michael.d.kinney@intel.com>
6 years agoBaseTools: add /Gw to CC_FLAGS for VS2013 and higher tool chain tags
Yonghong Zhu [Wed, 14 Jun 2017 07:35:03 +0000 (15:35 +0800)]
BaseTools: add /Gw to CC_FLAGS for VS2013 and higher tool chain tags

The /Gw flag does a better job at size optimization than use of the
GLOBAL_REMOVE_IF_UNREFERENCED macro that is currently used for VS20xx
tool chains to remove unreferenced global variables.
This patch add /Gw to CC_FLAGS for VS2013 and higher tool chain tags.

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: Michael D Kinney <michael.d.kinney@intel.com>
6 years agoNetworkPkg: Fix GCC build issue.
Fu Siyuan [Fri, 23 Jun 2017 01:08:47 +0000 (09:08 +0800)]
NetworkPkg: Fix GCC build issue.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
6 years agoBaseTools/tools_def: AARCH64: disable LTO type mismatch warnings
Ard Biesheuvel [Tue, 20 Jun 2017 18:43:54 +0000 (20:43 +0200)]
BaseTools/tools_def: AARCH64: disable LTO type mismatch warnings

On AARCH64, any code that may execute with the MMU off needs to be built
with -mstrict-align, given that unaligned accesses are not allowed unless
the MMU is enabled. This does not only affect SEC and PEI modules, but
also static libraries of the BASE type, which may be linked into such
modules, as well as into modules of other types. As it turns out, the
presence of -mstrict-align is reflected in the internal representations
of the types defined in those libraries.

When -fstrict-aliasing is passed to GCC, it assumes that pointers to
objects of different types cannot refer to the same memory location, and
attempts to exploit this fact when optimizing the code. Since such
assumptions are only valid under very strict conditions which are not
guaranteed to be met in EDK2, we disable this optimization by passing
-fno-strict-aliasing by default. [*]

When LTO is in effect, this applies equally to the code generation that
may occur at link time, which is why the linker warns about unexpected
differences in type definitions between the intermediate representations
that are present in the object files being linked. This may result in
warnings such as the one below, even if -fno-strict-aliasing is used:

  MdePkg/Include/Library/BaseLib.h:1712:1:
  warning: type of 'StrToGuid' does not match original declaration
  [-Wlto-type-mismatch]
   StrToGuid (
   ^
  MdePkg/Library/BaseLib/SafeString.c:1506:1:
  note: 'StrToGuid' was previously declared here
   StrToGuid (
   ^
  MdePkg/Library/BaseLib/SafeString.c:1506:1:
  note: code may be misoptimized unless -fno-strict-aliasing is used

This warning is inadvertently triggered when linking BASE libraries built
with -mstrict-align into modules of types other than SEC or PEI, since the
types are subtly different, even though the use of code that maintains
strict alignment in a module that does not care about this is unlikely to
cause problems. And even if it did, it would still only affect code built
with -fstrict-aliasing enabled, which we disable unconditionally. So let's
just silence the warning by passing -Wno-lto-type-mismatch.

[*] Leif adds: "-fstrict-aliasing is GCC default, because it is a
    restriction in the C language. Because it's a bit non-obvious, things
    can go hilariously wrong in very non-obvious ways, and the potential
    optimization gains are unlikely to be generally relevant,
    -fno-strict-aliasing is a sensible thing to always have set (like we
    do)."

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
6 years agoBaseTools/tools_def GCC: ARM/AARCH64: drop -save-temps from command line
Ard Biesheuvel [Tue, 20 Jun 2017 18:43:53 +0000 (20:43 +0200)]
BaseTools/tools_def GCC: ARM/AARCH64: drop -save-temps from command line

For historical reasons, GCC builds for ARM and AARCH64 pass the
-save-temps command line option to GCC, which instructs the compiler
to preserve intermediate files, i.e., preprocessor output and generated
assembler. Given that this clutters up the Build directory, and slows
down the build, let's remove 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>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoDuetPkg FSVariable: Add missing change in e286e118bafa
Star Zeng [Wed, 21 Jun 2017 13:27:01 +0000 (21:27 +0800)]
DuetPkg FSVariable: Add missing change in e286e118bafa

e286e118bafa updated *.c file, but forgot to update *.h file.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
6 years agoMdeModulePkg Variable: Add missing change in dd59d95e1994
Star Zeng [Wed, 21 Jun 2017 13:24:55 +0000 (21:24 +0800)]
MdeModulePkg Variable: Add missing change in dd59d95e1994

dd59d95e1994 updated *.c file, but forgot to update *.h file.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoMdeModulePkg: Minor update to the Data parameter for PEI GetVariable()
Star Zeng [Wed, 21 Jun 2017 09:31:35 +0000 (17:31 +0800)]
MdeModulePkg: Minor update to the Data parameter for PEI GetVariable()

PI 1.5 spec has minor update to the Data parameter for PEI
GetVariable(), and no real functional behavior change.

The modifier of Data parameter:
OUT VOID *Data
->
OUT VOID *Data OPTIONAL

The comments of Data parameter:
Data    Points to the buffer which will hold the returned variable value.
->
Data    Points to the buffer which will hold the returned variable value.
        May be NULL with a zero DataSize in order to determine the size of the buffer needed.

The patch is to follow the spec to update the implementation.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoMdePkg: Minor update to the Data parameter for PEI GetVariable()
Star Zeng [Wed, 21 Jun 2017 09:26:41 +0000 (17:26 +0800)]
MdePkg: Minor update to the Data parameter for PEI GetVariable()

PI 1.5 spec has minor update to the Data parameter for PEI
GetVariable(), and no real functional behavior change.

The modifier of Data parameter:
OUT VOID *Data
->
OUT VOID *Data OPTIONAL

The comments of Data parameter:
Data    Points to the buffer which will hold the returned variable value.
->
Data    Points to the buffer which will hold the returned variable value.
        May be NULL with a zero DataSize in order to determine the size of the buffer needed.

The patch is to follow the spec to update the definition.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoNetworkPkg/HttpBootDxe: Add HTTP Boot Callback protocol support.
Fu Siyuan [Wed, 14 Jun 2017 09:28:48 +0000 (17:28 +0800)]
NetworkPkg/HttpBootDxe: Add HTTP Boot Callback protocol support.

This patch updates the HTTP Boot driver to install a default HTTP Callback protocol
if the platform doesn't provide one. This callback implementation will print the
boot file download progress in percentage format.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
6 years agoMdePkg: Add header file for HTTP Boot Callback protocol in UEFI 2.7.
Fu Siyuan [Wed, 14 Jun 2017 09:25:39 +0000 (17:25 +0800)]
MdePkg: Add header file for HTTP Boot Callback protocol in UEFI 2.7.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
6 years agoMdeModulePkg: Return invalid param in LocateProtocol for Protocol==NULL
Star Zeng [Tue, 20 Jun 2017 10:25:29 +0000 (18:25 +0800)]
MdeModulePkg: Return invalid param in LocateProtocol for Protocol==NULL

Return EFI_INVALID_PARAMETER in LocateProtocol for Protocol==NULL to
follow UEFI 2.7 spec

PiSmmCore is also updated as the EFI_SMM_SYSTEM_TABLE2.SmmLocateProtocol
is reusing the definition of EFI_LOCATE_PROTOCOL.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoMdePkg: Update comments for LocateProtocol to follow UEFI 2.7 spec
Star Zeng [Tue, 20 Jun 2017 10:18:07 +0000 (18:18 +0800)]
MdePkg: Update comments for LocateProtocol to follow UEFI 2.7 spec

Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoMdePkg: Add EFI UFS Device Config Protocol definitions
Hao Wu [Thu, 15 Jun 2017 03:08:34 +0000 (11:08 +0800)]
MdePkg: Add EFI UFS Device Config Protocol definitions

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>
6 years agoMdePkg/BluetoothConfig: Update comments for GetData/GetRemoteData
Hao Wu [Mon, 19 Jun 2017 05:06:22 +0000 (13:06 +0800)]
MdePkg/BluetoothConfig: Update comments for GetData/GetRemoteData

Updates the GetData and GetRemoteData services description comments
according to latest UEFI spec.

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>
6 years agoArmPlatformPkg: eliminate Juno gcc build warning
Leif Lindholm [Tue, 20 Jun 2017 10:51:34 +0000 (11:51 +0100)]
ArmPlatformPkg: eliminate Juno gcc build warning

When building without LTO, gcc incorrectly resolves the hazards for
'PciRegBase’ when inlining, leading to "may be used uninitialized"
warnings (and hence build failure with -Werror).
Eliminate this warning by explicitly initializing the variable to 0.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ryan Harkin <ryan.harkin@linaro.org>
6 years agoMdeModulePkg: Fix use-after-free error in InstallConfigurationTable()
Shi, Steven [Sat, 20 May 2017 09:05:17 +0000 (17:05 +0800)]
MdeModulePkg: Fix use-after-free error in InstallConfigurationTable()

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

When installing configuration table and the original
gDxeCoreST->ConfigurationTable[] buffer happen to be not big enough to
add a new table, the CoreInstallConfigurationTable() enter the branch
of line 113 in InstallConfigurationTable.c to free the old
gDxeCoreST->ConfigurationTable[] buffer and allocate a new bigger one.
The problem happens at line 139 CoreFreePool(), which is to free the
old gDxeCoreST->ConfigurationTable[] buffer. The CoreFreePool()'s
behavior is to free the buffer firstly, then call the
InstallMemoryAttributesTableOnMemoryAllocation (PoolType) to update
the EfiRuntimeServices type memory info, the
CoreInstallConfigurationTable() will be re-entered by CoreFreePool()
in its calling stack, then use-after-free read error will happen at
line 59 of InstallConfigurationTable.c and use-after-free write error
will happen at line 151 and 152 of InstallConfigurationTable.c.

The patch is to update System table to the new table pointer before
calling CoreFreePool() to free the old table.

The case above is in DxeCore, but not in PiSmmCore.
The change in PiSmmCore is to be consistent with DxeCore.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Steven Shi <steven.shi@intel.com>
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Steven Shi <steven.shi@intel.com>
6 years agoMdeModulePkg: Clean ACPI 2.0 characters in UEFI spec
Dandan Bi [Fri, 16 Jun 2017 05:24:02 +0000 (13:24 +0800)]
MdeModulePkg: Clean ACPI 2.0 characters in UEFI spec

v2: Add some missing changes.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoMdePkg: Clean ACPI 2.0 characters in UEFI spec
Dandan Bi [Fri, 16 Jun 2017 05:23:20 +0000 (13:23 +0800)]
MdePkg: Clean ACPI 2.0 characters in UEFI spec

Cc: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoMdePkg: update comments in ResetSystem() according to UEFI2.7
Dandan Bi [Fri, 16 Jun 2017 04:57:34 +0000 (12:57 +0800)]
MdePkg: update comments in ResetSystem() according to UEFI2.7

Cc: Liming Gao <liming.gao@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
6 years agoMdePkg: Update comments in EFI_MEMORY_DESCRIPTOR according to UEFI2.7
Dandan Bi [Fri, 16 Jun 2017 03:36:15 +0000 (11:36 +0800)]
MdePkg: Update comments in EFI_MEMORY_DESCRIPTOR according to UEFI2.7

Cc: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoMdePkg/HiiImageDecoder.h: Remove the unnecessary comments
Dandan Bi [Fri, 16 Jun 2017 03:13:01 +0000 (11:13 +0800)]
MdePkg/HiiImageDecoder.h: Remove the unnecessary comments

Cc: Liming Gao <liming.gao@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
6 years agoMdeModulePkg: Update comments in SimpleTextInEx according to UEFI 2.7
Dandan Bi [Fri, 16 Jun 2017 03:04:43 +0000 (11:04 +0800)]
MdeModulePkg: Update comments in SimpleTextInEx according to UEFI 2.7

v2: Add some missing changes Ps2KeyboardDxe.

Cc: Star Zeng <star.zeng@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
6 years agoIntelFrameworkModulePkg: Update comments in SimpleTextInEx
Dandan Bi [Fri, 16 Jun 2017 02:53:36 +0000 (10:53 +0800)]
IntelFrameworkModulePkg: Update comments in SimpleTextInEx

Update comments in SimpleTextInEx according to UEFI 2.7.

Cc: Star Zeng <star.zeng@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jeff Fan <jeff.fan@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
6 years agoMdePkg/SimpleTextInEx: Update comments according to UEFI 2.7 spec
Dandan Bi [Thu, 15 Jun 2017 05:43:00 +0000 (13:43 +0800)]
MdePkg/SimpleTextInEx: Update comments according to UEFI 2.7 spec

Cc: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
6 years agoUefiCpuPkg/SmmCpuFeatureLib: Add more CPU ID for SmmFeatureControl.
Jiewen Yao [Mon, 12 Jun 2017 02:12:50 +0000 (10:12 +0800)]
UefiCpuPkg/SmmCpuFeatureLib: Add more CPU ID for SmmFeatureControl.

Add more CPU ID which can support SmmFeatureControl,
according to IA32 SDM.

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
6 years agoNetworkPkg: Typo fix and comments correction
Jiaxin Wu [Thu, 16 Mar 2017 01:59:05 +0000 (09:59 +0800)]
NetworkPkg: Typo fix and comments correction

warter -> water
Maunual -> Manual
TCP and UDP --> TCP4 and TCP6
TCP or UDP --> TCP4 or TCP6

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
6 years agoMdeModulePkg/Network: Typo fix
Jiaxin Wu [Thu, 16 Mar 2017 01:58:27 +0000 (09:58 +0800)]
MdeModulePkg/Network: Typo fix

warter -> water
Maunual -> Manual

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
6 years agoShellBinPkg: Ia32/X64 Shell binary update.
Ruiyu Ni [Tue, 13 Jun 2017 08:23:18 +0000 (16:23 +0800)]
ShellBinPkg: Ia32/X64 Shell binary update.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
6 years agoMdeModulePkg/BMMUiLib: Fix incorrect variable name
Dandan Bi [Mon, 12 Jun 2017 01:16:32 +0000 (09:16 +0800)]
MdeModulePkg/BMMUiLib: Fix incorrect variable name

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

In function UpdateConsoleContent, we compare console name
with "ErrOut" string to check whether the content in console
Error device page has been changed. But when call function
UpdateConsoleContent, we pass console name as "ConErr" by mistake.
This patch is to fix the inconsistent issue.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Liming Gao <liming.gao@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>
6 years agoSecurityPkg TcgDxe: Simplify debug msg when "TPM not working properly"
Star Zeng [Thu, 8 Jun 2017 02:16:40 +0000 (10:16 +0800)]
SecurityPkg TcgDxe: Simplify debug msg when "TPM not working properly"

Current code for case "TPM not working properly" uses the predefined
macro __FILE__ in debug format string, but uses predefined macro
__LINE__ as parameter, and it also uses multiple pairs of "" in debug
format string.

To be simple and clear, this patch is to update the code to just use
"DriverEntry: TPM not working properly\n" as the debug message.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Amy Chan <amy.chan@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
6 years agoShellPkg: Fix typo errors in ifconfig help output
Tapan Shah [Fri, 9 Jun 2017 17:11:21 +0000 (01:11 +0800)]
ShellPkg: Fix typo errors in ifconfig help output

Found few instances where IPv4 and DHCPv4 spelled incorrectly
as IP4 and DHCP4 respectively.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Tapan Shah <tapandshah@hpe.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
6 years agoShell/alias: Print detailed error when deleting alias
Ruiyu Ni [Fri, 9 Jun 2017 03:10:32 +0000 (11:10 +0800)]
Shell/alias: Print detailed error when deleting alias

STR_GEN_ERR_NOT_FOUND is added and currently is only
used by alias command. This string template can be used
by other commands as well.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Tapan Shah <tapandshah@hpe.com>
6 years agoOvmfPkg/AcpiPlatformDxe: fix spurious uninitialized var warning
Ard Biesheuvel [Thu, 8 Jun 2017 19:03:04 +0000 (19:03 +0000)]
OvmfPkg/AcpiPlatformDxe: fix spurious uninitialized var warning

Commit 4275f38507a4 ("OvmfPkg/AcpiPlatformDxe: alloc blobs from 64-bit
space unless restricted") introduced a variable which is [incorrectly]
identified by GCC as being potentially uninitialized. So let's just set
it to NULL before use.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
6 years agoNetworkPkg/HttpBootDxe: Handle new #define in HttpBootDxe
hegdenag [Thu, 8 Jun 2017 06:40:33 +0000 (14:40 +0800)]
NetworkPkg/HttpBootDxe: Handle new #define in HttpBootDxe

Add a error message in HttpBootPrintErrorMessage for HTTP 308
Redirect.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
Reviewed-by: Sriram Subramanian <sriram-s@hpe.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
6 years agoMdeModulePkg/DxeHttpLib: Handle new #define in HttpMappingToStatusCode
hegdenag [Thu, 8 Jun 2017 06:40:09 +0000 (14:40 +0800)]
MdeModulePkg/DxeHttpLib: Handle new #define in HttpMappingToStatusCode

Related to the ECR for support of HTTP Redirect (308)

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Sriram Subramanian <sriram-s@hpe.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
6 years agoMdePkg/Http.h: Add #define for 308 redirect
hegdenag [Thu, 8 Jun 2017 06:39:03 +0000 (14:39 +0800)]
MdePkg/Http.h: Add #define for 308 redirect

Adding Support for the ECR for HTTP 308 redirect.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Sriram Subramanian <sriram-s@hpe.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
6 years agoShellPkg/ifconfig: Update help message
hegdenag [Thu, 8 Jun 2017 06:40:53 +0000 (14:40 +0800)]
ShellPkg/ifconfig: Update help message

Couple of instances had IP4 mentioned, instead of IPv4.
Changing all to IPv4 to maintain consistency.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
Reviewed-by: Tapan Shah <tapandshah@hpe.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
6 years agoShellPkg: Remove unnecessary Readme.txt
Ruiyu Ni [Wed, 7 Jun 2017 05:51:26 +0000 (13:51 +0800)]
ShellPkg: Remove unnecessary Readme.txt

The Readme.txt contains instructions about how to integrate Shell
into Nt32. Actually Nt32 already contains a macro USE_OLD_SHELL to
choose OLD or NEW Shell.

So remove this txt file.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
6 years agoMdeModulePkg/PciHostBridgeDxe: Make bitwise operands of the same size
Hao Wu [Thu, 8 Jun 2017 08:07:31 +0000 (16:07 +0800)]
MdeModulePkg/PciHostBridgeDxe: Make bitwise operands of the same size

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>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
6 years agoOvmfPkg/AcpiPlatformDxe: alloc blobs from 64-bit space unless restricted
Laszlo Ersek [Sat, 3 Jun 2017 14:11:08 +0000 (16:11 +0200)]
OvmfPkg/AcpiPlatformDxe: alloc blobs from 64-bit space unless restricted

... by narrower than 8-byte ADD_POINTER references.

Introduce the CollectAllocationsRestrictedTo32Bit() function, which
iterates over the linker/loader script, and collects the names of the
fw_cfg blobs that are referenced by QEMU_LOADER_ADD_POINTER.PointeeFile
fields, such that QEMU_LOADER_ADD_POINTER.PointerSize is less than 8. This
means that the pointee blob's address will have to be patched into a
narrower-than-8 byte pointer field, hence the pointee blob must not be
allocated from 64-bit address space.

In ProcessCmdAllocate(), consult these restrictions when setting the
maximum address for gBS->AllocatePages(). The default is now MAX_UINT64,
unless restricted like described above to the pre-patch MAX_UINT32 limit.

In combination with Ard's QEMU commit cb51ac2ffe36 ("hw/arm/virt: generate
64-bit addressable ACPI objects", 2017-04-10), this patch enables
OvmfPkg/AcpiPlatformDxe to work entirely above the 4GB mark.

(An upcoming / planned aarch64 QEMU machine type will have no RAM under
4GB at all. Plus, moving the allocations higher is beneficial to the
current "virt" machine type as well; in Ard's words: "having all firmware
allocations inside the same 1 GB (or 512 MB for 64k pages) frame reduces
the TLB footprint".)

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Suggested-by: Igor Mammedov <imammedo@redhat.com>
Suggested-by: Gerd Hoffmann <kraxel@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
6 years agoMdePkg: update Wi-Fi/Supplicant header files to meet UEFI 2.7.
Wang, Fan [Tue, 6 Jun 2017 10:51:35 +0000 (18:51 +0800)]
MdePkg: update Wi-Fi/Supplicant header files to meet UEFI 2.7.

This patch is used to update supplicant.h and wifi2.h
to meet UEFI 2.7 definition. Add EfiSupplicant80211PMK
field in EFI_SUPPLICANT_DATA_TYPE and change **NetworkDesc
to NetworkDesc[1] in EFI_80211_GET_NETWORKS_RESULT.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wang Fan <fan.wang@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
6 years agoBaseTools: Fix the bug use same FMP_PAYLOAD in different capsule file
Yonghong Zhu [Tue, 6 Jun 2017 05:28:07 +0000 (13:28 +0800)]
BaseTools: Fix the bug use same FMP_PAYLOAD in different capsule file

Fix the bug that use same FMP_PAYLOAD in different capsule file. Because
in previous FMP generation, the FMP already be generated, so we don't
need to regenerate again.

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>
6 years agoBaseTools: Fix incremental build failure that override file be removed
Yonghong Zhu [Tue, 6 Jun 2017 08:35:44 +0000 (16:35 +0800)]
BaseTools: Fix incremental build failure that override file be removed

Fix a Incremental build failure. The case is: Both A and B package will
include a same .h file, and in the driver's packages section, A
package is listed before B package, so we will use the .h file in the A
package and build success, then we directly delete the .h file in package
A, it cause increment build failure since in the AutoGenTimeStamp file
the .h file in A can't be found.

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>
6 years agoShellBinPkg: Ia32/X64 Shell binary update.
Ruiyu Ni [Wed, 7 Jun 2017 01:48:38 +0000 (09:48 +0800)]
ShellBinPkg: Ia32/X64 Shell binary update.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
6 years agoShellPkg/parse: Handle Unicode stream from pipe correctly
Ruiyu Ni [Tue, 6 Jun 2017 08:23:33 +0000 (16:23 +0800)]
ShellPkg/parse: Handle Unicode stream from pipe correctly

The original code expects the Unicode stream from pipe doesn't
contains the Unicode BOM.
But that's not true.
Commit [9ed21946c76e430097e9c4e59b419af928e0cb8c] changes
CreateFileInterfaceMem() to add the BOM for Unicode stream.

When parse pipe support was firstly added, a private implementation
ParseReturnStdInLine() was created to specially handle
the Unicode stream without BOM. Since now the Unicode steam contains
BOM, the private implementation can be removed and
ShellFileHandleReturnLine() can be used directly.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Tapan Shah <tapandshah@hpe.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
6 years agoShellPkg/alias: Return status for alias deletion
Ruiyu Ni [Tue, 6 Jun 2017 05:26:12 +0000 (13:26 +0800)]
ShellPkg/alias: Return status for alias deletion

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Tapan Shah <tapandshah@hpe.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
6 years agoMdePkg: Add BluetoothAttribute.h and BluetoothLeConfig.h
Ruiyu Ni [Tue, 6 Jun 2017 03:14:16 +0000 (11:14 +0800)]
MdePkg: Add BluetoothAttribute.h and BluetoothLeConfig.h

UEFI Spec 2.7 introduces BluetoothAttribute and BluetoothLeConfig
protocols. The patch adds the definitions for them.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
6 years agoMdePkg/BluetoothIo: Formalize function header comments.
Ruiyu Ni [Tue, 6 Jun 2017 03:07:12 +0000 (11:07 +0800)]
MdePkg/BluetoothIo: Formalize function header comments.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
6 years agoMdePkg/BluetoothHc: Add detailed function header comments
Ruiyu Ni [Tue, 6 Jun 2017 03:01:15 +0000 (11:01 +0800)]
MdePkg/BluetoothHc: Add detailed function header comments

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
6 years agoMdePkg/BluetoothConfig: Add new EFI_BLUETOOTH_CONFIG_DATA_TYPE types
Ruiyu Ni [Tue, 6 Jun 2017 02:54:34 +0000 (10:54 +0800)]
MdePkg/BluetoothConfig: Add new EFI_BLUETOOTH_CONFIG_DATA_TYPE types

UEFI spec 2.7 adds new EFI_BLUETOOTH_CONFIG_DATA_TYPE types.
The patch adds them to the header file.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
6 years agoMdePkg/DevicePath: Add BluetoothLe device path node support
Ruiyu Ni [Tue, 6 Jun 2017 02:03:09 +0000 (10:03 +0800)]
MdePkg/DevicePath: Add BluetoothLe device path node support

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
6 years agoMdePkg SmmIoLib: Use NULL pointer check instead of useless Status check
Star Zeng [Mon, 5 Jun 2017 06:31:19 +0000 (14:31 +0800)]
MdePkg SmmIoLib: Use NULL pointer check instead of useless Status check

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

The Status check in "if (!EFI_ERROR (Status))" condition is useless,
it should be NULL pointer check. And this patch also fixes a typo
"continous" to "continuous".

Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
6 years agoMdePkg SmmMemLib: Remove ASSERT in SmmIsBufferOutsideSmmValid
Star Zeng [Mon, 5 Jun 2017 02:50:43 +0000 (10:50 +0800)]
MdePkg SmmMemLib: Remove ASSERT in SmmIsBufferOutsideSmmValid

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

Currently the SmmIsBufferOutsideSmmValid() function in SmmMemLib.c will
ASSERT in certain conditions. Since this function is a "test" function,
it should not be making decisions on how to handle a failure.
Handling a failure should be left to the caller.

This patch is to remove ASSERT(FALSE) at line 178 of SmmMemLib.c.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Bret Barkelew <bret.barkelew@microsoft.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
6 years agoMdeModulePkg/UefiPxeBcDxe: Refine the PXE boot displayed information
Jiaxin Wu [Mon, 22 May 2017 01:25:57 +0000 (09:25 +0800)]
MdeModulePkg/UefiPxeBcDxe: Refine the PXE boot displayed information

This path is to refine the PXE boot displayed information so as to
in line with NetworkPkg/UefiPxeBcDxe driver.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
6 years agoMdeModulePkg/UefiPxeBcDxe: Fix the PXE BootMenu selection issue
Jiaxin Wu [Mon, 22 May 2017 01:13:18 +0000 (09:13 +0800)]
MdeModulePkg/UefiPxeBcDxe: Fix the PXE BootMenu selection issue

Currently implementation doesn't accept the input during the user
is trying to select the PXE BootMenu from option 43. This path is
to fix that problem.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
6 years agoShellPkg/alias: Fix bug to support upper-case alias
Ruiyu Ni [Thu, 1 Jun 2017 14:09:14 +0000 (22:09 +0800)]
ShellPkg/alias: Fix bug to support upper-case alias

alias in UEFI Shell is case insensitive.
Old code saves the alias to variable storage without
converting the alias to lower-case, which results
upper case alias setting doesn't work.
The patch converts the alias to lower case before saving
to variable storage.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Tapan Shah <tapandshah@hpe.com>
6 years agoEmulatorPkg/build.sh: Merge GCC toolchain detection from OVMF
Jordan Justen [Thu, 1 Jun 2017 23:42:38 +0000 (16:42 -0700)]
EmulatorPkg/build.sh: Merge GCC toolchain detection from OVMF

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
6 years agoMdeModulePkg/Xhci: Correct the indention of comments
Ruiyu Ni [Fri, 2 Jun 2017 07:45:42 +0000 (15:45 +0800)]
MdeModulePkg/Xhci: Correct the indention of comments

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoShellPkg/UefiShellLib: Check correct variable for NULL
Jeff Westfahl [Fri, 12 May 2017 20:41:40 +0000 (04:41 +0800)]
ShellPkg/UefiShellLib: Check correct variable for NULL

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Westfahl <jeff.westfahl@ni.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
6 years agoMdeModulePkg/Xhci: Remove TRB when canceling Async Int Transfer
Ruiyu Ni [Wed, 31 May 2017 02:56:35 +0000 (10:56 +0800)]
MdeModulePkg/Xhci: Remove TRB when canceling Async Int Transfer

Some USB devices don't report data periodically through Int
Transfer. They report data only when be asked. If the TRB
is not removed from the XHCI HW, when next time HOST asks
data again, the data is reported but consumed by the previous
TRB, which results the HOST thinks data never comes.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoMdeModulePkg/MnpDxe: Fix EBC build hang issue.
Fu Siyuan [Fri, 2 Jun 2017 05:17:17 +0000 (13:17 +0800)]
MdeModulePkg/MnpDxe: Fix EBC build hang issue.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
6 years agoMdeModulePkg/UsbBus: Correct debug message
Ruiyu Ni [Thu, 1 Jun 2017 10:28:23 +0000 (18:28 +0800)]
MdeModulePkg/UsbBus: Correct debug message

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoMdeModulePkg/UsbBus: Fix system hang when failed to uninstall UsbIo
Ruiyu Ni [Thu, 1 Jun 2017 10:27:23 +0000 (18:27 +0800)]
MdeModulePkg/UsbBus: Fix system hang when failed to uninstall UsbIo

When "reconnect -r" is typed in shell, UsbFreeInterface() is called
to uninstall the UsbIo and DevicePath. But When a UsbIo is opened
by a driver and that driver rejects to close the UsbIo in Stop(),
the uninstall doesn't succeed.
But UsbFreeInterface () frees the DevicePath memory without check
whether the uninstall succeeds.
It leads to the DXE core database contain a DevicePath instance but
that instance's memory is freed.
Assertion happens when someone calls InstallProtocol(DevicePath)
because the InstallProtocol() checks all DevicePath instance to
find whether the same one exits in database.

We haven't seen any USB device driver which rejects to close UsbIo
in Stop(), but it's very likely.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
6 years agoBaseTools/GCC ARM/AARCH64: Force disable PIE
dann frazier [Wed, 31 May 2017 16:57:54 +0000 (10:57 -0600)]
BaseTools/GCC ARM/AARCH64: Force disable PIE

After Debian's toolchain switched to PIE by default, our edk2 builds began
to fail to build (GCC49 w/ gcc 6.3). This patch fixes the build by forcing
off PIE for both ARM and AARCH64 builds.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: dann frazier <dannf@debian.org>
Add -fno-pic as well for ARM.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
6 years agoMaintainers.txt: Update maintainers for DuetPkg & Nt32Pkg
Hao Wu [Wed, 31 May 2017 01:50:34 +0000 (09:50 +0800)]
Maintainers.txt: Update maintainers for DuetPkg & Nt32Pkg

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>
6 years agoMdeModulePkg/Xhci: Fill the 'interval' field for ISO endpoint context
Hao Wu [Wed, 31 May 2017 01:22:27 +0000 (09:22 +0800)]
MdeModulePkg/Xhci: Fill the 'interval' field for ISO endpoint context

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

The commit fills the 'Interval' field of the Endpoint Context data for
isochronous endpoints. It will resolve the error when a Configure
Endpoint Command is sent to an isochronous endpoint.

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>
6 years agoMdeModulePkg/PrintLib: Avoid reading content beyond the format string
Hao Wu [Mon, 22 May 2017 07:03:24 +0000 (15:03 +0800)]
MdeModulePkg/PrintLib: Avoid reading content beyond the format string

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

In functions DxePrintLibPrint2ProtocolVaListToBaseList() and
InternalPrintLibSPrintMarker(), when processing ASCII format strings, if
the format string walker pointer 'Format' is pointing at the end of the
format string (i.e. '\0'), the following expression:
*(Format + 1)
will read an undefined value.

Though this value won't affect the functionality, since it will be masked
by variable 'FormatMask':
(*(Format + 1) << 8)) & FormatMask
(FormatMask is 0xff for ASCII format string)

This commit adds additional logic to avoid reading undefined content.

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>
6 years agoMdePkg/BasePrintLib: Avoid reading content beyond the format string
Hao Wu [Mon, 22 May 2017 06:49:11 +0000 (14:49 +0800)]
MdePkg/BasePrintLib: Avoid reading content beyond the format string

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

In function BasePrintLibSPrintMarker(), when processing ASCII format
strings, if the format string walker pointer 'Format' is pointing at the
end of the format string (i.e. '\0'), the following expression:
*(Format + 1)
will read an undefined value.

Though this value won't affect the functionality, since it will be masked
by variable 'FormatMask':
(*(Format + 1) << 8)) & FormatMask
(FormatMask is 0xff for ASCII format string)

This commit adds additional logic to avoid reading undefined content.

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>
6 years agoMdePkg/DevicePathLib: Reverse the byte order of BD_ADDR for Bluetooth
Hao Wu [Sat, 27 May 2017 02:22:33 +0000 (10:22 +0800)]
MdePkg/DevicePathLib: Reverse the byte order of BD_ADDR for Bluetooth

For the following two functions:
DevPathFromTextBluetooth()
DevPathToTextBluetooth()

The Bluetooth device address "UINT8  Address[6]" is displayed with the
order from Address[5] to Address[0]. This commit reverses the order.

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>
6 years agoQuarkPlatformPkg/SpiFvbServices: correct NumOfLba vararg type in EraseBlocks()
Laszlo Ersek [Thu, 18 May 2017 12:48:13 +0000 (14:48 +0200)]
QuarkPlatformPkg/SpiFvbServices: correct NumOfLba vararg type in EraseBlocks()

According to the PI spec, Volume 3,
EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL.EraseBlocks():

> The variable argument list is a list of tuples. Each tuple describes a
> range of LBAs to erase and consists of the following:
> * An EFI_LBA that indicates the starting LBA
> * A UINTN that indicates the number of blocks to erase

(NB, in edk2, EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL is a typedef to
EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL.)

In this driver, the NumOfLba local variable is defined with type UINTN,
but the TYPE argument passed to VA_ARG() is UINT32. Fix the mismatch.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Kelly Steele <kelly.steele@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Reported-by: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
6 years agoNt32Pkg/FvbServicesRuntimeDxe: correct NumOfLba vararg type in EraseBlocks()
Laszlo Ersek [Thu, 18 May 2017 12:48:13 +0000 (14:48 +0200)]
Nt32Pkg/FvbServicesRuntimeDxe: correct NumOfLba vararg type in EraseBlocks()

According to the PI spec, Volume 3,
EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL.EraseBlocks():

> The variable argument list is a list of tuples. Each tuple describes a
> range of LBAs to erase and consists of the following:
> * An EFI_LBA that indicates the starting LBA
> * A UINTN that indicates the number of blocks to erase

(NB, in edk2, EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL is a typedef to
EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL.)

In this driver, the NumOfLba local variable is defined with type UINTN,
but the TYPE argument passed to VA_ARG() is UINT32. Fix the mismatch.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Reported-by: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
6 years agoDuetPkg/FvbRuntimeService: correct NumOfLba vararg type in EraseBlocks()
Laszlo Ersek [Thu, 18 May 2017 12:48:13 +0000 (14:48 +0200)]
DuetPkg/FvbRuntimeService: correct NumOfLba vararg type in EraseBlocks()

According to the PI spec, Volume 3,
EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL.EraseBlocks():

> The variable argument list is a list of tuples. Each tuple describes a
> range of LBAs to erase and consists of the following:
> * An EFI_LBA that indicates the starting LBA
> * A UINTN that indicates the number of blocks to erase

(NB, in edk2, EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL is a typedef to
EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL.)

In this driver, the NumOfLba local variable is defined with type UINTN,
but the TYPE argument passed to VA_ARG() is UINT32. Fix the mismatch.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Reported-by: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
6 years agoBaseTools/Scripts: fix GccBase.lds line endings
Ard Biesheuvel [Sun, 28 May 2017 12:04:52 +0000 (12:04 +0000)]
BaseTools/Scripts: fix GccBase.lds line endings

Replace a <LF> line ending that was introduced inadvertently by a
recent commit with the correct <CR><LF>

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
6 years agoUefiCpuPkg/MpInitLib: Force to enable X2APIC if CPU number > 255
Jeff Fan [Fri, 26 May 2017 11:50:43 +0000 (19:50 +0800)]
UefiCpuPkg/MpInitLib: Force to enable X2APIC if CPU number > 255

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
6 years agoUefiCpuPkg/MpInitLib: Check APIC mode change around AP function
Jeff Fan [Wed, 24 May 2017 05:53:30 +0000 (13:53 +0800)]
UefiCpuPkg/MpInitLib: Check APIC mode change around AP function

If APIC ID values are changed during AP functions execution, we need to update
new APIC ID values in local data structure accordingly.

But if APIC mode change happened during AP function execution, we do not support
APIC ID value changed.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
6 years agoUefiCpuPkg/CpuCommonFeaturesLib: Support X2APIC enable
Jeff Fan [Wed, 24 May 2017 05:45:25 +0000 (13:45 +0800)]
UefiCpuPkg/CpuCommonFeaturesLib: Support X2APIC enable

Current X2APIC is enabled in MpInitLib (used by CpuMpPei and CpuDxe) to follow
SDM suggestion. That means we only enable X2APIC if we found there are any
initial CPU ID value >= 255.

This patch is to provide one chance for platform to enable X2APIC even there is
no any initial CPU ID value >= 255.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
6 years agoMdeModulePkg: Fix potential memory leaks in DxeHttpLib.
Paulo Alcantara [Mon, 22 May 2017 11:52:11 +0000 (19:52 +0800)]
MdeModulePkg: Fix potential memory leaks in DxeHttpLib.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
6 years agoVlv2TbltDevicePkg/FvbRuntimeDxe: correct NumOfLba vararg type in EraseBlocks()
Laszlo Ersek [Thu, 18 May 2017 15:04:27 +0000 (23:04 +0800)]
Vlv2TbltDevicePkg/FvbRuntimeDxe: correct NumOfLba vararg type in EraseBlocks()

According to the PI spec, Volume 3,
EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL.EraseBlocks():

> The variable argument list is a list of tuples. Each tuple describes a
> range of LBAs to erase and consists of the following:
> * An EFI_LBA that indicates the starting LBA
> * A UINTN that indicates the number of blocks to erase

(NB, in edk2, EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL is a typedef to
EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL.)

In this driver, the NumOfLba local variable is defined with type UINTN,
but the TYPE argument passed to VA_ARG() is UINT32. Fix the mismatch.

Cc: David Wei <david.wei@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Mang Guo <mang.guo@intel.com>
Reported-by: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
6 years agoBaseTools: Correct if condition expression for DatumType == 'VOID*'
Yonghong Zhu [Wed, 24 May 2017 08:16:07 +0000 (16:16 +0800)]
BaseTools: Correct if condition expression for DatumType == 'VOID*'

Correct the if condition expression for DatumType == 'VOID*'. Current
this condition is not work since the DatumType is changed before we do
the value judgement.

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>
6 years agoMdeModulePkg/DebugSupportDxe: Fix XCODE5 build failure
Michael Kinney [Tue, 23 May 2017 19:22:37 +0000 (12:22 -0700)]
MdeModulePkg/DebugSupportDxe: Fix XCODE5 build failure

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

Update X64 AsmFuncs.S to resolve a build failure using the
XCODE5 tool chain.  This change updates AsmFuncs.S to match
AsmFuncs.asm and AsmFuncs.nasm.

The error generated in XCODE5 build is:

error: invalid instruction mnemonic 'movzxw'
    movzxw 8(%rax), %rax
    ^~~~~~

The correct instruction is

    movzwq 8(%rax), %rax

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Andrew Fish <afish@apple.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Andrew Fish <afish@apple.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoMdeModulePkg/RegularExpressionDxe: Fix XCODE5 build failure
Michael Kinney [Tue, 23 May 2017 19:03:39 +0000 (12:03 -0700)]
MdeModulePkg/RegularExpressionDxe: Fix XCODE5 build failure

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

The ErrorMessage local variable in OnigurumaMatch() should
be type OnigUChar instead of type CHAR8.  This resolves
a build failure with the XCODE5 tool chain.

Cc: Andrew Fish <afish@apple.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Andrew Fish <afish@apple.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
6 years agoBaseTools/Scripts: discard .gnu.hash section in GCC builds
Ard Biesheuvel [Fri, 19 May 2017 10:47:40 +0000 (11:47 +0100)]
BaseTools/Scripts: discard .gnu.hash section in GCC builds

Some builds of GCC/binutils will default to using the GNU flavor of
the symbol hash table, and will emit it into a section called .gnu.hash
rather than .hash. We have no use for its contents, and GenFw ignores
it anyway, so it shouldn't really matter what we do with it.

However, due to a workaround for AARCH64 we have in GenFw to deal with
older GCCs that corrupt section-based relocations when merging sections
during the final link, we need the ELF and PE/COFF views of the binary
to be identical. Since we don't place the .gnu.hash section explicitly,
it may end up at the beginning of the ELF binary, causing other sections
to be shifted in the ELF view but not in the PE/COFF view.

So let's add .gnu.hash to the GCC linker script. We don't care about its
contents so add it to the /DISCARD/ section.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>