diff options
author | Attilio Rao <attilio@FreeBSD.org> | 2007-06-04 21:38:48 +0000 |
---|---|---|
committer | Attilio Rao <attilio@FreeBSD.org> | 2007-06-04 21:38:48 +0000 |
commit | 6759608248f30eb575170c0700cc99140e0bdc35 (patch) | |
tree | a35bbd71798a97fd11a5f264ff97c562de001111 /sys/sun4v | |
parent | 041b706b2fa9a5d00d1752796abb7af549d5977b (diff) | |
download | src-6759608248f30eb575170c0700cc99140e0bdc35.tar.gz src-6759608248f30eb575170c0700cc99140e0bdc35.zip |
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)
Notes
Notes:
svn path=/head/; revision=170291
Diffstat (limited to 'sys/sun4v')
-rw-r--r-- | sys/sun4v/include/pcpu.h | 3 | ||||
-rw-r--r-- | sys/sun4v/sun4v/trap.c | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/sys/sun4v/include/pcpu.h b/sys/sun4v/include/pcpu.h index b6d901a4da1b..25150311afff 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)) diff --git a/sys/sun4v/sun4v/trap.c b/sys/sun4v/sun4v/trap.c index 4fe6edc7fad5..fa2de3dc43f0 100644 --- a/sys/sun4v/sun4v/trap.c +++ b/sys/sun4v/sun4v/trap.c @@ -268,7 +268,7 @@ trap(struct trapframe *tf, int64_t type, uint64_t data) trap_msg[trapno], (TRAPF_USERMODE(tf) ? "user" : "kernel"), rdpr(pil)); - PCPU_LAZY_INC(cnt.v_trap); + PCPU_INC(cnt.v_trap); trapno = (type & TRAP_MASK); ctx = (type >> TRAP_CTX_SHIFT); @@ -575,7 +575,7 @@ syscall(struct trapframe *tf) p = td->td_proc; - PCPU_LAZY_INC(cnt.v_syscall); + PCPU_INC(cnt.v_syscall); narg = 0; error = 0; |