Module Name: src
Committed By: msaitoh
Date: Mon Oct 27 05:41:21 UTC 2014
Modified Files:
src/sys/kern [netbsd-6]: subr_pcq.c
Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1132):
sys/kern/subr_pcq.c: revision 1.7
__HAVE_ATOMIC_AS_MEMBAR is spelled with two leading underscores.
This underscores the need to replace this error-prone cpp API by
unconditionally defined {pre,post}atomic_membar_*.
This change should only remove unnecessary membar_producers on x86.
To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.6.2.1 src/sys/kern/subr_pcq.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/kern/subr_pcq.c
diff -u src/sys/kern/subr_pcq.c:1.6 src/sys/kern/subr_pcq.c:1.6.2.1
--- src/sys/kern/subr_pcq.c:1.6 Tue Jan 31 20:40:09 2012
+++ src/sys/kern/subr_pcq.c Mon Oct 27 05:41:21 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_pcq.c,v 1.6 2012/01/31 20:40:09 alnsn Exp $ */
+/* $NetBSD: subr_pcq.c,v 1.6.2.1 2014/10/27 05:41:21 msaitoh Exp $ */
/*-
* Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_pcq.c,v 1.6 2012/01/31 20:40:09 alnsn Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_pcq.c,v 1.6.2.1 2014/10/27 05:41:21 msaitoh Exp $");
#include <sys/param.h>
#include <sys/types.h>
@@ -115,7 +115,7 @@ pcq_put(pcq_t *pcq, void *item)
* that the caller made to the data item are globally visible
* before we put it onto the list.
*/
-#ifndef _HAVE_ATOMIC_AS_MEMBAR
+#ifndef __HAVE_ATOMIC_AS_MEMBAR
membar_producer();
#endif
pcq->pcq_items[op] = item;
@@ -180,7 +180,7 @@ pcq_get(pcq_t *pcq)
* after it, we could in theory wipe out a modification made
* to pcq_items[] by pcq_put().
*/
-#ifndef _HAVE_ATOMIC_AS_MEMBAR
+#ifndef __HAVE_ATOMIC_AS_MEMBAR
membar_producer();
#endif
while (__predict_false(atomic_cas_32(&pcq->pcq_pc, v, nv) != v)) {