summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Library
Commit message (Collapse)AuthorAgeFilesLines
* MdeModulePkg: VarCheckUefiLib: Add DeployedMode/AuditMode var check logicChao Zhang2015-12-071-0/+22
| | | | | | | | | | | | DeployedMode & AuditMode are UINT8 Global variable according to Enable Secure Boot feature defined in UEFI2.5 Mantis 1263. Add them to var check list. https://mantis.uefi.org/mantis/view.php?id=1263 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chao Zhang <chao.b.zhang@intel.com> Reviewed-by: Zeng Star <star.zeng@intel.com> Reviewed-by: Long Qin <qin.long@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19131 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: DebugAssert enhancementBaraneedharan Anbazhagan2015-12-071-15/+36
| | | | | | | | | | | | | | If the assert happens in a library, then it's hard to determine which module using that library is generating that assert. Use gEfiCallerBaseName in DebugAssert to display the module name. V2: Updated code to use copy mem and ModuleNameSize calculation. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Baraneedharan Anbazhagan <anbazhagan@hp.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19128 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg/BootLogoLib: Fix INF comments to follow coding standardsRuiyu Ni2015-12-011-6/+6
| | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Shumin Qiu <shumin.qiu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19083 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg/BmpImageDecoderLib: Fix function header commentsRuiyu Ni2015-12-011-4/+4
| | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Shumin Qiu <shumin.qiu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19082 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg:Replace unsafe string function with safe one.Dandan Bi2015-11-301-10/+12
| | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19029 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg/BDS: Do not pass unnecessary option to boot optionRuiyu Ni2015-11-301-5/+27
| | | | | | | | | | | | | | | | | BDS puts a special GUID in boot option optional data for auto-discovered boot option. But when launching that boot option, the BDS core unconditionally pass the special GUID to the executable. A good written application/OS loader can ignore the unexpected parameters, but BDS core should still avoid passing the unnecessary GUID. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19007 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg:Refine the comments in INF filesDandan Bi2015-11-262-12/+12
| | | | | | | | | | | Add comments in INF file in BootMaintenanceManagerLib.inf. Refine the comments in INF file in FileExplorerLib.inf Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18975 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg BaseSerialPortLib16550:Implement Get(Set)Control/SetAttributesStar Zeng2015-11-261-0/+337
| | | | | | | | | | | | Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18965 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: Clean code to follow C Coding style.Zhang Lubo2015-11-251-1/+1
| | | | | | | | | Clean code to follow C Coding style. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18943 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg/UefiBootManagerLib: Always create MemoryTypeInfo variableRuiyu Ni2015-11-243-12/+20
| | | | | | | | | | | | Align to old BDS behavior (IntelFrameworkModulePkg/BDS) to always create MemoryTypeInfo variable regardless of the PcdResetOnMemoryTypeInformationChange value. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18926 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg:Create Boot Maintenance Manager LibraryDandan Bi2015-11-2312-0/+8468
| | | | | | | | | | | | Split the boot maintenance manager library from UiApp in MdeModulePkg/Application and put the library in MdeModulePkg/Library. 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> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18923 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg:Create Device Manager LibraryDandan Bi2015-11-235-0/+1242
| | | | | | | | | | | | Split the device manager library from UiApp in MdeModulePkg/Application and put the library in MdeModulePkg/Library. 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> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18922 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg:Create Boot Manager LibraryDandan Bi2015-11-235-0/+1077
| | | | | | | | | | | | Split the boot manager library from UiApp in MdeModulePkg/Application and put the library in MdeModulePkg/Library. 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> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18921 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg DxeFileExplorerProtocol: Create wrapper fileexplorer library.Eric Dong2015-11-233-0/+134
| | | | | | | | | | | This library wrapper explorer protocol and produce the file explorer library. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18919 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg FileExplorerLib: Create file explorer library.Eric Dong2015-11-236-0/+1862
| | | | | | | | | | | This library support select one file from the specified directory or from system root directory. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18917 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg/BootLogoLib: Fix GCC build failureRuiyu Ni2015-11-231-0/+2
| | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18916 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg BaseSerialPortLib16550: Fix typo in SerialPortWrite()Star Zeng2015-11-201-1/+1
| | | | | | | | | | | | | The "read" word in SerialPortWrite() header comment block should be "write". Cc: Michael D Kinney <michael.d.kinney@intel.com> 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: Michael D Kinney <michael.d.kinney@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18910 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: Change BootLogoEnableLogo use INTN for minus valueRuiyu Ni2015-11-181-33/+30
| | | | | | | | | | | | | | The parameter name is also changed from Coordinate* to Offset* to reflect that it's the offset to the location specified by Attribute. For example, when the Attribute is Center, OffsetX and OffsetY are used to specify the offset to the Center. OffsetX = 100 means 100 pixels right to the Center. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18867 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg/VarCheck: Add VarCheck handler for PlatformRecovery####Ruiyu Ni2015-11-172-0/+18
| | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18864 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: Add Platform recovery supportRuiyu Ni2015-11-173-17/+119
| | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Sunny Wang <sunnywang@hpe.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18859 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: Support to expand File device pathRuiyu Ni2015-11-171-0/+76
| | | | | | | | | | | To support platform recovery, File device path expanding capability is added. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Sunny Wang <sunnywang@hpe.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18858 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: Use BmForEachVariable to collect all key optionsRuiyu Ni2015-11-171-71/+90
| | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Sunny Wang <sunnywang@hpe.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18857 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: Use BM_OPTION_NAME_LEN instead of sizeof L"Boot####"Ruiyu Ni2015-11-171-5/+5
| | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Sunny Wang <sunnywang@hpe.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18856 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: Use BmCharToUint in BmIsKeyOptionVariableRuiyu Ni2015-11-174-28/+44
| | | | | | | | | | | The patch also moves the BmCharToUint to BmMisc.c because it belongs to misc functions. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Sunny Wang <sunnywang@hpe.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18855 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: Add Bm prefix for internal functionsRuiyu Ni2015-11-172-4/+12
| | | | | | | | | | | Change VARIABLE_VISITOR to BM_VARIABLE_VISITOR Change ForEachVariable to BmForEachVariable Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Sunny Wang <sunnywang@hpe.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18854 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: SmmLockBoxPeiLib: work without EFI_PEI_SMM_COMMUNICATION_PPILaszlo Ersek2015-11-161-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The RestoreLockBox() and RestoreAllLockBoxInPlace() functions handle the case when EFI_PEI_SMM_COMMUNICATION_PPI.Communicate() returns EFI_NOT_STARTED: they access the SMRAM directly, for restoring LockBox data. This occurs if a PEIM needs to restore LockBox data *before* the SMBASE is relocated and the SMI handler is installed for all processors. One such PEIM is UefiCpuPkg/Universal/Acpi/S3Resume2Pei. On the S3 resume path, in function S3RestoreConfig2(), LockBox data are restored *before* the SmmRestoreCpu() function of UefiCpuPkg/PiSmmCpuDxeSmm is called via SmmS3ResumeState->SmmS3ResumeEntryPoint. (The latter SmmRestoreCpu() function is responsible for the SMBASE relocation.) If a platform knows that its PEIMs restore LockBox data *only* before SMBASE relocation -- e.g., due to S3Resume2Pei being the platform's only SmmLockBoxPeiLib client --, then the platform might not want to include "UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationPei.inf" at all (hence not provide EFI_PEI_SMM_COMMUNICATION_PPI) -- because all of those restores would be serviced by direct SMRAM access anyway. Currently the absence of EFI_PEI_SMM_COMMUNICATION_PPI is not supported by SmmLockBoxPeiLib, but it's not hard to implement. Handle it the same as when EFI_PEI_SMM_COMMUNICATION_PPI.Communicate() returns EFI_NOT_STARTED: restore LockBox data directly from SMRAM. Suggested-by: Jiewen Yao <jiewen.yao@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18823 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg/BmpImageDecoderLib: Support ImageFormatUnknown typeRuiyu Ni2015-11-121-1/+1
| | | | | | | | | | Enhance the library to handle unknown image format. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18774 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: Add BootLogoLib to provide interfaces about logo display.Ruiyu Ni2015-11-122-0/+643
| | | | | | | | | 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: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18772 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: Add BmpImageDecoderLib to provide BMP decoding capabilityRuiyu Ni2015-11-122-0/+314
| | | | | | | | | 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: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18771 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: Add ImageDecoderLib to provide image decoding service.Ruiyu Ni2015-11-122-0/+163
| | | | | | | | | | | | The library itself doesn't provide any image decoding capabilities but manages the different image decoders. 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: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18770 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg:Modify the pointer type.Dandan Bi2015-11-111-3/+3
| | | | | | | | | | | | Previously the pointer type is EFI_IFR_FORM_SET, it is incorrect when do pointer addition without conversion.Now change it to UINT8 type. 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> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18768 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg:Fix a bug that HttpLib can not parse Ipv6 address correctly.Zhang Lubo2015-11-091-4/+29
| | | | | | | | | | | | | | When parsing the authority component of the input URL, it can not distinguish the ":" is the flag that indicates the port or the separator between the ipv6 address. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Gary Ching-Pang Lin <glin@suse.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18744 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: Fix memory leak issuesSunny Wang2015-11-031-0/+6
| | | | | | | | | | Fix memory leak issues Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Sunny Wang <sunnywang@hpe.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18722 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: Add DEBUG statement when reaching max perf log entriesSamer El-Haj-Mahmoud2015-11-021-0/+2
| | | | | | | | | | | Add a DEBUG statement when the number of PEI perf log entries exceeds PcdMaxPeiPerformanceLogEntries Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@hpe.com> Reviewed-by: Star Zeng <star.zeng@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18714 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg:Add new API HiiGetFormSetFromHiiHandle into UefiHiiLibDandan Bi2015-10-271-0/+111
| | | | | | | | | | | This function is mainly through the Hii handle to get the formset opcode. 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> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18684 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: Make the BmFindLoadOption function publicSunny Wang2015-10-263-27/+9
| | | | | | | | | | | Make the BmFindLoadOption function public Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Sunny Wang <sunnywang@hpe.com> Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18662 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg VarCheckLib: R18611 was thoughtless for property setStar Zeng2015-10-191-12/+17
| | | | | | | | | | | | | | | R18611 only updated the logic to return correct property when no property set to variable with wildcard name. But VariablePropertySet needs the pointer of property data for set. So roll back the change in VariablePropertyGetWithWildcardName at R18611, and check the property revision first in VariablePropertyGet and SetVariableCheck before using the property data. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18626 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulepkg VarCheckLib: Return NULL when no property setStar Zeng2015-10-161-2/+10
| | | | | | | | | | | | | | | | | | | | to variable with wildcard name. VarCheckLib has zeroed property for variable with wildcard name and is waiting for property set. The code should return NULL when no property set to variable with wildcard name, but not return the zeroed property that will impact the functionality of SetVariableCheck. The issue does not appear with VarCheckUefiLib linked as the library just has the expected property set. 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> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18611 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg PiDxeS3BootScriptLib: Use PcdSet64S to instead of PcdSet64Star Zeng2015-10-101-2/+4
| | | | | | | | | | | | | | | | | | PcdSet## has no error status returned, then the caller has no idea about whether the set operation is successful or not. PcdSet##S were added to return error status and PcdSet## APIs were put in ifndef DISABLE_NEW_DEPRECATED_INTERFACES condition. To adopt PcdSet##S and further code development with DISABLE_NEW_DEPRECATED_INTERFACES defined, we need to Replace PcdSet## usage with PcdSet##S. Normally, DynamicDefault PCD set is expected to be success, but DynamicHii PCD set failure is a legal case. For this case, PcdS3BootScriptTablePrivateDataPtr and PcdS3BootScriptTablePrivateSmmDataPtr are expected to be DynamicDefault, so use PcdSet64S to instead of PcdSet64 and assert when set failure. Cc: Jiewen Yao <jiewen.yao@intel.com> 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: Jiewen Yao <jiewen.yao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18599 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg UefiBootManagerLib: Do not assume perf entry count has no changeStar Zeng2015-09-301-85/+35
| | | | | | | | | | | | | | | | | | Current implementation assumes the performance entry count has no change from multiple GetPerformanceMeasurement() while loops, it may cause the allocated buffer for PerfEntriesAsDxeHandle at the first loop to be overflowed if the following loop has the count changed. This patch is also to sync the change at commit R17851 "IntelFrameworkModulePkg GenericBdsLib: Resolve array size mismatch". Cc: Ruiyu Ni <ruiyu.ni@intel.com> 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: Ruiyu Ni <ruiyu.ni@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18561 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: Add SMBIOS 3.0 support in NetLibGetSystemGuid.Samer El-Haj-Mahmoud2015-09-302-12/+20
| | | | | | | | | | | | | NetLibGetSystemGuid gets the UUID from SMBIOS table to use as the System GUID (in DHCP and other network use cases). This change adds support to get the UUID from either SMBIOS 2.x or 3.0, since SMBIOS 3.0 uses a different GUID in the System Configuration Table. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@hpe.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18559 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg:Fix the bug the incorrect change of StrCpyS functionDandan Bi2015-09-171-2/+2
| | | | | | | | | | | The pointer to the destination string changed,the max length also changed.Previous change neglect this point. And base on the code logic,we can use StrCatS to replace StrCpyS.Now this patch is to fix this bug. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18497 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg PiDxeS3BootScriptLib: Remove a hidden assumption.Star Zeng2015-09-153-157/+341
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | What to do: 1. Remove a hidden assumption "No SMM driver writes BootScript between SmmReadyToLock and S3SleepEntryCallback". 1.1. Use SmmExitBootServices and SmmLegacyBoot notification to record AtRuntime flag. 1.2. Use mBootScriptDataBootTimeGuid LockBox to save boot time boot script data to handle potential INSERT boot script at runtime in SMM. 2. Do not depend on OS to help restore ACPINvs data and use EfiReservedMemoryType instead of EfiACPIMemoryNVS. 2.1. Use mBootScriptSmmPrivateDataGuid LockBox to save boot script SMM private data with BackFromS3 = TRUE at runtime. S3 resume will help restore it to tell the Library the system is back from S3. Why to do: 1. The hidden assumption "No SMM driver writes BootScript between SmmReadyToLock and S3SleepEntryCallback" will cause confusion to the library's consumer and block the usage of "SMM driver writes BootScript after SmmReadyToLock". So Remove the assumption. 2. In original code, there might be a corner case that malicious code patch ACPINvs boot TableLength field same as SMM boot script. So that it can skip the table restore. The impact is that BootScript in SMM may be overridden by malicious code. -------------------- CopyMem ((VOID*)&TableHeader, (VOID*)mS3BootScriptTablePtr->TableBase, sizeof(EFI_BOOT_SCRIPT_TABLE_HEADER)); if (mS3BootScriptTablePtr->TableLength + sizeof(EFI_BOOT_SCRIPT_TERMINATE) != TableHeader.TableLength) { // TableLength is in NVS ...... // // NOTE: We should NOT use TableHeader.TableLength, because it is already updated to be whole length. // mS3BootScriptTablePtr->TableLength = (UINT32)(mLockBoxLength - sizeof(EFI_BOOT_SCRIPT_TERMINATE)); ? This line can be skipped. -------------------- So use EfiReservedMemoryType instead of EfiACPIMemoryNVS as the code has been updated to not depend on OS to help restore ACPINvs data. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18467 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: Fix a performance data buffer overrun issueRuiyu Ni2015-09-091-0/+5
| | | | | | | | | | | | | | | | The mBmPerfHeader.Count isn't reset to 0 in BmWriteBootToOsPerformanceData() so when the actual performance data entry count exceeds the LimitCount, the performance data collection breaks on condition if (mBmPerfHeader.Count == LimitCount), but 2nd time calling this function will not break on condition if (mBmPerfHeader.Count == LimitCount) because the mBmPerfHeader.Count always bigger than LimitCount, which results buffer overrun. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18417 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: Remove unused variables from both UefiBootManagerLib and ↵Sunny Wang2015-08-282-5/+2
| | | | | | | | | | BdsDxe to fix GCC build. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Sunny Wang <sunnywang@hpe.com> Reviewed-by: Eric Dong <eric.dong@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18350 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: Add the missing module UNI files.Liming Gao2015-08-284-0/+2
| | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18342 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: Replace deprecated function.Eric Dong2015-08-271-1/+1
| | | | | | | | | | Replace GetEfiGlobalVariable with GetEfiGlobalVariable2. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18332 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: Convert the UNIX to DOS end of line formatJiaxin Wu2015-08-272-1435/+1435
| | | | | | | | | | Convert the UNIX to DOS end of line format. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18324 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: Fix UefiBootManagerLib.inf license header.Ruiyu Ni2015-08-251-0/+1
| | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18298 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: Add PlatformVarCleanupLib libraryStar Zeng2015-08-257-0/+1531
| | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18295 6f19259b-4bc3-4df7-8a09-765794883524