summaryrefslogtreecommitdiffstats
path: root/ldap/servers/slapd/slapi_counter.c
diff options
context:
space:
mode:
authorNoriko Hosoi <nhosoi@redhat.com>2008-10-22 20:24:37 +0000
committerNoriko Hosoi <nhosoi@redhat.com>2008-10-22 20:24:37 +0000
commitc56e4415b2de4f72c0e6da144e4156b70912685d (patch)
tree034c42d7ccb75a406e32113a26ea5230ffbba2a6 /ldap/servers/slapd/slapi_counter.c
parentb330c3504778b2ec6bae877ff63122653874a72c (diff)
downloadds-c56e4415b2de4f72c0e6da144e4156b70912685d.tar.gz
ds-c56e4415b2de4f72c0e6da144e4156b70912685d.tar.xz
ds-c56e4415b2de4f72c0e6da144e4156b70912685d.zip
Resolves: 207457
Summary: (64bitcounters) rhds 7.1 - server stats use 32-bit integers - entrycachehitratio 1503% Change description: 1) Makefile.am: instead of the inline assembly langauge file .il, include an independent .S file to the libslapd_la_SOURCES list. 2) add AM_PROG_AS to configure.ac to accept CCAS and CCASFLAGS. 3) slapi_counter.c: adjusted to slapi_counter_sunos_sparcv9.S. 4) add slapi_counter_sunos_sparcv9.S 5) remove slapi_counter_sunos_sparcv9.il
Diffstat (limited to 'ldap/servers/slapd/slapi_counter.c')
-rw-r--r--ldap/servers/slapd/slapi_counter.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/ldap/servers/slapd/slapi_counter.c b/ldap/servers/slapd/slapi_counter.c
index 1118d5b7..607ae1c5 100644
--- a/ldap/servers/slapd/slapi_counter.c
+++ b/ldap/servers/slapd/slapi_counter.c
@@ -41,6 +41,12 @@
#include "slap.h"
+#ifdef SOLARIS
+PRUint64 _sparcv9_AtomicSet_il(PRUint64 *address, PRUint64 newval);
+PRUint64 _sparcv9_AtomicAdd_il(PRUint64 *address, PRUint64 val);
+PRUint64 _sparcv9_AtomicSub_il(PRUint64 *address, PRUint64 val);
+#endif
+
#ifdef HPUX
#ifdef ATOMIC_64BIT_OPERATIONS
#include <machine/sys/inline.h>
@@ -157,7 +163,7 @@ PRUint64 slapi_counter_add(Slapi_Counter *counter, PRUint64 addvalue)
#ifdef LINUX
newvalue = __sync_add_and_fetch(&(counter->value), addvalue);
#elif defined(SOLARIS)
- newvalue = _sparcv9_AtomicAdd_il(&(counter->value), addvalue);
+ newvalue = _sparcv9_AtomicAdd(&(counter->value), addvalue);
#elif defined(HPUX)
/* fetchadd only works with values of 1, 4, 8, and 16. In addition, it requires
* it's argument to be an integer constant. */
@@ -214,7 +220,7 @@ PRUint64 slapi_counter_subtract(Slapi_Counter *counter, PRUint64 subvalue)
#ifdef LINUX
newvalue = __sync_sub_and_fetch(&(counter->value), subvalue);
#elif defined(SOLARIS)
- newvalue = _sparcv9_AtomicSub_il(&(counter->value), subvalue);
+ newvalue = _sparcv9_AtomicSub(&(counter->value), subvalue);
#elif defined(HPUX)
/* fetchadd only works with values of -1, -4, -8, and -16. In addition, it requires
* it's argument to be an integer constant. */
@@ -272,7 +278,7 @@ PRUint64 slapi_counter_set_value(Slapi_Counter *counter, PRUint64 newvalue)
}
}
#elif defined(SOLARIS)
- _sparcv9_AtomicSet_il(&(counter->value), newvalue);
+ _sparcv9_AtomicSet(&(counter->value), newvalue);
return newvalue;
#elif defined(HPUX)
do {
@@ -313,7 +319,7 @@ PRUint64 slapi_counter_get_value(Slapi_Counter *counter)
#elif defined(SOLARIS)
while (1) {
value = counter->value;
- if (value == _sparcv9_AtomicSet_il(&(counter->value), value)) {
+ if (value == _sparcv9_AtomicSet(&(counter->value), value)) {
break;
}
}