diff options
| author | jmcneill <jmcneill@NetBSD.org> | 2021-09-20 21:05:14 +0000 |
|---|---|---|
| committer | jmcneill <jmcneill@NetBSD.org> | 2021-09-20 21:05:14 +0000 |
| commit | ee50eaf2f34b614db08df49c2020d70eda2b352f (patch) | |
| tree | 83c43eb49e4e392e67d53370fd2ca835c103d1b3 | |
| parent | 565ede481ca13b39b95fcf854e7b12ed39497f48 (diff) | |
Make _splraise/_spllower/splx functions available to modules again.
| -rw-r--r-- | sys/arch/arm/cortex/gic_splfuncs.c | 10 | ||||
| -rw-r--r-- | sys/arch/arm/fdt/fdt_intr.h | 6 | ||||
| -rw-r--r-- | sys/arch/arm/pic/pic_splfuncs.c | 48 | ||||
| -rw-r--r-- | sys/arch/arm/pic/picvar.h | 8 |
4 files changed, 57 insertions, 15 deletions
diff --git a/sys/arch/arm/cortex/gic_splfuncs.c b/sys/arch/arm/cortex/gic_splfuncs.c index 23dcc6f9890..5f695e69822 100644 --- a/sys/arch/arm/cortex/gic_splfuncs.c +++ b/sys/arch/arm/cortex/gic_splfuncs.c @@ -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> @@ -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 @@ dosoft: 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 --git a/sys/arch/arm/fdt/fdt_intr.h b/sys/arch/arm/fdt/fdt_intr.h index d35ba1d8e07..41eea7b6dd4 100644 --- a/sys/arch/arm/fdt/fdt_intr.h +++ b/sys/arch/arm/fdt/fdt_intr.h @@ -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> @@ -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 --git a/sys/arch/arm/pic/pic_splfuncs.c b/sys/arch/arm/pic/pic_splfuncs.c index 0e7f81a2293..23e786b9949 100644 --- a/sys/arch/arm/pic/pic_splfuncs.c +++ b/sys/arch/arm/pic/pic_splfuncs.c @@ -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_splraise(int); 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 @@ pic_default_splx(int savedipl) 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 --git a/sys/arch/arm/pic/picvar.h b/sys/arch/arm/pic/picvar.h index e459c858c71..3326f417d19 100644 --- a/sys/arch/arm/pic/picvar.h +++ b/sys/arch/arm/pic/picvar.h @@ -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); |
