summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Library/ExtendedIfrSupportLib/Common.c2
-rw-r--r--MdeModulePkg/Library/ExtendedIfrSupportLib/Form.c12
2 files changed, 7 insertions, 7 deletions
diff --git a/MdeModulePkg/Library/ExtendedIfrSupportLib/Common.c b/MdeModulePkg/Library/ExtendedIfrSupportLib/Common.c
index a5c3f15..56f2b79 100644
--- a/MdeModulePkg/Library/ExtendedIfrSupportLib/Common.c
+++ b/MdeModulePkg/Library/ExtendedIfrSupportLib/Common.c
@@ -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;
diff --git a/MdeModulePkg/Library/ExtendedIfrSupportLib/Form.c b/MdeModulePkg/Library/ExtendedIfrSupportLib/Form.c
index e149d4e..b9b62b2 100644
--- a/MdeModulePkg/Library/ExtendedIfrSupportLib/Form.c
+++ b/MdeModulePkg/Library/ExtendedIfrSupportLib/Form.c
@@ -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;