summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg
Commit message (Collapse)AuthorAgeFilesLines
* MdeModulePkg/TerminalDxe: Fix driver model bugRuiyu Ni2017-01-111-663/+281
| | | | | | | | | | | | | | | | | TerminalDxe driver contains bugs in its DriverBindingStart(): 1. It cannot be started AGAIN using a different terminal type; 2. It doesn't install SimpleTextInput/SimpleTextOut when ConIn/ConOut doesn't contain its device path. The check is duplicated of the same logic in ConPlatform driver and can be removed. The patch optimized the code to remove the unnecessary gEfiCallerIdGuid protocol installation. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg/TerminalDxe: Remove unnecessary NULL pointer checkRuiyu Ni2017-01-111-7/+2
| | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg/TerminalDxe: Separate state machine start/stop logicRuiyu Ni2017-01-111-26/+59
| | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg/TerminalDxe: Refine SetTerminalDevicePathRuiyu Ni2017-01-111-38/+3
| | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg/TerminalDxe: Refine InitializeTerminalConsoleTextModeRuiyu Ni2017-01-111-82/+26
| | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg/TerminalDxe: Separate controller name init logicRuiyu Ni2017-01-111-91/+56
| | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg/TerminalDxe: Add TerminalTypeFromGuid internal functionRuiyu Ni2017-01-111-26/+29
| | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg/TerminalDxe: Replace macro with enum for terminal typesRuiyu Ni2017-01-114-97/+100
| | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg/DxeCore: Fix ASSERT() from GCD DEBUG() messagesMichael Kinney2017-01-101-3/+11
| | | | | | | | | | | | | | | | | | | | | If a BaseAddress of NULL is passed into DXE Core services CoreAllocateIoSpace() or CoreAllocateMemorySpace(), and DEBUG() messages are enabled, then a NULL pointer reference is made. The parameter check for BaseAddress is performed in the function CoreAllocateSpace() after the DEBUG() messages. A check is added in the DEBUG() messages to prevent the NULL pointer reference. This issue was found with PI SCTs with DEBUG messages enabled in the DXE Core. Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@Intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg/Bds: Fix a bug that may causes S4 fails to resumeRuiyu Ni2017-01-061-6/+13
| | | | | | | | | | | | | | | | | When firmware boots to UiApp, the memory type information settings are saved to NV storage and the settings in HOB are changed as well. Because UiApp is an APPLICATION type of boot option, system doesn't reset when settings change. But when user selects OS to boot in UiApp, because the settings in HOB was updated when booting to UiApp, the BDS doesn't think the settings change, expected reset doesn't happen. The patch fixes this issue to not update the settings in HOB. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Sunny Wang <sunnywang@hpe.com>
* MdeModulePkg/StaControllerDxe: Fix coding style issueDandan Bi2017-01-051-2/+1
| | | | | | | | | Remove the empty line. Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg/DxeCapsuleLibFmp: Fix incorrect MODULE_TYPEDandan Bi2017-01-051-1/+1
| | | | | | | Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
* MdeModulePkg/Ip4Dxe: Fix the potential NULL pointer freeJiaxin Wu2017-01-041-3/+7
| | | | | | | | | | | | | Ip4Config2SetDnsServer may cause ASSERT if the invalid DNS server address received. The issue is triggered by the NULL pointer(Tmp) free. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
* MdeModulePkg: S3SaveStateDxe, SmmS3SaveState: save 64-bit LoopTimesLaszlo Ersek2017-01-032-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The BootScriptWriteMemPoll() helper function in both drivers does the following: - pop Delay from the variable argument list as UINT64, then truncate it to UINTN, - divide Delay by 10, using DivU64x32Remainder(), then store the quotient in LoopTimes (also UINTN), - pass LoopTimes to S3BootScriptSaveMemPoll() as last argument. The truncation to UINTN is superfluous and wrong in this logic (not to mention incompatible with the PI spec); it prevents callers from specifying Delays longer than 0xFFFF_FFFF * 100ns (approximately 429 seconds == 7 minutes 9 seconds) on Ia32. In particular it prevents callers from specifying an infinite timeout (for example, 0xFFFF_FFFF_FFFF_FFFF * 100ns, approximately 58494 years). Change the type of Delay and LoopTimes to UINT64. Keep the same logic, just remove the truncations. The resultant LoopTimes values can be safely passed to S3BootScriptSaveMemPoll() thanks to the previous patch. Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: "Yao, Jiewen" <jiewen.yao@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
* MdePkg, MdeModulePkg: S3BootScriptSaveMemPoll(): accept 64-bit LoopTimesLaszlo Ersek2017-01-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The BaseNull instance of S3BootScriptLib obviously doesn't care about the type of the S3BootScriptSaveMemPoll() function's LoopTimes parameter; this lib instance doesn't do anything with the parameters received in S3BootScriptSaveMemPoll(). The PiDxe instance saves the LoopTimes parameter in EFI_BOOT_SCRIPT_MEM_POLL.LoopTimes. This target field already has UINT64 type. Furthermore, the BootScriptExecuteMemPoll() function in the same library instance already uses a local UINT64 variable called LoopTimes to count up to EFI_BOOT_SCRIPT_MEM_POLL.LoopTimes. This means that the the UINTN type for S3BootScriptSaveMemPoll()'s LoopTimes parameter is an unnecessary restriction. The callers of S3BootScriptSaveMemPoll() will be updated in the next patches, functionally. At this stage, they will continue to compile, since UINT64 parameters can accept UINTN arguments. Cc: Feng Tian <feng.tian@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: "Yao, Jiewen" <jiewen.yao@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
* MdeModulePkg/PrintLib: Add missing return status check for Print APIsHao Wu2017-01-031-38/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=307 For the following APIs in PrintLib instance MdeModulePkg\Library\DxePrintLibPrint2Protocol: UnicodeVSPrint UnicodeSPrint UnicodeVSPrintAsciiFormat UnicodeSPrintAsciiFormat AsciiVSPrint AsciiSPrint AsciiVSPrintUnicodeFormat AsciiSPrintUnicodeFormat The internal function DxePrintLibPrint2ProtocolVaListToBaseList() will be called to convert a VA_LIST to a BASE_LIST. However, those APIs miss checking the return value of the internal function. This commit adds codes to check the return value. If the VA_LIST fails to be converted to a BASE_LIST, those PrintLib APIs will return 0 and leave the output 'StartOfBuffer' unmodified. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
* MdeModulePkg Ps2KbDxe: Execute key notify func at TPL_CALLBACKStar Zeng2016-12-264-2/+94
| | | | | | | | | | | | | | | | | | Current implementation executes key notify function in TimerHandler at TPL_NOTIFY. The code change is to make key notify function executed at TPL_CALLBACK to reduce the time occupied at TPL_NOTIFY. The code will signal KeyNotify process event if the key pressed matches any key registered and insert the KeyData to the EFI Key queue for notify, then the KeyNotify process handler will invoke key notify functions at TPL_CALLBACK. Cc: Ruiyu Ni <Ruiyu.ni@intel.com> Cc: Michael Kinney <michael.d.kinney@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: Ruiyu Ni <Ruiyu.ni@intel.com>
* MdeModulePkg TerminalDxe: Execute key notify func at TPL_CALLBACKStar Zeng2016-12-263-7/+284
| | | | | | | | | | | | | | | | | | Current implementation executes key notify function in TimerHandler at TPL_NOTIFY. The code change is to make key notify function executed at TPL_CALLBACK to reduce the time occupied at TPL_NOTIFY. The code will signal KeyNotify process event if the key pressed matches any key registered and insert the KeyData to the EFI Key queue for notify, then the KeyNotify process handler will invoke key notify functions at TPL_CALLBACK. Cc: Ruiyu Ni <Ruiyu.ni@intel.com> Cc: Michael Kinney <michael.d.kinney@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: Ruiyu Ni <Ruiyu.ni@intel.com>
* MdeModulePkg UsbKbDxe: Execute key notify func at TPL_CALLBACKStar Zeng2016-12-263-5/+92
| | | | | | | | | | | | | | | | | | Current implementation executes key notify function in TimerHandler at TPL_NOTIFY. The code change is to make key notify function executed at TPL_CALLBACK to reduce the time occupied at TPL_NOTIFY. The code will signal KeyNotify process event if the key pressed matches any key registered and insert the KeyData to the EFI Key queue for notify, then the KeyNotify process handler will invoke key notify functions at TPL_CALLBACK. Cc: Ruiyu Ni <Ruiyu.ni@intel.com> Cc: Michael Kinney <michael.d.kinney@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: Ruiyu Ni <Ruiyu.ni@intel.com>
* MdeModulePkg ConSplitterDxe: Support toggle state syncStar Zeng2016-12-262-9/+194
| | | | | | | | | | | | | | | | | Register key notify for toggle state (CapsLock, NumLock and ScrollLock) sync between multiple keyboards. The implementation for this feature requires keyboard driver supports EFI_KEY_STATE_EXPOSED, and turns on physical TextInEx partial key report for toggle state sync. The virtual TextInEx will report the partial key after it is required by calling SetState(X | KEY_STATE_VALID_EXPOSED) explicitly. Cc: Ruiyu Ni <Ruiyu.ni@intel.com> Cc: Michael Kinney <michael.d.kinney@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: Ruiyu Ni <Ruiyu.ni@intel.com>
* MdeModulePkg/CapsuleLib: Follow UEFI 22.2.3 to process FMP.Jiewen Yao2016-12-264-560/+785
| | | | | | | | | | | | | | | | | | | | | | | | Previous logic does not follow UEFI 22.2.3 to process FMP strictly. It may cause FMP image not be processed in some corner case. The updated logic follows UEFI 22.2.3. The way to check if a capsule is processed is also simplified. The function - ProcessFmpCapsuleImage() is too big, so that we created sub-functions - StartFmpImage(), DumpAllFmpInfo(), GetFmpHandleBufferByType(), SetFmpImageData(), RecordFmpCapsuleStatus() to improve the readability. The function - ProcessTheseCapsules() is too big, so that we created sub-functions - InitCapsulePtr(), AreAllImagesProcessed(), PopulateCapsuleInConfigurationTable() to improve the readability. Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Chao Zhang <chao.b.zhang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/CapsuleLib: Support result rolling over.Jiewen Yao2016-12-261-5/+4
| | | | | | | | | | | According to UEFI spec, capsule result variable may roll over to 0. Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Chao Zhang <chao.b.zhang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/CapsuleLib: Add CapsuleTarget support.Jiewen Yao2016-12-263-9/+40
| | | | | | | | | | | | | UEFI spec requires CapsuleTarget to be a device path associated with FMP producer. Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Chao Zhang <chao.b.zhang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Chao Zhang <chao.b.zhang@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/CapsuleLib: remove ImageIndex check.Jiewen Yao2016-12-231-2/+1
| | | | | | | | | | | | UEFI specification does not require ImageIndex check, it only requires ImageTypeId check. Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@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> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/CapsuleApp: Dump capsule name in record.Jiewen Yao2016-12-231-8/+8
| | | | | | | | | | | | | According to UEFI spec, capsule report variable should include a null terminator for capsule name and capsule target, if they are not present. Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@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> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/CapsuleLib: Add NULL capsule name in record.Jiewen Yao2016-12-231-3/+8
| | | | | | | | | | | | | | | According to UEFI spec, capsule report variable should include a null terminator for capsule name and capsule target, if they are not present. The reserved field is zeroed. Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@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> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/UefiPxeBcDxe: Refine the CvtNum function logicHao Wu2016-12-221-3/+2
| | | | | | | | | | | | This commit refines the logic for the CvtNum function. It avoids using the decrement operator '--' for array index to prevent possible mis-reports by static code checkers. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
* MdeModulePkg/DxeNetLib: Rewrite NetblockChecksum function logicHao Wu2016-12-221-8/+8
| | | | | | | | | | | | This commit rewrites the logic for NetblockChecksum. It processes the checksum of the left-over byte first to prevent possible mis-reports by static code checkers. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
* MdeModulePkg/NonDiscoverableDeviceRegistrationLib: Fix coding style issuesDandan Bi2016-12-203-13/+27
| | | | | | | | | | | 1. Fix issues in comments 2. Fix Guid/protocol format Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* MdeModulePkg/SataControllerDxe: Fix coding style issueDandan Bi2016-12-201-1/+1
| | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg/TerminalDxe: Initialize variable after declarationDandan Bi2016-12-201-1/+3
| | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg/EmmcDxe: Avoid Non-Boolean type used as BooleanDandan Bi2016-12-201-1/+1
| | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg/EbcDxe: Make variable name follow rulesDandan Bi2016-12-203-14/+14
| | | | | | | | For variable name, it should contain lower case characters. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
* MdeModulePkg/CapsuleApp: Fix Guid format issuesDandan Bi2016-12-201-9/+9
| | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
* MdeModulePkg/NonDiscoverablePciDevice: Make variable definition follow ruleDandan Bi2016-12-192-2/+3
| | | | | | | | Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
* MdeModulePkg/NonDiscoverablePciDeviceDxe: Add comments for functionsDandan Bi2016-12-195-14/+469
| | | | | | | | Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
* MdeModulePkg/NonDiscoverablePciDeviceDxe: Fix VS2010/2012 build failureDandan Bi2016-12-191-0/+1
| | | | | | | | Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
* MdeModulePkg: Replace ASSERT with error return code in PXE driver.Fu Siyuan2016-12-192-36/+68
| | | | | | | | | | This patch remove the ASSERT when receive a DHCP packet large than the maximum cache buffer size. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
* MdeModulePkg/NonDiscoverablePciDeviceDxe: add support for non-coherent DMAArd Biesheuvel2016-12-154-7/+367
| | | | | | | | | | | Add support for non-coherent DMA, either by performing explicit cache maintenance when DMA mappings are aligned to the CPU's DMA buffer alignment, or by bounce buffering via uncached mappings otherwise. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Marcin Wojtas <mw@semihalf.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
* MdeModulePkg/CapsuleApp: Fix GUID/protocol format issuesDandan Bi2016-12-141-14/+14
| | | | | | | Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
* MdeModulePkg: Add missing info string for PCDsDandan Bi2016-12-142-0/+70
| | | | | | | | | | Some Pcds are added to the dec file, but miss to add the prompt&&help info to the uni file, now add them. Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
* MdeModulePkg: Make the comments align with the functionDandan Bi2016-12-144-14/+14
| | | | | | | Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
* MdeModulePkg EbcDxe: Fix CLANG38 build failureLiming Gao2016-12-141-2/+5
| | | | | | | | | Change structure value assignment with CopyMem() API. Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
* MdeModulePkg/NonDiscoverablePciDev: Fix type mismatch in switch/caseHao Wu2016-12-131-24/+24
| | | | | | | | | | | | | | | Fix switch/case statement type mismatch in functions PciIoMemRead & PciIoMemWrite. Parameter 'Width' is of enum type EFI_PCI_IO_PROTOCOL_WIDTH, but the enum type provided in 'switch (Width)' block is of type EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Ruiyu Ni <ruiyu.ni@intel.com> 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>
* MdeModulePkg/CapsuleLib: Correct debug message.Jiewen Yao2016-12-131-1/+1
| | | | | | | | Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg PiSmmCore: Retrieve Smram base address from system tableLiming Gao2016-12-123-41/+13
| | | | | | | | | | | PiSmmIpl records LoadModuleAtFixAddressSmramBase in LMFAConfigurationTable. Update PiSmmCore to directly get the address from this system table. Cc: Star Zeng <star.zeng@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg SmmIpl: Fill Smram range for SMM driver when LMFA enableLiming Gao2016-12-121-6/+34
| | | | | | | | | | | Allocate the additional Smram range to describe the reserved smram for SMM core and driver when LMFA feature is enabled. Cc: Star Zeng <star.zeng@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg PiSmmCore: Update FreePages to handle zero address and pagesLiming Gao2016-12-122-6/+6
| | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=278 Zero memory address or zero number pages are invalid to SmmFreePages(). Cc: Star Zeng <star.zeng@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg VariableSmm: Check InfoSize correctlyStar Zeng2016-12-121-8/+17
| | | | | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=290 Current SmmVariableGetStatistics() in VariableSmm.c is always checking input InfoSize against the first variable info, it is incorrect. For instance, there are three variables. BootOrder Boot0000 Boot0001 If the input InfoEntry is holding the second variable info (Boot0000) and InfoSize is sizeof (VARIABLE_INFO_ENTRY) + StrSize (L"Boot0000"), current code will return EFI_BUFFER_TOO_SMALL, but it should return the third variable info (Boot0001). This patch is to refine the code logic. Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
* MdeModulePkg VariableSmm: Do not need check CommBufferSize bufferStar Zeng2016-12-121-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current code in SmmVariableHandler() checks CommBufferSize buffer to make sure it points to outside SMRAM in "case SMM_VARIABLE_FUNCTION_GET_STATISTICS". But after eaae7b33b1cf6b9f21db1636f219c2b6a8d88afd, CommBufferSize buffer points to SMRAM that was used by SMM core to cache CommSize from SmmCommunication protocol, then the check will fail definitely and GET_STATISTICS feature breaks. In fact, do not need check CommBufferSize buffer at all even before eaae7b33b1cf6b9f21db1636f219c2b6a8d88afd. Before eaae7b33b1cf6b9f21db1636f219c2b6a8d88afd, CommBufferSize buffer pointed to gSmmCorePrivate->BufferSize that is outside SMRAM, the check will success definitely; after eaae7b33b1cf6b9f21db1636f219c2b6a8d88afd, CommBufferSize buffer points to local variable BufferSize (in SMRAM) in SmmEntryPoint(), the check is not needed definitely. The patch is to remove the check. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Jeff Fan <jeff.fan@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>