summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2007-01-17 19:30:13 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2007-01-17 19:30:13 +0000
commit97eb97c5ef871b7f73c592795c48189cbb2b10e8 (patch)
tree6874de358e70d2923742494c077507731b8532b0 /sys/arch
parent85fc4ab54949af79c8a6a9a5053de81499f6116a (diff)
new shorter version of userret() as surely miod ment it to be like (; miod@ ok
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/hppa/hppa/trap.c38
-rw-r--r--sys/arch/hppa/include/cpu.h3
2 files changed, 13 insertions, 28 deletions
diff --git a/sys/arch/hppa/hppa/trap.c b/sys/arch/hppa/hppa/trap.c
index 9035a66a465..5a10fdb01bc 100644
--- a/sys/arch/hppa/hppa/trap.c
+++ b/sys/arch/hppa/hppa/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.95 2007/01/15 17:09:50 mickey Exp $ */
+/* $OpenBSD: trap.c,v 1.96 2007/01/17 19:30:12 mickey Exp $ */
/*
* Copyright (c) 1998-2004 Michael Shalayeff
@@ -131,41 +131,25 @@ u_char hppa_regmap[32] = {
};
void
-userret(struct proc *p, register_t 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 (astpending) {
astpending = 0;
+ uvmexp.softs++;
if (p->p_flag & P_OWEUPC) {
p->p_flag &= ~P_OWEUPC;
ADDUPROF(p);
}
- }
- if (want_resched) {
- /*
- * We're being preempted.
- */
- preempt(NULL);
- while ((sig = CURSIG(p)) != 0)
- postsig(sig);
+ if (want_resched)
+ preempt(NULL);
}
- /*
- * 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);
- }
+ while ((sig = CURSIG(p)) != 0)
+ postsig(sig);
- curpriority = p->p_priority;
+ curpriority = p->p_priority = p->p_usrpri;
}
void
@@ -570,7 +554,7 @@ if (kdb_trap (type, va, frame))
*/
if ((type & T_USER) &&
(frame->tf_iioq_head & ~PAGE_MASK) != SYSCALLGATE)
- userret(p, frame->tf_iioq_head, 0);
+ userret(p);
}
void
@@ -587,7 +571,7 @@ child_return(arg)
tf->tf_ret1 = 1; /* ischild */
tf->tf_t1 = 0; /* errno */
- userret(p, tf->tf_iioq_head, 0);
+ userret(p);
#ifdef KTRACE
if (KTRPOINT(p, KTR_SYSRET))
ktrsysret(p,
@@ -834,7 +818,7 @@ syscall(struct trapframe *frame)
#ifdef SYSCALL_DEBUG
scdebug_ret(p, code, oerror, rval);
#endif
- userret(p, frame->tf_iioq_head, 0);
+ userret(p);
#ifdef KTRACE
if (KTRPOINT(p, KTR_SYSRET))
ktrsysret(p, code, oerror, rval[0]);
diff --git a/sys/arch/hppa/include/cpu.h b/sys/arch/hppa/include/cpu.h
index ffcb5d79c59..04a70b07691 100644
--- a/sys/arch/hppa/include/cpu.h
+++ b/sys/arch/hppa/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.46 2005/04/07 00:26:21 mickey Exp $ */
+/* $OpenBSD: cpu.h,v 1.47 2007/01/17 19:30:12 mickey Exp $ */
/*
* Copyright (c) 2000-2004 Michael Shalayeff
@@ -129,6 +129,7 @@ extern int cpu_hvers;
#define signotify(p) (setsoftast())
#define need_resched(ci) (want_resched = 1, setsoftast())
#define need_proftick(p) ((p)->p_flag |= P_OWEUPC, setsoftast())
+#define PROC_PC(p) ((p)->p_md.md_regs->tf_iioq_head)
#ifndef _LOCORE
#ifdef _KERNEL