summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* EmbeddedPkg/RTC: use returned status at init-timeLeo Duran2016-03-251-1/+4
| | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Leo Duran <leo.duran@amd.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* NetworkPkg:Fix bug when parsing the dhcp6 option 16Zhang, Lubo2016-03-251-2/+2
| | | | | | | | | | | | | | | when to parse the DHCP6 reply packet,there will be 6 bytes offset before the option data according to RFC 3315. 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: Reviewed-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
* NetworkPkg:Fix Http boot download issue.Zhang Lubo2016-03-251-1/+1
| | | | | | | | | | | | | | | When http boot download the second time without return out of the boot manager, the DHCP process will start twice with the same Boot file uri and print the information twice which we not expected. This is caused by wrong logic of handling the device path of the boot file when loading 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: Fu Siyuan <siyuan.fu@intel.com>
* ShellPkg/UefiHandleParsingLib: Fix GUID referenceQiu Shumin2016-03-251-1/+1
| | | | | | | | | Pass in GUID* for the GUID reference in a CatSPrint statement. Issue was noticed when running "dh -d -v" command on a system with a PCI NIC installed. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Thomas Palmer <thomas.palmer@hpe.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
* BaseTools: Updated BuildNotes URLsPeter Kirmeier2016-03-252-15/+13
| | | | | | | | | | Updated URLs (git repository and step-by-step instructions) Cc: Yonghong Zhu <yonghong.zhu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Peter Kirmeier <topeterk@freenet.de> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* MdeModulePkg/RamDiskDxe: Fix typo in HII messageAlcantara, Paulo2016-03-241-1/+1
| | | | | | | | | | | | s/Configutation/Configuration/ 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> Signed-off-by: Juliano Ciocari <juliano.ciocari@hp.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@Intel.com>
* SecurityPkg/SecureBootConfigDxe: Remove type casting from the ChooseFile ↵Gary Lin2016-03-241-5/+5
| | | | | | | | | | | | handlers The type casting in the ChooseFile is not necessary and it actually hid the incompatible handlers from the compiler. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Gary Lin <glin@suse.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Dandan Bi <dandan.bi@intel.com>
* SecurityPkg/SecureBootConfigDxe: Declare EFIAPI for the ChooseFile handlersGary Lin2016-03-242-0/+10
| | | | | | | | | | | | | | | | | | | | | | | The SecureBootConfig now uses ChooseFile() from FileExplorerLib to select the certificates to be enrolled into PK, KEK, DB, DBX, or DBT, and the corresponding handlers to get the content of the file. Per the definition of CHOOSE_HANDLER, the handler must use EFIAPI as the calling convention. However, the calling convention was not specified the following handlers: UpdatePKFromFile(), UpdateKEKFromFile(), UpdateDBFromFile(), UpdateDBXFromFile(), and UpdateDBTFromFile(). When compiling the firmware with gcc, the default calling convention is not compatible with EFIAPI, so the handlers interpreted the argument the wrong way and passed the wrong device path to UpdatePage(), and the system crashed when the user tried to enroll a certificate into the key database. This commit specifies the calling convention for those functions so that gcc can generate the right code. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Gary Lin <glin@suse.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Dandan Bi <dandan.bi@intel.com>
* ShellPkg/UefiShellDebug1CommandsLib: remove unused but set variableArd Biesheuvel2016-03-241-4/+0
| | | | | | | | | | Remove variable FStartRow that is declared, assigned but never referenced. This fixes a warning emitted by GCC when -Wunused-but-set-variable is in effect. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg/PciBus: Should reserve enough bus number for HPCRuiyu Ni2016-03-241-2/+2
| | | | | | | | | | | | | | | When there is no bridge before the HPC (hot plug controller), the issue cannot be seen. But when there are bridges before the HPC, the PciBus will only use the value (= <CurrentBusNumber> + <ReservedBusNumber>) as the sub-ordinary bus number for HPC. The correct sub-ordinary bus number should be: <CurrentBusNumber> + <OccupiedBusNumber>(by earlier bridges) + <ReservedBusNumber>. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com>
* MdeModulePkg/Bds: Fix VS2012 build failure.Ruiyu Ni2016-03-241-4/+3
| | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* ShellPkg: Modify the 'dh' Shell command to dump the Firmware Management ↵Tapan Shah2016-03-243-3/+573
| | | | | | | | | | | | Protocol Image Descriptor Information. Modify 'dh' shell command to dump FirmwareManagement Protocol information. Add FirmwareManagement image descriptor V1 and V2 structure definition in UefiHandleParsingLib.h to support decoding V1/V2 revisions. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Tapan Shah <tapandshah@hpe.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* MdePkg: Move SMBIOS data into the IndustryStandard header.Marvin Häuser2016-03-242-90/+133
| | | | | | | | | | | | | | | | | | | | | | | | As the SMBIOS table types belong to the SMBIOS standard, they were moved from the SMBIOS Protocol header into the SMBIOS IndustryStandard header without the EFI_-prefix. Defines with the EFI_-prefix have been kept in the Protocol header for backwards-compatibility, resolving to the IndustryStandard defines. The same has been done with the C types. The SMBIOS table header structure had been duplicated - SMBIOS_STRUCTURE in the IndustryStandard header and EFI_SMBIOS_TABLE_HEADER in the Protocol file - and thus the Protocol type was replaced with a typedef to the InudstryStandard's. This doesn't only make it easier to maintain, but it also prevents potential future issues as the Protocol type has been aligned, while the standard and the IndustryStandard header declare it as byte-packed. This has worked well till now only because the members of the structure do not require alignment yet. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* ShellPkg: Make the USB mouse behavior in 'edit' consistent with 'hexedit'.Qiu Shumin2016-03-245-39/+480
| | | | | | | | | 1. Make the USB mouse cursor move smoothly in 'edit'. 2. Make the USB mouse can drag and select text in 'edit'. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* NetworkPkg: Fix HII related problem in HTTP boot driver.Fu Siyuan2016-03-243-17/+85
| | | | | | | | | | | | | | According to UEFI spec, HII_Config_Access.RouteConfig() should return success if the required configuration has been processed. Current HTTP boot driver may return error code in some situation, which failed the UEFI SCT test. This patch fix this issue by removing the returned error status code and adding extra check point in the Callback() function, which will pop up a message box if user input an unsupported URI string. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Dong Eric <eric.dong@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
* MdeModulePkg/FileExplorerLib.h: Remove the redefinition of typedefsDandan Bi2016-03-241-14/+1
| | | | | | | | | | Xcode clang seems unhappy with both FileExplorerLib.h and Protocol/FileExplorer.h both defining CHOOSE_HANDLER, now remove the definition in FileExplorerLib.h. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Andrew Fish <afish@apple.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
* OvmfPkg: PciHostBridgeLib: install 64-bit PCI host apertureLaszlo Ersek2016-03-232-0/+9
| | | | | | | | | | | | | | | | | | On the normal boot path (which is when PciHostBridgeDxe runs), the PCDs have been calculated; report the 64-bit PCI host aperture to PciHostBridgeDxe. In the Ia32 build, the PCD values (zeros) come directly from the DEC file, and this patch makes no difference. Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Marcel Apfelbaum <marcel@redhat.com> Cc: Thomas Lamprecht <t.lamprecht@proxmox.com> Ref: https://github.com/tianocore/edk2/issues/59 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg: PlatformPei: determine the 64-bit PCI host aperture for X64 DXELaszlo Ersek2016-03-235-0/+121
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main observation about the 64-bit PCI host aperture is that it is the highest part of the useful address space. It impacts the top of the GCD memory space map, and, consequently, our maximum address width calculation for the CPU HOB too. Thus, modify the GetFirstNonAddress() function to consider the following areas above the high RAM, while calculating the first non-address (i.e., the highest inclusive address, plus one): - the memory hotplug area (optional, the size comes from QEMU), - the 64-bit PCI host aperture (we set a default size). While computing the first non-address, capture the base and the size of the 64-bit PCI host aperture at once in PCDs, since they are natural parts of the calculation. (Similarly to how PcdPciMmio32* are not rewritten on the S3 resume path (see the InitializePlatform() -> MemMapInitialization() condition), nor are PcdPciMmio64*. Only the core PciHostBridgeDxe driver consumes them, through our PciHostBridgeLib instance.) Set 32GB as the default size for the aperture. Issue#59 mentions the NVIDIA Tesla K80 as an assignable device. According to nvidia.com, these cards may have 24GB of memory (probably 16GB + 8GB BARs). As a strictly experimental feature, the user can specify the size of the aperture (in MB) as well, with the QEMU option -fw_cfg name=opt/ovmf/X-PciMmio64Mb,string=65536 The "X-" prefix follows the QEMU tradition (spelled "x-" there), meaning that the property is experimental, unstable, and might go away any time. Gerd has proposed heuristics for sizing the aperture automatically (based on 1GB page support and PCPU address width), but such should be delayed to a later patch (which may very well back out "X-PciMmio64Mb" then). For "everyday" guests, the 32GB default for the aperture size shouldn't impact the PEI memory demand (the size of the page tables that the DXE IPL PEIM builds). Namely, we've never reported narrower than 36-bit addresses; the DXE IPL PEIM has always built page tables for 64GB at least. For the aperture to bump the address width above 36 bits, either the guest must have quite a bit of memory itself (in which case the additional PEI memory demand shouldn't matter), or the user must specify a large aperture manually with "X-PciMmio64Mb" (and then he or she is also responsible for giving enough RAM to the VM, to satisfy the PEI memory demand). Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Marcel Apfelbaum <marcel@redhat.com> Cc: Thomas Lamprecht <t.lamprecht@proxmox.com> Ref: https://github.com/tianocore/edk2/issues/59 Ref: http://www.nvidia.com/object/tesla-servers.html Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg: PlatformPei: factor out GetFirstNonAddress()Laszlo Ersek2016-03-231-1/+17
| | | | | | | | | | | | | | | Factor out the expression that is currently the basis of the address width calculation into a standalone function. In the next patches we'll raise the return value under certain circumstances. Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Marcel Apfelbaum <marcel@redhat.com> Cc: Thomas Lamprecht <t.lamprecht@proxmox.com> Ref: https://github.com/tianocore/edk2/issues/59 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg: AcpiPlatformDxe: enable PCI IO and MMIO while fetching QEMU tablesLaszlo Ersek2016-03-235-0/+212
| | | | | | | | | | | | | | | | | | | | | Now that the previous patches ensure that we can access all PCI devices in AcpiPlatformDxe, we can enable IO and MMIO decoding for all of them while we contact QEMU for the ACPI tables. See more details in the patch titled: OvmfPkg: introduce gRootBridgesConnectedEventGroupGuid In particular, this patch will prevent the bug when the 64-bit MMIO aperture is completely missing from QEMU's _CRS, and consequently Linux rejects 64-bit BARs with the error message pci 0000:00:03.0: can't claim BAR 4 [mem 0x800000000-0x8007fffff 64bit pref]: no compatible bridge window Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: 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>
* OvmfPkg: AcpiPlatformDxe: when PCI is enabled, wait for Platform BDS's cueLaszlo Ersek2016-03-233-36/+18
| | | | | | | | | | | | | | | | | | | | | | | | This patch doesn't change the behavior of AcpiPlatformDxe when PcdPciDisableBusEnumeration is TRUE -- that is, when the driver runs on Xen (OvmfPkg and ArmVirtPkg both), or when the driver runs on QEMU as part of ArmVirtPkg but no PCI host bridge was found by VirtFdtDxe. In these cases the driver continues to install the ACPI tables immediately. However, when PcdPciDisableBusEnumeration is FALSE (i.e., when the driver runs on QEMU as part of OVMF, or as part of ArmVirtPkg and VirtFdtDxe finds a PCI host bridge), we now delay the ACPI table download from QEMU. We wait until the Platform BDS tells us that root bridges have been connected, and PciIo instances are available. The explanation is in the patch titled OvmfPkg: introduce gRootBridgesConnectedEventGroupGuid Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: 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>
* ArmVirtPkg: PlatformIntelBdsLib: signal gRootBridgesConnectedEventGroupGuidLaszlo Ersek2016-03-232-0/+7
| | | | | | | | | | | | | | | The explanation is in the patch titled OvmfPkg: introduce gRootBridgesConnectedEventGroupGuid At this point, this signal doesn't do anything yet. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* OvmfPkg: PlatformBdsLib: signal gRootBridgesConnectedEventGroupGuidLaszlo Ersek2016-03-232-0/+7
| | | | | | | | | | | | | | The explanation is in the patch titled OvmfPkg: introduce gRootBridgesConnectedEventGroupGuid At this point, this signal doesn't do anything yet. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: 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>
* OvmfPkg: introduce gRootBridgesConnectedEventGroupGuidLaszlo Ersek2016-03-232-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QEMU's ACPI table generator can only create meaningful _CRS objects -- apertures -- for the root buses if all of the PCI devices behind those buses are actively decoding their IO and MMIO resources, at the time of the firmware fetching the "etc/table-loader" fw_cfg file. This is not a QEMU error; QEMU follows the definition of BARs (which are meaningless when decoding is disabled). Currently we hook up AcpiPlatformDxe to the PCI Bus driver's gEfiPciEnumerationCompleteProtocolGuid cue. Unfortunately, when the PCI Bus driver installs this protocol, it's *still* not the right time for fetching "etc/table-loader": although resources have been allocated and BARs have been programmed with them, the PCI Bus driver has also cleared IO and MMIO decoding in the command registers of the devices. Furthermore, we couldn't reenable IO and MMIO decoding temporarily in our gEfiPciEnumerationCompleteProtocolGuid callback even if we wanted to, because at that time the PCI Bus driver has not produced PciIo instances yet. Our Platform BDSes are responsible for connecting the root bridges, hence they know exactly when the PciIo instances become available -- not when PCI enumeration completes (signaled by the above protocol), but when the ConnectController() calls return. This is when our Platform BDSes should explicitly cue in AcpiPlatformDxe. Then AcpiPlatformDxe can temporarily enable IO and MMIO decoding for all devices, while it contacts QEMU for the ACPI payload. This patch introduces the event group GUID that we'll use for unleashing AcpiPlatformDxe from our Platform BDSes. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: 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>
* OvmfPkg: OvmfPkg.dec: add horizontal whitespace under Guids and ProtocolsLaszlo Ersek2016-03-231-9/+9
| | | | | | | | | We'll need more room in the next patch. No functional changes. Cc: 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>
* OvmfPkg/PlatformBdsLib: rebase to EfiEventGroupSignalLaszlo Ersek2016-03-231-29/+1
| | | | | | | | Cc: 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: Liming Gao <liming.gao@intel.com>
* ArmVirtPkg/PlatformIntelBdsLib: rebase to EfiEventGroupSignalLaszlo Ersek2016-03-233-34/+2
| | | | | | | | | Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Quickly-acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* IntelFrameworkPkg/FrameworkUefiLib: implement EfiEventGroupSignalLaszlo Ersek2016-03-231-0/+43
| | | | | | | | | | | | | | | | This patch follows the implementation seen in MdePkg's UefiLib instance, so that FrameworkUefiLib also covers the UefiLib.h library class header completely. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Jeff Fan <jeff.fan@intel.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Suggested-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: Liming Gao <liming.gao@intel.com>
* IntelFrameworkPkg/FrameworkUefiLib: move InternalEmptyFunction to UefiLib.cLaszlo Ersek2016-03-233-23/+39
| | | | | | | | | | | | | | | | | | | | | The InternalEmptyFunction() is currently only used by code in "UefiNotTiano.c" -- "Library functions that abstract areas of conflict between framework and UEFI 2.0.". In the next patches, InternalEmptyFunction() will be used from "UefiLib.c" as well, hence promote it to "general utility" status: move the function definition to "UefiLib.c", and place the function declaration (which is already extern) into "UefiLibInternal.h". Fix a typo in the function's name while at it. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Jeff Fan <jeff.fan@intel.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> 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>
* MdePkg/UefiLib: introduce EfiEventGroupSignalLaszlo Ersek2016-03-232-0/+61
| | | | | | | | | | | | | | | | | | | | | | This is a small convenience function that eases signaling an event group (identified by GUID). An example where it can be used is Platform BDS signaling the End-of-DXE event group. The naming follows EfiNamedEventSignal(). The patch modifies the library class header, and updates the most commonly used library instance at once. Other library instances in the edk2 tree will be adapted in the following patches. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Suggested-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: Liming Gao <liming.gao@intel.com>
* MdePkg/UefiLib: move InternalEmptyFunction to UefiLib.cLaszlo Ersek2016-03-233-21/+37
| | | | | | | | | | | | | | | | | | | The InternalEmptyFunction() is currently only used by code in "UefiNotTiano.c" -- "Library functions that abstract areas of conflict between framework and UEFI 2.0.". In the next patches, InternalEmptyFunction() will be used from "UefiLib.c" as well, hence promote it to "general utility" status: move the function definition to "UefiLib.c", and place the function declaration (which is already extern) into "UefiLibInternal.h". Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> 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>
* BaseTools: not include the undefined macro in response fileYonghong Zhu2016-03-232-7/+41
| | | | | | | | | | | | | | In last Nmake patch, when we generate the response file, we would replace all the Macros in the make file. Once there have undefined macro used, the tool direct report error. In this patch, we use following solution to resolve the failure. 1. Add all the defined macros into AutoGenObject macro dict 2. For the undefined macros which used in the Make file, when we generate the response file, we not include this macro, let make phase to handle. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg/BootMaintenanceManagerUiLib: Remove type casting in ChooseFileDandan Bi2016-03-231-3/+3
| | | | | | | | | | | The type casting is not necessary and now remove it. Cc: Liming Gao <liming.gao@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Gary Lin <glin@suse.com>
* MdeModulePkg/BootMaintManagerUiLib: Declare EFIAPI for ChooseFile handlerDandan Bi2016-03-232-0/+6
| | | | | | | | | | | | | | | | The BootMaintenanceManagerUiLib use ChooseFile() from FileExplorerLib to select files. And the third parameter in ChooseFile() is CHOOSE_HANDLER, per the definition of CHOOSE_HANDLER, it must use EFIAPI as the calling convention. But the calling convention was not specified for following handlers: CreateBootOptionFromFile, CreateDriverOptionFromFile, BootFromFile. Now specifies the calling convention for those functions. Cc: Liming Gao <liming.gao@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Gary Lin <glin@suse.com>
* MdeModulePkg RamDiskDxe: Remove unnecessary TPL raise operationsHao Wu2016-03-232-14/+0
| | | | | | | | | | There is no asynchronous operations to the registered RAM disks link list maintained within RamDiskDxe driver, therefore, the TPL raise and restore operations when dealing with the link list are unnecessary. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg RamDiskDxe: Uninstall DEVICE_PATH_PROTOCOL with correct paramHao Wu2016-03-231-1/+1
| | | | | | | | | | | Previously, the code uninstalls the DEVICE_PATH_PROTOCOL with the device path given by caller of the 'RamDiskUnregister' function. The given device path might be different from the one used to install the DEVICE_PATH_PROTOCOL. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg RamDiskDxe: Remove unnecessary 'DisconnectController' callsHao Wu2016-03-232-5/+0
| | | | | | | | | | | The 'DisconnectController' function calls after 'UninstallMultipleProtocolInterfaces' are unnecessary, since 'DisconnectController' is called inside function 'UninstallMultipleProtocolInterfaces'. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg/Bds: BDS hotkey shouldn't work on inactive consolesRuiyu Ni2016-03-231-23/+73
| | | | | | | 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: Sunny Wang <sunnywang@intel.com>
* ArmPkg/AArch64Mmu: use correct AP[] bits in ArmClearMemoryRegionReadOnlyArd Biesheuvel2016-03-221-1/+1
| | | | | | | | | | | | | The function ArmClearMemoryRegionReadOnly() was supposed to undo the effect of ArmSetMemoryRegionReadOnly(), but instead, it sets the permissions to EL0-no access, EL1-read-only. Since the EL0 bit should be 1 to align with EL2/3 (where the bit is SBO), use TT_AP_RW_RW instead, which makes the entry read-write for EL0 when executing at EL1, and read-write for all other levels. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* ArmPkg/ArmExceptionLib: reimplement register stack/unstack routinesArd Biesheuvel2016-03-221-126/+109
| | | | | | | | | | | | | | | | This replaces the somewhat opaque preprocessor based stack/unstack macros with open coded ldp/stp sequences to preserve the interrupted context before handing over to the exception handler in C. This removes various arithmetic operations on the stack pointer, and reduces the exception return critical section to its minimum size (i.e., the bare minimum required to populate the ELR and SPSR registers and invoke the eret). 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: Eugene Cohen <eugene@hp.com>
* ArmPkg/ArmExceptionLib: avoid indirect call if using vector table in placeArd Biesheuvel2016-03-221-0/+4
| | | | | | | | | | | If we are using the vector table in place, there is no need to make an indirect call to the common handler routine from the vector table entries, so just use a straight branch instruction in that case. 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: Eugene Cohen <eugene@hp.com>
* ArmPkg/ArmExceptionLib: make build time define visible to the compilerArd Biesheuvel2016-03-221-2/+4
| | | | | | | | | | | | | | The global gArmRelocateVectorTable is a build time constant, but due to its external linkage and lack of constness, the compiler does not see that. So turn it into a static boolean, and at the same time, make the function CopyExceptionHandlers() (which is only called if gArmRelocateVectorTable is set) static as well, so that the compiler can eliminate it completely if we are using the vector table in place. 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: Eugene Cohen <eugene@hp.com>
* ArmPkg/ArmExceptionLib: don't restore ESR and FAR upon exception returnArd Biesheuvel2016-03-221-6/+0
| | | | | | | | | | | ESR and FAR are populated by the hardware upon exception entry, and describe the exception, not the interrupted context. So there is no point in restoring their values before returning from the exception. 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: Eugene Cohen <eugene@hp.com>
* ArmPkg/ArmExceptionLib: stack FPSR on common pathArd Biesheuvel2016-03-221-8/+6
| | | | | | | | | | | We have three code paths to stack/unstack the exception context, one for each of EL3, EL2 and EL1. However, they all access the same copy of FPSR so move that access to the common path. 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: Eugene Cohen <eugene@hp.com>
* ArmPkg/ArmExceptionLib: fold exception handler prologue into vector tableArd Biesheuvel2016-03-221-73/+39
| | | | | | | | | | | | | | | | Unlike the AArch32 vector table, which has room for a single instruction for each exception type, the AArch64 exception table has 128 byte slots, which can easily hold the shared prologues that are emitted out of line. So refactor this code into a single macro, and expand it into each vector table slot. Since the address of the command handler entry point is no longer patched in by the C code, we can just emit the literal into each vector entry directly. 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: Eugene Cohen <eugene@hp.com>
* ArmPkg/AsmMacroIoLibV8: remove undocumented assumption from ELx macrosArd Biesheuvel2016-03-221-8/+8
| | | | | | | | | | | | | | | The macros EL1_OR_EL2() and EL1_OR_EL2_OR_EL3() allow conditional execution of assembly sequences based on the current exception level, by jumping to caller supplied labels 1f, 2f or 3f. However, the jump to 1f is actually a fallthrough, which means the EL1 code needs to follow right after the macro invocation, and the 1f label is ignored. So let's fix this by making all jumps explicit. 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: Eugene Cohen <eugene@hp.com>
* BaseTools: Fix nmake failure due to command-line length limitationYonghong Zhu2016-03-224-2/+135
| | | | | | | | | | | | | | | | | | | | | | NMAKE is limited to command-line length of 4096 characters. Due to the large number of /I directives specified on command line (one per include directory), the path length of WORKSPACE is multiplied by the number of /I directives and can exceed the limit. This patch: 1. Add new build option -l, --cmd-len to set the maximum command line length, default value is 4096. 2. Generate the response file only if the command line length exceed its maximum characters (default is 4096) when build the module. Cover PP_FLAGS, CC_FLAGS, VFRPP_FLAGS, APP_FLAGS, ASLPP_FLAGS, ASLCC_FLAGS and ASM_FLAGS. 3. The content of the response file is combine from the FLAGS option and INC option. 4. When build failure, it would print out the response file's file location and its content. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg/Pci22.h: Fix a coding style issueRuiyu Ni2016-03-221-6/+5
| | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Shumin Qiu <shumin.qiu@intel.com>
* MdeModulePkg DxeCore: Address boundary check for Type AllocateAddressStar Zeng2016-03-221-0/+26
| | | | | | | | | | | | | | | | | | Check for Type AllocateAddress, if NumberOfPages is 0 or if (NumberOfPages << EFI_PAGE_SHIFT) is above MAX_ADDRESS or if (Start + NumberOfBytes) rolls over 0 or if Start is above MAX_ADDRESS or if End is above MAX_ADDRESS, return EFI_NOT_FOUND. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Feng Tian <feng.tian@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>
* MdeModulePkg DxeCore: Check Start consistently in CoreConvertPagesExStar Zeng2016-03-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | Current check: ASSERT (NumberOfPages); ASSERT ((Start & EFI_PAGE_MASK) == 0); ASSERT (End > Start) ; if (NumberOfPages == 0 || ((Start & EFI_PAGE_MASK) != 0) || (Start > (Start + NumberOfBytes))) { This patch is to update "(Start > (Start + NumberOfBytes))" to "(Start >= End)" to be consistent with "ASSERT (End > Start)" Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Feng Tian <feng.tian@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>