summaryrefslogtreecommitdiff
path: root/sys/arch/powerpc
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2007-03-23 21:06:07 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2007-03-23 21:06:07 +0000
commitf9bb69616f2bcaf3c499675e6dc7a5fc93d64939 (patch)
tree76fd5d7d6b5e65b6c546c8ec3a0e7120f113ce1d /sys/arch/powerpc
parentfe0875bc53895b38f7abc955a429db3eff188ff6 (diff)
Define PROC_PC and simplify userret(); ok kettenis@ (and I think drahn@ too)
Diffstat (limited to 'sys/arch/powerpc')
-rw-r--r--sys/arch/powerpc/include/cpu.h9
-rw-r--r--sys/arch/powerpc/powerpc/trap.c21
2 files changed, 12 insertions, 18 deletions
diff --git a/sys/arch/powerpc/include/cpu.h b/sys/arch/powerpc/include/cpu.h
index fe4151fa6be..5e0a49f112b 100644
--- a/sys/arch/powerpc/include/cpu.h
+++ b/sys/arch/powerpc/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.30 2007/03/20 20:59:53 kettenis Exp $ */
+/* $OpenBSD: cpu.h,v 1.31 2007/03/23 21:06:05 miod Exp $ */
/* $NetBSD: cpu.h,v 1.1 1996/09/30 16:34:21 ws Exp $ */
/*
@@ -120,7 +120,12 @@ extern struct cpu_info cpu_info[PPC_MAXPROCS];
#define CLKF_PC(frame) ((frame)->srr0)
#define CLKF_INTR(frame) ((frame)->depth != 0)
-#define cpu_wait(p)
+/*
+ * This is used during profiling to integrate system time.
+ */
+#define PROC_PC(p) (trapframe(p)->srr0)
+
+#define cpu_wait(p) do { /* nothing */ } while (0)
void delay(unsigned);
#define DELAY(n) delay(n)
diff --git a/sys/arch/powerpc/powerpc/trap.c b/sys/arch/powerpc/powerpc/trap.c
index 378730ba6ae..f94168607d7 100644
--- a/sys/arch/powerpc/powerpc/trap.c
+++ b/sys/arch/powerpc/powerpc/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.75 2007/03/20 20:59:53 kettenis Exp $ */
+/* $OpenBSD: trap.c,v 1.76 2007/03/23 21:06:06 miod Exp $ */
/* $NetBSD: trap.c,v 1.3 1996/10/13 03:31:37 christos Exp $ */
/*
@@ -63,7 +63,7 @@
static int fix_unaligned(struct proc *p, struct trapframe *frame);
int badaddr(char *addr, u_int32_t len);
-static __inline void userret(struct proc *, int, u_quad_t);
+static __inline void userret(struct proc *);
void trap(struct trapframe *frame);
/* These definitions should probably be somewhere else XXX */
@@ -239,24 +239,13 @@ enable_vec(struct proc *p)
#endif /* ALTIVEC */
static __inline void
-userret(struct proc *p, int pc, u_quad_t oticks)
+userret(struct proc *p)
{
int sig;
/* take pending signals */
while ((sig = CURSIG(p)) != 0)
postsig(sig);
- p->p_priority = p->p_usrpri;
-
- /*
- * If profiling, charge recent system time to the trapped pc.
- */
- if (p->p_flag & P_PROFIL) {
- extern int psratio;
-
- addupc_task(p, pc, (int)(p->p_sticks - oticks) * psratio);
- }
-
curcpu()->ci_schedstate.spc_curpriority = p->p_priority;
}
@@ -676,7 +665,7 @@ for (i = 0; i < errnum; i++) {
break;
}
- userret(p, frame->srr0, sticks);
+ userret(p);
/*
* If someone stole the fpu while we were away, disable it
@@ -712,7 +701,7 @@ child_return(void *arg)
KERNEL_PROC_UNLOCK(p);
- userret(p, tf->srr0, 0);
+ userret(p);
#ifdef KTRACE
if (KTRPOINT(p, KTR_SYSRET)) {