summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg
Commit message (Collapse)AuthorAgeFilesLines
* MdeModulePkg:TcpDriver need to use EFI_D_NET for DEBUG maessage.Zhang Lubo2016-10-095-47/+47
| | | | | | | | | | | | | | Tcp driver need to use EFI_D_NET to log DEBUG message, So it becomes easy to separate/filter out debug messages from network stack versus generic EFI_D_INFO debugs. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Cc: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com> Cc: Subramanian Sriram <sriram-s@hpe.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Ye Ting <ting.ye@intel.com> Reviewed-by: Sriram Subramanian <sriram-s@hpe.com>
* MdeModulePkg/HiiDataBase: Fix NULL deference bug in HiiGetImageInfoRuiyu Ni2016-10-091-0/+4
| | | | | | | | | | The return value of GetImageIdOrAddress() could be NULL if the ImageId is invalid. The patch fixes the bug to return EFI_NOT_FOUND when GetImageIdOrAddress() returns NULL. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg/HiiDataBase: Fix incorrect local variable typeDandan Bi2016-10-081-1/+1
| | | | | | | | | | | The type of variable "SmallestIdFromFlag" should be BOOLEAN, this patch fix the incorrect type. 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>
* MdeModulePkg/CdExpressPei: Fix capsule size mismatch issue.Jiewen Yao2016-10-082-4/+6
| | | | | | | | | | | | | | | | Current PeiCdExpress driver will return capsule size to be block aligned. It will fail if we check the capsuleImageSize field. The patch correct the returned capsule size. Tested-by: Eric Dong <eric.dong@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg/ImageDecoderLib: Retire it due to new BootLogoLibRuiyu Ni2016-09-294-266/+0
| | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg/BmpImageDecoderLib: Retire it due to new BootLogoLibRuiyu Ni2016-09-293-341/+0
| | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg: Remove ImageDecoderLib and BmpImageDecoderLibRuiyu Ni2016-09-292-7/+0
| | | | | | | | | | The two libraries are created to support old BootLogoLib to decode the images. Due to the new BootLogoLib starts using HiiImageEx interfaces, the two libraries are not needed. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg/Logo: Add LogoDxe moduleRuiyu Ni2016-09-285-0/+274
| | | | | | | | | | | | | | LogoDxe embeds the image resource in the PE resource section, then it produces Platform Logo protocol which can return the images in pixel format. HiiImageEx protocol is responsible to decode the JPEG/PNG images to pixel format. LogoDxe driver uses HiiImageEx protocol. Contributed-under: TianoCore Contribution Agreement 1.0 Reviewed-by: Liming Gao <liming.gao@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
* MdeModulePkg/BootLogoLib&PlatformLogo: Use HII data types in parametersRuiyu Ni2016-09-285-164/+89
| | | | | | | | | | | | | | | 1. Change PlatformLogo protocol to return EFI_IMAGE_INPUT instead of RAW image data. PlatformLogo implementation can use HiiImageEx to decode the image if it's JPEG or PNG format. 2. Change BootLogoLib to consume the new PlatformLogo protocol. 3. Change BootLogoEnableLogo() to only use images returned from PlatformLogo protocol. Contributed-under: TianoCore Contribution Agreement 1.0 Reviewed-by: Liming Gao <liming.gao@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
* MdeModulePkg/HiiDatabase: Add HiiImageEx implementation.Ruiyu Ni2016-09-285-53/+822
| | | | | | | | | | | | | | | According to UEFI spec, NewImageEx()/SetImageEx()/DrawImageEx() implicitly call the non-Ex version interface of HiiImage protocol. GetImageEx()/DrawImageIdEx() are the enhanced version of GetImage()/DrawImageId(), which can support decoding JPEG/PNG through the help of HiiImageDecoder protocol. Contributed-under: TianoCore Contribution Agreement 1.0 Reviewed-by: Liming Gao <liming.gao@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
* MdeModulePkg/HiiDatabase: Update HiiImage to support PNG/JPEGRuiyu Ni2016-09-281-7/+14
| | | | | | | | | | | | | | | 1. Update GetImageIdOrAddress() to recognize PNG/JPEG image block. A offset calculation bug was fixed. 2. Update HiiGetImage() comments to say PNG/JPEG support is provided by HiiImageEx 3. Update HiiSetImage() to support replacing a PNG/JPEG image block with a new image Contributed-under: TianoCore Contribution Agreement 1.0 Reviewed-by: Liming Gao <liming.gao@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
* MdemodulePkg/HiiDatabase: Correct typo in comments.Ruiyu Ni2016-09-285-75/+75
| | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Reviewed-by: Liming Gao <liming.gao@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
* MdeModulePkg/HiiDatabase: Refine HiiDrawImage()Ruiyu Ni2016-09-281-14/+12
| | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Reviewed-by: Liming Gao <liming.gao@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
* MdeModulePkg/HiiDatabase: Refine HiiSetImage()Ruiyu Ni2016-09-281-70/+46
| | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Reviewed-by: Liming Gao <liming.gao@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
* MdeModulePkg/HiiDatabase: Refine HiiGetImage()Ruiyu Ni2016-09-281-35/+20
| | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Reviewed-by: Liming Gao <liming.gao@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
* MdeModulePkg/HiiDatabase: Refine HiiNewImage()Ruiyu Ni2016-09-281-56/+27
| | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Reviewed-by: Liming Gao <liming.gao@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
* MdeModulePkg/HiiDatabase: Move common code to LocatePackageList()Ruiyu Ni2016-09-281-54/+34
| | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Reviewed-by: Liming Gao <liming.gao@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
* MdeModulePkg/HiiDatabase: Refine GetImageIdOrAddressRuiyu Ni2016-09-283-76/+63
| | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Reviewed-by: Liming Gao <liming.gao@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
* MdeModulePkg/PciSioSerialDxe: Remove unused global variablesRuiyu Ni2016-09-281-4/+1
| | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg FormBrowserEx: Change its structure name with EDKII_ prefixLiming Gao2016-09-277-9/+16
| | | | | | | | | | | | EDKII implementation protocol should be with EDKII_ prefix. V2: add gEdkiiFormBrowserExProtocolGuid to align its structure name. Cc: Eric Dong <eric.dong@intel.com> Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg: Clean the previous address since the policy changedJiaxin Wu2016-09-261-31/+31
| | | | | | | | | | | | | | | The previous DNS server data will be retained after the policy changes from Dhcp to Static. This patch is used to clean the previous dhcp configuration data. Cc: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com> Cc: Subramanian Sriram <sriram-s@hpe.com> Cc: Ye Ting <ting.ye@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Sriram Subramanian <sriram-s@hpe.com> Reviewed-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com> Tested-by: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
* MdeModulePkg/PciBusDxe: make OPROM BAR degradation configurableArd Biesheuvel2016-09-263-40/+55
| | | | | | | | | | | | | | | | | | | | The 'universal' PCI bus driver in MdeModulePkg contains a quirk to degrade 64-bit PCI MMIO BARs to 32-bit in the presence of an option ROM on the same PCI controller. This quirk is highly specific to not just the X64 architecture in general, but to the PC platform in particular, given that only X64 platforms that require legacy PC BIOS compatibility require it. However, making the quirk dependent on the presence of the legacy BIOS protocol met with resistance, due to the fact that it introduces a dependency on the IntelFrameworkModulePkg package. So instead, make the quirk configurable, by introducing a feature flag PCD 'PcdPciDegradeResourceForOptionRom' which defaults to TRUE only for X64. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
* MdeModulePkg/XhciPei:1ms delay before access MMIO reg during resetFeng Tian2016-09-211-0/+6
| | | | | | | | | | | | | Some XHCI host controllers require to have extra 1ms delay before accessing any MMIO register during HC reset. As this delay is not defined by XHCI spec, we use this workaround to fix the issue. 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>
* MdeModulePkg/XhciDxe:1ms delay before access MMIO reg during resetFeng Tian2016-09-211-1/+7
| | | | | | | | | | | | | Some XHCI host controllers require to have extra 1ms delay before accessing any MMIO register during HC reset. As this delay is not defined by XHCI spec, we use this workaround to fix the issue. 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>
* MdeModulePkg PCD: Update PCD database structure definition to match BaseToolsStar Zeng2016-09-207-16/+16
| | | | | | | | | | | | | | | | | | | | To follow PI1.4a, BaseTools has be updated to fix artificial limitation of SkuId range. This patch is to update PCD database structure definition to match BaseTools. Note: The source code and BaseTools need to be upgraded at the same time, and if they are not upgraded at the same time, build error like below will be triggered to help user identify the problem. "Please make sure the version of PCD PEIM Service and the generated PCD PEI Database match." Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@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/HiiDB: Handle the "&READONLY" tag in <KeywordResp> correctlyDandan Bi2016-09-121-4/+13
| | | | | | | | | | | | | | | | | This patch is to fix the incorrect logic when handling the "&READONLY" tag in <KeywordResp>. 1. In UEFI spec, the "&READONLY" tag is in upper case, but using the lower case in current codes by mistake. 2. The logic in checking the ReadOnly flag is not correct. Whether having "&READONLY" tag must be consistent with the result of "ExtractReadOnlyFromOpCode" function. 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: Liming Gao <liming.gao@intel.com>
* MdeModulePkg/UiApp: Fix incorrect question idDandan Bi2016-09-121-1/+2
| | | | | | | | | | | | For a question, its question id can not be zero. This patch is to fix the issue that using zero as question id. 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: Liming Gao <liming.gao@intel.com>
* MdeModulePkg/PciHostBridgeDxe: restrict 64-bit DMA to devices that support itArd Biesheuvel2016-09-061-4/+10
| | | | | | | | | | | | | | | | | Currently, the EFI_PCI_ATTRIBUTE_DUAL_ADDRESS_CYCLE attribute is completely ignored by the PCI host bridge driver, which means that, on an implementation that supports DMA above 4 GB, allocations above 4 GB may be provided to devices that have not expressed support for it. So in addition to checking 'RootBridge->DmaAbove4G' to establish whether the root bridge itself supports DMA above 4 GB, we must also take into account the operation type (EfiPciOperationBusMaster{Read|Write|CommonBuffer}64), and the EFI_PCI_ATTRIBUTE_DUAL_ADDRESS_CYCLE attribute, when mapping and allocating DMA memory, respectively. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Ruiyu Ni <Ruiyu.ni@intel.com>
* MdeModulePkg/XhciDxe: enable 64-bit PCI DMAArd Biesheuvel2016-09-062-1/+23
| | | | | | | | | | PCI controller drivers must set the EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE attribute if the controller supports 64-bit DMA addressing. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Feng Tian <feng.tian@Intel.com>
* MdeModulePkg/SdMmcPciHcDxe: enable 64-bit PCI DMAArd Biesheuvel2016-09-061-0/+20
| | | | | | | | | PCI controller drivers must set the EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE attribute if the controller supports 64-bit DMA addressing. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Feng Tian <feng.tian@Intel.com>
* MdeModulePkg/NvmExpressDxe: enable 64-bit PCI DMAArd Biesheuvel2016-09-061-0/+13
| | | | | | | | | PCI controller drivers must set the EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE attribute if the controller supports 64-bit DMA addressing. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Feng Tian <feng.tian@Intel.com>
* MdeModulePkg/EhciDxe: enable 64-bit PCI DMAArd Biesheuvel2016-09-063-2/+24
| | | | | | | | | | PCI controller drivers must set the EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE attribute if the controller supports 64-bit DMA addressing. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Feng Tian <feng.tian@Intel.com>
* MdeModulePkg/AtaAtapiPassThru: enable 64-bit PCI DMAArd Biesheuvel2016-09-061-1/+19
| | | | | | | | | PCI controller drivers must set the EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE attribute if the controller supports 64-bit DMA addressing. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Feng Tian <feng.tian@Intel.com>
* MdeModulePkg: Support classless IP for DHCPv4 TransmitReceive()Jiaxin Wu2016-09-061-8/+20
| | | | | | | | | | | | | | | The IP address should not be treated as classful one if DHCP options contain a classless IP with its true subnet mask. Otherwise, DHCPv4 TransmitReceive() will failed. This real subnet mask will be parsed and recorded in DhcpSb->Netmask. So, we need check it before get the IP's corresponding subnet mask. Cc: Santhapur Naveen <naveens@amiindia.co.in> 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: Fu Siyuan <siyuan.fu@intel.com>
* MdeModulePkg NvmExpressDxe: Set the non-blocking I/O feature support bitHao Wu2016-09-061-1/+4
| | | | | | | | | | | | Since current codes in NvmExpressDxe already support the non-blocking I/O feature for EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL interface, the relative bit in the 'Attributes' field of EFI_NVM_EXPRESS_PASS_THRU_MODE should be set to reflect this. Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg NvmExpressDxe: Fix 'Event' won't be signaled for Admin cmdsHao Wu2016-09-061-2/+11
| | | | | | | | | | | This commit fixes the issue that the caller event passed to EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL.PassThru() will not be signaled for NVME Admin commands. Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg NvmExpressDxe: Add NamespaceId validity check in PassThruHao Wu2016-09-061-0/+8
| | | | | | | | | | | | According to the UEFI spec, EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL.PassThru() should return EFI_INVALID_PARAMETER if the input 'NamespaceId' is invalid for the NVM Express controller. This commit adds check in PassThru() to follow this rule. Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg NvmExpressDxe: Add check for command packet in PassThruHao Wu2016-09-061-2/+19
| | | | | | | | | | | | | | | | | | | | | | This commit adds serveral checks for the 'Packet' parameter passed to the EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL.PassThru() API: The check for the 'TransferLength' field in EFI_NVM_EXPRESS_PASS_THRU_COMMAND_PACKET to make sure the value will not exceed the maximum data transfer size allowed by a controller. The check for the 'TransferBuffer' and 'TransferLength' fields in EFI_NVM_EXPRESS_PASS_THRU_COMMAND_PACKET when the Opcode of an NVME command indicates a data transfer between controller and host. The check for the 'MetadataLength' field in EFI_NVM_EXPRESS_PASS_THRU_COMMAND_PACKET to make sure the value is not 0 when the corresponding 'MetadataBuffer' field has a non-NULL value. Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg NvmExpressDxe: Add check on the attributes of NVME controllerHao Wu2016-09-061-1/+13
| | | | | | | | | | | | | | According to UEFI spec, an EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL with neither EFI_NVM_EXPRESS_PASS_THRU_ATTRIBUTES_LOGICAL nor EFI_NVM_EXPRESS_PASS_THRU_ATTRIBUTES_PHYSICAL set in the Attributes field is an illegal configuration. This commit adds this check in the PassThru API to follow the spec. Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg NvmExpressDxe: Add buffer alignment check in PassThru APIHao Wu2016-09-061-21/+34
| | | | | | | | | | | | | According to the UEFI spec, the 'TransferBuffer' and 'MetadataBuffer' used in a data transfer should be aligned on the boundary specified by the IoAlign field in the EFI_NVM_EXPRESS_PASS_THRU_MODE structure. This commit adds this check to follow the spec. Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg NvmExpressDxe: Refine GetNextNamespace API to follow specHao Wu2016-09-061-1/+5
| | | | | | | | | | | | | According to the UEFI spec, EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL.GetNextNamespace() should return EFI_NOT_FOUND when the value pointed to by NamespaceId is the namespace ID of the last namespace on the NVM Express controller. This commit modifies the check for NamespaceId to follow this rule. Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg NvmExpressDxe: Refine GetNameSpace API to follow specHao Wu2016-09-061-1/+11
| | | | | | | | | | | | | | | According to the UEFI spec, EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL.GetNamespace() should return EFI_NOT_FOUND when the input DevicePath is a device path node type that the NVM Express Pass Thru driver supports, but there is not a valid translation from DevicePath to a namespace ID. Current code will return EFI_SUCCESS. This commit adds additional check in the GetNameSpace API to make sure correct status is returned. Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg NvmExpressDxe: Refine BuildDevicePath API to follow specHao Wu2016-09-061-5/+9
| | | | | | | | | | | | | According to the UEFI spec, EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL.BuildDevicePath() should return EFI_NOT_FOUND when the input NamespaceId is not valid. However, current code returns EFI_DEVICE_ERROR instead. This commit modifies the check for input NamespaceId to return the correct status. Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg NvmExpressDxe: Avoid crashing 'Mode' during OpenProtocolHao Wu2016-09-061-5/+5
| | | | | | | | | | | | | | | | | The gBS->OpenProtocol() calls to open EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL in NvmExpress.c will crash the data in 'Mode' field of 'Private->Passthru'. The third parameter of gBS->OpenProtocol() is an output parameter that stores the address where a pointer to the corresponding Protocol Interface. The current code mistakenly pass '&Private->Passthru' (a pointer of the EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL) as the third parameter. This will crash the data in 'Mode' filed. Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg PiDxeS3BootScriptLib: Support multiple PCI segmentStar Zeng2016-09-054-90/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | Support multiple PCI segment for PCI_CONFIG2 opcodes. PiDxeS3BootScriptLib needs to be updated to consume PciSegmentLib instead of PciLib. That means platforms need to add PciSegmentLib declaration like below in platform dsc if the PciSegmentLib was not declared in platform dsc before. PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf For platforms only have one segment, MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf is recommended to be used and declared in platform dsc for PiDxeS3BootScriptLib to have equivalent functionality with before. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Amy Chan <amy.chan@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com>
* MdeModulePkg PiDxeS3BootScriptLib: Remove the trailing white spacesStar Zeng2016-09-056-370/+370
| | | | | | | | | | | Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Amy Chan <amy.chan@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com>
* MdeModulePkg UefiBootManagerLib: Ignore BootManagerMenu from LoadFileLiming Gao2016-09-021-10/+7
| | | | | | | | | | | | BootManagerMenu boot option is handled by EfiBootManagerGetBootManagerMenu. Don't need to handle it again when parse LoadFile protocol. In V2, use "BootManagerMenu" instead of "BootMenuApp". Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Sunny Wang <sunnywang@hpe.com>
* MdeModulePkg UefiBootManagerLib: Rename BootMenuApp to BootManagerMenuLiming Gao2016-09-021-10/+10
| | | | | | | | | | | | Rename local function name BootMenuApp to BootManagerMenu to align to other public function name. In V2, use "BootManagerMenu" instead of "BootMenuApp". Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Sunny Wang <sunnywang@hpe.com>
* MdeModulePkg/EbcDxe AARCH64: simplify interpreter entry point thunksArd Biesheuvel2016-09-022-83/+36
| | | | | | | | | | | | | | | | | | | The prototypes of EbcInterpret() and ExecuteEbcImageEntryPoint() are private to the AARCH64 implementation of EbcDxe, so we can shuffle the arguments around a bit and make the assembler thunking glue a lot simpler. For ExecuteEbcImageEntryPoint(), this involves passing the EntryPoint argument as the third parameter, rather than the first, which allows us to do a tail call. For EbcInterpret(), instead of copying each argument beyond #8 from one native stack frame to the next (before another copy is made into the VM stack), pass a pointer to the argument stack. 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: Feng Tian <feng.tian@intel.com>
* MdeModulePkg/EbcDxe AARCH64: use tail call for EBC to native thunkArd Biesheuvel2016-09-021-20/+65
| | | | | | | | | | | | | | Instead of pessimistically copying at least 64 bytes from the VM stack to the native stack, and popping off the register arguments again before doing the native call, try to avoid touching the stack completely if the VM stack frame is <= 64 bytes. Also, if the stack frame does exceed 64 bytes, there is no need to copy the first 64 bytes, since we are passing those in registers anyway. 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: Feng Tian <feng.tian@intel.com>