Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch mi_userret(): take care of calling preempt(), set s...
details: https://anonhg.NetBSD.org/src/rev/75d16fbe371d
branches: trunk
changeset: 461286:75d16fbe371d
user: ad <ad%NetBSD.org@localhost>
date: Thu Nov 21 19:57:23 2019 +0000
description:
mi_userret(): take care of calling preempt(), set spc_curpriority directly,
and remove MD code that does the same.
diffstat:
sys/arch/aarch64/aarch64/cpu_machdep.c | 13 ++-----------
sys/arch/mips/mips/cpu_subr.c | 13 ++-----------
sys/arch/powerpc/powerpc/powerpc_machdep.c | 9 ++-------
sys/arch/riscv/riscv/riscv_machdep.c | 10 +---------
sys/arch/x86/include/cpu.h | 3 +--
5 files changed, 8 insertions(+), 40 deletions(-)
diffs (142 lines):
diff -r ee5c74721c28 -r 75d16fbe371d sys/arch/aarch64/aarch64/cpu_machdep.c
--- a/sys/arch/aarch64/aarch64/cpu_machdep.c Thu Nov 21 19:47:21 2019 +0000
+++ b/sys/arch/aarch64/aarch64/cpu_machdep.c Thu Nov 21 19:57:23 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu_machdep.c,v 1.6 2018/08/03 17:04:30 ryo Exp $ */
+/* $NetBSD: cpu_machdep.c,v 1.7 2019/11/21 19:57:23 ad Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: cpu_machdep.c,v 1.6 2018/08/03 17:04:30 ryo Exp $");
+__KERNEL_RCSID(1, "$NetBSD: cpu_machdep.c,v 1.7 2019/11/21 19:57:23 ad Exp $");
#include "opt_multiprocessor.h"
@@ -299,15 +299,6 @@
setsoftast(l->l_cpu);
}
-void
-cpu_set_curpri(int pri)
-{
- kpreempt_disable();
- curcpu()->ci_schedstate.spc_curpriority = pri;
- kpreempt_enable();
-}
-
-
#ifdef __HAVE_PREEMPTION
bool
cpu_kpreempt_enter(uintptr_t where, int s)
diff -r ee5c74721c28 -r 75d16fbe371d sys/arch/mips/mips/cpu_subr.c
--- a/sys/arch/mips/mips/cpu_subr.c Thu Nov 21 19:47:21 2019 +0000
+++ b/sys/arch/mips/mips/cpu_subr.c Thu Nov 21 19:57:23 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu_subr.c,v 1.34 2019/01/21 08:04:26 skrll Exp $ */
+/* $NetBSD: cpu_subr.c,v 1.35 2019/11/21 19:57:23 ad Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.34 2019/01/21 08:04:26 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.35 2019/11/21 19:57:23 ad Exp $");
#include "opt_cputype.h"
#include "opt_ddb.h"
@@ -567,15 +567,6 @@
l->l_md.md_astpending = 1; /* force call to ast() */
}
-void
-cpu_set_curpri(int pri)
-{
- kpreempt_disable();
- curcpu()->ci_schedstate.spc_curpriority = pri;
- kpreempt_enable();
-}
-
-
#ifdef __HAVE_PREEMPTION
bool
cpu_kpreempt_enter(uintptr_t where, int s)
diff -r ee5c74721c28 -r 75d16fbe371d sys/arch/powerpc/powerpc/powerpc_machdep.c
--- a/sys/arch/powerpc/powerpc/powerpc_machdep.c Thu Nov 21 19:47:21 2019 +0000
+++ b/sys/arch/powerpc/powerpc/powerpc_machdep.c Thu Nov 21 19:57:23 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: powerpc_machdep.c,v 1.72 2018/09/16 09:25:47 skrll Exp $ */
+/* $NetBSD: powerpc_machdep.c,v 1.73 2019/11/21 19:57:24 ad Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: powerpc_machdep.c,v 1.72 2018/09/16 09:25:47 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: powerpc_machdep.c,v 1.73 2019/11/21 19:57:24 ad Exp $");
#include "opt_altivec.h"
#include "opt_ddb.h"
@@ -378,11 +378,6 @@
l->l_pflag &= ~LP_OWEUPC;
ADDUPROF(l);
}
-
- /* Check whether we are being preempted. */
- if (ci->ci_want_resched) {
- preempt();
- }
}
void
diff -r ee5c74721c28 -r 75d16fbe371d sys/arch/riscv/riscv/riscv_machdep.c
--- a/sys/arch/riscv/riscv/riscv_machdep.c Thu Nov 21 19:47:21 2019 +0000
+++ b/sys/arch/riscv/riscv/riscv_machdep.c Thu Nov 21 19:57:23 2019 +0000
@@ -31,7 +31,7 @@
#include "opt_modular.h"
-__RCSID("$NetBSD: riscv_machdep.c,v 1.4 2019/04/06 11:54:20 kamil Exp $");
+__RCSID("$NetBSD: riscv_machdep.c,v 1.5 2019/11/21 19:57:24 ad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -324,14 +324,6 @@
}
void
-cpu_set_curpri(int pri)
-{
- kpreempt_disable();
- curcpu()->ci_schedstate.spc_curpriority = pri;
- kpreempt_enable();
-}
-
-void
cpu_reboot(int how, char *bootstr)
{
for (;;) {
diff -r ee5c74721c28 -r 75d16fbe371d sys/arch/x86/include/cpu.h
--- a/sys/arch/x86/include/cpu.h Thu Nov 21 19:47:21 2019 +0000
+++ b/sys/arch/x86/include/cpu.h Thu Nov 21 19:57:23 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.h,v 1.110 2019/10/12 06:31:03 maxv Exp $ */
+/* $NetBSD: cpu.h,v 1.111 2019/11/21 19:57:24 ad Exp $ */
/*
* Copyright (c) 1990 The Regents of the University of California.
@@ -371,7 +371,6 @@
#if !defined(__GNUC__) || defined(_MODULE)
/* For non-GCC and modules */
struct cpu_info *x86_curcpu(void);
-void cpu_set_curpri(int);
# ifdef __GNUC__
lwp_t *x86_curlwp(void) __attribute__ ((const));
# else
Home |
Main Index |
Thread Index |
Old Index