summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2011-01-02 20:41:22 +0000
committerkettenis <kettenis@openbsd.org>2011-01-02 20:41:22 +0000
commit32f5aba4973511c862de2aa192d1e36a5013b2d5 (patch)
treeafddf1b387f0732e2ee498f39b483ed615041c17
parentFigure out how much L2 cache is available on 88410-blessed designs, and (diff)
downloadwireguard-openbsd-32f5aba4973511c862de2aa192d1e36a5013b2d5.tar.xz
wireguard-openbsd-32f5aba4973511c862de2aa192d1e36a5013b2d5.zip
Make need_resched() call cpu_unidle() such that we wake up a process running on
another CPU. ok miod@
-rw-r--r--sys/arch/hppa/dev/cpu.c15
-rw-r--r--sys/arch/hppa/include/cpu.h13
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
/*