Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/cddl/osnet/dist/cmd/ztest On i386 use 32bit version...



details:   https://anonhg.NetBSD.org/src/rev/8e890e391f31
branches:  trunk
changeset: 747443:8e890e391f31
user:      haad <haad%NetBSD.org@localhost>
date:      Tue Sep 15 01:48:41 2009 +0000

description:
On i386 use 32bit version of atomic_add_op because 64 doesn't work on
i486 userland.

diffstat:

 external/cddl/osnet/dist/cmd/ztest/ztest.c |  13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diffs (33 lines):

diff -r 137ad12dde4f -r 8e890e391f31 external/cddl/osnet/dist/cmd/ztest/ztest.c
--- a/external/cddl/osnet/dist/cmd/ztest/ztest.c        Tue Sep 15 01:20:42 2009 +0000
+++ b/external/cddl/osnet/dist/cmd/ztest/ztest.c        Tue Sep 15 01:48:41 2009 +0000
@@ -2983,10 +2983,13 @@
                    (double)zi->zi_call_total / zi->zi_call_target >
                    (double)(now - zs->zs_start_time) / (zopt_time * NANOSEC))
                        continue;
-
+#ifdef __HAVE_ATOMIC64_OPS
                atomic_add_64(&zi->zi_calls, 1);
                atomic_add_64(&zi->zi_call_total, 1);
-
+#else
+               atomic_add_32(&zi->zi_calls, 1);
+               atomic_add_32(&zi->zi_call_total, 1);
+#end           
                za->za_diroff = (za->za_instance * ZTEST_FUNCS + f) *
                    ZTEST_DIRSIZE;
                za->za_diroff_shared = (1ULL << 63);
@@ -2995,9 +2998,11 @@
                        zi->zi_func(za);
 
                functime = gethrtime() - now;
-
+#ifdef __HAVE_ATOMIC64_OPS
                atomic_add_64(&zi->zi_call_time, functime);
-
+#else
+               atomic_add_32(&zi->zi_call_time, functime);
+#endif
                if (zopt_verbose >= 4) {
                        Dl_info dli;
                        (void) dladdr((void *)zi->zi_func, &dli);



Home | Main Index | Thread Index | Old Index