summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvisa <visa@openbsd.org>2019-05-05 13:28:14 +0000
committervisa <visa@openbsd.org>2019-05-05 13:28:14 +0000
commit00c79297cde52f3758ac191ea525674a23bbbead (patch)
tree08b374d6050b7a8bb6c2dace6965b157d7d50b0b
parentFor "unpriv -f file", chown file back to root once the command finishes, (diff)
downloadwireguard-openbsd-00c79297cde52f3758ac191ea525674a23bbbead.tar.xz
wireguard-openbsd-00c79297cde52f3758ac191ea525674a23bbbead.zip
Turn need_resched() and signotify() into proper functions on mips64.
-rw-r--r--sys/arch/mips64/include/cpu.h15
-rw-r--r--sys/arch/mips64/mips64/cpu.c11
-rw-r--r--sys/arch/mips64/mips64/sendsig.c9
3 files changed, 21 insertions, 14 deletions
diff --git a/sys/arch/mips64/include/cpu.h b/sys/arch/mips64/include/cpu.h
index 7bb5cf35971..06c539d3f93 100644
--- a/sys/arch/mips64/include/cpu.h
+++ b/sys/arch/mips64/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.126 2018/12/05 10:28:21 jsg Exp $ */
+/* $OpenBSD: cpu.h,v 1.127 2019/05/05 13:28:14 visa Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -300,12 +300,7 @@ void cp0_calibrate(struct cpu_info *);
* Preempt the current process if in interrupt from user mode,
* or after the current trap/syscall if in system mode.
*/
-#define need_resched(ci) \
- do { \
- (ci)->ci_want_resched = 1; \
- if ((ci)->ci_curproc != NULL) \
- aston((ci)->ci_curproc); \
- } while(0)
+void need_resched(struct cpu_info *);
#define clear_resched(ci) (ci)->ci_want_resched = 0
/*
@@ -319,11 +314,7 @@ void cp0_calibrate(struct cpu_info *);
* Notify the current process (p) that it has a signal pending,
* process as soon as possible.
*/
-#ifdef MULTIPROCESSOR
-#define signotify(p) (aston(p), cpu_unidle((p)->p_cpu))
-#else
-#define signotify(p) aston(p)
-#endif
+void signotify(struct proc *);
#define aston(p) ((p)->p_md.md_astpending = 1)
diff --git a/sys/arch/mips64/mips64/cpu.c b/sys/arch/mips64/mips64/cpu.c
index bff7de1b5a5..b5bbf3b82dc 100644
--- a/sys/arch/mips64/mips64/cpu.c
+++ b/sys/arch/mips64/mips64/cpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.c,v 1.70 2018/12/04 16:24:13 visa Exp $ */
+/* $OpenBSD: cpu.c,v 1.71 2019/05/05 13:28:14 visa Exp $ */
/*
* Copyright (c) 1997-2004 Opsycon AB (www.opsycon.se)
@@ -472,6 +472,15 @@ save_fpu(void)
MipsSaveCurFPState16(p);
}
+void
+need_resched(struct cpu_info *ci)
+{
+ ci->ci_want_resched = 1;
+
+ if (ci->ci_curproc != NULL)
+ aston(ci->ci_curproc);
+}
+
#ifdef MULTIPROCESSOR
struct cpu_info *
get_cpu_info(int cpuno)
diff --git a/sys/arch/mips64/mips64/sendsig.c b/sys/arch/mips64/mips64/sendsig.c
index 45ae47d4825..1473df83211 100644
--- a/sys/arch/mips64/mips64/sendsig.c
+++ b/sys/arch/mips64/mips64/sendsig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sendsig.c,v 1.30 2018/07/10 04:19:59 guenther Exp $ */
+/* $OpenBSD: sendsig.c,v 1.31 2019/05/05 13:28:14 visa Exp $ */
/*
* Copyright (c) 1990 The Regents of the University of California.
@@ -229,3 +229,10 @@ sys_sigreturn(struct proc *p, void *v, register_t *retval)
sizeof(ksc.sc_fpregs));
return (EJUSTRETURN);
}
+
+void
+signotify(struct proc *p)
+{
+ aston(p);
+ cpu_unidle(p->p_cpu);
+}