summaryrefslogtreecommitdiff
path: root/kern
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2014-09-20 02:14:11 +0200
committerRichard Braun <rbraun@sceen.net>2014-09-20 02:14:11 +0200
commit65c9a187a9926181534939480a4034b06b10b71e (patch)
tree48d80d3d7c7c53d967fb22c2a85976a150e19e21 /kern
parent18478032a4e6b3c475a2b37227808bf5fa4a870b (diff)
kern/evcnt: new evcnt_add function
Diffstat (limited to 'kern')
-rw-r--r--kern/evcnt.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/kern/evcnt.h b/kern/evcnt.h
index a6caf96b..f585fad0 100644
--- a/kern/evcnt.h
+++ b/kern/evcnt.h
@@ -65,6 +65,18 @@ evcnt_inc(struct evcnt *evcnt)
}
/*
+ * Batched increment.
+ *
+ * It is the responsibility of the caller to synchronize access to the
+ * counter.
+ */
+static inline void
+evcnt_add(struct evcnt *evcnt, unsigned long long delta)
+{
+ evcnt->count += delta;
+}
+
+/*
* Obtain the current value of the given counter.
*
* Since counters are 64-bits wide, retrieving them on 32-bits systems might