summaryrefslogtreecommitdiffstats
path: root/MdePkg
diff options
context:
space:
mode:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2010-05-19 06:06:40 +0000
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2010-05-19 06:06:40 +0000
commit4e4a5f359d04a9551b2c74a3aeb7b10677988bc0 (patch)
tree3145f18eb6f5c733afbe461fb76b72fbaa5eb0f0 /MdePkg
parentafe7c8b2bb2891a08acba13902257e740caa2567 (diff)
downloadedk2-4e4a5f359d04a9551b2c74a3aeb7b10677988bc0.tar.gz
edk2-4e4a5f359d04a9551b2c74a3aeb7b10677988bc0.tar.bz2
edk2-4e4a5f359d04a9551b2c74a3aeb7b10677988bc0.zip
Temporarily remove build-in __sync_val_compare_and_swap() in the implementation of sync functions.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10519 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg')
-rw-r--r--MdePkg/Library/BaseSynchronizationLib/Ia32/GccInline.c24
-rw-r--r--MdePkg/Library/BaseSynchronizationLib/X64/GccInline.c20
2 files changed, 4 insertions, 40 deletions
diff --git a/MdePkg/Library/BaseSynchronizationLib/Ia32/GccInline.c b/MdePkg/Library/BaseSynchronizationLib/Ia32/GccInline.c
index dcaaa6a8a2..d357e91817 100644
--- a/MdePkg/Library/BaseSynchronizationLib/Ia32/GccInline.c
+++ b/MdePkg/Library/BaseSynchronizationLib/Ia32/GccInline.c
@@ -1,7 +1,7 @@
/** @file
GCC inline implementation of BaseSynchronizationLib processor specific functions.
- Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -114,13 +114,6 @@ InternalSyncCompareExchange32 (
)
{
-// GCC 4.1 and forward supports atomic builtins
-#if ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)))
-
- return __sync_val_compare_and_swap (Value, CompareValue, ExchangeValue);
-
-#else
-
__asm__ __volatile__ (
" \n\t"
"lock \n\t"
@@ -133,9 +126,7 @@ InternalSyncCompareExchange32 (
"cc"
);
- return CompareValue;
-
-#endif
+ return CompareValue;
}
/**
@@ -163,13 +154,6 @@ InternalSyncCompareExchange64 (
IN UINT64 ExchangeValue
)
{
-// GCC 4.1 and forward supports atomic builtins
-#if ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)))
-
- return __sync_val_compare_and_swap (Value, CompareValue, ExchangeValue);
-
-#else
-
__asm__ __volatile__ (
" \n\t"
"push %%ebx \n\t"
@@ -186,8 +170,4 @@ InternalSyncCompareExchange64 (
);
return CompareValue;
-
-#endif
}
-
-
diff --git a/MdePkg/Library/BaseSynchronizationLib/X64/GccInline.c b/MdePkg/Library/BaseSynchronizationLib/X64/GccInline.c
index 944a1ee4da..181f44a576 100644
--- a/MdePkg/Library/BaseSynchronizationLib/X64/GccInline.c
+++ b/MdePkg/Library/BaseSynchronizationLib/X64/GccInline.c
@@ -1,7 +1,7 @@
/** @file
GCC inline implementation of BaseSynchronizationLib processor specific functions.
- Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -49,7 +49,6 @@ InternalSyncIncrement (
);
return Result;
-
}
@@ -115,12 +114,7 @@ InternalSyncCompareExchange32 (
IN UINT32 ExchangeValue
)
{
-// GCC 4.1 and forward supports atomic builtins
-#if ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)))
-
- return __sync_val_compare_and_swap (Value, CompareValue, ExchangeValue);
-#else
__asm__ __volatile__ (
"lock \n\t"
@@ -134,9 +128,7 @@ InternalSyncCompareExchange32 (
"cc"
);
- return CompareValue;
-
-#endif
+ return CompareValue;
}
@@ -165,12 +157,6 @@ InternalSyncCompareExchange64 (
IN UINT64 ExchangeValue
)
{
-// GCC 4.1 and forward supports atomic builtins
-#if ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)))
-
- return __sync_val_compare_and_swap (Value, CompareValue, ExchangeValue);
-
-#else
__asm__ __volatile__ (
"lock \n\t"
@@ -185,8 +171,6 @@ InternalSyncCompareExchange64 (
);
return CompareValue;
-
-#endif
}