From a3ca595f1ab85c8b43bca39e29a74038de29958e Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 11 Dec 2007 15:50:04 +0000 Subject: 2007-12-11 Joel Sherrill * clock/clock.c, include/bsp.h, startup/bspstart.c: Eliminate copies of the Configuration Table. Use the RTEMS provided accessor macros to obtain configuration fields. --- c/src/lib/libbsp/c4x/c4xsim/ChangeLog | 6 ++++++ c/src/lib/libbsp/c4x/c4xsim/clock/clock.c | 4 ++-- c/src/lib/libbsp/c4x/c4xsim/include/bsp.h | 4 ---- c/src/lib/libbsp/c4x/c4xsim/startup/bspstart.c | 12 ++---------- 4 files changed, 10 insertions(+), 16 deletions(-) (limited to 'c/src/lib/libbsp/c4x') diff --git a/c/src/lib/libbsp/c4x/c4xsim/ChangeLog b/c/src/lib/libbsp/c4x/c4xsim/ChangeLog index 766dd1ec79..4fbaffbba2 100644 --- a/c/src/lib/libbsp/c4x/c4xsim/ChangeLog +++ b/c/src/lib/libbsp/c4x/c4xsim/ChangeLog @@ -1,3 +1,9 @@ +2007-12-11 Joel Sherrill + + * clock/clock.c, include/bsp.h, startup/bspstart.c: Eliminate copies of + the Configuration Table. Use the RTEMS provided accessor macros to + obtain configuration fields. + 2007-12-04 Joel Sherrill * include/bsp.h, startup/bspstart.c: Move interrupt_stack_size field diff --git a/c/src/lib/libbsp/c4x/c4xsim/clock/clock.c b/c/src/lib/libbsp/c4x/c4xsim/clock/clock.c index ae6770c358..c181061012 100644 --- a/c/src/lib/libbsp/c4x/c4xsim/clock/clock.c +++ b/c/src/lib/libbsp/c4x/c4xsim/clock/clock.c @@ -36,12 +36,12 @@ void Clock_driver_support_initialize_hardware() tmpi = ((int) &_ClockFrequency) * 1000000; /* ClockFrequency is in Mhz */ tmp = (float) tmpi / 2.0; - tmp = ((float) BSP_Configuration.microseconds_per_tick / 1000000.0) * (tmp); + tmp = ((float) rtems_configuration_get_microseconds_per_tick() / 1000000.0) * (tmp); Clock_counter_register_value = (unsigned int) tmp; #if 0 Clock_counter_register_value = - (uint32_t) ((float) BSP_Configuration.microseconds_per_tick / + (uint32_t) ((float) rtems_configuration_get_microseconds_per_tick() / ((float)_ClockFrequency / 2.0))); #endif c4x_timer_stop( C4X_TIMER_0 ); diff --git a/c/src/lib/libbsp/c4x/c4xsim/include/bsp.h b/c/src/lib/libbsp/c4x/c4xsim/include/bsp.h index eb27804579..9b0d162255 100644 --- a/c/src/lib/libbsp/c4x/c4xsim/include/bsp.h +++ b/c/src/lib/libbsp/c4x/c4xsim/include/bsp.h @@ -64,10 +64,6 @@ void BSP_fatal_return( void ); void bsp_spurious_initialize( void ); -extern rtems_configuration_table BSP_Configuration; /* owned by BSP */ - -extern uint32_t bsp_isr_level; - #endif /* ASM */ #ifdef __cplusplus diff --git a/c/src/lib/libbsp/c4x/c4xsim/startup/bspstart.c b/c/src/lib/libbsp/c4x/c4xsim/startup/bspstart.c index d15ce74ce2..8e497a91e2 100644 --- a/c/src/lib/libbsp/c4x/c4xsim/startup/bspstart.c +++ b/c/src/lib/libbsp/c4x/c4xsim/startup/bspstart.c @@ -20,14 +20,6 @@ #include #include -/* - * The original table from the application and our copy of it with - * some changes. - */ - -extern rtems_configuration_table Configuration; -rtems_configuration_table BSP_Configuration; - /* * Use the shared implementations of the following routines */ @@ -74,10 +66,10 @@ void bsp_start( void ) extern void *_WorkspaceBase; extern uint32_t _WorkspaceMax; - BSP_Configuration.work_space_start = (void *)&_WorkspaceBase; + Configuration.work_space_start = (void *)&_WorkspaceBase; /* XXX check to see if satisfying small memory model */ - if ( BSP_Configuration.work_space_size > (int) &_WorkspaceMax ) + if ( rtems_configuration_get_work_space_size() > (int) &_WorkspaceMax ) rtems_fatal_error_occurred( 0x43218765 ); BSP_output_char = C4X_BSP_output_char; -- cgit v1.2.3