aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/pcpu.h
diff options
context:
space:
mode:
authorLawrence Stewart <lstewart@FreeBSD.org>2010-07-13 08:05:48 +0000
committerLawrence Stewart <lstewart@FreeBSD.org>2010-07-13 08:05:48 +0000
commitaac762c267018b349e40264e4aeb2bd7ff1d9e14 (patch)
tree0497870ef45ddd9159fe4eceeeacb86f74905e1a /sys/sys/pcpu.h
parent985147dec6637ed539722ff87198812703fd7aca (diff)
downloadsrc-aac762c267018b349e40264e4aeb2bd7ff1d9e14.tar.gz
src-aac762c267018b349e40264e4aeb2bd7ff1d9e14.zip
Macro to simplify zeroing DPCPU variables.
Sponsored by: FreeBSD Foundation MFC after: 3 days
Notes
Notes: svn path=/head/; revision=209981
Diffstat (limited to 'sys/sys/pcpu.h')
-rw-r--r--sys/sys/pcpu.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/sys/pcpu.h b/sys/sys/pcpu.h
index c157807ed5df..a563ae7374c0 100644
--- a/sys/sys/pcpu.h
+++ b/sys/sys/pcpu.h
@@ -133,6 +133,15 @@ extern uintptr_t dpcpu_off[];
sum; \
})
+#define DPCPU_ZERO(n) do { \
+ u_int _i; \
+ \
+ CPU_FOREACH(_i) { \
+ bzero(DPCPU_ID_PTR(_i, n), \
+ sizeof(__typeof(DPCPU_PTR(n)))); \
+ } \
+} while(0)
+
/*
* XXXUPS remove as soon as we have per cpu variable
* linker sets and can define rm_queue in _rm_lock.h