summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg
Commit message (Collapse)AuthorAgeFilesLines
* MdeModulePkg BootScriptExecutorDxe: Convert X64/S3Asm.asm to NASMLiming Gao2016-06-281-28/+29
| | | | | | | Use real nasm instruction to replace DB bytes. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg BootScriptExecutorDxe: Convert X64/S3Asm.asm to NASMJordan Justen2016-06-282-0/+136
| | | | | | | | The BaseTools/Scripts/ConvertMasmToNasm.py script was used to convert X64/S3Asm.asm to X64/S3Asm.nasm Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
* MdeModulePkg BootScriptExecutorDxe: Convert IA32/S3Asm.asm to NASMLiming Gao2016-06-281-12/+13
| | | | | | | Use real nasm instruction to replace DB bytes. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg BootScriptExecutorDxe: Convert IA32/S3Asm.asm to NASMJordan Justen2016-06-282-0/+68
| | | | | | | | The BaseTools/Scripts/ConvertMasmToNasm.py script was used to convert IA32/S3Asm.asm to IA32/S3Asm.nasm Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
* MdeModulePkg EbcDxe: Convert X64/EbcLowLevel.asm to NASMJordan Justen2016-06-282-0/+243
| | | | | | | | | | | The BaseTools/Scripts/ConvertMasmToNasm.py script was used to convert X64/EbcLowLevel.asm to X64/EbcLowLevel.nasm And, manually update nasm code to use mov rcx, dword value and generate the same assembly code with rcx register to asm code. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
* MdeModulePkg EbcDxe: Convert Ia32/EbcLowLevel.asm to NASMJordan Justen2016-06-282-0/+198
| | | | | | | | The BaseTools/Scripts/ConvertMasmToNasm.py script was used to convert Ia32/EbcLowLevel.asm to Ia32/EbcLowLevel.nasm Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
* MdeModulePkg DebugSupportDxe: Convert X64/AsmFuncs.asm to NASMJordan Justen2016-06-282-0/+588
| | | | | | | | | | | | The BaseTools/Scripts/ConvertMasmToNasm.py script was used to convert X64/AsmFuncs.asm to X64/AsmFuncs.nasm Note: Also applied many manual cleanups where conversion script failed Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com>
* MdeModulePkg DebugSupportDxe: Convert Ia32/AsmFuncs.asm to NASMJordan Justen2016-06-282-1/+501
| | | | | | | | | | | | | The BaseTools/Scripts/ConvertMasmToNasm.py script was used to convert Ia32/AsmFuncs.asm to Ia32/AsmFuncs.nasm Note: Also applied many manual cleanups where conversion script failed And, update Vect2Desc() to be same to original logic Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com>
* MdeModulePkg CapsulePei: Convert X64/PageFaultHandler.asm to NASMJordan Justen2016-06-282-0/+88
| | | | | | | | The BaseTools/Scripts/ConvertMasmToNasm.py script was used to convert X64/PageFaultHandler.asm to X64/PageFaultHandler.nasm Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
* MdeModulePkg DxeIplPeim: Convert Ia32/IdtVectorAsm.asm to NASMJordan Justen2016-06-282-0/+78
| | | | | | | | | | | | The BaseTools/Scripts/ConvertMasmToNasm.py script was used to convert Ia32/IdtVectorAsm.asm to Ia32/IdtVectorAsm.nasm Note: Manually updated code storing @VectorTemplateBase address Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com>
* MdeModulePkg EbcDxe: Use NASM compatible syntaxJordan Justen2016-06-281-3/+3
| | | | | | | | | | | Without this change, after converting this code to NASM, this error will be reported: error: comma or end of line expected Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com>
* MdeModulePkg BootScriptExecutorDxe: EXTERNDEF=>PUBLIC in S3AsmJordan Justen2016-06-282-4/+4
| | | | | | | | | | | | NASM doesn't support EXTERNDEF, so convert this to PUBLIC. This will make it easier to convert this code to NASM using an automated script. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com>
* MdeModulePkg BootScriptExecutorDxe: Use NASM compatible syntaxJordan Justen2016-06-282-2/+2
| | | | | | | | | | | Without this change, after converting this code to NASM, this error will be reported: error: invalid combination of opcode and operands Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/SetupBrowser: Fix the typo in the commentGary Lin2016-06-271-1/+1
| | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Gary Lin <glin@suse.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg PiDxeS3BootScriptLib: Use a specific name for mSmstStar Zeng2016-06-271-40/+40
| | | | | | | | | | | When a driver also uses a same name, there will be a link error: one or more multiply defined symbols found. Use a specific name for mSmst to avoid the link error. 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/UefiBootManagerLib: Fix data in MemoryTypeInformationSunny Wang2016-06-271-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After booting a large-size ISO RAM disk (HTTP boot option pointing to a ISO file) and reboot system, system will possibly run into the following ASSERT because the BDS core code doesn't consider the case that Memory page management (Page.c) would possibly NOT update current memory usage statistics(CurrentMemoryTypeInformation) if system allocates a memory buffer with a large number of pages. ASSERT [DxeCore] u:\MdeModulePkg\Core\Dxe\Gcd\Gcd.c(2273): Length >= MinimalMemorySizeNeeded The BDS code block for skipping counting reserved memory occupied by RAM Disk didn't consider the Memory page management's behavior mentioned above, which caused that the CurrentMemoryTypeInformation[Index1].NumberOfPages will be updated to a "very big value" because RamDiskSizeInPages is bigger than CurrentMemoryTypeInformation[Index1].NumberOfPages. For example, NumberOfPages is 0x9000 (current use) and RamDiskSizeInPages is 0xC0000 (ISO image size). The result will become a very big value 0xFFF49000. Therefore, we need to add a check to prevent BDS core code updating wrong data (very big value) to MemoryTypeInformation variable. This code change is a improvement for fixing this issue for most cases. There is still a corner case even when the memory bins don't include the RAM disk memory, the memory used by all other modules exceeds RamDiskSizeInPages. Ray will send the other patch to fix this corner case. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Sunny Wang <sunnywang@hpe.com> Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com> Reviewed-by: Ruiyu Ni <Ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg: SdMmc: Add delay before eMMC resetJoe Zhou2016-06-241-0/+2
| | | | | | | | | This delay is necessary for eMMC reset to working properly. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Joe Zhou <shjzhou@marvell.com> Signed-off-by: Marcin Wojtas <mw@semihalf.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg: SdMmc: Fix parameters order in EmmcSwitch functions callJoe Zhou2016-06-242-2/+2
| | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Joe Zhou <shjzhou@marvell.com> Signed-off-by: Jan Dabros <jsd@semihalf.com> Signed-off-by: Marcin Wojtas <mw@semihalf.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg: Remove NORETURN for PeiCore() and DxeMain() functionLiming Gao2016-06-233-3/+0
| | | | | | | | | | | | | | PeiCore EntryPoint library _ModuleEntryPoint() will call PeiCore(), then call CpuDeadLoop (). When NORETURN is added for PeiCore(), MSVC compiler will report warning C4702: unreachable code for CpuDeadLoop (). And, the warning is treated as error and cause build break. DxeMain() has the similar issue. edk2 uses EntryPoint library to wrap every module entry point function except for SEC. The module entry point is still called by _ModuleEntryPoint(). So, there will be negative impact to add NORETURN for the module entry point. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg: Fix the wrong IpSb->State updateJiaxin Wu2016-06-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is used to fix the wrong IpSb->State update issue. Issue reproduce steps: 1 .First PXE boot, then boot to shell; 2. ifconfig -s eth0 dhcp (Success); 3. Reboot and do PXE, then boot to shell; 4. ifconfig -s eth0 dhcp (Platform failed to get IP address no matter how many times retried.) Root cause: On step3 reboot, policy is DHCP (Changed by step2). So, Ip4Dxe driver will try to get one IP address from DHCP server automatically. Before it get the IP address successfully, the IpSb->State will be always in IP4_SERVICE_STARTED status until the Instance->Dhcp4Event is triggered, then it can be changed to IP4_SERVICE_CONFIGED. But the DHCP process will be interrupted by PXE boot, which will change the policy to static, and the Instance->Dhcp4Event will be also closed directly. However, current implementation doesn't update the IpSb->State to IP4_SERVICE_UNSTARTED status in such case. So, failure happened. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Ryan Harkin <ryan.harkin@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Ryan Harkin <ryan.harkin@linaro.org> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Tested-by: Ryan Harkin <ryan.harkin@linaro.org>
* MdeModulePkg/Bds: Do not boot to UI again when BootNext points to UIRuiyu Ni2016-06-231-2/+3
| | | | | | | | | | | | Per UEFI spec the successful returning of boot option triggers boot to UI. But when the BootNext just points to UI, it causes confusing. So the patch avoids booting to UI again when the BootNext points to UI. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Amy Chan <amy.chan@intel.com>
* MedmodulePkg: Refine codes related to Dhcpv4 and Dhcpv6 configuration.Zhang Lubo2016-06-2313-343/+192
| | | | | | | | | | | | | Add a new head file Dhcp.h in Mde/Include/IndustryStandard, normalize the universal option numbers and other network number tags. Cc: Sriram Subramanian <sriram-s@hpe.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@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>
* MdedulePkg: AtaAtapiPassThru: Remove polling on PxCMD.FR flag settingJan D?bro?2016-06-221-17/+1
| | | | | | | | | | | | It is enough to set PxCMD.FRE bit, which cause HBA to post received FISes into the FIS receive area. According to AHCI Specification, only polling on PxCMD.FRE to be cleared is necessary, when it is needeed to stop FIS engine (eg. in order to change PxCMD.FB address). Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jan Dabros <jsd@semihalf.com> Signed-off-by: Marcin Wojtas <mw@semihalf.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* Revert "MdeModulePkg/Bds: Do not boot to UI again when BootNext points to UI"Ruiyu Ni2016-06-221-3/+2
| | | | This reverts commit dd85dd0731e971c5782fb94b2cbac8669b33312b.
* MdeModulePkg/Bds: Do not boot to UI again when BootNext points to UIRuiyu Ni2016-06-221-2/+3
| | | | | | | | | | | | Per UEFI spec the successful returning of boot option triggers boot to UI. But when the BootNext just points to UI, it causes confusing. So the patch avoids booting to UI again when the BootNext points to UI. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Amy Chan <amy.chan@intel.com>
* MdeModulePkg/Core: Decorate phase-transition functions with NORETURN.Marvin H?user2016-06-223-0/+9
| | | | | | | | | | | This patch adds the NORETURN attribute to functions that transfer to other phases, along with an UNREACHABLE() call at the end to avoid false warnings. DxeIpl has been excluded as its main function returns a status. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg CapsulePei: Validate capsule integrity by memory resource hobStar Zeng2016-06-216-48/+241
| | | | | | | 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 CapsulePei: Fix some typosStar Zeng2016-06-213-13/+11
| | | | | | | 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: Replace UnicodeStrToAsciiStr/AsciiStrToUnicodeStrStar Zeng2016-06-219-48/+80
| | | | | | | | | | | | | | | It is the follow up of 3ab41b7a325ca11a12b42f5ad1661c4b6791cb49 to replace UnicodeStrToAsciiStr/AsciiStrToUnicodeStr with UnicodeStrToAsciiStrS/AsciiStrToUnicodeStrS. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* MdeModulePkg/UiApp: Retrieve the value of language menuDandan Bi2016-06-211-0/+13
| | | | | | | | | | | | | | | In current UI code, we use oneof opcode without storage for language menu. If we change the language form A->B, then go to another form and then go back to the front page, the language menu always shows A. Now we fix this issue by retrieving the value of oneof opcode(language menu) when display 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: Liming Gao <liming.gao@intel.com>
* MdeModulePkg/BootManagerUiLib: No need to connect all devicesDandan Bi2016-06-211-5/+2
| | | | | | | | | | | | The connect all action has been done in UiApp, no need to do it when update boot manager form. 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: Connect all devices in UiApp if neededDandan Bi2016-06-212-5/+4
| | | | | | | | | | | | If the connect all action has not been performed before. We do it in UiApp now. 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 PCD: Avoid DynamicHii PCD set to override other valuesStar Zeng2016-06-201-5/+89
| | | | | | | | | | | | | | | | | When Hii variable is not present and if we try to update a variable offset with some value, we are creating a new variable by Zeroing all the variable offsets except the one which we are trying to update. This will override all the other variable default values which are programmed as a part of initial PCD definition. DXE PCD driver could be enhanced to combine the DynamicHii PCDs(related to same variable) default values and only update the offset PcdSetXXX want to set, then set the combined values to variable. Cc: Liming Gao <liming.gao@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/Database: Fix incorrect calculation of baseline in FontPackageDandan Bi2016-06-151-0/+16
| | | | | | | | | | | | | | | | When adding font package, there exists the case that only have the EFI_HII_GIBT_GLYPH_DEFAULT or EFI_HII_GIBT_GLYPHS_DEFAULT glyph block and use the default cell info in font package fixed header. In this case, we can't get the correct baseline now. This patch is to fix this issue by recalculating the baseline when the glyph block type is EFI_HII_GIBT_GLYPH_DEFAULT or EFI_HII_GIBT_GLYPHS_DEFAULT. 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 the incorrect use of the HiiHandleDandan Bi2016-06-141-3/+3
| | | | | | | | | | | In current code, when adding string package, it will return 'gStringPackHandle'. But the code use the 'gHiiHandle' to get string. It is incorrect. This patch is to fix this issue. 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>
* MdeModulePkg DxeS3BootScriptLib: Check (mSmst != NULL) before freeing SMRAMStar Zeng2016-06-131-1/+1
| | | | | | | | | | | | | | There is static scan tool reports BootScriptSave.c:628:'mSmst' is explicitly dereferenced. The patch is to check (mSmst != NULL) before freeing SMRAM at BootScriptSave.c:628. Cc: Shumin Qiu <shumin.qiu@intel.com> 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: Shumin Qiu <shumin.qiu@intel.com>
* MdeModulePkg: Correct the usage of gPerformanceProtocolGuid in infStar Zeng2016-06-122-2/+3
| | | | | | | | | | | | | Add gPerformanceProtocolGuid in BdsDxe.inf explicitly. Currently, BdsDxe could build pass as it inherits gPerformanceProtocolGuid from UefiBootManagerLib.inf. Also update the usage of gPerformanceProtocolGuid in UefiBootManagerLib.inf. Cc: Liming Gao <liming.gao@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/RamDiskDxe: Add Memory Type selection support in Ramdisk HIITapan Shah2016-06-124-9/+72
| | | | | | | | | | Adding an option in HII menu so user can choose memory type to use when creating a RAM Disk in system. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Tapan Shah <tapandshah@hpe.com> Reviewed-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
* MdeModulePkg RamDiskDxe: Do not save 'Size' numeric value by varstoreHao Wu2016-06-124-126/+33
| | | | | | | | | | | | | | | The 'Size' numeric value used when creating a raw RAM disk does not require a varstore to save its previous value in the create raw RAM disk HII page. The expecting behavior is that after a user created a raw RAM disk, the next time when the create raw RAM disk page is entered, the 'Size' numeric will be the default value (EFI_PAGE_SIZE). 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> Reviewed-by: Tapan Shah <tapandshah@hpe.com>
* MdeModulePkg: Fix IPv4 UseDefaultAddress failure case.Jiaxin Wu2016-06-081-2/+5
| | | | | | | | | | | | | | | | This patch is used to update IP4->Configure() to allow the upper layer modules to obtain a default address by setting UseDefaultAddress to TRUE when default address is not available yet. Cc: Ye Ting <ting.ye@intel.com> Cc: El-Haj-Mahmoud Samer <samer.el-haj-mahmoud@hpe.com> Cc: Subramanian Sriram <sriram-s@hpe.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Sriram Subramanian <sriram-s@hpe.com> Tested-by: Sriram Subramanian <sriram-s@hpe.com>
* MdeModulePkg DxeS3BootScriptLib: Revert git commit 058196bbb345Star Zeng2016-06-072-5/+0
| | | | | | | | | | | | | With a destructor implemented, the shortcut from 058196bbb345 should be unnecessary. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Suggested-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com>
* MdeModulePkg DxeS3BootScriptLib: Add DESTRUCTOR S3BootScriptLibDeinitializeStar Zeng2016-06-072-34/+124
| | | | | | | | | | | | | | | | | | | | | | PiDxeS3BootScriptLib has a constructor S3BootScriptLibInitialize() that registers ready-to-lock callback S3BootScriptSmmEventCallBack() and several more. The library is linked to SMM modules. If the module entry-point function returns error (because of lack of resources, unsupported, whatever), the module will be unloaded and the notify callback pointers will point to undefined memory. On ready-to-lock exception occurs when calling S3BootScriptSmmEventCallBack(), and probably all the other callbacks registered by the constructor would also cause exception. This patch is to implement library Destructor to free the resources allocated by S3BootScriptLibInitialize() and unregister callbacks. Cc: Jiewen Yao <jiewen.yao@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: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com>
* MdeModulePkg SmmLockBoxSmmLib: Add DESTRUCTOR SmmLockBoxSmmDestructorStar Zeng2016-06-072-0/+40
| | | | | | | | | | | | | | | | | | SmmLockBoxSmmLib is linked to SMM modules. If the module entry-point function returns error, the module will be unloaded and the global variables will point to undefined memory. This patch is to add DESTRUCTOR SmmLockBoxSmmDestructor to uninstall SmmLockBoxCommunication configuration table if it has been installed in Constructor. Cc: Jiewen Yao <jiewen.yao@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: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com>
* MdeModulePkg SmmLockBoxSmmLib: Fix typo in SmmLockBoxSmmConstructuorStar Zeng2016-06-072-7/+7
| | | | | | | | | | | SmmLockBoxSmmConstructuor should be SmmLockBoxSmmConstructor. Cc: Jiewen Yao <jiewen.yao@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: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com>
* MdeModulePkg/AtaBusDxe: Fix some ATA hard drives cannot be discoveredCinnamon Shia2016-06-071-1/+2
| | | | | | | | | | | | | | | | | | | | | | If there is no multiplier, the DEV bit of the ATA device register would always be set. It causes that some ATA hard drives don't response the ATA identity command sent to them. Below is the description about DEV bit in ATA spec: A device is selected when the DEV bit of the Device register is equal to the device number assigned to the device by means of a Device 0/Device 1 jumper or switch, or use of the CSEL signal. Below is the description about DEV bit in SATA spec: When the DEV bit in the Device register is set to one, selecting the non-existent Device 1, the host adapter shall respond to register reads and writes as specified for a Device 0 with no Device 1 present, as defined in the ATA/ATAPI-5 standard. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Cinnamon Shia <cinnamon.shia@hpe.com> Reviewed-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com>
* MdeModulePkg/HiiDatabase: Remove the incorrect calculation of font baselineDandan Bi2016-06-061-4/+0
| | | | | | | | | | | | | | | | When add Font Package, the cell in EFI_HII_FONT_PACKAGE_HDR contains the measurement of the widest and tallest characters in the font. The measurement may be not absolutely correct, so when use this cell information to calculate the baseline may cause incorrect result. Besides this calculation is not necessary. So remove it now. 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/HiiDatabase: Preinit background when render string to screenDandan Bi2016-06-061-0/+6
| | | | | | | | | | | | | | When render string to screen, for proportional fonts, the background color may not set to the whole BltBuffer. And this will cause incorrect display. Now initialize the background color to fix this issue. 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:Prevent the BmRepairAllControllers routine in an infinite loopGary Li2016-06-034-3/+20
| | | | | | | | | | Prevent the BmRepairAllControllers routine in an infinite loop Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Gary Li <garyli@hpe.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg NvmExpressDxe: Fix invalid queue size when creating IO queuesHao Wu2016-06-021-2/+24
| | | | | | | | | | | | | | | | | | | | The Maximum Queue Entries Supported (MQES) field in the CAP (Controller Capabilities) register for a NVMe controller restrict the maximum individual queue size that the controller supports. The origin code does not check this value and always uses a hardcode value when creating I/O submission/completion queues for asynchronous transmission. The hardcode value might be larger than the MQES field, this will lead to an 'Invalid Queue Size' error when creating I/O submission/completion queues. The patch will add checks to make sure proper queue size is passed when creating I/O submission/completion queues. 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: Fix SNP.Initialize() spec conformance issueJiaxin Wu2016-06-021-6/+27
| | | | | | | | | | | | | | | | | | | | | | | | | v2: *Refine the coding style according edk2 community's feedback. Current SNP UNDI Initialize command does not follow the UEFI Spec to update the SNP MediaPresent field. The result for the Initialize command execution check should be: StatFlags: (1) Monitor the upper two bits (14 & 15) in the field to know whether the command has been executed by the UNDI (Not started, Queued, Error, Complete). (2) Check the other field to see if there is an active connection to this network device (used to update MediaPresent). StatCode: After command execution completes, either successfully or not, this field contains the result of the command execution (success or failure). This patch is used to fix it. NOTE: If any UNDI driver does not follow the UEFI Spec for the media status update, it may meet failure with this more conditions check (StatFlags). 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: Ye Ting <ting.ye@intel.com>