Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Jul 2010 08:05:48 +0000 (UTC)
From:      Lawrence Stewart <lstewart@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r209981 - head/sys/sys
Message-ID:  <201007130805.o6D85mDN063765@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201007130805.o6D85mDN063765>