]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Cleanup Cpu library class and CpuLib instance and BaseLib instance; and add comments...
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 20 Aug 2008 09:15:34 +0000 (09:15 +0000)
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 20 Aug 2008 09:15:34 +0000 (09:15 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5694 6f19259b-4bc3-4df7-8a09-765794883524

15 files changed:
MdePkg/Include/Library/CpuLib.h
MdePkg/Library/BaseLib/Ia32/CpuSleep.S [deleted file]
MdePkg/Library/BaseLib/Ia32/CpuSleep.asm [deleted file]
MdePkg/Library/BaseLib/Ia32/CpuSleep.c [deleted file]
MdePkg/Library/BaseLib/X64/CpuSleep.S [deleted file]
MdePkg/Library/BaseLib/X64/CpuSleep.asm [deleted file]
MdePkg/Library/CpuLib/CpuLib.inf
MdePkg/Library/CpuLib/Ia32/CpuPause.S [deleted file]
MdePkg/Library/CpuLib/Ia32/CpuPause.asm [deleted file]
MdePkg/Library/CpuLib/Ia32/CpuPause.c [deleted file]
MdePkg/Library/CpuLib/Ipf/CpuPause.s [deleted file]
MdePkg/Library/CpuLib/X64/CpuPause.S [deleted file]
MdePkg/Library/CpuLib/X64/CpuPause.asm [deleted file]
MdePkg/Library/HiiLib/HiiLib.c
MdePkg/Library/IfrSupportLib/UefiIfrOpCodeCreation.c

index 043c727c723f055235fcc6e849f0ec646787ff6f..c524f88928ffb26a636bef14f7ac7c80ed42ca0d 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Library that provides processor specific library services\r
 \r
-  Copyright (c) 2006, Intel Corporation                                                         \r
+  Copyright (c) 2006 - 2008, Intel Corporation                                                         \r
   All rights reserved. This program and the accompanying materials                          \r
   are licensed and made available under the terms and conditions of the BSD License         \r
   which accompanies this distribution.  The full text of the license may be found at        \r
@@ -29,21 +29,6 @@ CpuSleep (
   VOID
   );
 
-
-/**
-  Requests CPU to pause for a short period of time.
-
-  Requests CPU to pause for a short period of time. Typically used in MP
-  systems to prevent memory starvation while waiting for a spin lock.
-
-**/
-VOID
-EFIAPI
-CpuPause (
-  VOID
-  );
-
-
 /**
   Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.
 
diff --git a/MdePkg/Library/BaseLib/Ia32/CpuSleep.S b/MdePkg/Library/BaseLib/Ia32/CpuSleep.S
deleted file mode 100644 (file)
index ac39e8f..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#------------------------------------------------------------------------------ ;\r
-# Copyright (c) 2006, Intel Corporation\r
-# All rights reserved. This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution.  The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-#   CpuSleep.Asm\r
-#\r
-# Abstract:\r
-#\r
-#   CpuSleep function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-.globl ASM_PFX(CpuSleep)\r
-\r
-#------------------------------------------------------------------------------\r
-# VOID\r
-# EFIAPI\r
-# CpuSleep (\r
-#   VOID\r
-#   );\r
-#------------------------------------------------------------------------------\r
-ASM_PFX(CpuSleep):\r
-    hlt\r
-    ret\r
diff --git a/MdePkg/Library/BaseLib/Ia32/CpuSleep.asm b/MdePkg/Library/BaseLib/Ia32/CpuSleep.asm
deleted file mode 100644 (file)
index 8a779f7..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-;------------------------------------------------------------------------------ ;\r
-; Copyright (c) 2006, Intel Corporation\r
-; All rights reserved. This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   CpuSleep.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   CpuSleep function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .386\r
-    .model  flat,C\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EFIAPI\r
-; CpuSleep (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-CpuSleep    PROC\r
-    hlt\r
-    ret\r
-CpuSleep    ENDP\r
-\r
-    END\r
diff --git a/MdePkg/Library/BaseLib/Ia32/CpuSleep.c b/MdePkg/Library/BaseLib/Ia32/CpuSleep.c
deleted file mode 100644 (file)
index 8861e33..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/** @file\r
-  CpuSleep function.\r
-\r
-  Copyright (c) 2006 - 2007, Intel Corporation<BR>\r
-  All rights reserved. This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-//\r
-// Include common header file for this module.\r
-//\r
-\r
-\r
-/**\r
-  Places the CPU in a sleep state until an interrupt is received.\r
-\r
-  Places the CPU in a sleep state until an interrupt is received. If interrupts\r
-  are disabled prior to calling this function, then the CPU will be placed in a\r
-  sleep state indefinitely.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-CpuSleep (\r
-  VOID\r
-  )\r
-{\r
-  _asm {\r
-    hlt\r
-  }\r
-}\r
-\r
diff --git a/MdePkg/Library/BaseLib/X64/CpuSleep.S b/MdePkg/Library/BaseLib/X64/CpuSleep.S
deleted file mode 100644 (file)
index 658cb1a..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#------------------------------------------------------------------------------ ;\r
-# Copyright (c) 2006, Intel Corporation\r
-# All rights reserved. This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution.  The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-#   CpuSleep.S\r
-#\r
-# Abstract:\r
-#\r
-#   CpuSleep function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-\r
-#------------------------------------------------------------------------------\r
-# VOID\r
-# EFIAPI\r
-# CpuSleep (\r
-#   VOID\r
-#   );\r
-#------------------------------------------------------------------------------\r
-.global ASM_PFX(CpuSleep)\r
-ASM_PFX(CpuSleep):\r
-    hlt\r
-    ret\r
diff --git a/MdePkg/Library/BaseLib/X64/CpuSleep.asm b/MdePkg/Library/BaseLib/X64/CpuSleep.asm
deleted file mode 100644 (file)
index b2c4907..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------ ;\r
-; Copyright (c) 2006, Intel Corporation\r
-; All rights reserved. This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   CpuSleep.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   CpuSleep function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EFIAPI\r
-; CpuSleep (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-CpuSleep    PROC\r
-    hlt\r
-    ret\r
-CpuSleep    ENDP\r
-\r
-    END\r
index 13e660dfb66a58fa327e80393076c631d01b577a..70981a780a0c8280a374ec4e3500b3891dbb8b11 100644 (file)
@@ -43,7 +43,7 @@
   Ia32/CpuFlushTlb.S | GCC \r
 \r
 [Sources.X64]\r
-  X64/CpuFlushTlb.asm\r
+  X64/CpuFlushTlb.asm \r
   X64/CpuSleep.asm\r
 \r
   X64/CpuSleep.S | GCC \r
@@ -62,7 +62,3 @@
 \r
 [LibraryClasses.Ipf]\r
 PalCallLib\r
-\r
-\r
-[Pcd.common]\r
-\r
diff --git a/MdePkg/Library/CpuLib/Ia32/CpuPause.S b/MdePkg/Library/CpuLib/Ia32/CpuPause.S
deleted file mode 100644 (file)
index 5fef9c8..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#------------------------------------------------------------------------------ ;\r
-# Copyright (c) 2006, Intel Corporation\r
-# All rights reserved. This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution.  The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-#   CpuPause.Asm\r
-#\r
-# Abstract:\r
-#\r
-#   CpuPause function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-.globl ASM_PFX(CpuPause)\r
-\r
-#------------------------------------------------------------------------------\r
-# VOID\r
-# EFIAPI\r
-# CpuPause (\r
-#   VOID\r
-#   );\r
-#------------------------------------------------------------------------------\r
-ASM_PFX(CpuPause):\r
-    pause\r
-    ret\r
diff --git a/MdePkg/Library/CpuLib/Ia32/CpuPause.asm b/MdePkg/Library/CpuLib/Ia32/CpuPause.asm
deleted file mode 100644 (file)
index 4c7135f..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-;------------------------------------------------------------------------------ ;\r
-; Copyright (c) 2006, Intel Corporation\r
-; All rights reserved. This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   CpuPause.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   CpuPause function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .686\r
-    .model  flat,C\r
-    .xmm\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EFIAPI\r
-; CpuPause (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-CpuPause    PROC\r
-    pause\r
-    ret\r
-CpuPause    ENDP\r
-\r
-    END\r
diff --git a/MdePkg/Library/CpuLib/Ia32/CpuPause.c b/MdePkg/Library/CpuLib/Ia32/CpuPause.c
deleted file mode 100644 (file)
index c62503a..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/** @file\r
-  CpuPause function.\r
-\r
-  Copyright (c) 2006 - 2007, Intel Corporation<BR>\r
-  All rights reserved. This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-\r
-/**\r
-  Places the CPU in a pause state until an interrupt is\r
-  received.\r
-\r
-  Places the CPU in a pause state until an interrupt is\r
-  received. If interrupts are disabled prior to calling this\r
-  function, then the CPU will be placed in a pause state\r
-  indefinitely.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-CpuPause (\r
-  VOID\r
-  )\r
-{\r
-  _asm {\r
-    pause\r
-  }\r
-}\r
-\r
diff --git a/MdePkg/Library/CpuLib/Ipf/CpuPause.s b/MdePkg/Library/CpuLib/Ipf/CpuPause.s
deleted file mode 100644 (file)
index f52692f..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/// @file\r
-///   CpuPause() function for Itanium-based architecture.\r
-///\r
-/// Copyright (c) 2006, Intel Corporation\r
-/// All rights reserved. This program and the accompanying materials\r
-/// are licensed and made available under the terms and conditions of the BSD License\r
-/// which accompanies this distribution.  The full text of the license may be found at\r
-/// http://opensource.org/licenses/bsd-license.php\r
-///\r
-/// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-/// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-///\r
-/// Module Name:  CpuPause.s\r
-///\r
-///\r
-\r
-.auto\r
-.text\r
-\r
-.proc   CpuPause\r
-.type   CpuPause, @function\r
-CpuPause::\r
-        hint                @pause\r
-        br.ret.sptk.many    b0\r
-.endp\r
diff --git a/MdePkg/Library/CpuLib/X64/CpuPause.S b/MdePkg/Library/CpuLib/X64/CpuPause.S
deleted file mode 100644 (file)
index f71fdec..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#------------------------------------------------------------------------------ ;\r
-# Copyright (c) 2006, Intel Corporation\r
-# All rights reserved. This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution.  The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-# Module Name:\r
-#\r
-#   CpuPause.S\r
-#\r
-# Abstract:\r
-#\r
-#   CpuPause function\r
-#\r
-# Notes:\r
-#\r
-#------------------------------------------------------------------------------\r
-\r
-\r
-#------------------------------------------------------------------------------\r
-# VOID\r
-# EFIAPI\r
-# CpuPause (\r
-#   VOID\r
-#   );\r
-#------------------------------------------------------------------------------\r
-.global ASM_PFX(CpuPause)\r
-ASM_PFX(CpuPause):\r
-    pause\r
-    ret\r
diff --git a/MdePkg/Library/CpuLib/X64/CpuPause.asm b/MdePkg/Library/CpuLib/X64/CpuPause.asm
deleted file mode 100644 (file)
index d16da37..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------ ;\r
-; Copyright (c) 2006, Intel Corporation\r
-; All rights reserved. This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution.  The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-; Module Name:\r
-;\r
-;   CpuPause.Asm\r
-;\r
-; Abstract:\r
-;\r
-;   CpuPause function\r
-;\r
-; Notes:\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-    .code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EFIAPI\r
-; CpuPause (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-CpuPause    PROC\r
-    pause\r
-    ret\r
-CpuPause    ENDP\r
-\r
-    END\r
index 81a7241cc9dd5d20b0d810e1b442d85487fa8337..db9112026fb6563a8439ad2d6c4dc80451e70fab 100644 (file)
@@ -119,6 +119,9 @@ InternalHiiLibPreparePackages (
   //\r
   for (Index = 0; Index < NumberOfPackages; Index++) {\r
     PackageArray = (UINT8 *) VA_ARG (Marker, VOID *);\r
+    //\r
+    // CopyMem is used for UINT32 to cover the unaligned address access.\r
+    //\r
     CopyMem (&PackageLength, PackageArray, sizeof (UINT32));\r
     PackageLength  -= sizeof (UINT32);\r
     PackageArray += sizeof (UINT32);\r
index b4cba7843bc7b17d8a66df0c5cfc8fdf53f2430f..afbfcfca2aa47987a0a9d339774d3e1c076f1c29 100644 (file)
@@ -127,6 +127,9 @@ CreateEndOpCode (
   End.Header.Scope   = 0;
 
   LocalBuffer = (UINT8 *) Data->Data + Data->Offset;
+  //
+  // CopyMem is used for EFI_IFR_END to cover the unaligned address access.
+  //
   CopyMem (LocalBuffer, &End, sizeof (EFI_IFR_END));
   Data->Offset += sizeof (EFI_IFR_END);
 
@@ -174,6 +177,9 @@ CreateDefaultOpCode (
   CopyMem (&Default.Value, Value, sizeof(EFI_IFR_TYPE_VALUE));
 
   LocalBuffer = (UINT8 *) Data->Data + Data->Offset;
+  //
+  // CopyMem is used for EFI_IFR_DEFAULT to cover the unaligned address access.
+  //
   CopyMem (LocalBuffer, &Default, sizeof (EFI_IFR_DEFAULT));
   Data->Offset += sizeof (EFI_IFR_DEFAULT);
 
@@ -230,6 +236,9 @@ CreateActionOpCode (
   Action.QuestionConfig         = QuestionConfig;
 
   LocalBuffer = (UINT8 *) Data->Data + Data->Offset;
+  //
+  // CopyMem is used for EFI_IFR_ACTION to cover the unaligned address access.
+  //
   CopyMem (LocalBuffer, &Action, sizeof (EFI_IFR_ACTION));
   Data->Offset += sizeof (EFI_IFR_ACTION);
 
@@ -276,6 +285,9 @@ CreateSubTitleOpCode (
   Subtitle.Flags            = Flags;
 
   LocalBuffer = (UINT8 *) Data->Data + Data->Offset;
+  //
+  // CopyMem is used for EFI_IFR_SUBTITLE to cover the unaligned address access.
+  //
   CopyMem (LocalBuffer, &Subtitle, sizeof (EFI_IFR_SUBTITLE));
   Data->Offset += sizeof (EFI_IFR_SUBTITLE);
 
@@ -321,6 +333,9 @@ CreateTextOpCode (
   Text.TextTwo          = TextTwo;
 
   LocalBuffer = (UINT8 *) Data->Data + Data->Offset;
+  //
+  // CopyMem is used for EFI_IFR_TEXT to cover the unaligned address access.
+  //
   CopyMem (LocalBuffer, &Text, sizeof (EFI_IFR_TEXT));
   Data->Offset += sizeof (EFI_IFR_TEXT);
 
@@ -377,6 +392,9 @@ CreateGotoOpCode (
   Goto.FormId                 = FormId;
 
   LocalBuffer = (UINT8 *) Data->Data + Data->Offset;
+  //
+  // CopyMem is used for EFI_IFR_REF to cover the unaligned address access.
+  //
   CopyMem (LocalBuffer, &Goto, sizeof (EFI_IFR_REF));
   Data->Offset += sizeof (EFI_IFR_REF);
 
@@ -429,6 +447,9 @@ CreateOneOfOptionOpCode (
     OneOfOption.Type          = Type;
 
     LocalBuffer = (UINT8 *) Data->Data + Data->Offset;
+    //
+    // CopyMem is used for EFI_IFR_ONF_OF_OPTION to cover the unaligned address access.
+    //
     CopyMem (LocalBuffer, &OneOfOption, sizeof (EFI_IFR_ONE_OF_OPTION));
     Data->Offset += sizeof (EFI_IFR_ONE_OF_OPTION);
   }
@@ -500,6 +521,9 @@ CreateOneOfOpCode (
   ZeroMem ((VOID *) &OneOf.data, sizeof (MINMAXSTEP_DATA));
 
   LocalBuffer = (UINT8 *) Data->Data + Data->Offset;
+  //
+  // CopyMem is used for EFI_IFR_ONF_OF to cover the unaligned address access.
+  //
   CopyMem (LocalBuffer, &OneOf, sizeof (EFI_IFR_ONE_OF));
   Data->Offset += sizeof (EFI_IFR_ONE_OF);
 
@@ -583,6 +607,9 @@ CreateOrderedListOpCode (
   OrderedList.Flags                           = OrderedListFlags;
 
   LocalBuffer = (UINT8 *) Data->Data + Data->Offset;
+  //
+  // CopyMem is used for EFI_IFR_ORDERED_LIST to cover the unaligned address access.
+  //
   CopyMem (LocalBuffer, &OrderedList, sizeof (EFI_IFR_ORDERED_LIST));
   Data->Offset += sizeof (EFI_IFR_ORDERED_LIST);
 
@@ -648,6 +675,9 @@ CreateCheckBoxOpCode (
   CheckBox.Flags                           = CheckBoxFlags;
 
   LocalBuffer = (UINT8 *) Data->Data + Data->Offset;
+  //
+  // CopyMem is used for EFI_IFR_CHECKBOX to cover the unaligned address access.
+  //
   CopyMem (LocalBuffer, &CheckBox, sizeof (EFI_IFR_CHECKBOX));
   Data->Offset += sizeof (EFI_IFR_CHECKBOX);
 
@@ -748,6 +778,9 @@ CreateNumericOpCode (
   CopyMem (&Numeric.data, &MinMaxStep, sizeof (MINMAXSTEP_DATA));
 
   LocalBuffer = (UINT8 *) Data->Data + Data->Offset;
+  //
+  // CopyMem is used for EFI_IFR_NUMERIC to cover the unaligned address access.
+  //
   CopyMem (LocalBuffer, &Numeric, sizeof (EFI_IFR_NUMERIC));
   Data->Offset += sizeof (EFI_IFR_NUMERIC);
 
@@ -823,6 +856,9 @@ CreateStringOpCode (
   String.Flags                           = StringFlags;
 
   LocalBuffer = (UINT8 *) Data->Data + Data->Offset;
+  //
+  // CopyMem is used for EFI_IFR_STRING to cover the unaligned address access.
+  //
   CopyMem (LocalBuffer, &String, sizeof (EFI_IFR_STRING));
   Data->Offset += sizeof (EFI_IFR_STRING);