summaryrefslogtreecommitdiffstats
path: root/c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-01-11 18:25:35 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-01-11 18:25:35 +0000
commiteabd9f06e73034771d77bb9e8fc7096ce82fd0f5 (patch)
treec322b512f8ec4bb26d862818cc52f71d1ff61aee /c
parentAdd http://www.rtems.info, http://www.rtems.org/ftp. (diff)
downloadrtems-eabd9f06e73034771d77bb9e8fc7096ce82fd0f5.tar.bz2
2008-01-11 Joel Sherrill <joel.sherrill@oarcorp.com>
* configure.ac, irq/irq.c, startup/bspclean.c, startup/bspstart.c: Add ALLOW_IRQ_NESTING option. The MPC5200 has a settle time after acknowledging the IRQs and currently the BSP does not account for that. After acknowledging an interrupt, it currently gets a second spurious IRQ a significant percentage of the time. Rename to BENCHMARK_IRQ_PROCESSING and get it working again. Under one test load, not nesting interrupts resulted in a 50% reduction in the number of IRQs and an ~30% reduction in time spent in IRQs.
Diffstat (limited to 'c')
-rw-r--r--c/src/lib/libbsp/powerpc/gen5200/ChangeLog11
-rw-r--r--c/src/lib/libbsp/powerpc/gen5200/configure.ac8
-rw-r--r--c/src/lib/libbsp/powerpc/gen5200/irq/irq.c31
-rw-r--r--c/src/lib/libbsp/powerpc/gen5200/startup/bspclean.c2
-rw-r--r--c/src/lib/libbsp/powerpc/gen5200/startup/bspstart.c10
5 files changed, 53 insertions, 9 deletions
diff --git a/c/src/lib/libbsp/powerpc/gen5200/ChangeLog b/c/src/lib/libbsp/powerpc/gen5200/ChangeLog
index 3bf4777e2e..d872e60041 100644
--- a/c/src/lib/libbsp/powerpc/gen5200/ChangeLog
+++ b/c/src/lib/libbsp/powerpc/gen5200/ChangeLog
@@ -1,3 +1,14 @@
+2008-01-11 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * configure.ac, irq/irq.c, startup/bspclean.c, startup/bspstart.c: Add
+ ALLOW_IRQ_NESTING option. The MPC5200 has a settle time after
+ acknowledging the IRQs and currently the BSP does not account for
+ that. After acknowledging an interrupt, it currently gets a second
+ spurious IRQ a significant percentage of the time. Rename to
+ BENCHMARK_IRQ_PROCESSING and get it working again. Under one test
+ load, not nesting interrupts resulted in a 50% reduction in the
+ number of IRQs and an ~30% reduction in time spent in IRQs.
+
2007-12-18 Joel Sherrill <joel.sherrill@OARcorp.com>
* startup/linkcmds: Spacing.
diff --git a/c/src/lib/libbsp/powerpc/gen5200/configure.ac b/c/src/lib/libbsp/powerpc/gen5200/configure.ac
index 1932321d47..f9bc5b3709 100644
--- a/c/src/lib/libbsp/powerpc/gen5200/configure.ac
+++ b/c/src/lib/libbsp/powerpc/gen5200/configure.ac
@@ -25,6 +25,14 @@ RTEMS_BSPOPTS_HELP([INSTRUCTION_CACHE_ENABLE],
[If defined, the instruction cache will be enabled after address translation
is turned on.])
+RTEMS_BSPOPTS_SET([BENCHMARK_IRQ_PROCESSING],[*],[0])
+RTEMS_BSPOPTS_HELP([BENCHMARK_IRQ_PROCESSING],
+[If defined, enable code to benchmark IRQ processing.])
+
+RTEMS_BSPOPTS_SET([ALLOW_IRQ_NESTING],[*],[1])
+RTEMS_BSPOPTS_HELP([ALLOW_IRQ_NESTING],
+[If defined, allow nested IRQ processing.])
+
RTEMS_CHECK_NETWORKING
AM_CONDITIONAL(HAS_NETWORKING,test "$HAS_NETWORKING" = "yes")
diff --git a/c/src/lib/libbsp/powerpc/gen5200/irq/irq.c b/c/src/lib/libbsp/powerpc/gen5200/irq/irq.c
index 9b3670fd21..e28de41ce0 100644
--- a/c/src/lib/libbsp/powerpc/gen5200/irq/irq.c
+++ b/c/src/lib/libbsp/powerpc/gen5200/irq/irq.c
@@ -631,7 +631,7 @@ int BSP_rtems_irq_mngt_get(rtems_irq_global_settings** config)
return 0;
}
-#if defined(TIME_IRQs)
+#if (BENCHMARK_IRQ_PROCESSING == 1)
#include <stdio.h>
uint64_t BSP_Starting_TBR;
uint64_t BSP_Total_in_ISR;
@@ -688,7 +688,7 @@ int C_dispatch_irq_handler (CPU_Interrupt_frame *frame, unsigned int excNum)
register unsigned int new_msr;
register unsigned int pmce;
register unsigned int crit_pri_main_mask, per_mask;
-#if defined(TIME_IRQs)
+#if (BENCHMARK_IRQ_PROCESSING == 1)
uint64_t start, stop, thisTime;
start = PPC_Get_timebase_register();
@@ -759,18 +759,22 @@ int C_dispatch_irq_handler (CPU_Interrupt_frame *frame, unsigned int excNum)
crit_pri_main_mask = mpc5200.crit_pri_main_mask;
mpc5200.crit_pri_main_mask |= irqMaskTable[irq];
+#if (ALLOW_IRQ_NESTING == 1)
/* enable interrupt nesting */
_CPU_MSR_GET(msr);
new_msr = msr | MSR_EE;
_CPU_MSR_SET(new_msr);
+#endif
/* call the module specific handler and pass the
* specific handler
*/
rtems_hdl_tbl[irq].hdl(0);
+#if (ALLOW_IRQ_NESTING == 1)
/* disable interrupt nesting */
_CPU_MSR_SET(msr);
+#endif
/* restore original interrupt mask */
mpc5200.crit_pri_main_mask = crit_pri_main_mask;
@@ -796,18 +800,22 @@ int C_dispatch_irq_handler (CPU_Interrupt_frame *frame, unsigned int excNum)
per_mask = mpc5200.per_mask;
mpc5200.per_mask |= irqMaskTable[irq];
+#if (ALLOW_IRQ_NESTING == 1)
/* enable interrupt nesting */
_CPU_MSR_GET(msr);
new_msr = msr | MSR_EE;
_CPU_MSR_SET(new_msr);
+#endif
/* call the module specific handler and pass
* the specific handler
*/
rtems_hdl_tbl[irq].hdl(0);
+#if (ALLOW_IRQ_NESTING == 1)
/* disable interrupt nesting */
_CPU_MSR_SET(msr);
+#endif
/* restore original interrupt mask */
mpc5200.per_mask = per_mask;
@@ -883,16 +891,20 @@ int C_dispatch_irq_handler (CPU_Interrupt_frame *frame, unsigned int excNum)
per_mask = mpc5200.per_mask;
mpc5200.per_mask |= irqMaskTable[irq];
+#if (ALLOW_IRQ_NESTING == 1)
/* enable interrupt nesting */
_CPU_MSR_GET(msr);
new_msr = msr | MSR_EE;
_CPU_MSR_SET(new_msr);
+#endif
/* call the module specific handler and pass the
* specific handler */
rtems_hdl_tbl[irq].hdl(rtems_hdl_tbl[irq].handle);
+#if (ALLOW_IRQ_NESTING == 1)
_CPU_MSR_SET(msr);
+#endif
/* restore original interrupt mask */
mpc5200.per_mask = per_mask;
@@ -948,17 +960,21 @@ int C_dispatch_irq_handler (CPU_Interrupt_frame *frame, unsigned int excNum)
crit_pri_main_mask = mpc5200.crit_pri_main_mask;
mpc5200.crit_pri_main_mask |= irqMaskTable[irq];
+#if (ALLOW_IRQ_NESTING == 1)
/* enable interrupt nesting */
_CPU_MSR_GET(msr);
new_msr = msr | MSR_EE;
_CPU_MSR_SET(new_msr);
+#endif
/* call the module specific handler and pass the specific
* handler */
rtems_hdl_tbl[irq].hdl(rtems_hdl_tbl[irq].handle);
+#if (ALLOW_IRQ_NESTING == 1)
/* disable interrupt nesting */
_CPU_MSR_SET(msr);
+#endif
/* restore original interrupt mask */
mpc5200.crit_pri_main_mask = crit_pri_main_mask;
@@ -980,17 +996,21 @@ int C_dispatch_irq_handler (CPU_Interrupt_frame *frame, unsigned int excNum)
per_mask = mpc5200.per_mask;
mpc5200.per_mask |= irqMaskTable[irq];
+#if (ALLOW_IRQ_NESTING == 1)
/* enable interrupt nesting */
_CPU_MSR_GET(msr);
new_msr = msr | MSR_EE;
_CPU_MSR_SET(new_msr);
+#endif
/* call the module specific handler and pass the
* specific handler */
rtems_hdl_tbl[irq].hdl(rtems_hdl_tbl[irq].handle);
+#if (ALLOW_IRQ_NESTING == 1)
/* disable interrupt nesting */
_CPU_MSR_SET(msr);
+#endif
/* restore original interrupt mask */
mpc5200.per_mask = per_mask;
@@ -1022,11 +1042,12 @@ int C_dispatch_irq_handler (CPU_Interrupt_frame *frame, unsigned int excNum)
break;
} /* end of switch(excNum) */
-#if defined(TIME_IRQs)
+#if (BENCHMARK_IRQ_PROCESSING == 1)
stop = PPC_Get_timebase_register();
thisTime = stop - start;
- if ( thisTime > BSP_Worst_ISR );
- thisTime = BSP_Worst_ISR;
+ BSP_Total_in_ISR += thisTime;
+ if ( thisTime > BSP_Worst_ISR )
+ BSP_Worst_ISR = thisTime;
#endif
return 0;
}
diff --git a/c/src/lib/libbsp/powerpc/gen5200/startup/bspclean.c b/c/src/lib/libbsp/powerpc/gen5200/startup/bspclean.c
index ee473977e8..b39214deef 100644
--- a/c/src/lib/libbsp/powerpc/gen5200/startup/bspclean.c
+++ b/c/src/lib/libbsp/powerpc/gen5200/startup/bspclean.c
@@ -21,7 +21,7 @@ extern int mpc5200_uart_pollRead(int minor);
void bsp_cleanup( void )
{
- #if defined(TIME_IRQs)
+ #if (BENCHMARK_IRQ_PROCESSING == 1)
{
extern void BSP_report_IRQ_Timing(void);
BSP_report_IRQ_Timing();
diff --git a/c/src/lib/libbsp/powerpc/gen5200/startup/bspstart.c b/c/src/lib/libbsp/powerpc/gen5200/startup/bspstart.c
index 59d62e32b9..67ef77ec7c 100644
--- a/c/src/lib/libbsp/powerpc/gen5200/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/gen5200/startup/bspstart.c
@@ -65,12 +65,12 @@
/* conditions. */
/* The mmu is unused at this time. */
/* */
-/* COPYRIGHT (c) 1989-2007.
+/* COPYRIGHT (c) 1989-2007. */
/* On-Line Applications Research Corporation (OAR). */
/* */
/* The license and distribution terms for this file may be */
/* found in found in the file LICENSE in this distribution or at */
-/* http://www.rtems.com/license/LICENSE. */
+/* http://www.rtems.com/license/LICENSE. */
/* */
/*---------------------------------------------------------------------*/
/* */
@@ -301,13 +301,17 @@ void bsp_start(void)
* not malloc'ed. It is just "pulled from the air".
*/
Configuration.work_space_start = (void *)&_WorkspaceBase;
+#ifdef SHOW_MORE_INIT_SETTINGS
+ printk( "workspace=%p\n", Configuration.work_space_start );
+ printk( "workspace size=%d\n", Configuration.work_space_size );
+#endif
/*
* Initalize RTEMS IRQ system
*/
BSP_rtems_irq_mng_init(0);
-#if defined(TIME_IRQs)
+#if (BENCHMARK_IRQ_PROCESSING == 1)
{
void BSP_initialize_IRQ_Timing(void);
BSP_initialize_IRQ_Timing();