diff options
author | attilio <attilio@FreeBSD.org> | 2007-06-04 21:38:48 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2007-06-04 21:38:48 +0000 |
commit | e333d0ff0eb23a5f94f36fd95b4bbcfda3ccbc8f (patch) | |
tree | a35bbd71798a97fd11a5f264ff97c562de001111 /sys/sparc64/include | |
parent | 771efb08f5bfaf22da0498ae91647fdecb3cc6bb (diff) | |
download | FreeBSD-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/sparc64/include')
-rw-r--r-- | sys/sparc64/include/pcpu.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/sparc64/include/pcpu.h b/sys/sparc64/include/pcpu.h index 9da5775..f3a9f64 100644 --- a/sys/sparc64/include/pcpu.h +++ b/sys/sparc64/include/pcpu.h @@ -71,7 +71,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)) |