Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Mar 2013 17:38:59 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r248380 - projects/counters/sys/sparc64/include
Message-ID:  <201303161738.r2GHcx5l043911@svn.freebsd.org>

index | next in thread | raw e-mail

Author: glebius
Date: Sat Mar 16 17:38:59 2013
New Revision: 248380
URL: http://svnweb.freebsd.org/changeset/base/248380

Log:
  Revert accidentially committed incorrect attempt.

Modified:
  projects/counters/sys/sparc64/include/counter.h

Modified: projects/counters/sys/sparc64/include/counter.h
==============================================================================
--- projects/counters/sys/sparc64/include/counter.h	Sat Mar 16 17:09:44 2013	(r248379)
+++ projects/counters/sys/sparc64/include/counter.h	Sat Mar 16 17:38:59 2013	(r248380)
@@ -30,43 +30,17 @@
 #define __MACHINE_COUNTER_H__
 
 #include <sys/pcpu.h>
-#include <machine/asi.h>
-#include <machine/asmacros.h>
 
-extern char pcpu0[1];
-
-static inline void
+static __inline void
 counter_u64_inc(counter_u64_t c, uint64_t inc)
 {
 
-	__asm __volatile(
-	"add	%" __XSTRING(PCPU_REG) ", %0, %%g1\n\t"
-	"ldx	[%%g1], %%g3\n\t"
-"1:\n\t"
-	"mov	%%g3, %%g2\n\t"
-	"add	%%g2, %1, %%g3\n\t"
-	"casxa	[%%g1] " __XSTRING(ASI_N) " , %%g2, %%g3\n\t"
-	"bne,pn	%%xcc, 1b\n\t"
-	" cmp	%%g2, %%g3\n\t"
-	:
-	: "r" ((char *)c - pcpu0), "r" (inc)
-	: "memory", "cc", "g1", "g2", "g3");
-
-#if 0
-	__asm __volatile(
-	"wrpr	%%g0, %2, %%pstate\n\t"
-	"ldx	[%" __XSTRING(PCPU_REG) " + %0], %%g2\n\t"
-	"add	%%g2, %1, %%g1\n\t"
-	"stx	%%g1, [%" __XSTRING(PCPU_REG) " + %0]\n\t"
-	"wrpr	%%g0, %3, %%pstate\n\t"
-	:
-	: "r" ((char *)c - pcpu0), "r" (inc),
-	  "i" (PSTATE_NORMAL), "i" (PSTATE_KERNEL)
-	: "memory", "cc", "g2", "g1");
-#endif
+	critical_enter();
+	*(uint64_t *)((char *)c + sizeof(struct pcpu) * curcpu) += inc;
+	critical_exit();
 }
 
-static inline void
+static __inline void
 counter_u64_dec(counter_u64_t c, uint64_t dec)
 {
 


help

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