2008-06-06 Joel Sherrill <joel.sherrill@oarcorp.com>

* include/bsp.h, irq/irq.c, irq/irq_init.c, startup/bspclean.c,
	startup/bspstart.c: Slightly better names for IRQ benchmarking. Make
	sure the routines are present all the time.
This commit is contained in:
Joel Sherrill
2008-06-06 21:43:02 +00:00
parent e5b6bf463b
commit 6826a4c567
6 changed files with 80 additions and 59 deletions

View File

@@ -1,3 +1,9 @@
2008-06-06 Joel Sherrill <joel.sherrill@oarcorp.com>
* include/bsp.h, irq/irq.c, irq/irq_init.c, startup/bspclean.c,
startup/bspstart.c: Slightly better names for IRQ benchmarking. Make
sure the routines are present all the time.
2008-05-22 Joel Sherrill <joel.sherrill@oarcorp.com> 2008-05-22 Joel Sherrill <joel.sherrill@oarcorp.com>
* console/console.c: Remove explicit switch and call * console/console.c: Remove explicit switch and call

View File

@@ -258,6 +258,9 @@ void bsp_cleanup(void);
Thread _Thread_Idle_body(uint32_t ignored); Thread _Thread_Idle_body(uint32_t ignored);
#define BSP_IDLE_TASK_BODY _Thread_Idle_body #define BSP_IDLE_TASK_BODY _Thread_Idle_body
/* BSP specific IRQ Benchmarking support */
void BSP_IRQ_Benchmarking_Reset(void);
void BSP_IRQ_Benchmarking_Report(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@@ -631,7 +631,14 @@ int BSP_rtems_irq_mngt_get(rtems_irq_global_settings** config)
return 0; return 0;
} }
#if (BENCHMARK_IRQ_PROCESSING == 1) #if (BENCHMARK_IRQ_PROCESSING == 0)
void BSP_IRQ_Benchmarking_Reset(void)
{
}
void BSP_IRQ_Benchmarking_Report(void)
{
}
#else
#include <stdio.h> #include <stdio.h>
uint64_t BSP_Starting_TBR; uint64_t BSP_Starting_TBR;
uint64_t BSP_Total_in_ISR; uint64_t BSP_Total_in_ISR;
@@ -640,7 +647,7 @@ uint32_t BSP_Worst_ISR;
#define BSP_COUNTED_IRQ 16 #define BSP_COUNTED_IRQ 16
uint32_t BSP_ISR_Count_Per[BSP_COUNTED_IRQ + 1]; uint32_t BSP_ISR_Count_Per[BSP_COUNTED_IRQ + 1];
void BSP_initialize_IRQ_Timing(void) void BSP_IRQ_Benchmarking_Reset(void)
{ {
int i; int i;
BSP_Starting_TBR = PPC_Get_timebase_register(); BSP_Starting_TBR = PPC_Get_timebase_register();
@@ -659,7 +666,8 @@ static const char * u64tostring(
sprintf( buffer, "%lld %lld usecs", v, (v / 33) ); sprintf( buffer, "%lld %lld usecs", v, (v / 33) );
return buffer; return buffer;
} }
void BSP_report_IRQ_Timing(void)
void BSP_IRQ_Benchmarking_Report(void)
{ {
uint64_t now; uint64_t now;
char buffer[96]; char buffer[96];

View File

@@ -231,16 +231,22 @@ void BSP_rtems_irq_mng_init(unsigned cpuId)
{ {
rtems_raw_except_connect_data vectorDesc; rtems_raw_except_connect_data vectorDesc;
int i; int i;
#if (BENCHMARK_IRQ_PROCESSING == 1)
extern void BSP_initialize_IRQ_Timing(void);
void BSP_initialize_IRQ_Timing(void);
#endif
BSP_SIU_irq_init(); BSP_SIU_irq_init();
/* /*
* Initialize Rtems management interrupt table * Initialize Rtems management interrupt table
*/ */
/* /*
* re-init the rtemsIrq table * re-init the rtemsIrq table
*/ */
for (i = 0; i < BSP_IRQ_NUMBER; i++) for (i = 0; i < BSP_IRQ_NUMBER; i++) {
{
rtemsIrq[i] = defaultIrq; rtemsIrq[i] = defaultIrq;
rtemsIrq[i].name = i; rtemsIrq[i].name = i;
} }
@@ -253,12 +259,13 @@ void BSP_rtems_irq_mng_init(unsigned cpuId)
initial_config.irqBase = BSP_LOWEST_OFFSET; initial_config.irqBase = BSP_LOWEST_OFFSET;
initial_config.irqPrioTbl = irqPrioTable; initial_config.irqPrioTbl = irqPrioTable;
if (!BSP_rtems_irq_mngt_set(&initial_config)) if (!BSP_rtems_irq_mngt_set(&initial_config)) {
{
/* /*
* put something here that will show the failure... * put something here that will show the failure...
*/ */
BSP_panic("Unable to initialize RTEMS interrupt Management!!! System locked\n"); BSP_panic(
"Unable to initialize RTEMS interrupt Management!!! System locked\n"
);
} }
/* /*
@@ -273,8 +280,7 @@ void BSP_rtems_irq_mng_init(unsigned cpuId)
vectorDesc.off = nop_func; vectorDesc.off = nop_func;
vectorDesc.isOn = connected; vectorDesc.isOn = connected;
if (!ppc_set_exception (&vectorDesc)) if (!ppc_set_exception (&vectorDesc)) {
{
BSP_panic("Unable to initialize RTEMS decrementer raw exception\n"); BSP_panic("Unable to initialize RTEMS decrementer raw exception\n");
} }
@@ -283,8 +289,7 @@ void BSP_rtems_irq_mng_init(unsigned cpuId)
vectorDesc.hdl.raw_hdl = external_exception_vector_prolog_code; vectorDesc.hdl.raw_hdl = external_exception_vector_prolog_code;
vectorDesc.hdl.raw_hdl_size = (unsigned) &external_exception_vector_prolog_code_size; vectorDesc.hdl.raw_hdl_size = (unsigned) &external_exception_vector_prolog_code_size;
if (!ppc_set_exception (&vectorDesc)) if (!ppc_set_exception (&vectorDesc)) {
{
BSP_panic("Unable to initialize RTEMS external raw exception\n"); BSP_panic("Unable to initialize RTEMS external raw exception\n");
} }
@@ -293,10 +298,8 @@ void BSP_rtems_irq_mng_init(unsigned cpuId)
vectorDesc.hdl.raw_hdl = system_management_exception_vector_prolog_code; vectorDesc.hdl.raw_hdl = system_management_exception_vector_prolog_code;
vectorDesc.hdl.raw_hdl_size = (unsigned) &system_management_exception_vector_prolog_code_size; vectorDesc.hdl.raw_hdl_size = (unsigned) &system_management_exception_vector_prolog_code_size;
if (!ppc_set_exception (&vectorDesc)) if (!ppc_set_exception (&vectorDesc)) {
{
BSP_panic("Unable to initialize RTEMS system management raw exception\n"); BSP_panic("Unable to initialize RTEMS system management raw exception\n");
} }
} }

View File

@@ -23,8 +23,7 @@ void bsp_cleanup( void )
#if (BENCHMARK_IRQ_PROCESSING == 1) #if (BENCHMARK_IRQ_PROCESSING == 1)
{ {
extern void BSP_report_IRQ_Timing(void); BSP_IRQ_Benchmarking_Report();
BSP_report_IRQ_Timing();
} }
#endif #endif

View File

@@ -224,23 +224,24 @@ void bsp_start(void)
register unsigned char* intrStack; register unsigned char* intrStack;
/* /*
* Get CPU identification dynamically. Note that the get_ppc_cpu_type() function * Get CPU identification dynamically. Note that the get_ppc_cpu_type()
* store the result in global variables so that it can be used latter... * function store the result in global variables so that it can be used
* later...
*/ */
myCpu = get_ppc_cpu_type(); myCpu = get_ppc_cpu_type();
myCpuRevision = get_ppc_cpu_revision(); myCpuRevision = get_ppc_cpu_revision();
#if defined(HAS_UBOOT) #if defined(HAS_UBOOT)
uboot_bdinfo_copy = *uboot_bdinfo_ptr; uboot_bdinfo_copy = *uboot_bdinfo_ptr;
uboot_bdinfo_ptr = &uboot_bdinfo_copy; uboot_bdinfo_ptr = &uboot_bdinfo_copy;
#endif #endif
#if defined(HAS_UBOOT) && defined(SHOW_MORE_INIT_SETTINGS) #if defined(HAS_UBOOT) && defined(SHOW_MORE_INIT_SETTINGS)
{ {
void dumpUBootBDInfo( bd_t * ); void dumpUBootBDInfo( bd_t * );
dumpUBootBDInfo( uboot_bdinfo_ptr ); dumpUBootBDInfo( uboot_bdinfo_ptr );
} }
#endif #endif
cpu_init(); cpu_init();
@@ -266,12 +267,12 @@ void bsp_start(void)
/* /*
* Enable instruction and data caches. Do not force writethrough mode. * Enable instruction and data caches. Do not force writethrough mode.
*/ */
#if INSTRUCTION_CACHE_ENABLE #if INSTRUCTION_CACHE_ENABLE
rtems_cache_enable_instruction(); rtems_cache_enable_instruction();
#endif #endif
#if DATA_CACHE_ENABLE #if DATA_CACHE_ENABLE
rtems_cache_enable_data(); rtems_cache_enable_data();
#endif #endif
/* /*
* Need to "allocate" the memory for the RTEMS Workspace and * Need to "allocate" the memory for the RTEMS Workspace and
@@ -279,28 +280,29 @@ void bsp_start(void)
* not malloc'ed. It is just "pulled from the air". * not malloc'ed. It is just "pulled from the air".
*/ */
Configuration.work_space_start = (void *)&_WorkspaceBase; Configuration.work_space_start = (void *)&_WorkspaceBase;
#ifdef SHOW_MORE_INIT_SETTINGS #ifdef SHOW_MORE_INIT_SETTINGS
printk( "workspace=%p\n", Configuration.work_space_start ); printk( "workspace=%p\n", Configuration.work_space_start );
printk( "workspace size=%d\n", Configuration.work_space_size ); printk( "workspace size=%d\n", Configuration.work_space_size );
#endif #endif
/* /*
* Initalize RTEMS IRQ system * Initalize RTEMS IRQ system
*/ */
BSP_rtems_irq_mng_init(0); BSP_rtems_irq_mng_init(0);
#if (BENCHMARK_IRQ_PROCESSING == 1) /*
{ * If the BSP was built with IRQ benchmarking enabled,
void BSP_initialize_IRQ_Timing(void); * then intialize it.
BSP_initialize_IRQ_Timing(); */
} #if (BENCHMARK_IRQ_PROCESSING == 1)
#endif BSP_IRQ_Benchmarking_Reset();
#endif
#ifdef SHOW_MORE_INIT_SETTINGS #ifdef SHOW_MORE_INIT_SETTINGS
printk("Exit from bspstart\n"); printk("Exit from bspstart\n");
#endif #endif
} }
/* /*
* *