]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.c
Update the check condition to allows UINT64 and INT64 data types to be 32-bit aligned...
[mirror_edk2.git] / UefiCpuPkg / CpuIo2Dxe / CpuIo2Dxe.c
index fd4b2e8524d0db8dcb9cb80e6c9710888f7a9cbd..802342caaebd1396f17cdd6144a90e1c67d8571c 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Produces the CPU I/O 2 Protocol.\r
 \r
 /** @file\r
   Produces the CPU I/O 2 Protocol.\r
 \r
-Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
 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
 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
@@ -175,8 +175,9 @@ CpuIoCheckParameter (
 \r
   //\r
   // Check to see if Buffer is aligned\r
 \r
   //\r
   // Check to see if Buffer is aligned\r
+  // (IA-32 allows UINT64 and INT64 data types to be 32-bit aligned.)\r
   //\r
   //\r
-  if (((UINTN)Buffer & (mInStride[Width] - 1)) != 0) {\r
+  if (((UINTN)Buffer & ((MIN (sizeof (UINTN), mInStride[Width])  - 1))) != 0) {\r
     return EFI_UNSUPPORTED;\r
   }\r
 \r
     return EFI_UNSUPPORTED;\r
   }\r
 \r