summaryrefslogtreecommitdiff
path: root/MdePkg/Library
AgeCommit message (Collapse)Author
2016-07-15MdePkg/BaseSynchronizationLib: spin lock alignment is 32 at leastJeff Fan
Some processor may return small cache line size, we should return 32 bytes at least for spin lock alignment. Cc: Liming Gao <liming.gao@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> (cherry picked from commit 52f5bd2669916c54845eda8829b2f129b6088896)
2016-07-15MdePkg/BaseSynchronizationLib: Add spin lock alignment for IA32/x64Jeff Fan
From Intel(R) 64 and IA-32 Architectures Software Developer's Manual, one lock or semaphore is suggested to be present within a cache line. If the processors are based on Intel NetBurst microarchitecture, two cache lines are suggested. This could minimize the bus traffic required to service locks. Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> (cherry picked from commit 5f0a17d83a6443931068d428600824276ca2bd37)
2016-07-15MdePkg/BaseSynchronizationLib: Do not check timeout if lock releasedJeff Fan
Current AcquireSpinLock() will check if timeout happens when PcdSpinLockTimeout is not zero, even though the spin lock is already released. It may do unnecessary operation to read timer's counter. This update is trying to acquire spin lock firstly. If it could be acquired successfully, needn't to check timeout at all. Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> (cherry picked from commit 0f18e1eda2a807283484adfbf5eaae6a92b1ffa7)
2016-07-07MdePkg: Indicate UnicodeStrToAsciiStr/AsciiStrToUnicodeStr to be deprecatedStar Zeng
Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Michael D Kinney <michael.d.kinney@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> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> (cherry picked from commit 415aa2f1cb915a00b2d91fdfb1798bb75bcaed09)
2016-07-07MdePkg: Replace UnicodeStrToAsciiStr() with UnicodeStrToAsciiStrS()Star Zeng
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: Michael D Kinney <michael.d.kinney@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> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> (cherry picked from commit ca2ac9d521b595e969dbe65f1a19fd96d499fa61)
2016-07-06MdePkg/BaseLib: Add 2 more safe string functions.Jiewen Yao
Add UnicodeStrToAsciiStrS() and AsciiStrToUnicodeStrS() API. These 2 safe version APIs are used to replace UnicodeStrToAsciiStr() and AsciiStrToUnicodeStr() API. The safe version string convert APIs use similar check as StrCpyS(). Cc: Liming Gao <Liming.Gao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao <Jiewen.Yao@intel.com> Reviewed-by: Liming Gao <Liming.Gao@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> (cherry picked from commit 3ab41b7a325ca11a12b42f5ad1661c4b6791cb49)
2016-07-06MdePkg/Hsti: Fix a memory allocation check issue.Jiewen Yao
Cc: Liming Gao <Liming.Gao@intel.com> Cc: Amy Chan <Amy.Chan@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao <Jiewen.Yao@intel.com> Reviewed-by: Liming Gao <Liming.Gao@intel.com> Reviewed-by: Amy Chan <Amy.Chan@intel.com> (cherry picked from commit d3858e1006f3b88cb510f7c71452a53ff6f75c05)
2016-07-06MdePkg-SmmMemLib: Enhance SmmIsBufferOutsideSmmValid() check for fixed comm ↵Jiewen Yao
buffer. This patch adds more check in SmmIsBufferOutsideSmmValid(), to make sure that SMM communication buffer is only EfiReservedMemoryType/EfiRuntimeServicesCode/ EfiRuntimeServicesData/EfiACPIMemoryNVS. So that the communication buffer will not touch any OS memory. The assumption is that a platform reports valid SMM communication buffer at EndOfDxe, because EndOfDxe is last hook point that SMM code can call-out to get memory map information. A platform MUST finish SMM communication buffer allocation before EndOfDxe. If a DXE or OS driver need do communication after EndOfDxe, it can either allocate SMM communication buffer before EndOfDxe and save it, or consume EDKII_PI_SMM_COMMUNICATION_REGION_TABLE table to get general fixed comm buffer. This is designed to meet Microsoft WSMT table definition on FIXED_COMM_BUFFERS requirement. Cc: Liming Gao <liming.gao@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Regression-tested-by: Laszlo Ersek <lersek@redhat.com> (cherry picked from commit 91f51fcc84d9ce3b801fdd895e514cd5525975c7)
2016-02-23MdePkg: Add PciSegmentLib instance based on PciLibRuiyu Ni
This PciSegmentLib instance only supports Segment 0 access. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19657 6f19259b-4bc3-4df7-8a09-765794883524 (cherry picked from commit 32fa5588ff703507e82bd9c64d56e1baa4076f60)
2015-12-23MdePkg UefiScsiLib: Raise the Tpl of async IO callback to TPL_NOTIFYHao Wu
Raise the Tpl of async SCSI I/O callback function to TPL_NOTIFY to match the behavior in ScsiDiskDxe driver. (Sync patch r19453 from main trunk.) 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> git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2015@19474 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-23MdePkg UefiScsiLib: Close event when SCSI command failsHao Wu
The ScsiExecuteSCSICommand() function in ScsiBusDxe driver will not signal the event passed from UefiScsiLib when error occurs. In this case, UefiScsiLib should close the event passing to ScsiExecuteSCSICommand(). (Sync patch r19448 from main trunk.) 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> git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2015@19469 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-15MdePkg: Correct Protocol usages in UefiDebugLibDebugPortProtocolLiming Gao
(Sync patch r18415 from main trunk.) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2015@19277 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-15MdePkg: Add UefiDebugLibDebugPortProtocol to output logs via DebugPort.Masamitsu MURASE
UefiDebugLibDebugPortProtocol is an implementation of DebugLib. It calls EFI_DEBUGPORT_PROTOCOL.Write in DebugPrint and DebugAssert. (Sync patch r18414 from main trunk.) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Masamitsu MURASE <masamitsu.murase@gmail.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2015@19276 6f19259b-4bc3-4df7-8a09-765794883524
2015-12-11MdePkg UefiScsiLib: Add non-blocking support for SCSI Read/Write commandHao Wu
Four new functions are added to UefiScsiLib: ScsiRead10CommandEx ScsiWrite10CommandEx ScsiRead16CommandEx ScsiWrite16CommandEx They support both blocking and non-blocking SCSI Read/Write operation depending on the optional parameter 'Event' passed to those APIs. When 'Event' is NULL, these four functions will call the non-EX version couterparts to execute blocking SCSI I/O. When 'Event' is not NULL, non-blocking I/O operation is executed. (Sync patch r19214 from main trunk.) 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> git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2015@19221 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-30MdePkg SerialPortLib: Upstream Get(Set)Control/SetAttributes interfacesStar Zeng
The extended interfaces GetControl/SetControl/SetAttributes are from EmbeddedPkg/Include/Library/SerialPortExtLib.h. (Sync patch r18963 from main trunk.) 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: 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/branches/UDK2015@19013 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-30MdePkg SerialPortLib: Fix typo in SerialPortWrite()Star Zeng
The "read" word in SerialPortWrite() header comment block should be "write". (Sync patch r18908 from main trunk.) 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/branches/UDK2015@19009 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-18MdePkg: Add more DataBits support to Port80 outputLiming Gao
The BasePostCodeLibPort80 instance just prints UINT8 to IoPort 80. Some boards may support 16bit or 32bit. To support them, new PCD PcdPort80DataWidth is introduced to specify the width of data bits to Port80. (Sync patch r18765 from main trunk.) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-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/branches/UDK2015@18871 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-16MdePkg: Create GetRandomNumber128 in RngLibThomas Palmer
Declare GetRandomNumber128 in RngLib.h. Create GetRandomNumber128 in BaseRngLib, which is simply calling GetRandomNumber64 twice. A GetRandomNumber128 function allows platforms with 128bit HWRNGs to save on IO overhead that comes from having to prime the HWRNG device before each read operation. Using the HWRNG installed on the HP ProLiant m400 moonshot cartridge, this will save about 50ms per RAW Entropy operation as compared with calling GetRandomNumber64 twice. (Sync patch r18590 from main trunk.) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Thomas Palmer <thomas.palmer@hpe.com> Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Chao Zhang <chao.b.zhang@intel.com> Reviewed-by: Qin Long <qin.long@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2015@18791 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-16MdePkg: Add RngLib into MdePkgQin Long
Add one library class (RngLib.h) with three GetRandomNumber16/32/64 APIs to provide random number generator services, and one library instance (BaseRngLib), based on Intel RdRand instruction access, to provide high-quality random numbers generator. (Sync patch r18519 from main trunk.) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qin Long <qin.long@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2015@18786 6f19259b-4bc3-4df7-8a09-765794883524
2015-11-16MdePkg: Add CPU RdRand access APIs for random number generationQin Long
Add AsmRdRand16/32/64 APIs for RdRand instruction access to generate high-quality random number. (Sync patch r18518 from main trunk.) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qin Long <qin.long@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2015@18785 6f19259b-4bc3-4df7-8a09-765794883524
2015-09-17MdePkg/SmmServicesTableLib: Return TRUE in InSmm ()Jeff Fan
SmmServicesTableLib instance only supports DXE_SMM_DRIVER type drivers that will be loaded into SMM range. InSmm() could return TRUE directly. (Sync patch r18495 from main trunk.) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Jiewen Yao <Jiewen.Yao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2015@18496 6f19259b-4bc3-4df7-8a09-765794883524
2015-09-11MdePkg/UefiScsiLib: comments update to add EFI_INVALID_PARAMETER statusFeng Tian
EFI_SCSI_IO_PROTOCOL has alignment requirement on any data buffer used in SCSI data transfer. As a wrap of this protocol, UefiScsiLib have same request. Adding EFI_INVALID_PARAMETER return status in function comments to ask the caller to guarantee this alignment. (Sync patch r18434 from main trunk.) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2015@18439 6f19259b-4bc3-4df7-8a09-765794883524
2015-09-10MdePkg: Refine UefiFileHandleLib to avoid write non-ASCII char into ASCII file.Qiu Shumin
(Sync patch r18430 from main trunk.) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2015@18432 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-28MdePkg UefiDevicePathLib: Fix possible memory read/write cross boundaryHao Wu
The SSID field of a Wi-Fi device path node may not contain a NULL termination. Additonal handle is added to make sure no cross-boundary memory read/write will occur. (Sync patch r18355 from main trunk.) 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> git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2015@18358 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-28MdePkg: Modify string expression of Wi-Fi device path to follow UEFI specHao Wu
According to UEFI 2.5 spec, the string expression of a Wi-Fi device node should be displayed as: Wi-Fi(SSID). However, current code displays it as: WiFi(SSID). (Sync patch r18354 from main trunk.) 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> git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2015@18357 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-28MdePkg: Modify string expression of BMC device path to follow UEFI specHao Wu
According to UEFI 2.5 spec, the string expression of a BMC device node should be displayed as: BMC(Type,Address). However, current code displays it as: Bmc(Type,Address). (Sync patch r18353 from main trunk.) 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> git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2015@18356 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-28MdePkg: Refine the device path text format for Bluetooth to follow spec.Qiu Shumin
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18346 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-28MdePkg: Add the missing module UNI filesLiming Gao
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18340 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-26MdePkg: Make the FileHandleGetFileName return the file name in right format.Qiu Shumin
1. If the file is not a directory remove the redundant '\' char in file name string returned from UefiFileHandleLib.FileHandleGetFileName. 2. Update function comments. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18314 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-24MdePkg/Library/UefiFileHandleLib: Make FileHandleReadLine return the right ↵Qiu Shumin
buffer size. 1. '\r' char will not return in buffer so buffer size should exclude the number of '\r' char. 2. When 'Truncate' is TRUE return the truncated string with 'EFI_SUCCESS' status. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18276 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-24MdePkg: Add two PcdApi for Patch VOID* PCD set operation.Liming Gao
Two new APIs LibPatchPcdSetPtrAndSize() and LibPatchPcdSetPtrAndSizeS() are added to catch the size of the updated VOID* PCD value buffer, then PcdGetSize() API can return the actual size. Update three PcdLib instances to implement these two APIs. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18269 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-24MdePkg/Library/UefiFileHandleLib: Update the module Basename and module type ↵Qiu Shumin
to 'UEFI*'. The library instance is not BASE type, to follow naming convention this patch change Basename into 'Uefi*Lib' and module type into 'UEFI_DRIVER'. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18265 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-05MdePkg UefiLib: Fix wrong DestMax passed to StrCpyS()Hao Wu
The second parameter 'DestMax' of StrCpyS() should be the number of unicode characters, not the size in bytes. Also, code is modified to keep align with the one in IntelFrameworkPkg\Library\FrameworkUefiLib\UefiLibPrint.c. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18160 6f19259b-4bc3-4df7-8a09-765794883524
2015-08-04MdePkg/UefiDevicePathLib: Fix RAM Disk Device Path To Text IssueTapan Shah
Perform Left Shift 32 bits of a 32-bit StartAddr[1] and EndingAddr[1] instead of Right Shift when displaying 64-bit Start and End Address Value. StartAddr[1] and EndingAddr[1] are already a 32-bit value and it should perform left shift 32-bit to generate a complete 64-bit value along with StartAddr[0] and EndingAddr[0] respectively. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Tapan Shah <tapandshah@hp.com> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18144 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-16MdePkg/BasePrintLib: make mStatusString array CONSTArd Biesheuvel
Change the type of mStatusString[] to reflect that it is a CONST array of pointers to CONST. 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: Jaben Carsey <jaben.carsey@intel.com> Reviewed-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@18021 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-15MdePkg: Add BMC device path definition and its node/text conversionHao Wu
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> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17985 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-13MdePkg: ensure SafeString length functions don't access beyond MaxSizeLeif Lindholm
The StrnLenS and AsciiStrnLenS functions, when presented with a string with no terminating NULL in the first MaxSize characters will check the character at String[MaxSize] before checking if Length < MaxSize. (They return the correct value, but have accessed beyond the stated limit in the process.) Flip the order of the tests to prevent this behaviour. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17936 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-09MdePkg/AArch64: use GCC_ASM_EXPORT to export functionsOlivier Martin
This ensures the .type directive is used to mark them as function symbols Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <Olivier.Martin@arm.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17904 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-09MdePkg/UefiDevicePathLib:Fix link error due to missing RamDisk GUIDsFeng Tian
UefiDevicePathLibOptionalDevicePathProtocol.inf needs to be updated to add RamDisk related GUIDs for passing compiler build. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17901 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-09MdePkg: SmmMemLib.inf: add Depex section and update protocol usage.Qiu Shumin
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: "Yao, Jiewen" <jiewen.yao@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17890 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-08MdePkg: Add UEFI2.5 Ramdisk device path definitionFeng Tian
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17878 6f19259b-4bc3-4df7-8a09-765794883524
2015-07-06MdePkg: Fix bug in CatVSPrint introduced by r17742.Heyi Guo
Just use a more conservative way to replace unsafe StrCpy. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Heyi Guo <heyi.guo@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Qiu Shumin <shumin.qiu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17823 6f19259b-4bc3-4df7-8a09-765794883524
2015-06-30MdePkg UefiLib: Use safe string functionsHao Wu
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17742 6f19259b-4bc3-4df7-8a09-765794883524
2015-06-30MdePkg UefiDevicePathLib: Remove unsafe string functionsHao Wu
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17741 6f19259b-4bc3-4df7-8a09-765794883524
2015-06-24MdePkg\Library\UefiFileHandleLib: Make FileHandleWriteLine support both ↵Qiu Shumin
ASCII and UNICODE file. When the file is a UNICODE file (with UNICODE file tag) write UNICODE text. When the file is an ASCII file write ASCII text. If the file size is zero (without the file tag at the beginning) write ASCII text as default. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17701 6f19259b-4bc3-4df7-8a09-765794883524
2015-06-19MdePkg: Refine the cod logic of FileHandleLib.Qiu Shumin
When the file is empty, make FileHandleReadLine in FileHandleLib return EFI_SUCCESS instead of EFI_BUFFER_TOO_SMALL. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17668 6f19259b-4bc3-4df7-8a09-765794883524
2015-06-19MdePkg: Enhance the comments for SmmMemoryAllocationLib instance.Qiu Shumin
Per PI spec all allocation of SMRAM should use EfiRuntimeServicesCode or EfiRuntimeServicesData. So SMM instance use EfiRuntimeServicesCode as the default memory allocation type instead of EfiBootServicesData. This patch clarify this usage in comments. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17666 6f19259b-4bc3-4df7-8a09-765794883524
2015-06-18MdePkg/DxeServicesLib: Return NULL GetFileBufferByFilePath reads directoryRuiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17655 6f19259b-4bc3-4df7-8a09-765794883524
2015-06-17MdePkg: Refine the comments for FileHandleLib.Qiu Shumin
Make the function comments of FileHandleLib consistent with instance implementation. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17650 6f19259b-4bc3-4df7-8a09-765794883524
2015-06-15MdePkg: Refine the comments for FileHandleIsDirectory.Qiu Shumin
Make the function comments of FileHandleIsDirectory in FileHandleLib consistent with instance implementation. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17630 6f19259b-4bc3-4df7-8a09-765794883524