summaryrefslogtreecommitdiff
path: root/MdeModulePkg
AgeCommit message (Collapse)AuthorFilesLines
2016-03-17MdeModulePkg: Fixed incorrect return value of MatchStringCecil Sheng1-5/+29
In UEFI2.6, CapturePtr's in the Captures array returned by MatchString are to be separatedly allocated so that they can be freed by the caller. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Cecil Sheng <cecil.sheng@hpe.com> Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2016-03-16MdeModulePkg: ConSplitterDxe: use U64 mult/div wrappers in AbsPtr scalingLaszlo Ersek1-3/+24
This is an emergency fix for UINT64 multiplications and divisions not being done with the right BaseLib functions -- they break Ia32 builds. Fixes: 30ed3422ab2de03abf7c1433ebb482f6e5e16f45 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com>
2016-03-16MdeModulePkg: Rescale ConSplitter Absolute Pointer.Derek Lin1-7/+36
ConSplitter's Absolute Pointer should scale virtual device's resolution like what Simple Pointer do. Before this change, caller will get Virtual device's resolution but physical device's current point. This change let caller get Virtual device's resolution with virtual device's current point. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Derek Lin <derek.lin2@hpe.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
2016-03-16MdeModulePkg: Coding style update for DxeHttpLib.infJiaxin Wu1-2/+2
Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Zhang Lubo <lubo.zhang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Zhang Lubo <lubo.zhang@intel.com>
2016-03-16MdeModulePkg: Refine the UI codeDandan Bi4-71/+17
Remove the ASSERT in UI code that may be triggered, and clean up 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>
2016-03-16MdeModulePkg/DriverSampleDxe: Uninstall the ConfigAccess protocolDandan Bi1-0/+2
In DriverSampleInit, has installed the configAccess protocol to the DriverHandle[1], but don't uninstall it in DriverSampleUnload. Now uninstall the configAccess protocol. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
2016-03-15MdeModulePkg: Add PcdMaxPeiPerformanceLogEntries16 PROMPT&HELP STR to *.uniStar Zeng1-1/+10
Commit 7c50b3434377cbb49ce4514ee31339000a5cadc0 introduced PcdMaxPeiPerformanceLogEntries16 to support > 256 PEI performance log entries, but its PROMPT&HELP STR were forgotten to be added into *.uni. Commit 7c50b3434377cbb49ce4514ee31339000a5cadc0 also updated PcdMaxPeiPerformanceLogEntries HELP STR. This patch is to add PcdMaxPeiPerformanceLogEntries16 PROMPT&HELP STR and update PcdMaxPeiPerformanceLogEntries HELP STR in *.uni. Cc: Shumin Qiu <shumin.qiu@intel.com> Cc: Cinnamon Shia <cinnamon.shia@hpe.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: Shumin Qiu <shumin.qiu@intel.com> Reviewed-by: Cinnamon Shia <cinnamon.shia@hpe.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2016-03-11MdeModulePkg: Add missing pcd description to MdeModulePkg.uniDandan Bi1-0/+8
Since PcdHiiOsRuntimeSupport has added in the MdeModulePkg.dec file, now add the usage information in the uni file. Cc: Qiu Shumin <shumin.qiu@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: Qiu Shumin <shumin.qiu@intel.com>
2016-03-10ModulePkg/DxeHttpLib: Adding Functions to HttpLibGhazi Belaam4-66/+753
There some usefull functions in edk2 private modules that could be used, so we added them to the httpLib Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ghazi Belaam <Ghazi.belaam@hpe.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Samer EL-Haj-Mahmoud <elhaj@hpe.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
2016-03-08MdeModulePkg: Increase the maximum number of PEI performance log entriesCinnamon Shia5-10/+37
The maximum number of PEI performance log entries is 255. Add a new PCD, PcdMaxPeiPerformanceLogEntries16, to increase the maximum number of PEI performance log entries. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Cinnamon Shia <cinnamon.shia@hpe.com> Reviewed-by: Samer EL-Haj-Mahmoud <elhaj@hpe.com> Reviewed-by: Joseph Shifflett <joseph.shifflett@hpe.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2016-03-08MdeModulePkg AcpiTableDxe: Use Rsdt to check against NULLStar Zeng1-2/+2
Some static scan tool may regard CurrentRsdtEntry to be potentially referenced to NULL pointer if CurrentRsdtEntry == NULL is used in the right above if condition judgment. CopyMem (CurrentRsdtEntry, CurrentRsdtEntry + 1, (*NumberOfTableEntries - Index) * sizeof (UINT32)); It is introduced by commit f9bbb8d9c3f065faba9f266cf4e731fe2ca70c4d. To avoid it and have same style with "((Xsdt == NULL) || CurrentTablePointer64 == (UINT64) (UINTN) Table->Table)", use Rsdt instead of CurrentRsdtEntry to check against NULL. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Shumin Qiu <shumin.qiu@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: Shumin Qiu <shumin.qiu@intel.com>
2016-03-07MdeModulePkg/Bds: More user-friendly network boot option descriptionRuiyu Ni2-39/+133
The patch enhances the UefiBootManagerLib to use more user-friendly network boot option description. It builds description like below: "PXEv6 (MAC:112233445566 VLAN1)" "HTTPv4 (MAC:112233445566)" Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
2016-03-07MdeModulePkg/UefiBootManagerLib: Separate boot description functions.Ruiyu Ni4-621/+613
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
2016-03-07MdeModulePkg/Bds: Fix VS2010/VS2012 build failure.Ruiyu Ni1-0/+2
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Shumin Qiu <shumin.qiu@intel.com>
2016-03-04MdeModulePkg AcpiTableDxe: Don't uninstall Acpi Sdt Protocol at ReadyToLockStar Zeng3-67/+3
1. The consumer of Acpi Sdt Protocol may want to use the API after ReadyToLock. 2. The ACPI system configuration table even could be overwritten, we see little issue in leaving Acpi Sdt Protocol installed. Cc: Jiewen Yao <jiewen.yao@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: Jiewen Yao <jiewen.yao@intel.com>
2016-03-04MdeModulePkg/PciHostBridge: Don't assert when setting UC to MMIO failsRuiyu Ni1-1/+3
Failing to set EFI_MEMORY_UC to MMIO aperture is not a fatal error. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com>
2016-03-04MdeModulePkg/Bds: Support booting from remote file system.Ruiyu Ni2-1/+89
Enhance BDS to support booting from a remote file system exposed by a HTTP boot option. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Sunny Wang <sunnywang@hpe.com>
2016-03-04MdeModulePkg/Bds: Support short-form URI boot.Ruiyu Ni1-0/+72
The patch adds short-form URI boot support to follow UEFI Spec. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Sunny Wang <sunnywang@hpe.com>
2016-03-04MdeModulePkg/Bds: Wide match HTTP boot option.Ruiyu Ni1-12/+137
Enhance BDS to wide match the HTTP boot option without matching the specific device path data in IP device path and URI device path node. It's to follow UEFI Spec 2.6. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Sunny Wang <sunnywang@hpe.com>
2016-03-04MdeModulePkg/Bds: Refine the code to load file from FV.Ruiyu Ni1-23/+40
Change BmGetFileBufferByMemmapFv to BmGetFileBufferByFvFilePath. The original function gets the file buffer only from memory mapped FV device path and leaves GUIDed FV device path to the code below; The new function gets the file buffer from both formats of FV device paths. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Sunny Wang <sunnywang@hpe.com>
2016-03-04MdeModulePkg: Fix IPv4 double freeSamer El-Haj-Mahmoud1-1/+3
Fix a possible ASSERT after NBP finishes loading from a PXE boot. Ip4Dxe driver calls Ip4Config2SetPolicy which calls CloseEvent on the Dhcp4Event struct member. After NBP is downloaded, it then calls Ip4Config2CleanInstance which calls CloseEvent again on Dhcp4Event. This double free can cause an ASSERT. When the event is closed, set the event pointer to NULL so the Ip4 code won't call CloseEvent on it again. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Samer El-Haj-Mahmoud <elhaj@hpe.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
2016-03-04MdeModulePkg: Make HII configuration settings available to OS runtimeDandan Bi7-5/+259
This feature is aimed to allow OS make use of the HII database during runtime. In this case, the contents of the HII Database is exported to a buffer. The pointer to the buffer is placed in the EFI System Configuration Table, where it can be retrieved by an OS application. Cc: Liming Gao <liming.gao@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Brian J. Johnson <bjohnson@sgi.com> Cc: Andrew Fish <afish@apple.com> Cc: El-Haj-Mahmoud Samer <samer.el-haj-mahmoud@hpe.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>
2016-03-04MdeModulePkg/DisplayEngineDxe: Refine the coding styleDandan Bi1-1/+0
Remove the empty line to conform with current coding style. Cc: Qiu Shumin <shumin.qiu@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>
2016-03-03MdeModulePkg/PciHostBridgeLib: Correct the function header commentsRuiyu Ni2-6/+5
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: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
2016-03-03MdeModulePkg: PciHostBridgeDxe: don't assume extended config spaceLaszlo Ersek3-1/+8
The "pc" ("pc-i440fx-*") machine types of QEMU don't support extended config space. Accordingly, OVMF will use the following library instances in connection with the core PciHostBridgeDxe driver: BasePciSegmentLibPci [class: PciSegmentLib] BasePciLibCf8 [class: PciLib] BasePciCf8Lib [class: PciCf8Lib] Add a new field to the PCI_ROOT_BRIDGE structure so that RootBridgeIoCheckParameter() can catch config space offsets above 0xFF on such old (emulated) platforms. Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Marcel Apfelbaum <marcel@redhat.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Marcel Apfelbaum <marcel@redhat.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
2016-03-03MdeModulePkg: PciHostBridgeDxe: insert horizontal whitespaceLaszlo Ersek2-29/+29
... in preparation for the next patch. Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-03-03MdeModulePkg/FvSimpleFs: don't open DevicePath with BY_DRIVER modeFeng Tian1-6/+5
The device path protocol doesn't get closed at FvSimpleFilesystem driver stop() when it's opened at start() with BY_DRIVER mode. We change it to open DevicePath with GET_PROTOCOL mode as FV2 protocol with BY_DRIVER is enough. Cc: Chao Zhang <chao.b.zhang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
2016-03-02MdeModulePkg: Change the default IPv4 config policyJiaxin Wu5-107/+150
Git version '3d0a49ad' commit provided a scenario to resolve the performance issue for IPv4, but it's not workable for IPv6. To avoid IPv4 and IPv6 inconsistency, we decided to revert that version fix. If so, the default policy for Ip4Config2 is Ip4Config2PolicyDhcp, which results in all NIC ports attempting DHCP. So, this patch is used to changes the the default IPv4 config policy to Ip4Config2PolicyStatic and also defer the SetData operation after Ip4Config2Protocol installed. This update let the other platform drivers have chance to change the default config data by consume Ip4Config2Protocol. Cc: Subramanian Sriram <sriram-s@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: Subramanian Sriram <sriram-s@hpe.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
2016-03-02MdeModulePkg: Add ASSERT to make sure pointers are not NULLDandan Bi1-0/+2
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
2016-03-02MdeModulePkg: FileExplorerLib: Modify the EFI_FILE_EXPLORE_FORMSET_GUIDDandan Bi1-2/+2
Currently the EFI_FILE_EXPLORE_FORMSET_GUID value in BdsDxe in IntelFrameworkModulePkg is same with the GUID VALUE in FileExplorerLib. This patch is to modify the EFI_FILE_EXPLORE_FORMSET_GUID in FileExplorerLib to avoid potential 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>
2016-03-02MdeModulePkg: FileExplorerLib: Add check when to call FreePool functionDandan Bi1-2/+6
when free up resource allocated for a MenuEntry, there exists the case that the DevicePath and DisplayString are NULL, so before calling FreePool function, need to check. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
2016-03-01MdeModulePkg: DxeCore: fully initialize image context before passing it onArd Biesheuvel1-2/+8
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>
2016-03-01MdeModulePkg/NvmExpress: Fix uninitialized field used in NVMe DiskInfoTian, Feng1-1/+2
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>
2016-03-01MdeModulePkg: Add new API HttpUrlGetPath() to HttpLib.hFu Siyuan2-2/+85
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>
2016-02-29MdeModulePkg/HiiDatabaseDxe: Fix a variable is uninitialized.Cinnamon Shia1-0/+2
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>
2016-02-29MdeModulePkg: PciHostBridgeLibNull: rewrap source to 79 charactersLaszlo Ersek2-24/+38
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>
2016-02-29MdeModulePkg: Update PeiCore dispatcher to handle PEIM and PEI_CORE onlyLiming Gao1-3/+21
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>
2016-02-29MdeModulePkg RamDiskDxe: Install Block I/O 2 Protocol on RAM disk devicesHao Wu5-5/+373
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>
2016-02-29MdeModulePkg: Add RamDiskDxe driver implementationHao Wu14-0/+2648
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>
2016-02-29MdeModuelPkg/PciBus: Return AddrTranslationOffset in GetBarAttributesRuiyu Ni1-0/+62
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>
2016-02-29MdeModulePkg/PciBus: reorganize case-statement to reduce code linesRuiyu Ni1-24/+10
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>
2016-02-29MdeModulePkg/PciBus: Change local variable AddressSpace to DescriptorRuiyu Ni1-26/+22
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>
2016-02-29MdeModulePkg: Add missing PCD usage information string.Qiu Shumin1-1/+12
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>
2016-02-29MdeModulePkg:Fix a robustness issue of Mnp DriverZhang Lubo1-4/+60
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>
2016-02-26MdeModulePkg: RegularExpressionDxe: support free(NULL)Laszlo Ersek1-1/+11
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>
2016-02-26MdeModulePkg: AcpiTableDxe: fix VS2008 build by merging adjacent if blocksArd Biesheuvel1-12/+10
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>
2016-02-26MdeModulePkg/PciHostBridge: Don't assume resources are fully NonExistentRuiyu Ni1-11/+294
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>
2016-02-26MdeModulePkg/PciHostBridge: Refine function header comments.Ruiyu Ni4-81/+103
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>
2016-02-26MdeModulePkg: Add ASSERT to make sure pointer 'OptionalData' not be NULLDandan Bi1-0/+2
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>
2016-02-26MdeModulePkg: Add ASSERT to make sure pointer 'MemoryMap' is not NULL.Qiu Shumin1-0/+1
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>