Author: lstewart
Date: Tue Jul 13 08:05:48 2010
New Revision: 209981
URL: http://svn.freebsd.org/changeset/base/209981

Log:
  Macro to simplify zeroing DPCPU variables.
  
  Sponsored by: FreeBSD Foundation
  MFC after:    3 days

Modified:
  head/sys/sys/pcpu.h

Modified: head/sys/sys/pcpu.h
==============================================================================
--- head/sys/sys/pcpu.h Tue Jul 13 07:00:57 2010        (r209980)
+++ head/sys/sys/pcpu.h Tue Jul 13 08:05:48 2010        (r209981)
@@ -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
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to