Module Name:    src
Committed By:   ad
Date:           Thu Nov 21 19:57:24 UTC 2019

Modified Files:
        src/sys/arch/aarch64/aarch64: cpu_machdep.c
        src/sys/arch/mips/mips: cpu_subr.c
        src/sys/arch/powerpc/powerpc: powerpc_machdep.c
        src/sys/arch/riscv/riscv: riscv_machdep.c
        src/sys/arch/x86/include: cpu.h

Log Message:
mi_userret(): take care of calling preempt(), set spc_curpriority directly,
and remove MD code that does the same.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/aarch64/aarch64/cpu_machdep.c
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/mips/mips/cpu_subr.c
cvs rdiff -u -r1.72 -r1.73 src/sys/arch/powerpc/powerpc/powerpc_machdep.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/riscv/riscv/riscv_machdep.c
cvs rdiff -u -r1.110 -r1.111 src/sys/arch/x86/include/cpu.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/aarch64/aarch64/cpu_machdep.c
diff -u src/sys/arch/aarch64/aarch64/cpu_machdep.c:1.6 src/sys/arch/aarch64/aarch64/cpu_machdep.c:1.7
--- src/sys/arch/aarch64/aarch64/cpu_machdep.c:1.6	Fri Aug  3 17:04:30 2018
+++ src/sys/arch/aarch64/aarch64/cpu_machdep.c	Thu Nov 21 19:57:23 2019
@@ -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 @@ cpu_need_proftick(struct lwp *l)
 	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)

Index: src/sys/arch/mips/mips/cpu_subr.c
diff -u src/sys/arch/mips/mips/cpu_subr.c:1.34 src/sys/arch/mips/mips/cpu_subr.c:1.35
--- src/sys/arch/mips/mips/cpu_subr.c:1.34	Mon Jan 21 08:04:26 2019
+++ src/sys/arch/mips/mips/cpu_subr.c	Thu Nov 21 19:57:23 2019
@@ -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 @@ cpu_need_proftick(struct lwp *l)
 	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)

Index: src/sys/arch/powerpc/powerpc/powerpc_machdep.c
diff -u src/sys/arch/powerpc/powerpc/powerpc_machdep.c:1.72 src/sys/arch/powerpc/powerpc/powerpc_machdep.c:1.73
--- src/sys/arch/powerpc/powerpc/powerpc_machdep.c:1.72	Sun Sep 16 09:25:47 2018
+++ src/sys/arch/powerpc/powerpc/powerpc_machdep.c	Thu Nov 21 19:57:24 2019
@@ -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 @@ cpu_ast(struct lwp *l, struct cpu_info *
 		l->l_pflag &= ~LP_OWEUPC;
 		ADDUPROF(l);
 	}
-
-	/* Check whether we are being preempted. */
-	if (ci->ci_want_resched) {
-		preempt();
-	}
 }
 
 void

Index: src/sys/arch/riscv/riscv/riscv_machdep.c
diff -u src/sys/arch/riscv/riscv/riscv_machdep.c:1.4 src/sys/arch/riscv/riscv/riscv_machdep.c:1.5
--- src/sys/arch/riscv/riscv/riscv_machdep.c:1.4	Sat Apr  6 11:54:20 2019
+++ src/sys/arch/riscv/riscv/riscv_machdep.c	Thu Nov 21 19:57:24 2019
@@ -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 @@ cpu_need_proftick(struct lwp *l)
 }
 
 void
-cpu_set_curpri(int pri)
-{
-	kpreempt_disable();
-	curcpu()->ci_schedstate.spc_curpriority = pri;
-	kpreempt_enable();
-}
-
-void
 cpu_reboot(int how, char *bootstr)
 {
 	for (;;) {

Index: src/sys/arch/x86/include/cpu.h
diff -u src/sys/arch/x86/include/cpu.h:1.110 src/sys/arch/x86/include/cpu.h:1.111
--- src/sys/arch/x86/include/cpu.h:1.110	Sat Oct 12 06:31:03 2019
+++ src/sys/arch/x86/include/cpu.h	Thu Nov 21 19:57:24 2019
@@ -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 @@ extern struct cpu_info *cpu_info_list;
 #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

Reply via email to