diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2011-01-02 20:41:23 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2011-01-02 20:41:23 +0000 |
commit | 9c15b9cbbc972bbd647fd9d0df148746025ea225 (patch) | |
tree | 89bd89d340bfbd6c83f23f3e2d427d4de40332c8 /sys | |
parent | ead94d6d1e87034052f170a419e435630fb9eafe (diff) |
Make need_resched() call cpu_unidle() such that we wake up a process running on
another CPU.
ok miod@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/hppa/dev/cpu.c | 15 | ||||
-rw-r--r-- | sys/arch/hppa/include/cpu.h | 13 |
2 files changed, 19 insertions, 9 deletions
diff --git a/sys/arch/hppa/dev/cpu.c b/sys/arch/hppa/dev/cpu.c index a11877b8f68..dd1b3d3aaf6 100644 --- a/sys/arch/hppa/dev/cpu.c +++ b/sys/arch/hppa/dev/cpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.c,v 1.38 2010/12/30 14:10:14 jsing Exp $ */ +/* $OpenBSD: cpu.c,v 1.39 2011/01/02 20:41:22 kettenis Exp $ */ /* * Copyright (c) 1998-2003 Michael Shalayeff @@ -29,6 +29,7 @@ #include <sys/param.h> #include <sys/systm.h> #include <sys/device.h> +#include <sys/proc.h> #include <sys/reboot.h> #include <uvm/uvm_extern.h> @@ -277,3 +278,15 @@ cpu_unidle(struct cpu_info *ci) hppa_ipi_send(ci, HPPA_IPI_NOP); } #endif + +void +need_resched(struct cpu_info *ci) +{ + ci->ci_want_resched = 1; + + /* There's a risk we'll be called before the idle threads start */ + if (ci->ci_curproc) { + setsoftast(ci->ci_curproc); + cpu_unidle(ci); + } +} diff --git a/sys/arch/hppa/include/cpu.h b/sys/arch/hppa/include/cpu.h index 050a0ac7805..946a3b6cf6e 100644 --- a/sys/arch/hppa/include/cpu.h +++ b/sys/arch/hppa/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.78 2010/12/30 14:26:14 jsing Exp $ */ +/* $OpenBSD: cpu.h,v 1.79 2011/01/02 20:41:22 kettenis Exp $ */ /* * Copyright (c) 2000-2004 Michael Shalayeff @@ -200,13 +200,6 @@ extern int cpu_hvers; #define CLKF_USERMODE(framep) ((framep)->tf_flags & T_USER) #define CLKF_SYSCALL(framep) ((framep)->tf_flags & TFF_SYS) -#define need_resched(ci) \ - do { \ - (ci)->ci_want_resched = 1; \ - if ((ci)->ci_curproc != NULL) \ - setsoftast((ci)->ci_curproc); \ - } while (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) @@ -242,6 +235,10 @@ void cpu_unidle(struct cpu_info *); #else #define cpu_unidle(ci) #endif + +extern void need_resched(struct cpu_info *); +#define clear_resched(ci) (ci)->ci_want_resched = 0 + #endif /* |