summaryrefslogtreecommitdiff
path: root/sys/arch/mips64/include/cpu.h
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2009-06-10 18:05:32 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2009-06-10 18:05:32 +0000
commitc97f584948035e1a4ccf9be653268e794f1cc4a7 (patch)
tree56eeccaecff52fce2182bbffb06eb500c1ee370c /sys/arch/mips64/include/cpu.h
parent679b7378ed7ee80740ab0733174fffb7f28738e4 (diff)
Switch sgi to per-process AST, and move ast() from interrupt.c to trap.c
where it can use userret() instead of duplicating it.
Diffstat (limited to 'sys/arch/mips64/include/cpu.h')
-rw-r--r--sys/arch/mips64/include/cpu.h28
1 files changed, 17 insertions, 11 deletions
diff --git a/sys/arch/mips64/include/cpu.h b/sys/arch/mips64/include/cpu.h
index 73d559c8589..f16edec4b76 100644
--- a/sys/arch/mips64/include/cpu.h
+++ b/sys/arch/mips64/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.32 2009/06/02 17:55:37 miod Exp $ */
+/* $OpenBSD: cpu.h,v 1.33 2009/06/10 18:05:30 miod Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -358,10 +358,13 @@ extern vaddr_t uncached_base;
#include <sys/sched.h>
struct cpu_info {
- struct schedstate_percpu ci_schedstate;
+ struct proc *ci_curproc;
- struct proc *ci_curproc;
- u_int32_t ci_randseed;
+ struct schedstate_percpu
+ ci_schedstate;
+ int ci_want_resched; /* need_resched() invoked */
+
+ u_int32_t ci_randseed; /* per cpu random seed */
};
extern struct cpu_info cpu_info_primary;
@@ -401,25 +404,28 @@ extern int int_nest_cntr;
* Preempt the current process if in interrupt from user mode,
* or after the current trap/syscall if in system mode.
*/
-#define need_resched(info) { want_resched = 1; aston(); }
-#define clear_resched(ci) want_resched = 0
+#define need_resched(ci) \
+ do { \
+ (ci)->ci_want_resched = 1; \
+ if ((ci)->ci_curproc != NULL) \
+ aston((ci)->ci_curproc); \
+ } while(0)
+#define clear_resched(ci) (ci)->ci_want_resched = 0
/*
* Give a profiling tick to the current process when the user profiling
* buffer pages are invalid. On the PICA, request an ast to send us
* through trap, marking the proc as needing a profiling tick.
*/
-#define need_proftick(p) aston()
+#define need_proftick(p) aston(p)
/*
* Notify the current process (p) that it has a signal pending,
* process as soon as possible.
*/
-#define signotify(p) aston()
-
-#define aston() (astpending = 1)
+#define signotify(p) aston(p)
-extern int want_resched; /* resched() was called */
+#define aston(p) p->p_md.md_astpending = 1
#endif /* !_LOCORE */
#endif /* _KERNEL */