#At file:///net/helheim/store/bteam/bzr/mysql-6.0.9-alpha-release/
2714 Jonathan Perkin 2008-12-22
Tidy Solaris support:
- remove redundant ifdefs
- add solaris 8 support
- restrict cas_sparc implementation to __sparc
modified:
storage/falcon/Interlock.h
=== modified file 'storage/falcon/Interlock.h'
--- a/storage/falcon/Interlock.h 2008-12-11 12:35:08 +0000
+++ b/storage/falcon/Interlock.h 2008-12-22 11:02:03 +0000
@@ -16,12 +16,12 @@
#ifndef __INTERLOCK_H
#define __INTERLOCK_H
-#if defined(__sparcv8) || defined(__sparcv9) || defined(__sun)
+#if defined(__sun)
#include <sys/atomic.h>
-#if defined(__SunOS_5_9) && defined(__SUNPRO_CC) && defined(__sparc)
+#if (defined(__SunOS_5_8) || defined(__SunOS_5_9)) && defined(__SUNPRO_CC) && defined(__sparc)
#include "CompareAndSwapSparc.h"
-#endif /* __SunOS_5_9 && __SUNPRO_CC && __sparc */
+#endif
#endif
@@ -144,16 +144,16 @@ inline int inline_cas (volatile int *tar
);
return ret;
/*
- We are running Sun Studio on SPARC or x86
+ We are running Sun Studio on Solaris >= 10 (SPARC or x86), use libc implementation
Todo: get assembler version of atomic_cas_uint().
*/
-#elif (defined(__sparcv8) || defined(__sparcv9) || defined(__sun)) && !defined(__GNUC__)
-#if defined(__SunOS_5_10) || defined(__SunOS_5_11)
- return (compare == atomic_cas_uint((volatile uint_t *)target, compare, exchange));
-#else
- /* Use inline assembly for Solaris 9 */
+#elif (defined(__SunOS_5_10) || defined(__SunOS_5_11)) && defined(__SUNPRO_CC)
+ return (compare == atomic_cas_uint((volatile uint_t *)target, compare, exchange));
+ /*
+ We are running Sun Studio on Solaris < 10 (SPARC, no x86 yet), use inline assembler
+ */
+#elif defined(__sparc) && defined(__SUNPRO_CC)
return cas_sparc(target, compare, exchange);
-#endif
#else
# error inline_cas not defined for this platform
@@ -255,16 +255,16 @@ inline char inline_cas_pointer (volatile
}
return ret;
/*
- We are running Sun Studio on SPARC or x86
+ We are running Sun Studio on Solaris >= 10 (SPARC or x86), use libc implementation
Todo: get assembler version of atomic_cas_ptr().
*/
-#elif (defined(__sparcv8) || defined(__sparcv9) || defined(__sun)) && !defined(__GNUC__)
-#if defined(__SunOS_5_10) || defined(__SunOS_5_11)
- return (char)(compare == atomic_cas_ptr(target, compare, exchange));
-#else
- /* Use inline assembly for Solaris 9 */
+#elif (defined(__SunOS_5_10) || defined(__SunOS_5_11)) && defined(__SUNPRO_CC)
+ return (char)(compare == atomic_cas_ptr(target, compare, exchange));
+ /*
+ We are running Sun Studio on Solaris < 10 (SPARC, no x86 yet), use inline assembler
+ */
+#elif defined(__sparc) && defined(__SUNPRO_CC)
return cas_pointer_sparc(target, compare, exchange);
-#endif
#else
# error inline_cas not defined for this platform
| Thread |
|---|
| • bzr commit into mysql-6.0 branch (jperkin:2714) | Jonathan Perkin | 22 Dec |