summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2009-12-29 13:40:10 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2009-12-29 13:40:10 +0000
commit49710b88dbf15cb0063f51cdaa453b04d114a4eb (patch)
tree83a4e9a4ea09754f546aed22831b4a29454e86ee /sys/arch
parent049fc13d355604630c9f405a90c3a9bde13458ab (diff)
Make want_resched a per CPU variable.
ok kettenis@ miod@
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/hppa/hppa/trap.c7
-rw-r--r--sys/arch/hppa/include/cpu.h10
2 files changed, 8 insertions, 9 deletions
diff --git a/sys/arch/hppa/hppa/trap.c b/sys/arch/hppa/hppa/trap.c
index 80136774f26..ad0b097099d 100644
--- a/sys/arch/hppa/hppa/trap.c
+++ b/sys/arch/hppa/hppa/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.102 2009/12/29 13:11:40 jsing Exp $ */
+/* $OpenBSD: trap.c,v 1.103 2009/12/29 13:40:09 jsing Exp $ */
/*
* Copyright (c) 1998-2004 Michael Shalayeff
@@ -93,8 +93,6 @@ const char *trap_type[] = {
};
int trap_types = sizeof(trap_type)/sizeof(trap_type[0]);
-int want_resched;
-
#define frame_regmap(tf,r) (((u_int *)(tf))[hppa_regmap[(r)]])
u_char hppa_regmap[32] = {
offsetof(struct trapframe, tf_pad[0]) / 4, /* r0 XXX */
@@ -134,6 +132,7 @@ u_char hppa_regmap[32] = {
void
userret(struct proc *p)
{
+ struct cpu_info *ci = curcpu();
int sig;
if (p->p_md.md_astpending) {
@@ -142,7 +141,7 @@ userret(struct proc *p)
if (p->p_flag & P_OWEUPC) {
ADDUPROF(p);
}
- if (want_resched)
+ if (ci->ci_want_resched)
preempt(NULL);
}
diff --git a/sys/arch/hppa/include/cpu.h b/sys/arch/hppa/include/cpu.h
index 3aef944489b..bb6c5f62bbd 100644
--- a/sys/arch/hppa/include/cpu.h
+++ b/sys/arch/hppa/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.61 2009/12/29 13:11:40 jsing Exp $ */
+/* $OpenBSD: cpu.h,v 1.62 2009/12/29 13:40:09 jsing Exp $ */
/*
* Copyright (c) 2000-2004 Michael Shalayeff
@@ -70,6 +70,8 @@
struct cpu_info {
struct proc *ci_curproc;
+ int ci_want_resched;
+
struct schedstate_percpu ci_schedstate;
u_int32_t ci_randseed;
};
@@ -156,11 +158,11 @@ extern register_t kpsw;
#define signotify(p) setsoftast(p)
#define need_resched(ci) \
do { \
- want_resched = 1; \
+ (ci)->ci_want_resched = 1; \
if ((ci)->ci_curproc != NULL) \
setsoftast((ci)->ci_curproc); \
} while (0)
-#define clear_resched(ci) want_resched = 0
+#define clear_resched(ci) (ci)->ci_want_resched = 0
#define need_proftick(p) setsoftast(p)
#define PROC_PC(p) ((p)->p_md.md_regs->tf_iioq_head)
@@ -171,8 +173,6 @@ extern register_t kpsw;
#define MD_CACHE_CTL(a,s,t) \
(((t)? pdcache : fdcache) (HPPA_SID_KERNEL,(vaddr_t)(a),(s)))
-extern int want_resched;
-
#define DELAY(x) delay(x)
extern int (*cpu_desidhash)(void);