Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm Add __HAVE_PIC_HAVE_PENDING_INTRS and define it...



details:   https://anonhg.NetBSD.org/src/rev/d2b60ecd1e82
branches:  trunk
changeset: 337272:d2b60ecd1e82
user:      matt <matt%NetBSD.org@localhost>
date:      Wed Apr 08 21:43:30 2015 +0000

description:
Add __HAVE_PIC_HAVE_PENDING_INTRS and define it if __HAVE_PIC_SET_PRIORITY
is undefined (also define in mvsoc_intr.h since their use of the latter is
peculiar).  This new define controls whether the pending interrupt logic is
compiled.  The GIC doesn't use pending interrupts since it uses the priority
level on the GIC to control delivery of interrupts, thus there can never
be a pending interrupt.  The kernel shrinks about 4KB with the removal of
the pending interupt support,

diffstat:

 sys/arch/arm/marvell/mvsoc_intr.h |   3 ++-
 sys/arch/arm/pic/pic.c            |  18 +++++++++++++-----
 sys/arch/arm/pic/picvar.h         |   8 +++++++-
 3 files changed, 22 insertions(+), 7 deletions(-)

diffs (137 lines):

diff -r 6e0ba602ea2e -r d2b60ecd1e82 sys/arch/arm/marvell/mvsoc_intr.h
--- a/sys/arch/arm/marvell/mvsoc_intr.h Wed Apr 08 20:42:09 2015 +0000
+++ b/sys/arch/arm/marvell/mvsoc_intr.h Wed Apr 08 21:43:30 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mvsoc_intr.h,v 1.4 2014/03/18 06:46:14 matt Exp $      */
+/*     $NetBSD: mvsoc_intr.h,v 1.5 2015/04/08 21:43:30 matt Exp $      */
 /*
  * Copyright (c) 2010 KIYOHARA Takashi
  * All rights reserved.
@@ -33,6 +33,7 @@
 
 #if defined(ARMADAXP)
 #define __HAVE_PIC_SET_PRIORITY
+#define __HAVE_PIC_PENDING_INTRS
 #endif
 #endif
 
diff -r 6e0ba602ea2e -r d2b60ecd1e82 sys/arch/arm/pic/pic.c
--- a/sys/arch/arm/pic/pic.c    Wed Apr 08 20:42:09 2015 +0000
+++ b/sys/arch/arm/pic/pic.c    Wed Apr 08 21:43:30 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pic.c,v 1.27 2015/04/08 18:10:08 matt Exp $    */
+/*     $NetBSD: pic.c,v 1.28 2015/04/08 21:43:30 matt Exp $    */
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -33,7 +33,7 @@
 #include "opt_multiprocessor.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pic.c,v 1.27 2015/04/08 18:10:08 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pic.c,v 1.28 2015/04/08 21:43:30 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -60,6 +60,7 @@
 
 #include <arm/pic/picvar.h>
 
+#if defined(__HAVE_PIC_PENDING_INTRS)
 static uint32_t
        pic_find_pending_irqs_by_ipl(struct pic_softc *, size_t, uint32_t, int);
 static struct pic_softc *
@@ -68,14 +69,15 @@
        pic_deliver_irqs(struct pic_softc *, int, void *);
 static void
        pic_list_deliver_irqs(register_t, int, void *);
+volatile uint32_t pic_blocked_pics;
+volatile uint32_t pic_pending_pics;
+volatile uint32_t pic_pending_ipls;
+#endif /* __HAVE_PIC_PENDING_INTRS */
 
 struct pic_softc *pic_list[PIC_MAXPICS];
 #if PIC_MAXPICS > 32
 #error PIC_MAXPICS > 32 not supported
 #endif
-volatile uint32_t pic_blocked_pics;
-volatile uint32_t pic_pending_pics;
-volatile uint32_t pic_pending_ipls;
 struct intrsource *pic_sources[PIC_MAXMAXSOURCES];
 struct intrsource *pic__iplsources[PIC_MAXMAXSOURCES];
 struct intrsource **pic_iplsource[NIPL] = {
@@ -196,6 +198,7 @@
        return rv > 0;
 }
 
+#if defined(__HAVE_PIC_PENDING_INTRS)
 void
 pic_mark_pending_source(struct pic_softc *pic, struct intrsource *is)
 {
@@ -283,6 +286,7 @@
                pending &= ~irq_mask;
        }
 }
+#endif /* __HAVE_PIC_PENDING_INTRS */
 
 void
 pic_dispatch(struct intrsource *is, void *frame)
@@ -318,6 +322,7 @@
        percpu_putref(is->is_pic->pic_percpu);
 }
 
+#if defined(__HAVE_PIC_PENDING_INTRS)
 void
 pic_deliver_irqs(struct pic_softc *pic, int ipl, void *frame)
 {
@@ -483,6 +488,7 @@
        }
        atomic_and_32(&pic_pending_ipls, ~ipl_mask);
 }
+#endif /* __HAVE_PIC_PENDING_INTRS */
 
 void
 pic_do_pending_ints(register_t psw, int newipl, void *frame)
@@ -492,6 +498,7 @@
                KASSERTMSG(ci->ci_cpl == IPL_HIGH, "cpl %d", ci->ci_cpl);
                return;
        }
+#if defined(__HAVE_PIC_PENDING_INTRS)
        while ((pic_pending_ipls & ~__BIT(newipl)) > __BIT(newipl)) {
                KASSERT(pic_pending_ipls < __BIT(NIPL));
                for (;;) {
@@ -505,6 +512,7 @@
                        pic_list_unblock_irqs();
                }
        }
+#endif /* __HAVE_PIC_PENDING_INTRS */
 #ifdef __HAVE_PREEEMPTION
        if (newipl == IPL_NONE && (ci->ci_astpending & __BIT(1))) {
                pic_set_priority(ci, IPL_SCHED);
diff -r 6e0ba602ea2e -r d2b60ecd1e82 sys/arch/arm/pic/picvar.h
--- a/sys/arch/arm/pic/picvar.h Wed Apr 08 20:42:09 2015 +0000
+++ b/sys/arch/arm/pic/picvar.h Wed Apr 08 21:43:30 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: picvar.h,v 1.11 2014/10/29 14:14:14 skrll Exp $        */
+/*     $NetBSD: picvar.h,v 1.12 2015/04/08 21:43:30 matt Exp $ */
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -59,11 +59,17 @@
 #define        NIPI                    6
 #endif
 
+#if !defined(__HAVE_PIC_SET_PRIORITY)
+#define __HAVE_PIC_PENDING_INTRS
+#endif
+
 int    pic_handle_intr(void *);
+#if defined(__HAVE_PIC_PENDING_INTRS)
 void   pic_mark_pending(struct pic_softc *pic, int irq);
 void   pic_mark_pending_source(struct pic_softc *pic, struct intrsource *is);
 uint32_t pic_mark_pending_sources(struct pic_softc *pic, size_t irq_base,
            uint32_t pending);
+#endif /* __HAVE_PIC_PENDING_INTRS */
 void   *pic_establish_intr(struct pic_softc *pic, int irq, int ipl, int type,
            int (*func)(void *), void *arg);
 int    pic_alloc_irq(struct pic_softc *pic);



Home | Main Index | Thread Index | Old Index