]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/XenBusDxe/TestAndClearBit.c
BaseTools: Add DefaultStore section format Check
[mirror_edk2.git] / OvmfPkg / XenBusDxe / TestAndClearBit.c
index 410677ee8acda598a8e0af47d6733c964f56c350..ac01b3ce50d4ceedaab96da82d40bfce602e648a 100644 (file)
@@ -2,6 +2,7 @@
   Implementation of TestAndClearBit using compare-exchange primitive\r
 \r
   Copyright (C) 2015, Linaro Ltd.\r
+  Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -32,7 +33,7 @@ TestAndClearBit (
   // ensure we round towards -Inf, and end up with a positive shift in\r
   // 'Bit', even if 'Bit' itself is negative.\r
   //\r
-  Address += (Bit >> 4) * sizeof(UINT16);\r
+  Address = (VOID*)((UINT8*) Address + ((Bit >> 4) * sizeof(UINT16)));\r
   Mask = 1U << (Bit & 15);\r
 \r
   for (Word = *(UINT16 *) Address; Word & Mask; Word = Read) {\r