summaryrefslogtreecommitdiff
path: root/kern/syscnt.c
diff options
context:
space:
mode:
authorAgustina Arzille <avarzille@riseup.net>2017-04-03 16:09:51 +0200
committerRichard Braun <rbraun@sceen.net>2017-04-04 22:07:06 +0200
commitb1730c99f882fc2662c6b64371a4b11a8231bb9f (patch)
treec4fa5fa51287aee6d6cb372f1cfa8f6413ababd6 /kern/syscnt.c
parentd5bb14cf6a8305bda2a5a73ce727e5309996a20a (diff)
Use the new atomic operations interface
Stick to a sequentially consistent model for most atomic operations as it matches the semantics of the existing code. Each call site will have to be reevaluated in order to switch to more relaxed accesses where possible.
Diffstat (limited to 'kern/syscnt.c')
-rw-r--r--kern/syscnt.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/kern/syscnt.c b/kern/syscnt.c
index 5c4c3608..4336ef1e 100644
--- a/kern/syscnt.c
+++ b/kern/syscnt.c
@@ -17,6 +17,7 @@
#include <string.h>
+#include <kern/atomic.h>
#include <kern/init.h>
#include <kern/list.h>
#include <kern/mutex.h>
@@ -40,9 +41,9 @@ syscnt_setup(void)
void __init
syscnt_register(struct syscnt *syscnt, const char *name)
{
-#ifndef __LP64__
+#ifndef ATOMIC_HAVE_64B_OPS
spinlock_init(&syscnt->lock);
-#endif /* __LP64__ */
+#endif
syscnt->value = 0;
strlcpy(syscnt->name, name, sizeof(syscnt->name));