Module Name:    src
Committed By:   haad
Date:           Tue Sep 15 01:48:41 UTC 2009

Modified Files:
        src/external/cddl/osnet/dist/cmd/ztest: ztest.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/cddl/osnet/dist/cmd/ztest/ztest.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/cddl/osnet/dist/cmd/ztest/ztest.c
diff -u src/external/cddl/osnet/dist/cmd/ztest/ztest.c:1.1.1.1 src/external/cddl/osnet/dist/cmd/ztest/ztest.c:1.2
--- src/external/cddl/osnet/dist/cmd/ztest/ztest.c:1.1.1.1	Fri Aug  7 18:32:25 2009
+++ src/external/cddl/osnet/dist/cmd/ztest/ztest.c	Tue Sep 15 01:48:41 2009
@@ -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);

Reply via email to