Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm Make _splraise/_spllower/splx functions availab...



details:   https://anonhg.NetBSD.org/src/rev/7340e194006f
branches:  trunk
changeset: 1023661:7340e194006f
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Mon Sep 20 21:05:14 2021 +0000

description:
Make _splraise/_spllower/splx functions available to modules again.

diffstat:

 sys/arch/arm/cortex/gic_splfuncs.c |  10 +++---
 sys/arch/arm/fdt/fdt_intr.h        |   6 +++-
 sys/arch/arm/pic/pic_splfuncs.c    |  48 ++++++++++++++++++++++++++++++++++---
 sys/arch/arm/pic/picvar.h          |   8 +++---
 4 files changed, 57 insertions(+), 15 deletions(-)

diffs (145 lines):

diff -r 940e111cb8b2 -r 7340e194006f sys/arch/arm/cortex/gic_splfuncs.c
--- a/sys/arch/arm/cortex/gic_splfuncs.c        Mon Sep 20 14:30:05 2021 +0000
+++ b/sys/arch/arm/cortex/gic_splfuncs.c        Mon Sep 20 21:05:14 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gic_splfuncs.c,v 1.2 2021/09/18 12:25:07 jmcneill Exp $ */
+/* $NetBSD: gic_splfuncs.c,v 1.3 2021/09/20 21:05:14 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2021 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gic_splfuncs.c,v 1.2 2021/09/18 12:25:07 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gic_splfuncs.c,v 1.3 2021/09/20 21:05:14 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -127,7 +127,7 @@
 void
 gic_spl_init(void)
 {
-       _splraise = gic_splraise;
-       _spllower = gic_spllower;
-       splx = gic_splx;
+       pic_splraise = gic_splraise;
+       pic_spllower = gic_spllower;
+       pic_splx = gic_splx;
 }
diff -r 940e111cb8b2 -r 7340e194006f sys/arch/arm/fdt/fdt_intr.h
--- a/sys/arch/arm/fdt/fdt_intr.h       Mon Sep 20 14:30:05 2021 +0000
+++ b/sys/arch/arm/fdt/fdt_intr.h       Mon Sep 20 21:05:14 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_intr.h,v 1.6 2021/08/30 23:20:00 jmcneill Exp $ */
+/* $NetBSD: fdt_intr.h,v 1.7 2021/09/20 21:05:15 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -40,6 +40,10 @@
 #define        PIC_MAXSOURCES          8192
 #define        PIC_MAXMAXSOURCES       (PIC_MAXSOURCES * 2 + 32)
 
+#define        _splraise       pic_splraise
+#define        _spllower       pic_spllower
+#define        splx            pic_splx
+
 void   arm_fdt_irq_set_handler(void (*)(void *));
 void   arm_fdt_irq_handler(void *);
 void   arm_fdt_fiq_set_handler(void (*)(void *));
diff -r 940e111cb8b2 -r 7340e194006f sys/arch/arm/pic/pic_splfuncs.c
--- a/sys/arch/arm/pic/pic_splfuncs.c   Mon Sep 20 14:30:05 2021 +0000
+++ b/sys/arch/arm/pic/pic_splfuncs.c   Mon Sep 20 21:05:14 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pic_splfuncs.c,v 1.21 2021/08/10 15:31:55 jmcneill Exp $       */
+/*     $NetBSD: pic_splfuncs.c,v 1.22 2021/09/20 21:05:15 jmcneill Exp $       */
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -27,8 +27,11 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  */
+
+#include "opt_modular.h"
+
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pic_splfuncs.c,v 1.21 2021/08/10 15:31:55 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pic_splfuncs.c,v 1.22 2021/09/20 21:05:15 jmcneill Exp $");
 
 #define _INTR_PRIVATE
 #include <sys/param.h>
@@ -50,9 +53,9 @@
 static int     pic_default_spllower(int);
 static void    pic_default_splx(int);
 
-int (*_splraise)(int) = pic_default_splraise;
-int (*_spllower)(int) = pic_default_spllower;
-void (*splx)(int) = pic_default_splx;
+int (*pic_splraise)(int) = pic_default_splraise;
+int (*pic_spllower)(int) = pic_default_spllower;
+void (*pic_splx)(int) = pic_default_splx;
 
 static int
 pic_default_splraise(int newipl)
@@ -109,3 +112,38 @@
        KASSERTMSG(ci->ci_cpl == savedipl, "cpl %d savedipl %d",
            ci->ci_cpl, savedipl);
 }
+
+#ifdef MODULAR
+#ifdef _spllower
+#undef _spllower
+#endif
+int _spllower(int);
+
+#ifdef _splraise
+#undef _splraise
+#endif
+int _splraise(int);
+
+#ifdef splx
+#undef splx
+#endif
+void splx(int);
+
+int
+_spllower(int newipl)
+{
+       return pic_spllower(newipl);
+}
+
+int
+_splraise(int newipl)
+{
+       return pic_splraise(newipl);
+}
+
+void
+splx(int savedipl)
+{
+       pic_splx(savedipl);
+}
+#endif /* !MODULAR */
diff -r 940e111cb8b2 -r 7340e194006f sys/arch/arm/pic/picvar.h
--- a/sys/arch/arm/pic/picvar.h Mon Sep 20 14:30:05 2021 +0000
+++ b/sys/arch/arm/pic/picvar.h Mon Sep 20 21:05:14 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: picvar.h,v 1.35 2021/08/10 15:31:55 jmcneill Exp $     */
+/*     $NetBSD: picvar.h,v 1.36 2021/09/20 21:05:15 jmcneill Exp $     */
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -40,9 +40,9 @@
 
 typedef uint32_t       intr_handle_t;          /* for ACPI */
 
-extern int     (*_splraise)(int);
-extern int     (*_spllower)(int);
-extern void    (*splx)(int);
+extern int     (*pic_splraise)(int);
+extern int     (*pic_spllower)(int);
+extern void    (*pic_splx)(int);
 
 const char *
        intr_typename(int);



Home | Main Index | Thread Index | Old Index