summaryrefslogtreecommitdiffstats
path: root/sys/sun4v/include
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2007-06-04 21:38:48 +0000
committerattilio <attilio@FreeBSD.org>2007-06-04 21:38:48 +0000
commite333d0ff0eb23a5f94f36fd95b4bbcfda3ccbc8f (patch)
treea35bbd71798a97fd11a5f264ff97c562de001111 /sys/sun4v/include
parent771efb08f5bfaf22da0498ae91647fdecb3cc6bb (diff)
downloadFreeBSD-src-e333d0ff0eb23a5f94f36fd95b4bbcfda3ccbc8f.zip
FreeBSD-src-e333d0ff0eb23a5f94f36fd95b4bbcfda3ccbc8f.tar.gz
Rework the PCPU_* (MD) interface:
- Rename PCPU_LAZY_INC into PCPU_INC - Add the PCPU_ADD interface which just does an add on the pcpu member given a specific value. Note that for most architectures PCPU_INC and PCPU_ADD are not safe. This is a point that needs some discussions/work in the next days. Reviewed by: alc, bde Approved by: jeff (mentor)
Diffstat (limited to 'sys/sun4v/include')
-rw-r--r--sys/sun4v/include/pcpu.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/sun4v/include/pcpu.h b/sys/sun4v/include/pcpu.h
index b6d901a..2515031 100644
--- a/sys/sun4v/include/pcpu.h
+++ b/sys/sun4v/include/pcpu.h
@@ -92,7 +92,8 @@ register struct pcpu *pcpup __asm__(__XSTRING(PCPU_REG));
* XXX The implementation of this operation should be made atomic
* with respect to preemption.
*/
-#define PCPU_LAZY_INC(member) (++pcpup->pc_ ## member)
+#define PCPU_ADD(member, value) (pcpup->pc_ ## member += (value))
+#define PCPU_INC(member) PCPU_ADD(member, 1)
#define PCPU_PTR(member) (&pcpup->pc_ ## member)
#define PCPU_SET(member,value) (pcpup->pc_ ## member = (value))
OpenPOWER on IntegriCloud