summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2020-09-25 14:42:25 +0000
committerderaadt <deraadt@openbsd.org>2020-09-25 14:42:25 +0000
commit6ef6166d7ec6b74e5676d548198ae901c0add67c (patch)
tree395fcc9c1211160fdf6b70632b9ce9bb060c20dd /sys
parentAdd missing calls to uvm_grow(9). (diff)
downloadwireguard-openbsd-6ef6166d7ec6b74e5676d548198ae901c0add67c.tar.xz
wireguard-openbsd-6ef6166d7ec6b74e5676d548198ae901c0add67c.zip
landisk has legacy global variable want_resched, rather than post-MP
ci->ci_want_resched. convert to the modern style.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/sh/sh/cpu.c13
-rw-r--r--sys/arch/sh/sh/locore_c.c3
-rw-r--r--sys/arch/sh/sh/trap.c4
3 files changed, 15 insertions, 5 deletions
diff --git a/sys/arch/sh/sh/cpu.c b/sys/arch/sh/sh/cpu.c
index 7b66c313390..680b2cb040f 100644
--- a/sys/arch/sh/sh/cpu.c
+++ b/sys/arch/sh/sh/cpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.c,v 1.4 2019/07/07 14:41:55 deraadt Exp $ */
+/* $OpenBSD: cpu.c,v 1.5 2020/09/25 14:42:25 deraadt Exp $ */
/* $NetBSD: cpu.c,v 1.8 2006/01/02 23:16:20 uwe Exp $ */
/*-
@@ -29,8 +29,10 @@
#include <sys/param.h>
#include <sys/systm.h>
+#include <sys/proc.h>
#include <sys/device.h>
+#include <sh/cpu.h>
#include <sh/clock.h>
#include <sh/cache.h>
#include <sh/mmu.h>
@@ -74,3 +76,12 @@ cpu_attach(struct device *parent, struct device *self, void *aux)
sh_cache_information();
sh_mmu_information();
}
+
+void
+need_resched(struct cpu_info *ci)
+{
+ ci->ci_want_resched = 1;
+
+ if (ci->ci_curproc)
+ aston(ci->ci_curproc);
+}
diff --git a/sys/arch/sh/sh/locore_c.c b/sys/arch/sh/sh/locore_c.c
index b908f5f8169..562b6282ea7 100644
--- a/sys/arch/sh/sh/locore_c.c
+++ b/sys/arch/sh/sh/locore_c.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore_c.c,v 1.12 2014/11/18 20:51:01 krw Exp $ */
+/* $OpenBSD: locore_c.c,v 1.13 2020/09/25 14:42:25 deraadt Exp $ */
/* $NetBSD: locore_c.c,v 1.13 2006/03/04 01:13:35 uwe Exp $ */
/*-
@@ -121,7 +121,6 @@
void (*__sh_switch_resume)(struct proc *);
void cpu_switch_prepare(struct proc *, struct proc *);
-int want_resched;
/*
* Prepare context switch from oproc to nproc.
diff --git a/sys/arch/sh/sh/trap.c b/sys/arch/sh/sh/trap.c
index 0f84e2fe593..be252802363 100644
--- a/sys/arch/sh/sh/trap.c
+++ b/sys/arch/sh/sh/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.43 2020/09/24 17:54:30 deraadt Exp $ */
+/* $OpenBSD: trap.c,v 1.44 2020/09/25 14:42:25 deraadt Exp $ */
/* $NetBSD: exception.c,v 1.32 2006/09/04 23:57:52 uwe Exp $ */
/* $NetBSD: syscall.c,v 1.6 2006/03/07 07:21:50 thorpej Exp $ */
@@ -486,7 +486,7 @@ ast(struct proc *p, struct trapframe *tf)
p->p_md.md_astpending = 0;
refreshcreds(p);
uvmexp.softs++;
- mi_ast(p, want_resched);
+ mi_ast(p, curcpu()->ci_want_resched);
userret(p);
}
}