Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/pic arm: pic: allow overriding _splraise/_spllo...



details:   https://anonhg.NetBSD.org/src/rev/8ff2b0ffca3f
branches:  trunk
changeset: 1022868:8ff2b0ffca3f
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Tue Aug 10 15:31:55 2021 +0000

description:
arm: pic: allow overriding _splraise/_spllower/splx

diffstat:

 sys/arch/arm/pic/pic_splfuncs.c |  24 ++++++++++++++++--------
 sys/arch/arm/pic/picvar.h       |   9 +++++----
 2 files changed, 21 insertions(+), 12 deletions(-)

diffs (83 lines):

diff -r 65c5db709aa5 -r 8ff2b0ffca3f sys/arch/arm/pic/pic_splfuncs.c
--- a/sys/arch/arm/pic/pic_splfuncs.c   Tue Aug 10 15:31:38 2021 +0000
+++ b/sys/arch/arm/pic/pic_splfuncs.c   Tue Aug 10 15:31:55 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pic_splfuncs.c,v 1.20 2021/03/27 12:15:09 jmcneill Exp $       */
+/*     $NetBSD: pic_splfuncs.c,v 1.21 2021/08/10 15:31:55 jmcneill Exp $       */
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -28,7 +28,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pic_splfuncs.c,v 1.20 2021/03/27 12:15:09 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pic_splfuncs.c,v 1.21 2021/08/10 15:31:55 jmcneill Exp $");
 
 #define _INTR_PRIVATE
 #include <sys/param.h>
@@ -46,9 +46,16 @@
 
 #include <arm/pic/picvar.h>
 
+static int     pic_default_splraise(int);
+static int     pic_default_spllower(int);
+static void    pic_default_splx(int);
 
-int
-_splraise(int newipl)
+int (*_splraise)(int) = pic_default_splraise;
+int (*_spllower)(int) = pic_default_spllower;
+void (*splx)(int) = pic_default_splx;
+
+static int
+pic_default_splraise(int newipl)
 {
        struct cpu_info * const ci = curcpu();
        const int oldipl = ci->ci_cpl;
@@ -58,8 +65,9 @@
        }
        return oldipl;
 }
-int
-_spllower(int newipl)
+
+static int
+pic_default_spllower(int newipl)
 {
        struct cpu_info * const ci = curcpu();
        const int oldipl = ci->ci_cpl;
@@ -76,8 +84,8 @@
        return oldipl;
 }
 
-void
-splx(int savedipl)
+static void
+pic_default_splx(int savedipl)
 {
        struct cpu_info * const ci = curcpu();
        KASSERT(savedipl < NIPL);
diff -r 65c5db709aa5 -r 8ff2b0ffca3f sys/arch/arm/pic/picvar.h
--- a/sys/arch/arm/pic/picvar.h Tue Aug 10 15:31:38 2021 +0000
+++ b/sys/arch/arm/pic/picvar.h Tue Aug 10 15:31:55 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: picvar.h,v 1.34 2021/03/27 12:15:09 jmcneill Exp $     */
+/*     $NetBSD: picvar.h,v 1.35 2021/08/10 15:31:55 jmcneill Exp $     */
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -40,9 +40,10 @@
 
 typedef uint32_t       intr_handle_t;          /* for ACPI */
 
-int    _splraise(int);
-int    _spllower(int);
-void   splx(int);
+extern int     (*_splraise)(int);
+extern int     (*_spllower)(int);
+extern void    (*splx)(int);
+
 const char *
        intr_typename(int);
 



Home | Main Index | Thread Index | Old Index