summaryrefslogtreecommitdiffstats
path: root/sys/powerpc
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/powerpc
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/powerpc')
-rw-r--r--sys/powerpc/aim/trap.c4
-rw-r--r--sys/powerpc/include/pcpu.h3
-rw-r--r--sys/powerpc/powerpc/trap.c4
3 files changed, 6 insertions, 5 deletions
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)
OpenPOWER on IntegriCloud