]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
8 years agoShellPkg: Don't strip BOM when piping UCS2 data to a UEFI app
Jim_Dailey@Dell.com [Tue, 1 Mar 2016 21:02:19 +0000 (13:02 -0800)]
ShellPkg: Don't strip BOM when piping UCS2 data to a UEFI app

If the BOM is stripped from StdIn, then an app that duplicates StdIn
will not be able to duplicate, say, a UCS2 file that was piped into
it (the output file it creates would not start with a BOM).

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jim Dailey <jim_dailey@dell.com>
Reviewed-by: Jaben Carsey <Jaben.Carsey@intel.com>
8 years agoArmPlatformPkg/PL180MciDxe: don't check ID_REG3
Ryan Harkin [Tue, 1 Mar 2016 08:23:20 +0000 (08:23 +0000)]
ArmPlatformPkg/PL180MciDxe: don't check ID_REG3

TC2 reads 0x02 for the PL180 ID3 register instead of 0x00 as defined in
the spec.

However, the spec [1] states that the contents of ID3 register represent
the "configuration option of the peripheral" and thus not part of the
Prime Cell identification.

For this patch, we drop checking the value in MCI_PERIPH_ID_REG3.

[1] http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0172a/index.html

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
8 years agoArmPlatformPkg/PL180MciDxe: warn on probe fail
Ryan Harkin [Tue, 1 Mar 2016 08:20:40 +0000 (08:20 +0000)]
ArmPlatformPkg/PL180MciDxe: warn on probe fail

If the PL180 fails to probe, issue a warning on debug builds.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
8 years agoArmPlatformPkg/PL180MciDxe: fix Depex for TC2
Ryan Harkin [Tue, 1 Mar 2016 07:44:39 +0000 (07:44 +0000)]
ArmPlatformPkg/PL180MciDxe: fix Depex for TC2

PL180 on TC2 has a dependency on gEfiCpuArchProtocolGuid.  Without
adding the dependency, TC2 will crash in the PL180 driver.

This problem has been present since d340ef7 when TC2 stopped booting.
However, it was masked by 300fc77 which prevented PL180 from running on
TC2 due to TC2 using a version on PL180 newer than that documented
publicly.

[1] https://github.com/tianocore/edk2/commit/d340ef7
2014-08-26
ArmPkg/ArmArchTimerLib: Remove non required [depex] and IoLib
[2] https://github.com/tianocore/edk2/commit/300fc77
2015-08-25
ArmPlatformPkg/PL180MciDxe: check PrimeCell ID before initializing

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
8 years agoArmPlatformPkg: delete orphaned ArmVExpress.dsc.inc
Leif Lindholm [Tue, 1 Mar 2016 10:13:06 +0000 (10:13 +0000)]
ArmPlatformPkg: delete orphaned ArmVExpress.dsc.inc

In the recent migration of the ARM Ltd. platforms to
https://git.linaro.org/uefi/OpenPlatformPkg.git, this file unfortunately
got left behind. Delete it to reduce confusion and (further) risk of
duplication of effort.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
8 years agoMdeModulePkg: DxeCore: fully initialize image context before passing it on
Ard Biesheuvel [Mon, 29 Feb 2016 16:08:45 +0000 (17:08 +0100)]
MdeModulePkg: DxeCore: fully initialize image context before passing it on

When the DXE core is loaded, it invokes the PeCoffExtraActionLib library
function 'PeCoffLoaderRelocateImageExtraAction' explicitly, which may be
in addition to the same function having been called by the DxeIpl PE/COFF
loader instance.

The ImageContext that DXE core presents to this function is only partially
initialized, which may result in the following output on AArch64 systems:

add-symbol-file ..MdeModulePkg/Core/Dxe/DxeMain/DEBUG/DxeCore.dll 0x5F226240
<some intermediate output>
add-symbol-file ..MdeModulePkg/Core/Dxe/DxeMain/DEBUG/DxeCore.dll 0x5F226000

This is caused by incorrect data in the ImageContext structure, which means
the start of the .text section is calculated incorrectly. In general, it is
the duty of the caller to present a valid ImageContext structure, so let's
add the missing values before invoking PeCoffLoaderRelocateImageExtraAction().

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Star Zeng <star.zeng@intel.com>
8 years agoMdePkg: fix comment typo in DebugLib.h
Leif Lindholm [Mon, 29 Feb 2016 19:42:41 +0000 (19:42 +0000)]
MdePkg: fix comment typo in DebugLib.h

The definition of DEBUG_LOADFILE was incorrectly described as "UNDI
Driver". Correct this to align with MdePkg.dec.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
8 years agoMdeModulePkg/NvmExpress: Fix uninitialized field used in NVMe DiskInfo
Tian, Feng [Mon, 29 Feb 2016 05:12:38 +0000 (13:12 +0800)]
MdeModulePkg/NvmExpress: Fix uninitialized field used in NVMe DiskInfo

Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
8 years agoMdeModulePkg: Add new API HttpUrlGetPath() to HttpLib.h
Fu Siyuan [Mon, 29 Feb 2016 05:51:02 +0000 (13:51 +0800)]
MdeModulePkg: Add new API HttpUrlGetPath() to HttpLib.h

This patch is to add a new interface to get the "Path" component according to
the URI parse result, it would be helpful for the library user to extract the
file path value in a URI.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
8 years agoEmbeddedPkg/AndroidFastboot: fix size with 64bit
Haojian Zhuang [Mon, 29 Feb 2016 14:51:50 +0000 (22:51 +0800)]
EmbeddedPkg/AndroidFastboot: fix size with 64bit

Since there's percentage calcution, multiply on 32bit variable
will cause overflow. So fix the variables as 64bit.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
8 years agoMdeModulePkg/HiiDatabaseDxe: Fix a variable is uninitialized.
Cinnamon Shia [Mon, 22 Feb 2016 02:53:14 +0000 (10:53 +0800)]
MdeModulePkg/HiiDatabaseDxe: Fix a variable is uninitialized.

The StringSize variable in the FindStringBlock function is a IN OUT
parameter of the GetUnicodeStringTextOrSize function.
Thought the GetUnicodeStringTextOrSize function changes the value of
the StringSize variable, it is better to initialize the StringSize
variable before passing it to the GetUnicodeStringTextOrSize function.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Cinnamon Shia <cinnamon.shia@hpe.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
8 years agoMdeModulePkg: PciHostBridgeLibNull: rewrap source to 79 characters
Laszlo Ersek [Mon, 25 Jan 2016 19:47:35 +0000 (20:47 +0100)]
MdeModulePkg: PciHostBridgeLibNull: rewrap source to 79 characters

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Marcel Apfelbaum <marcel@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
8 years agoBaseTools: fix LzmaCompress VS2013 make failure
Yonghong Zhu [Mon, 29 Feb 2016 03:18:12 +0000 (11:18 +0800)]
BaseTools: fix LzmaCompress VS2013 make failure

when make BaseTools by VS2013, LzmaEnc.c report warning C4127:
conditional expression is constant, so this patch fix this issue.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
8 years agoMdeModulePkg: Update PeiCore dispatcher to handle PEIM and PEI_CORE only
Liming Gao [Sat, 6 Feb 2016 01:02:57 +0000 (09:02 +0800)]
MdeModulePkg: Update PeiCore dispatcher to handle PEIM and PEI_CORE only

When PcdShadowPeimOnBoot is FALSE, they are not copied to memory and
execute from their original locations. Here, this policy should only
apply for PEIM and PEI_CORE, not for other file type, such as DXE_CORE.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Tested-by: Eugene Cohen <eugene@hp.com>
8 years agoMdeModulePkg RamDiskDxe: Install Block I/O 2 Protocol on RAM disk devices
Hao Wu [Wed, 17 Feb 2016 03:25:14 +0000 (11:25 +0800)]
MdeModulePkg RamDiskDxe: Install Block I/O 2 Protocol on RAM disk devices

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
8 years agoMdeModulePkg: Add RamDiskDxe driver implementation
Hao Wu [Wed, 3 Feb 2016 06:14:47 +0000 (14:14 +0800)]
MdeModulePkg: Add RamDiskDxe driver implementation

The RamDiskDxe driver will:
1. Produce the EFI RAM Disk Protocol
2. Install RAM disk device path and block I/O related protocols on the
   RAM disk device handle.
3. Install RAM disk configuration form to HII database

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
8 years agoMdeModuelPkg/PciBus: Return AddrTranslationOffset in GetBarAttributes
Ruiyu Ni [Wed, 17 Feb 2016 10:06:36 +0000 (18:06 +0800)]
MdeModuelPkg/PciBus: Return AddrTranslationOffset in GetBarAttributes

Some platform doesn't use CPU(HOST)/Device 1:1 mapping for PCI Bus.
But PCI IO doesn't have interface to tell caller (device driver)
whether the address returned by GetBarAttributes() is HOST address
or device address.
UEFI Spec 2.6 addresses this issue by clarifying the address returned
is HOST address and caller can use AddrTranslationOffset to calculate
the device address.

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: Laszlo Ersek <lersek@redhat.com>
8 years agoMdeModulePkg/PciBus: reorganize case-statement to reduce code lines
Ruiyu Ni [Wed, 24 Feb 2016 08:02:18 +0000 (16:02 +0800)]
MdeModulePkg/PciBus: reorganize case-statement to reduce code lines

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: Laszlo Ersek <lersek@redhat.com>
8 years agoMdeModulePkg/PciBus: Change local variable AddressSpace to Descriptor
Ruiyu Ni [Mon, 15 Feb 2016 06:53:05 +0000 (14:53 +0800)]
MdeModulePkg/PciBus: Change local variable AddressSpace to Descriptor

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: Laszlo Ersek <lersek@redhat.com>
8 years agoMdeModulePkg: Add missing PCD usage information string.
Qiu Shumin [Fri, 26 Feb 2016 08:37:20 +0000 (16:37 +0800)]
MdeModulePkg: Add missing PCD usage information string.

For new PCDs add their usage information strings in UNI file.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: "Yao, Jiewen" <jiewen.yao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
8 years agoSecurityPkg: Tcg2Smm: Change TPM2.0 MMIO range attribute
Zhang, Chao B [Mon, 29 Feb 2016 01:17:03 +0000 (09:17 +0800)]
SecurityPkg: Tcg2Smm: Change TPM2.0 MMIO range attribute

Change TPM2.0 MMIO resource attribute to ReadWrite according to TCG PC Client Platform Firmware Profile Spec.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Anbazhagan Baraneedharan <anbazhagan@hp.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
8 years agoMdeModulePkg:Fix a robustness issue of Mnp Driver
Zhang Lubo [Wed, 24 Feb 2016 03:54:53 +0000 (11:54 +0800)]
MdeModulePkg:Fix a robustness issue of Mnp Driver

v3:
*
When there exists duplicate items in VLAN variable , save the correct
variable content back to the variable storage after duplicate items are removed

Duplicate items in VLAN variable will cause MNP driver binding
start function fall into infinite loop,so we should check it's
content before using it.

Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
8 years agoUefiCpuPkg/Cpuid: Fix GCC build error
Hao Wu [Fri, 26 Feb 2016 08:43:02 +0000 (16:43 +0800)]
UefiCpuPkg/Cpuid: Fix GCC build error

define PRINT_BIT_FIELD(Variable, FieldName) \
  Print (L"%5a%42a: %x\n", #Variable, #FieldName, \
  ##Variable.Bits.##FieldName);

The above definition in UefiCpuPkg/Application/Cpuid/Cpuid.c
will cause GCC build error.

Fix it with:

define PRINT_BIT_FIELD(Variable, FieldName) \
  Print (L"%5a%42a: %x\n", #Variable, #FieldName, \
  Variable.Bits.FieldName);

The '.' has its origin meaning as a member operator in the define
statement. Thus, the token-pasting operator '##' is not necessary here.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
8 years agoShellPkg: Fix unexpected behavior of mouse cursor in Editor.
Qiu Shumin [Fri, 26 Feb 2016 06:52:18 +0000 (14:52 +0800)]
ShellPkg: Fix unexpected behavior of mouse cursor in Editor.

USB mouse cursor cannot move unless the left button is down. The patch
refresh the FileBuffer of Editor every time when the 'MainEditorRefresh'
is called to fix this bug.

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
8 years agoCorebootModulePkg-CbParseLib: Fix bad reference in CbParseLib
Leahy, Leroy P [Thu, 25 Feb 2016 02:55:51 +0000 (18:55 -0800)]
CorebootModulePkg-CbParseLib: Fix bad reference in CbParseLib

Dereferencing pMemTableSize in debug statement displays bad values when
it is set to NULL.  Display the actual table size value instead.

TEST=Build and run on Galileo Gen2

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>
Reviewed-by: Prince Agyeman <prince.agyeman@intel.com>
8 years agoCorebootModulePkg-CbParseLib: Add ACPI table verification
Leahy, Leroy P [Thu, 25 Feb 2016 02:53:31 +0000 (18:53 -0800)]
CorebootModulePkg-CbParseLib: Add ACPI table verification

Verify the register address in the FADT.

TEST=Build and run on Galileo Gen2 when the FADT was not present.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>
Reviewed-by: Prince Agyeman <prince.agyeman@intel.com>
8 years agoMdeModulePkg: RegularExpressionDxe: support free(NULL)
Laszlo Ersek [Wed, 24 Feb 2016 20:00:04 +0000 (21:00 +0100)]
MdeModulePkg: RegularExpressionDxe: support free(NULL)

The ISO C standard says about free(),

  If ptr is a null pointer, no action occurs.

This is not true of the FreePool() interface of the MemoryAllocationLib
class:

  Buffer must have been allocated on a previous call to the pool
  allocation services of the Memory Allocation Library. [...] If Buffer
  was not allocated with a pool allocation function in the Memory
  Allocation Library, then ASSERT().

Therefore we must not forward the argument of free() to FreePool() without
checking.

Cc: Cecil Sheng <cecil.sheng@hpe.com>
Cc: Cinnamon Shia <cinnamon.shia@hpe.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Qiu Shumin <shumin.qiu@intel.com>
Cc: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Cc: Yao Jiewen <Jiewen.Yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-By: Cinnamon Shia <cinnamon.shia@hpe.com>
8 years agoArmPlatformPkg: PL061 - rewrite the hardware interaction
Leif Lindholm [Wed, 28 Oct 2015 18:11:49 +0000 (18:11 +0000)]
ArmPlatformPkg: PL061 - rewrite the hardware interaction

The PL061 GPIO controller is a bit of an anachronism, and the existing
driver does nothing to hide this - leading to it being very tricky to
read.

Rewrite it to document (in comments and code) what is actually
happening, and fix some bugs in the process.

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>
8 years agoArmPlatformPkg: PL061 - drop pointless initialize function
Leif Lindholm [Wed, 10 Feb 2016 16:38:26 +0000 (16:38 +0000)]
ArmPlatformPkg: PL061 - drop pointless initialize function

PL061Initialize() did not actually do anything other than call
PL061Identify() - so cut out the middle man.

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>
8 years agoArmPlatformPkg: PL061 - only initialize on protocol load
Leif Lindholm [Wed, 28 Oct 2015 18:08:53 +0000 (18:08 +0000)]
ArmPlatformPkg: PL061 - only initialize on protocol load

For whatever reason, every single operation on the PL061 looked for an
"Initialized" flag, and manually called the initialization function if
not set. Move this to a single call on protocol installation.

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>
8 years agoArmPlatformPkg: PL061 - reformat copyright statement.
Leif Lindholm [Wed, 28 Oct 2015 18:00:16 +0000 (18:00 +0000)]
ArmPlatformPkg: PL061 - reformat copyright statement.

The copyright statement in PL061Gpio.c would not fit on a normal terminal
screen. Break lines at <= 80 characters.

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>
8 years agoMdeModulePkg: AcpiTableDxe: fix VS2008 build by merging adjacent if blocks
Ard Biesheuvel [Thu, 25 Feb 2016 16:20:21 +0000 (17:20 +0100)]
MdeModulePkg: AcpiTableDxe: fix VS2008 build by merging adjacent if blocks

The assignment of CurrentRsdtEntry and its subsequent dereference are
subject to the same condition, but for some reason, VS2008 does not see
that and warns about the dereference possibly involving an uninitialized
pointer. Since the single statememt between the blocks is unrelated, we
can just move it and merge the two conditional blocks together.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: David Woodhouse <David.Woodhouse@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
8 years agoMdeModulePkg/PciHostBridge: Don't assume resources are fully NonExistent
Ruiyu Ni [Thu, 25 Feb 2016 09:13:31 +0000 (17:13 +0800)]
MdeModulePkg/PciHostBridge: Don't assume resources are fully NonExistent

The patch removes the assumption that the resources claimed by root
bridges should not exist. Because resources might have been added:
1. by platform modules either in PEI through resource HOB, or in DXE,
   before the PCI host bridge driver runs.
2. Resources claimed by different root bridges may overlap so that
   resource adding operation for latter root bridges may fail if
   we assume the resource should not exist.

In real world, this patch is to fit OVMF platform needs because
different root bridges in OVMF platform shares the same resources.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
[lersek@redhat.com: intersection-based implementation]
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
8 years agoMdeModulePkg/PciHostBridge: Refine function header comments.
Ruiyu Ni [Thu, 25 Feb 2016 01:14:29 +0000 (09:14 +0800)]
MdeModulePkg/PciHostBridge: Refine function header comments.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Shumin Qiu <shumin.qiu@intel.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
8 years agoSecurityPkg: Use FileExplorerLib in SecureBootConfigDxe
Dandan Bi [Thu, 28 Jan 2016 01:36:43 +0000 (09:36 +0800)]
SecurityPkg: Use FileExplorerLib in SecureBootConfigDxe

Using existing library FileExplorerLib to replace the same
logic in SecureBootConfigDxe to make the code clear. After using
FileExplorerLib, the UI behavior for enroll PK will change,
previously when select one PK file, commit/discard changes will
return to Device Manager,press ESC will return to FileExplorer.
Now using FileExplorerLib the behavior will keep same with
enroll KEK/DB/..., commit/discard changes will return to Custom
Secure Boot Options form and ESC will return to PK options form.

Cc: Chao Zhang <chao.b.zhang@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
8 years agoSecurityPkg: Add FileExplorerLib.inf to the dsc file
Dandan Bi [Wed, 24 Feb 2016 12:21:28 +0000 (20:21 +0800)]
SecurityPkg: Add FileExplorerLib.inf to the dsc file

Add FileExplorerLib to SecurePkg DSC to pass build,
as SecureBootConfigDxe requires this library now.

Cc: Chao Zhang <chao.b.zhang@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: Chao Zhang <chao.b.zhang@intel.com>
8 years agoVlv2TbltDevicePkg: Add FileExplorerLib.inf to the dsc file
Dandan Bi [Wed, 24 Feb 2016 12:20:24 +0000 (20:20 +0800)]
Vlv2TbltDevicePkg: Add FileExplorerLib.inf to the dsc file

Because SecureBootConfigDxe use FileExplorerLib now, but
FileExplorerLib is not in the dsc file of the package
that use SecureBootConfigDxe. Now add it to pass build.

Cc: David Wei <david.wei@intel.com>
Cc: Tim He <tim.he@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: David Wei <david.wei@intel.com>
8 years agoOvmfPkg: Add FileExplorerLib.inf to the dsc file
Dandan Bi [Wed, 24 Feb 2016 12:18:53 +0000 (20:18 +0800)]
OvmfPkg: Add FileExplorerLib.inf to the dsc file

Because SecureBootConfigDxe use FileExplorerLib now, but
FileExplorerLib is not in the dsc file of the package
that use SecureBootConfigDxe. Now add it to pass build.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.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: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoArmVirtPkg: Add FileExplorerLib.inf to the QEMU dsc files
Dandan Bi [Wed, 24 Feb 2016 12:15:52 +0000 (20:15 +0800)]
ArmVirtPkg: Add FileExplorerLib.inf to the QEMU dsc files

Because SecureBootConfigDxe use FileExplorerLib now, but
FileExplorerLib is not in the dsc files of the package
that use SecureBootConfigDxe. Now add it to pass build.

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
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: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
8 years agoMdeModulePkg: Add ASSERT to make sure pointer 'OptionalData' not be NULL
Dandan Bi [Thu, 25 Feb 2016 07:09:39 +0000 (15:09 +0800)]
MdeModulePkg: Add ASSERT to make sure pointer 'OptionalData' not be NULL

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: Liming Gao <liming.gao@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
8 years agoMdeModulePkg: Add ASSERT to make sure pointer 'MemoryMap' is not NULL.
Qiu Shumin [Thu, 25 Feb 2016 05:00:28 +0000 (13:00 +0800)]
MdeModulePkg: Add ASSERT to make sure pointer 'MemoryMap' is not NULL.

If 'CoreGetMemoryMap' return success the 'MemoryMap' shouldn't be NULL.
Add code to make sure this.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Yao Jiewen <Jiewen.Yao@intel.com>
8 years agoDuetPkg-PciBusNoEnumerationDxe: Fix stack overflow
Lee Leahy [Fri, 26 Feb 2016 02:07:51 +0000 (10:07 +0800)]
DuetPkg-PciBusNoEnumerationDxe: Fix stack overflow

When a PCI bridge is not enabled, the secondary bus may still be zero.
This causes an infinite recursive call to enumerate bus 0 which results
in a stack overflow.  The easy fix is to skip the recursive bus
enumeration for bridges which do not have the secondary bus initialized.

TEST=Build and run CorebootPayloadPkg on Quark/Galileo Gen2

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
8 years agoCryptoPkg: RuntimeCryptLib: support realloc(NULL, size)
Laszlo Ersek [Wed, 24 Feb 2016 20:00:04 +0000 (21:00 +0100)]
CryptoPkg: RuntimeCryptLib: support realloc(NULL, size)

The ISO C standard says about realloc(),

  If ptr is a null pointer, the realloc function behaves like the malloc
  function for the specified size.

The realloc() implementation doesn't conform to this currently, so add a
check and call malloc() if appropriate.

Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Qin Long <qin.long@intel.com>
Cc: Ting Ye <ting.ye@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Qin Long <qin.long@intel.com>
8 years agoCryptoPkg: RuntimeCryptLib: support free(NULL)
Laszlo Ersek [Wed, 24 Feb 2016 20:00:04 +0000 (21:00 +0100)]
CryptoPkg: RuntimeCryptLib: support free(NULL)

The ISO C standard says about free(),

  If ptr is a null pointer, no action occurs.

This is not true of the RuntimeFreeMem() internal function. Therefore we
must not forward the argument of free() to RuntimeFreeMem() without
checking.

Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Qin Long <qin.long@intel.com>
Cc: Ting Ye <ting.ye@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Qin Long <qin.long@intel.com>
8 years agoCryptoPkg: BaseCryptLib: support free(NULL)
Laszlo Ersek [Wed, 24 Feb 2016 20:00:04 +0000 (21:00 +0100)]
CryptoPkg: BaseCryptLib: support free(NULL)

The ISO C standard says about free(),

  If ptr is a null pointer, no action occurs.

This is not true of the FreePool() interface of the MemoryAllocationLib
class:

  Buffer must have been allocated on a previous call to the pool
  allocation services of the Memory Allocation Library. [...] If Buffer
  was not allocated with a pool allocation function in the Memory
  Allocation Library, then ASSERT().

Therefore we must not forward the argument of free() to FreePool() without
checking.

This bug can be triggered by upstream OpenSSL commit 8e704858f219
("RT3955: Reduce some stack usage"), for example.

Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Qin Long <qin.long@intel.com>
Cc: Ting Ye <ting.ye@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Qin Long <qin.long@intel.com>
8 years agoMdePkg: Add EFI RAM Disk Protocol definitions
Hao Wu [Wed, 3 Feb 2016 04:58:01 +0000 (12:58 +0800)]
MdePkg: Add EFI RAM Disk Protocol definitions

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>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: M1cha <sigmaepsilon92@gmail.com>
8 years agoMdePkg: Update Http11 with additional useful definitions
Samer El-Haj-Mahmoud [Thu, 18 Feb 2016 22:47:07 +0000 (06:47 +0800)]
MdePkg: Update Http11 with additional useful definitions

Add additional HTTP 1.1 definitions that are useful in HTTP
applications, such as User-Agent, Location, and x-Auth-Token

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
8 years agoNetworkPkg: Use Http11 definitions in HttpDxe and HttpBootDxe
Samer El-Haj-Mahmoud [Thu, 18 Feb 2016 22:47:36 +0000 (06:47 +0800)]
NetworkPkg: Use Http11 definitions in HttpDxe and HttpBootDxe

Change HttpDxe and HttpBootDxe to use the standard definitions from
Http11.h instead of private duplicate definitions.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
8 years agoMdeModulePkg: Add submitted callback test case in DriverSample
Dandan Bi [Tue, 23 Feb 2016 03:04:20 +0000 (11:04 +0800)]
MdeModulePkg: Add submitted callback test case in DriverSample

Now we add new HII action type EFI_BROWSER_ACTION_SUBMITTED in
EFI HII Configuration Access Protocol, so add the test case in
DriverSample to show how to use it and whether it works.

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: Liming Gao <liming.gao@intel.com>
8 years agoMdeModulePkg: Add new HII action type EFI_BROWSER_ACTION_SUBMITTED
Dandan Bi [Tue, 23 Feb 2016 02:59:10 +0000 (10:59 +0800)]
MdeModulePkg: Add new HII action type EFI_BROWSER_ACTION_SUBMITTED

Add new HII action type EFI_BROWSER_ACTION_SUBMITTED
to notify HII driver when its question values are submitted.

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: Liming Gao <liming.gao@intel.com>
8 years agoMdePkg: Add new HII action type EFI_BROWSER_ACTION_SUBMITTED
Dandan Bi [Tue, 23 Feb 2016 02:46:44 +0000 (10:46 +0800)]
MdePkg: Add new HII action type EFI_BROWSER_ACTION_SUBMITTED

Base on the UEFI2.6, Add the new HII action type
EFI_BROWSER_ACTION_SUBMITTED to notify HII driver
when its question values are submitted.

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: Liming Gao <liming.gao@intel.com>
8 years agoUefiCpuPkg/Cpuid: Add UEFI CPUID application
Michael Kinney [Fri, 19 Feb 2016 07:16:02 +0000 (23:16 -0800)]
UefiCpuPkg/Cpuid: Add UEFI CPUID application

Add UEFI application to UefiCpuPkg to display all supported CPUID
leafs and sub-leafs described by UefiCpuPkg/Include/Register/Cpuid.h
that is based on information from Intel(R) 64 and IA-32
Architectures Software Developer's Manual, Volume 2A, December
2015, CPUID instruction.

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
8 years agoUefiCpuPkg/Cpuid.h: Add CPUID leaf/sub-leaf defines and structures
Michael Kinney [Fri, 19 Feb 2016 07:15:48 +0000 (23:15 -0800)]
UefiCpuPkg/Cpuid.h: Add CPUID leaf/sub-leaf defines and structures

Add CPUID leaf and sub-leaf indexes and structures as described by
Intel(R) 64 and IA-32 Architectures Software Developer's Manual,
Volume 2A, December 2015, CPUID instruction.

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
8 years agoBaseTools/tools_def.txt: Add -march=i586 for IA32 GCC targets
Michael Kinney [Tue, 23 Feb 2016 00:46:06 +0000 (16:46 -0800)]
BaseTools/tools_def.txt: Add -march=i586 for IA32 GCC targets

Newer GCC compilers use a default of march higher than i586
for -m32 (IA32 configuration) and this is causing generation of
instructions that are not compatible with all IA32 targets.
Specically Galileo platform support in the QuarkPlatformPkg does
not boot if GCC48 or higher is used.

This is similar to the following checkin that was done to address
this same issue for VS2012 and higher tool chains:

SHA-1: 71028ba2c4c398d70475504e671d048d9003d90f

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Leroy Leahy <leroy.p.leahy@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
8 years agoMdeModulePkg: Fix Memory Attributes table type issue
Jiewen Yao [Tue, 23 Feb 2016 04:43:57 +0000 (12:43 +0800)]
MdeModulePkg: Fix Memory Attributes table type issue

According to the spec, each entry in the Memory
Attributes table shall have the same type as
the region it was carved out of in the UEFI memory map.
The current attribute uses RTData for PE Data, but
it should be RTCode.

This patch fixed the issue. It is validated with or
without PropertiesTable.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
8 years agoMdeModulePkg: Fix the build fail issue on VS2008\VS2010\GCC
Dandan Bi [Wed, 24 Feb 2016 01:03:22 +0000 (09:03 +0800)]
MdeModulePkg: Fix the build fail issue on VS2008\VS2010\GCC

This is caused by my last commit,the LoadOption may
not initialize when call FreePool, and after investigation,
find that we can delete the LoadOption variable, this patch
is to fix this issue.

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: Liming Gao <liming.gao@intel.com>
8 years agoMdePkg: Add definition for new warning code EFI_WARN_FILE_SYSTEM.
Fu Siyuan [Mon, 15 Feb 2016 05:57:41 +0000 (13:57 +0800)]
MdePkg: Add definition for new warning code EFI_WARN_FILE_SYSTEM.

Add the definition for the new return status code defined in UEFI 2.6.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
8 years agoOvmfPkg: add driver for Virtio-RNG device
Ard Biesheuvel [Wed, 24 Feb 2016 08:27:30 +0000 (09:27 +0100)]
OvmfPkg: add driver for Virtio-RNG device

This adds the new Virtio-RNG DXE module to all three builds of
OvmfPkg. Note that QEMU needs to be invoked with the 'device
virtio-rng-pci' option in order for this device to be exposed to
the guest.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
8 years agoArmVirtPkg: ArmVirtQemu: add driver for Virtio-RNG device
Ard Biesheuvel [Mon, 22 Feb 2016 07:52:15 +0000 (08:52 +0100)]
ArmVirtPkg: ArmVirtQemu: add driver for Virtio-RNG device

This adds the new Virtio-RNG DXE module to the default build of
ArmVirtQemu. Note that QEMU needs to be invoked with the 'device
virtio-rng-pci' option in order for this device to be exposed to
the guest.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
8 years agoOvmfPkg: implement UEFI driver for Virtio RNG devices
Ard Biesheuvel [Fri, 19 Feb 2016 10:43:12 +0000 (11:43 +0100)]
OvmfPkg: implement UEFI driver for Virtio RNG devices

This implements a UEFI driver model driver for Virtio devices of type
VIRTIO_SUBSYSTEM_ENTROPY_SOURCE, and exposes them via instances of
the EFI_RNG_PROTOCOL protocol, supporting the EFI_RNG_ALGORITHM_RAW
algorithm only.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
8 years agoOvmfPkg: VirtioFlush(): return the number of bytes written by the host
Laszlo Ersek [Fri, 19 Feb 2016 17:15:07 +0000 (18:15 +0100)]
OvmfPkg: VirtioFlush(): return the number of bytes written by the host

VirtioLib provides an API for simple, synchronous (request/response-style)
virtio communication. The guest driver builds one descriptor chain, link
for link, with VirtioPrepare() and VirtioAppendDesc(), then submits the
chain, and awaits the processing, with VirtioFlush().

The descriptor chain is always built at the beginning of the descriptor
area, with the head descriptor having descriptor index 0.

In order to submit the descriptor chain to the host, the guest always
pushes a new "available element" to the Available Ring, in genuine
queue-like fashion, with the new element referencing the head descriptor
(which always has index 0, see above).

In turn, after processing, the host always pushes a new "used element" to
the Used Ring, in genuine queue-like fashion, with the new element
referencing the head descriptor of the chain that was just processed. The
same element also reports the number of bytes that the host wrote,
consecutively across the host-writeable buffers that were linked by the
descriptors.

(See "OvmfPkg/VirtioNetDxe/TechNotes.txt" for a diagram about the
descriptor area and the rings.)

Because at most one descriptor chain can be in flight with VirtioLib at
any time,

- the Available Ring and the Used Ring proceed in lock-step,

- and the head descriptor that the new "available" and "used" elements can
  ever reference has index 0.

Based on the above, we can modify VirtioFlush() to return the number of
bytes written by the host across the descriptor chain. The virtio-block
and virtio-scsi drivers don't care (they have other ways to parse the data
produced by the host), while the virtio-net driver doesn't use
VirtioFlush() at all (it employs VirtioLib only to set up its rings).

However, the virtio entropy device,  to be covered in the upcoming
patches, reports the amount of randomness produced by the host only
through this quantity.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoArmPlatformPkg/IntelBds: call BdsLibConnectAll()
Leif Lindholm [Wed, 25 Nov 2015 17:24:29 +0000 (17:24 +0000)]
ArmPlatformPkg/IntelBds: call BdsLibConnectAll()

Currently, we don't pick up removable media (USB drives) or storage
devices connected via plug-in cards. Take the sledge hammer approach
for now.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Tested-by: Ryan Harkin <ryan.harkin@linaro.org>
Reviewed-by: Ryan Harkin <ryan.harkin@linaro.org>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
8 years agoArmVirtPkg/ArmVirtQemu: limit ACPI support to v5.0 and higher
Ard Biesheuvel [Thu, 18 Feb 2016 19:51:08 +0000 (20:51 +0100)]
ArmVirtPkg/ArmVirtQemu: limit ACPI support to v5.0 and higher

The ACPI spec predates the AARCH64 architecture by 5 versions, so there
is no point in supporting anything below v5.0. So set the PCD that
controls the ACPI table generation to the appropriate value.

Note that the current consumers of this PCD only check whether bit 1
is set or not (i.e., ACPI v1.0b), but this may change in the future,
so let's choose a meaningful value right away.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
8 years agoMdeModulePkg: AcpiTableDxe: make 4 GB table allocation limit optional
Ard Biesheuvel [Wed, 17 Feb 2016 14:37:58 +0000 (15:37 +0100)]
MdeModulePkg: AcpiTableDxe: make 4 GB table allocation limit optional

AARCH64 systems never require compatibility with legacy ACPI OSes, and
may not have any 32-bit addressable system RAM. To support ACPI on these
systems, we need to be able to relax the 4 GB allocation restriction.

So add a PCD PcdAcpiExposedTableVersions containing a bitmask describing
which ACPI versions are targeted, and wire it up it up to the memory
allocation calls in AcpiTableDxe/AcpiTableProtocol.c. I.e., if ACPI v1.0b
is not among the supported versions, the memory allocations are not limited
to 4 GB, and only table types that carry 64-bit addresses are emitted.

Note that this will inhibit the publishing of any tables that carry only
32-bit addresses, i.e., RSDPv1, RSDTv1 and RSDTv3.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
8 years agoMdeModulePkg: Add sample help information for HelloWorld application.
Qiu Shumin [Sun, 21 Feb 2016 07:55:14 +0000 (15:55 +0800)]
MdeModulePkg: Add sample help information for HelloWorld application.

Since Shell supports finding help information from resource section
of application image. We enhance the HelloWorld to add help information
string. After the HelloWorld are loaded in system the help string will
be stored in resource section of the application image.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
8 years agoShellPkg: Support finding help message embedded in resource section.
Qiu Shumin [Sun, 21 Feb 2016 07:52:53 +0000 (15:52 +0800)]
ShellPkg: Support finding help message embedded in resource section.

UEFI Shell scandalizes the help message in spec level so that a standalone
UEFI shell application can never get "-?" switch, instead the Shell core
(interpreter) detects the "-?" and finds .MAN file for that shell
application in certain spec defined paths, then show the help extracted
from that .MAN file.

But it means distributing a UEFI shell application not only means
distributing a .EFI file but also distributing a .MAN file. If the text
formatted .MAN file is corrupted (edited by user by mistake), or is
missing (deleted by user by mistake), no help will be shown to user.

So this patch enhance the Shell to make it support finding help message
imbedded in resource section of application image.

Cc: Jaben Carsey <jaben.carsey@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
8 years agoMdeModulePkg/UsbBusDxe: Fix memory leak
Alcantara, Paulo [Mon, 8 Feb 2016 20:53:34 +0000 (04:53 +0800)]
MdeModulePkg/UsbBusDxe: Fix memory leak

Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Paulo Alcantara <paulo.alc.cavalcanti@hp.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
8 years agoMdePkg: BaseLib: fix AArch64 DAIF interrupt mask definitions
Cohen, Eugene [Mon, 22 Feb 2016 21:59:52 +0000 (21:59 +0000)]
MdePkg: BaseLib: fix AArch64 DAIF interrupt mask definitions

The AArch64 DAIF bits are different for reading (mrs) versus writing (msr).
The bitmask definitions assumed they were the same causing incorrect
results when trying to determine the current interrupt state through
GetInterruptState.

The logic for interpreting the DAIF read data using the csel instruction
was also incorrect and is fixed.

Replaced the magic numbers in DisableInterrupts.S and EnableInterrupts.S
with definitions for the DAIF write (daifset/daifclr) IRQ field.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eugene Cohen <eugene@hp.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
8 years agoArmPkg: CpuDxe: don't track interrupt state in a global variable
Cohen, Eugene [Mon, 22 Feb 2016 23:08:27 +0000 (23:08 +0000)]
ArmPkg: CpuDxe: don't track interrupt state in a global variable

Update the CpuDxe driver to remove an assumption that it is the only
component modifying interrupt state since this can be done through BaseLib
as well. Instead of using a global variable for last interrupt state we
now check the current PSTATE value directly.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eugene Cohen <eugene@hp.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
8 years agoArmPkg: CpuDxe: fix AArch64 interrupt read masks
Cohen, Eugene [Mon, 22 Feb 2016 23:08:27 +0000 (23:08 +0000)]
ArmPkg: CpuDxe: fix AArch64 interrupt read masks

The AArch64 DAIF bits are different for reading (mrs) versus writing
(msr). The bitmask definitions assumed they were the same causing
incorrect results when trying to determine the current interrupt
state through ArmGetInterruptState.

The logic for interpreting the DAIF read data using the csel instruction
was also incorrect and is fixed.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eugene Cohen <eugene@hp.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
8 years agoMdeModulePkg: Refine the code in BootMaintenanceManagerUiLib
Dandan Bi [Tue, 26 Jan 2016 08:07:18 +0000 (16:07 +0800)]
MdeModulePkg: Refine the code in BootMaintenanceManagerUiLib

Refine the code in function Var_UpdateDriverOption and Var_UpdateBootOption,
use the existed API(EfiBootManagerInitializeLoadOption and
EfiBootManagerAddLoadOptionVariable) supplied by UefiBootManagerLib
to replace the same logic in the two functions. And remove the useless
code.

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: Liming Gao <liming.gao@intel.com>
8 years agoMdeModulePkg: HiiDatabaseDxe: HiiStringToImage() should not overwrite BltX
Dandan Bi [Fri, 19 Feb 2016 04:24:20 +0000 (12:24 +0800)]
MdeModulePkg: HiiDatabaseDxe: HiiStringToImage() should not overwrite BltX

when has next line to draw, should not overwrite the BltX
to 0, instead should keep the BltX value that pass into
StringToImage function.

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: Liming Gao <liming.gao@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
8 years agoMdeModulePkg/Partition: Fix 64bit build failure caused by last patch
Ni, Ruiyu [Mon, 22 Feb 2016 02:45:01 +0000 (10:45 +0800)]
MdeModulePkg/Partition: Fix 64bit build failure caused by last patch

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
8 years agoCryptoPkg/OpensslLib: Upgrade OpenSSL version to 1.0.2f
Qin Long [Tue, 23 Feb 2016 03:12:51 +0000 (11:12 +0800)]
CryptoPkg/OpensslLib: Upgrade OpenSSL version to 1.0.2f

OpenSSL has released version 1.0.2f with two security fixes
(http://www.openssl.org/news/secadv/20160128.txt) at 28-Jan-2016.
Upgrade the supported OpenSSL version in CryptoPkg/OpensslLib
to catch the latest release 1.0.2f.
(NOTE: The patch file was just re-generated, and no new source
       changes was introduced for 1.0.2f enabling)

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qin Long <qin.long@intel.com>
Reviewed-by: Ting Ye <ting.ye@intel.com>
8 years agoShellPkg: Do NULL pointer check before the pointer is used.
Qiu Shumin [Mon, 22 Feb 2016 02:21:38 +0000 (10:21 +0800)]
ShellPkg: Do NULL pointer check before the pointer is used.

Do NULL pointer check before the pointer is used to avoid dereferenced.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
8 years agoUefiCpuPkg/PiSmmCpuDxeSmm: Enable/Restore XD in SMM
Michael Kinney [Thu, 18 Feb 2016 21:09:23 +0000 (13:09 -0800)]
UefiCpuPkg/PiSmmCpuDxeSmm: Enable/Restore XD in SMM

If XD is supported, then SMM enables it.  The non-SMM execution
environment can choose to enable or disable XD, so the state of
XD must be detected in each SMI and be enabled/restored.

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
8 years agoUefiCpuPkg/PiSmmCpuDxeSmm: Add EFIAPI to CheckFeatureSupported()
Michael Kinney [Thu, 18 Feb 2016 17:46:25 +0000 (09:46 -0800)]
UefiCpuPkg/PiSmmCpuDxeSmm: Add EFIAPI to CheckFeatureSupported()

The function CheckFeatureSupported() is used as an EFI_AP_PROCEDURE
in the MP Services Protocol service StartAllAPs().  Any function
used as an EFI_AP_PROCEDURE must use EFIAPI calling convention.

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
8 years agoArmVirtPkg: ArmVirtQemu: make ACPI support AARCH64 only
Ard Biesheuvel [Mon, 22 Feb 2016 16:38:31 +0000 (17:38 +0100)]
ArmVirtPkg: ArmVirtQemu: make ACPI support AARCH64 only

No ARM support for ACPI is planned under any OS we intend to run under
ArmVirtQemu-ARM, so remove the drivers from the ARM build.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
8 years agoSecurityPkg: TcgConfigDxe: Move TPM state string update to CallBack function
Zhang, Chao B [Mon, 22 Feb 2016 05:51:53 +0000 (13:51 +0800)]
SecurityPkg: TcgConfigDxe: Move TPM state string update to CallBack function

TPM state string update requires HiiHandle which may not be initialized when calling ExtractConfig.
Move this logic to CallBack function.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
8 years agoMdePkg: Fix incorrect PCIe Extended Capabilities definition
Samer El-Haj-Mahmoud [Fri, 19 Feb 2016 00:01:11 +0000 (08:01 +0800)]
MdePkg: Fix incorrect PCIe Extended Capabilities definition

The HeaderLog field of the PCIe Extended Capabilities Advanced Error
Reporting structure was incorrectly defined as a 32-bit field. The PCIe
2.1 Base Specification, section 7.10, lists this as 16 bytes, or 4
DWORDs.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
8 years agoBaseTools/Trim: Fix the bug for stripping when no line directive in file
Yonghong Zhu [Wed, 17 Feb 2016 06:58:02 +0000 (14:58 +0800)]
BaseTools/Trim: Fix the bug for stripping when no line directive in file

when no line directive in file, the tool still need to strip the typedef
statement (eg: typedef struct, typedef union ..).

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
8 years agoShellPkg: Fix the last command doesn't work in a script.
Qiu Shumin [Thu, 18 Feb 2016 05:12:58 +0000 (13:12 +0800)]
ShellPkg: Fix the last command doesn't work in a script.

When the last line in a script file is not an empty line the Shell
will not execute the command in the last line. The patch refine the
logic in function 'ShellFileHandleReturnLine' and fix the issue.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
8 years agoMdeModulePkg/Partition: Use proper partition number for MBR
Ruiyu Ni [Thu, 18 Feb 2016 06:25:56 +0000 (14:25 +0800)]
MdeModulePkg/Partition: Use proper partition number for MBR

UEFI Spec 2.3.1.D Section 9.3.5.1 says Partitions are numbered
according to their entry in their respective partition table,
starting with 1.
Update the code for MBR partition to follow this rule.

Ref: https://github.com/tianocore/edk2/issues/50

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
8 years agoMdePkg: Change PcdPropertiesTableEnable default value to
Jiewen Yao [Fri, 19 Feb 2016 02:12:18 +0000 (10:12 +0800)]
MdePkg: Change PcdPropertiesTableEnable default value to
 FALSE

UEFI2.6 specification does not recommend to use BIT0
attribute for PropertiesTable, so we change default
value to FALSE.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Reviewed-by: "Gao, Liming" <liming.gao@intel.com>
Reviewed-by: "Ard Biesheuvel" <ard.biesheuvel@linaro.org>
Reviewed-by: "Laszlo Ersek" <lersek@redhat.com>
8 years agoBaseTools/Conf/XMLSchema: Reformat XML using Visual Studio 2013
Larry Hauch [Mon, 8 Feb 2016 23:18:27 +0000 (15:18 -0800)]
BaseTools/Conf/XMLSchema: Reformat XML using Visual Studio 2013

There are no functional changes in this patch.
The only change is to the XML format, updated using Visual Studio
Edit->Advanced->Format Document.

Different XML Schema editors use different formats for indentation and
line breaks. Visual Studio 2013 uses a two space indentation for content.

Cc: Zhu Yonghong <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Larry Hauch <larry.hauch@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
8 years agoArmPlatformPkg: Remove orphaned Juno Makefile
Leif Lindholm [Thu, 18 Feb 2016 10:23:04 +0000 (10:23 +0000)]
ArmPlatformPkg: Remove orphaned Juno Makefile

The Juno .dsc and .fdf files were recently deleted (currently held
in OpenPlatformPkg), but a spurious Makefile for building using it
was left in place. Drop the Makefile to complete the cleanup.

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>
8 years agoArmPlatformPkg: remove obsolete/outdated AArch64 bootstrap
Leif Lindholm [Thu, 18 Feb 2016 10:10:18 +0000 (10:10 +0000)]
ArmPlatformPkg: remove obsolete/outdated AArch64 bootstrap

Harking back to the earliest days of software development for AArch64,
this piece of code abstracted away "early setup stuff" when the
software model came out of reset.
However, it is unmaintained and has been superseded by ARM Trusted
Firmware. So drop it.

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>
8 years agoArmVirtPkg: ArmVirtQemu: expose only 64-bit entry point for v3.0+ SMBIOS
Ard Biesheuvel [Thu, 18 Feb 2016 08:59:09 +0000 (09:59 +0100)]
ArmVirtPkg: ArmVirtQemu: expose only 64-bit entry point for v3.0+ SMBIOS

The legacy 32-bit SMBIOS entry point has little use on AARCH64 systems,
since many such systems have no 32-bit addressable physical RAM, and so
OSes that implement SMBIOS will have to be able to deal with the 64-bit
entry point anyway.

Given that the OS will map main memory in 1 GB chunks if it can, and that
punching a page sized hole (e.g., for SMBIOS data) into it will result in
the whole 1 GB chunk being mapped using 2 MB and 4 KB blocks instead, it
is important to group memory reservations from the OS as much as we can,
and allocating below 4 GB for no good reason interferes with that.

This is especially important under virtualization, considering that each
*level* of lookup at stage 1 (the guest virtual page table) will result in
a full page table walk at stage 2 (the guest PA to host PA mapping).

So expose only the 64-bit entry point when the SMBIOS tables adhere to
version 3.0 or later.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
8 years agoShellPkg: Do NULL pointer check before the pointer is used.
Qiu Shumin [Tue, 16 Feb 2016 01:49:05 +0000 (09:49 +0800)]
ShellPkg: Do NULL pointer check before the pointer is used.

The pointer 'FileInterface->Buffer' returned from 'AllocateZeroPool' in function
'CreateFileInterfaceMem' may be NULL and will be dereferenced at the following code.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
8 years agoNetworkPkg: Replace the internal function with exposed one
Jiaxin Wu [Thu, 21 Jan 2016 17:40:56 +0000 (01:40 +0800)]
NetworkPkg: Replace the internal function with exposed one

This patch is used to replace the internal function with
the exposed one defined in NetLib.h.

Cc: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
Cc: El-Haj-Mahmoud Samer <samer.el-haj-mahmoud@hpe.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
8 years agoMdeModulePkg: Define a general function to create DNS QName
Jiaxin Wu [Thu, 21 Jan 2016 17:35:58 +0000 (01:35 +0800)]
MdeModulePkg: Define a general function to create DNS QName

This patch is used to define a general function to create
DNS QName.
QName is a domain name represented as a sequence
of labels, where each label consists of a length octet
followed by that number of octets. The domain name terminates
with the zero length octet for the null label of the root.

Cc: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
Cc: El-Haj-Mahmoud Samer <samer.el-haj-mahmoud@hpe.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
8 years agoBaseTools: LzmaCompress: fix gcc-6 warning "misleading-indentation"
Laszlo Ersek [Sun, 14 Feb 2016 07:17:16 +0000 (08:17 +0100)]
BaseTools: LzmaCompress: fix gcc-6 warning "misleading-indentation"

The way the first use of the "_maxMode" variable is commented out (i.e.,
together with the enclosing "if" statement) in GetOptimum() triggers the
"misleading-indentation" warning that is new in gcc-6.0, for the block of
code that originally depended on the "if" statement. Gcc believes
(mistakenly) that the programmer believes (mistakenly) that the block
depends on (repIndex == 0) higher up.

Restore the if statement, with a controlling expression that comprises the
constant 1 and "_maxMode" commented out.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Cole Robinson <crobinso@redhat.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Reported-by: Cole Robinson <crobinso@redhat.com>
Suggested-by: Jordan Justen <jordan.l.justen@intel.com>
Build-tested-by: Cole Robinson <crobinso@redhat.com>
Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1307439
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: Liming Gao <liming.gao@intel.com>
8 years agoBaseTools/VolInfo: add some generic options
Yonghong Zhu [Wed, 17 Feb 2016 03:24:47 +0000 (11:24 +0800)]
BaseTools/VolInfo: add some generic options

The Help information provided by VolInfo does not follow the EDK II Tools
Design doc, so this patch update the help text and add the generic
options: -d, -v, -q, -s.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
8 years agoBaseTools: report an error message when failed to start build command
Yonghong Zhu [Wed, 17 Feb 2016 06:48:28 +0000 (14:48 +0800)]
BaseTools: report an error message when failed to start build command

when build.py was failing to build packages but was not providing any
error message except for “Failed to start command.” this patch provide
the error message.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
8 years agoBaseTools/GenFw: Fix a bug for GCC build
Yonghong Zhu [Wed, 17 Feb 2016 08:57:44 +0000 (16:57 +0800)]
BaseTools/GenFw: Fix a bug for GCC build

current GCC build report error: 'for' loop initial declarations are only
allowed in C99 or C11 mode, the patch fix this failure.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
8 years agoPerformancePkg/Dp_App: Refine the code of locating all handles in DpTrace.c.
Cinnamon Shia [Mon, 15 Feb 2016 09:07:14 +0000 (17:07 +0800)]
PerformancePkg/Dp_App: Refine the code of locating all handles in DpTrace.c.

Replace gBS->LocateHandle with gBS->LocateHandleBuffer

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Cinnamon Shia <cinnamon.shia@hpe.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
8 years agoShellPkg/UefiDpLib: Refine the code of locating all handles in DpTrace.c.
Cinnamon Shia [Mon, 15 Feb 2016 09:07:13 +0000 (17:07 +0800)]
ShellPkg/UefiDpLib: Refine the code of locating all handles in DpTrace.c.

Replace gBS->LocateHandle with gBS->LocateHandleBuffer

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Cinnamon Shia <cinnamon.shia@hpe.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
8 years agoStdLib/BsdSocketLib: Fix minor memory leak by freeing rrecp on error return.
Daryl McDaniel [Tue, 16 Feb 2016 18:47:30 +0000 (10:47 -0800)]
StdLib/BsdSocketLib: Fix minor memory leak by freeing rrecp on error return.

The error return is triggered by one of two conditions:
  1.  rrecp is NULL (calloc failed)
  2.  strdup(dname) returns NULL

Previously, the function just returned NULL.  This patch adds a call to
free rrecp before returning NULL.  Since the free() function will properly
do nothing when called with a NULL parameter, it is not necessary to
separate the two tests into separate if clauses.

Reported-by: Colin King <colin.king@canonical.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daryl McDaniel <edk2-lists@mc2research.org>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
8 years agoBaseTools/GenFw: Correct datatypes in diagnostic messages and check for string termin...
Michael LeMay [Fri, 29 Jan 2016 17:53:47 +0000 (09:53 -0800)]
BaseTools/GenFw: Correct datatypes in diagnostic messages and check for string termination

This patch revises multiple diagnostic messages to use correct
datatypes.  It also checks that a symbol name that is about to be used
in a diagnostic message is terminated by a null character within the
contents of the string table section so that the print routine does
not read past the end of the string table section contents when
reading the symbol name.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael LeMay <michael.lemay@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
8 years agoBaseTools/GenFw: Enhance error message for bad symbol definitions
Michael LeMay [Fri, 29 Jan 2016 04:17:13 +0000 (12:17 +0800)]
BaseTools/GenFw: Enhance error message for bad symbol definitions

This patch expands the error message that is output when GenFw
encounters a bad symbol definition or an unsupported symbol type.  It
displays the symbol name, the symbol address, and a message that
describes both possibilities (bad symbol definition or unsupported
symbol type).  It also provides two examples of unsupported symbol
types.

Furthermore, this patch revises the conditional for detecting bad
symbol definitions to eliminate a redundant test (a Sym->st_shndx
value of SHN_ABS should certainly be greater than mEhdr->e_shnum) and
to change another test from 'Sym->st_shndx > mEhdr->e_shnum' to
'Sym->st_shndx >= mEhdr->e_shnum' for consistency with the test in
GetShdrByIndex.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael LeMay <michael.lemay@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>