Module Name:    src
Committed By:   matt
Date:           Wed Apr  8 21:43:30 UTC 2015

Modified Files:
        src/sys/arch/arm/marvell: mvsoc_intr.h
        src/sys/arch/arm/pic: pic.c picvar.h

Log Message:
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,


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/marvell/mvsoc_intr.h
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/arm/pic/pic.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/pic/picvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/marvell/mvsoc_intr.h
diff -u src/sys/arch/arm/marvell/mvsoc_intr.h:1.4 src/sys/arch/arm/marvell/mvsoc_intr.h:1.5
--- src/sys/arch/arm/marvell/mvsoc_intr.h:1.4	Tue Mar 18 06:46:14 2014
+++ src/sys/arch/arm/marvell/mvsoc_intr.h	Wed Apr  8 21:43:30 2015
@@ -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
 

Index: src/sys/arch/arm/pic/pic.c
diff -u src/sys/arch/arm/pic/pic.c:1.27 src/sys/arch/arm/pic/pic.c:1.28
--- src/sys/arch/arm/pic/pic.c:1.27	Wed Apr  8 18:10:08 2015
+++ src/sys/arch/arm/pic/pic.c	Wed Apr  8 21:43:30 2015
@@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: pic.c,v 1.27
 
 #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 @@ static void
 	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 @@ pic_handle_intr(void *arg)
 	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 @@ pic_find_pending_irqs_by_ipl(struct pic_
 		pending &= ~irq_mask;
 	}
 }
+#endif /* __HAVE_PIC_PENDING_INTRS */
 
 void
 pic_dispatch(struct intrsource *is, void *frame)
@@ -318,6 +322,7 @@ pic_dispatch(struct intrsource *is, void
 	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 @@ pic_list_deliver_irqs(register_t psw, in
 	}
 	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 @@ pic_do_pending_ints(register_t psw, int 
 		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_do_pending_ints(register_t psw, int 
 			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);

Index: src/sys/arch/arm/pic/picvar.h
diff -u src/sys/arch/arm/pic/picvar.h:1.11 src/sys/arch/arm/pic/picvar.h:1.12
--- src/sys/arch/arm/pic/picvar.h:1.11	Wed Oct 29 14:14:14 2014
+++ src/sys/arch/arm/pic/picvar.h	Wed Apr  8 21:43:30 2015
@@ -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 @@ struct cpu_info;
 #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);

Reply via email to