Module Name: src
Committed By: cherry
Date: Wed Dec 26 11:12:57 UTC 2018
Modified Files:
src/sys/arch/amd64/amd64: spl.S
src/sys/arch/i386/i386: spl.S
src/sys/arch/xen/x86: xen_intr.c
Log Message:
Xen can use the native splraise(9) functions.
There is no need for a slower C version.
To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/amd64/amd64/spl.S
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/i386/i386/spl.S
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/xen/x86/xen_intr.c
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/amd64/amd64/spl.S
diff -u src/sys/arch/amd64/amd64/spl.S:1.37 src/sys/arch/amd64/amd64/spl.S:1.38
--- src/sys/arch/amd64/amd64/spl.S:1.37 Tue Dec 25 06:50:11 2018
+++ src/sys/arch/amd64/amd64/spl.S Wed Dec 26 11:12:57 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: spl.S,v 1.37 2018/12/25 06:50:11 cherry Exp $ */
+/* $NetBSD: spl.S,v 1.38 2018/12/26 11:12:57 cherry Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@@ -78,6 +78,17 @@
.text
+/*
+ * int splraise(int s);
+ */
+ENTRY(splraise)
+ movl CPUVAR(ILEVEL),%eax
+ cmpl %edi,%eax
+ cmoval %eax,%edi
+ movl %edi,CPUVAR(ILEVEL)
+ ret
+END(splraise)
+
#ifndef XEN
/*
* Xsoftintr()
@@ -202,17 +213,6 @@ IDTVEC(resume_preempt)
IDTVEC_END(resume_preempt)
/*
- * int splraise(int s);
- */
-ENTRY(splraise)
- movl CPUVAR(ILEVEL),%eax
- cmpl %edi,%eax
- cmoval %eax,%edi
- movl %edi,CPUVAR(ILEVEL)
- ret
-END(splraise)
-
-/*
* void spllower(int s);
*
* Must be the same size as cx8_spllower(). This must use
Index: src/sys/arch/i386/i386/spl.S
diff -u src/sys/arch/i386/i386/spl.S:1.45 src/sys/arch/i386/i386/spl.S:1.46
--- src/sys/arch/i386/i386/spl.S:1.45 Tue Dec 25 09:00:26 2018
+++ src/sys/arch/i386/i386/spl.S Wed Dec 26 11:12:57 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: spl.S,v 1.45 2018/12/25 09:00:26 cherry Exp $ */
+/* $NetBSD: spl.S,v 1.46 2018/12/26 11:12:57 cherry Exp $ */
/*
* Copyright (c) 1998, 2007, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <machine/asm.h>
-__KERNEL_RCSID(0, "$NetBSD: spl.S,v 1.45 2018/12/25 09:00:26 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spl.S,v 1.46 2018/12/26 11:12:57 cherry Exp $");
#include "opt_ddb.h"
#include "opt_spldebug.h"
@@ -44,7 +44,6 @@ __KERNEL_RCSID(0, "$NetBSD: spl.S,v 1.45
.text
-#ifndef XEN
/*
* int splraise(int s);
*/
@@ -68,6 +67,8 @@ ENTRY(splraise)
ret
END(splraise)
+#ifndef XEN
+
/*
* void spllower(int s);
*
Index: src/sys/arch/xen/x86/xen_intr.c
diff -u src/sys/arch/xen/x86/xen_intr.c:1.12 src/sys/arch/xen/x86/xen_intr.c:1.13
--- src/sys/arch/xen/x86/xen_intr.c:1.12 Tue Dec 25 09:00:26 2018
+++ src/sys/arch/xen/x86/xen_intr.c Wed Dec 26 11:12:57 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: xen_intr.c,v 1.12 2018/12/25 09:00:26 cherry Exp $ */
+/* $NetBSD: xen_intr.c,v 1.13 2018/12/26 11:12:57 cherry Exp $ */
/*-
* Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xen_intr.c,v 1.12 2018/12/25 09:00:26 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_intr.c,v 1.13 2018/12/26 11:12:57 cherry Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -72,22 +72,6 @@ u_long xen_read_psl(void);
void xen_write_psl(u_long);
/*
- * Add a mask to cpl, and return the old value of cpl.
- */
-int
-splraise(int nlevel)
-{
- int olevel;
- struct cpu_info *ci = curcpu();
-
- olevel = ci->ci_ilevel;
- if (nlevel > olevel)
- ci->ci_ilevel = nlevel;
- __insn_barrier();
- return (olevel);
-}
-
-/*
* Restore a value to cpl (unmasking interrupts). If any unmasked
* interrupts are pending, call Xspllower() to process them.
*/