Source-Changes-HG archive

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

[src/trunk]: src/sys/sys Rely on volatile operations in KCOV data types



details:   https://anonhg.NetBSD.org/src/rev/865f3047d21b
branches:  trunk
changeset: 998242:865f3047d21b
user:      kamil <kamil%NetBSD.org@localhost>
date:      Thu Apr 11 11:20:46 2019 +0000

description:
Rely on volatile operations in KCOV data types

Extra atomicity isn't needed and makes maintenance burden between CPUs.

Fixes build issue on NetBSD/i386 reported by <msaitoh>

diffstat:

 sys/sys/kcov.h |  14 +-------------
 1 files changed, 1 insertions(+), 13 deletions(-)

diffs (29 lines):

diff -r 5c3589490665 -r 865f3047d21b sys/sys/kcov.h
--- a/sys/sys/kcov.h    Thu Apr 11 10:17:21 2019 +0000
+++ b/sys/sys/kcov.h    Thu Apr 11 11:20:46 2019 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: kcov.h,v 1.4 2019/03/10 17:51:00 kamil Exp $        */
+/*      $NetBSD: kcov.h,v 1.5 2019/04/11 11:20:46 kamil Exp $        */
 
 /*
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -47,19 +47,7 @@
 typedef volatile uint64_t kcov_int_t;
 #define KCOV_ENTRY_SIZE sizeof(kcov_int_t)
 
-/*
- * Always prefer 64-bit atomic operations whenever accessible.
- *
- * As a fallback keep regular volatile move operation that it's not known
- * to have negative effect in KCOV even if interrupted in the middle of
- * operation.
- */
-#ifdef __HAVE_ATOMIC64_OPS
-#define KCOV_STORE(x,v)        __atomic_store_n(&(x), (v), __ATOMIC_RELAXED)
-#define KCOV_LOAD(x)   __atomic_load_n(&(x), __ATOMIC_RELAXED)
-#else
 #define KCOV_STORE(x,v)        (x) = (v)
 #define KCOV_LOAD(x)   (x)
-#endif
 
 #endif /* !_SYS_KCOV_H_ */



Home | Main Index | Thread Index | Old Index