Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch Xen can use the native splraise(9) functions.



details:   https://anonhg.NetBSD.org/src/rev/c09d53c7b399
branches:  trunk
changeset: 446949:c09d53c7b399
user:      cherry <cherry%NetBSD.org@localhost>
date:      Wed Dec 26 11:12:57 2018 +0000

description:
Xen can use the native splraise(9) functions.

There is no need for a slower C version.

diffstat:

 sys/arch/amd64/amd64/spl.S  |  24 ++++++++++++------------
 sys/arch/i386/i386/spl.S    |   7 ++++---
 sys/arch/xen/x86/xen_intr.c |  20 ++------------------
 3 files changed, 18 insertions(+), 33 deletions(-)

diffs (121 lines):

diff -r e3475ce2e924 -r c09d53c7b399 sys/arch/amd64/amd64/spl.S
--- a/sys/arch/amd64/amd64/spl.S        Wed Dec 26 10:24:20 2018 +0000
+++ b/sys/arch/amd64/amd64/spl.S        Wed Dec 26 11:12:57 2018 +0000
@@ -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_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
diff -r e3475ce2e924 -r c09d53c7b399 sys/arch/i386/i386/spl.S
--- a/sys/arch/i386/i386/spl.S  Wed Dec 26 10:24:20 2018 +0000
+++ b/sys/arch/i386/i386/spl.S  Wed Dec 26 11:12:57 2018 +0000
@@ -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 @@
 
        .text
 
-#ifndef XEN
 /*
  * int splraise(int s);
  */
@@ -68,6 +67,8 @@
        ret
 END(splraise)
 
+#ifndef XEN
+
 /*
  * void spllower(int s);
  *
diff -r e3475ce2e924 -r c09d53c7b399 sys/arch/xen/x86/xen_intr.c
--- a/sys/arch/xen/x86/xen_intr.c       Wed Dec 26 10:24:20 2018 +0000
+++ b/sys/arch/xen/x86/xen_intr.c       Wed Dec 26 11:12:57 2018 +0000
@@ -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 @@
 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.
  */



Home | Main Index | Thread Index | Old Index