summaryrefslogtreecommitdiff
path: root/kern/bitmap.h
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/bitmap.h
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/bitmap.h')
-rw-r--r--kern/bitmap.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/kern/bitmap.h b/kern/bitmap.h
index 77dfac1b..6b7f2d79 100644
--- a/kern/bitmap.h
+++ b/kern/bitmap.h
@@ -26,9 +26,9 @@
#include <string.h>
+#include <kern/atomic.h>
#include <kern/bitmap_i.h>
#include <kern/limits.h>
-#include <machine/atomic.h>
#define BITMAP_DECLARE(name, nr_bits) unsigned long name[BITMAP_LONGS(nr_bits)]
@@ -78,7 +78,7 @@ bitmap_set_atomic(unsigned long *bm, int bit)
bitmap_lookup(bm, bit);
}
- atomic_or_ulong(bm, bitmap_mask(bit));
+ atomic_or(bm, bitmap_mask(bit), ATOMIC_SEQ_CST);
}
static inline void
@@ -98,7 +98,7 @@ bitmap_clear_atomic(unsigned long *bm, int bit)
bitmap_lookup(bm, bit);
}
- atomic_and_ulong(bm, ~bitmap_mask(bit));
+ atomic_and(bm, ~bitmap_mask(bit), ATOMIC_SEQ_CST);
}
static inline int