From e333d0ff0eb23a5f94f36fd95b4bbcfda3ccbc8f Mon Sep 17 00:00:00 2001 From: attilio Date: Mon, 4 Jun 2007 21:38:48 +0000 Subject: 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) --- sys/powerpc/aim/trap.c | 4 ++-- sys/powerpc/include/pcpu.h | 3 ++- sys/powerpc/powerpc/trap.c | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) (limited to 'sys/powerpc') diff --git a/sys/powerpc/aim/trap.c b/sys/powerpc/aim/trap.c index 34daa87..1f25b26 100644 --- a/sys/powerpc/aim/trap.c +++ b/sys/powerpc/aim/trap.c @@ -149,7 +149,7 @@ trap(struct trapframe *frame) u_int ucode; ksiginfo_t ksi; - PCPU_LAZY_INC(cnt.v_trap); + PCPU_INC(cnt.v_trap); td = PCPU_GET(curthread); p = td->td_proc; @@ -349,7 +349,7 @@ syscall(struct trapframe *frame) td = PCPU_GET(curthread); p = td->td_proc; - PCPU_LAZY_INC(cnt.v_syscall); + PCPU_INC(cnt.v_syscall); #ifdef KSE if (p->p_flag & P_SA) diff --git a/sys/powerpc/include/pcpu.h b/sys/powerpc/include/pcpu.h index 4575bd5..6e95076 100644 --- a/sys/powerpc/include/pcpu.h +++ b/sys/powerpc/include/pcpu.h @@ -62,7 +62,8 @@ struct pmap; * 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/powerpc/powerpc/trap.c b/sys/powerpc/powerpc/trap.c index 34daa87..1f25b26 100644 --- a/sys/powerpc/powerpc/trap.c +++ b/sys/powerpc/powerpc/trap.c @@ -149,7 +149,7 @@ trap(struct trapframe *frame) u_int ucode; ksiginfo_t ksi; - PCPU_LAZY_INC(cnt.v_trap); + PCPU_INC(cnt.v_trap); td = PCPU_GET(curthread); p = td->td_proc; @@ -349,7 +349,7 @@ syscall(struct trapframe *frame) td = PCPU_GET(curthread); p = td->td_proc; - PCPU_LAZY_INC(cnt.v_syscall); + PCPU_INC(cnt.v_syscall); #ifdef KSE if (p->p_flag & P_SA) -- cgit v1.1