mirror of https://github.com/acidanthera/audk.git
Replace CopyMem() which can be replaced by BaseLib's Read/WriteUnalianedXX() as these are applied to base data type such as UINT32.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7175 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
8a38e4510e
commit
3a306c1006
|
@ -117,7 +117,7 @@ IfrLibExtractClassFromHiiHandle (
|
|||
//
|
||||
Offset = sizeof (EFI_HII_PACKAGE_LIST_HEADER);
|
||||
Offset2 = 0;
|
||||
CopyMem (&PackageListLength, &HiiPackageList->PackageLength, sizeof (UINT32));
|
||||
PackageListLength = ReadUnaligned32 (&HiiPackageList->PackageLength);
|
||||
|
||||
while (Offset < PackageListLength) {
|
||||
Package = ((UINT8 *) HiiPackageList) + Offset;
|
||||
|
|
|
@ -56,7 +56,7 @@ GetPackageDataFromPackageList (
|
|||
Package = NULL;
|
||||
Index = 0;
|
||||
Offset = sizeof (EFI_HII_PACKAGE_LIST_HEADER);
|
||||
CopyMem (&PackageListLength, &HiiPackageList->PackageLength, sizeof (UINT32));
|
||||
PackageListLength = ReadUnaligned32 (&HiiPackageList->PackageLength);
|
||||
while (Offset < PackageListLength) {
|
||||
Package = (EFI_HII_PACKAGE_HEADER *) (((UINT8 *) HiiPackageList) + Offset);
|
||||
CopyMem (&PackageHeader, Package, sizeof (EFI_HII_PACKAGE_HEADER));
|
||||
|
@ -178,7 +178,7 @@ UpdateFormPackageData (
|
|||
}
|
||||
|
||||
ExtendOpCode = ((EFI_IFR_GUID_LABEL *) IfrOpHdr)->ExtendOpCode;
|
||||
CopyMem (&LabelNumber, &((EFI_IFR_GUID_LABEL *)IfrOpHdr)->Number, sizeof (UINT16));
|
||||
LabelNumber = ReadUnaligned16 (&((EFI_IFR_GUID_LABEL *)IfrOpHdr)->Number);
|
||||
if ((ExtendOpCode != EFI_IFR_EXTEND_OP_LABEL) || (LabelNumber != Label)
|
||||
|| !CompareGuid ((EFI_GUID *)(UINTN)(&((EFI_IFR_GUID_LABEL *)IfrOpHdr)->Guid), &mIfrVendorGuid)) {
|
||||
//
|
||||
|
@ -436,7 +436,7 @@ IfrLibUpdateForm (
|
|||
// Update package list length
|
||||
//
|
||||
BufferSize = UpdateBufferPos - (UINT8 *) UpdateBuffer;
|
||||
CopyMem (&UpdateBuffer->PackageLength, &BufferSize, sizeof (UINT32));
|
||||
WriteUnaligned32 (&UpdateBuffer->PackageLength, (UINT32)BufferSize);
|
||||
|
||||
FreePool (HiiPackageList);
|
||||
|
||||
|
@ -493,13 +493,13 @@ IfrLibExtractDefault(
|
|||
VA_START (Args, Number);
|
||||
for (Index = 0; Index < Number; Index++) {
|
||||
BufCfgArray = (UINT8 *) VA_ARG (Args, VOID *);
|
||||
CopyMem (&TotalLen, BufCfgArray, sizeof (UINT32));
|
||||
TotalLen = ReadUnaligned32 ((UINT32 *)BufCfgArray);
|
||||
BufferPos = BufCfgArray + sizeof (UINT32);
|
||||
|
||||
while ((UINT32)(BufferPos - BufCfgArray) < TotalLen) {
|
||||
CopyMem (&Offset, BufferPos, sizeof (UINT16));
|
||||
Offset = ReadUnaligned16 ((UINT16 *)BufferPos);
|
||||
BufferPos += sizeof (UINT16);
|
||||
CopyMem (&Width, BufferPos, sizeof (UINT16));
|
||||
Width = ReadUnaligned16 ((UINT16 *)BufferPos);
|
||||
BufferPos += sizeof (UINT16);
|
||||
Value = BufferPos;
|
||||
BufferPos += Width;
|
||||
|
|
Loading…
Reference in New Issue