]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BaseSynchronizationLib/X64/GccInline.c
Temporarily remove build-in __sync_val_compare_and_swap() in the implementation of...
[mirror_edk2.git] / MdePkg / Library / BaseSynchronizationLib / X64 / GccInline.c
index 944a1ee4dad9e10c50bf323dd135573425e0b0a8..181f44a5766a9e49870f8d0140d3bbeb9a6cba14 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   GCC inline implementation of BaseSynchronizationLib processor specific functions.\r
   \r
-  Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
   Portions copyright (c) 2008 - 2009, Apple Inc. 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
@@ -49,7 +49,6 @@ InternalSyncIncrement (
     );\r
     \r
   return Result;    \r
-\r
 }\r
 \r
 \r
@@ -115,12 +114,7 @@ InternalSyncCompareExchange32 (
   IN      UINT32                    ExchangeValue\r
   )\r
 {\r
-// GCC 4.1 and forward supports atomic builtins  \r
-#if ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)))\r
-\r
-  return __sync_val_compare_and_swap (Value, CompareValue, ExchangeValue);\r
 \r
-#else\r
 \r
   __asm__ __volatile__ (\r
     "lock                 \n\t"\r
@@ -134,9 +128,7 @@ InternalSyncCompareExchange32 (
       "cc"\r
     );\r
     \r
-    return CompareValue;\r
-\r
-#endif\r
+  return CompareValue;\r
 }\r
 \r
 \r
@@ -165,12 +157,6 @@ InternalSyncCompareExchange64 (
   IN      UINT64                    ExchangeValue\r
   )\r
 {\r
-// GCC 4.1 and forward supports atomic builtins  \r
-#if ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)))\r
-\r
-  return __sync_val_compare_and_swap (Value, CompareValue, ExchangeValue);\r
-\r
-#else\r
 \r
   __asm__ __volatile__ (\r
     "lock                 \n\t"\r
@@ -185,8 +171,6 @@ InternalSyncCompareExchange64 (
     );\r
   \r
   return CompareValue;\r
-\r
-#endif\r
 }\r
 \r
 \r