diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2007-11-26 22:36:18 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2007-11-26 22:36:18 +0000 |
commit | c63f6e2efc963a3630953130eb83b2e8cc727846 (patch) | |
tree | 1e70e39e9d9064296273a0900cb77cf07e5260d1 /c/src/lib/libbsp/mips | |
parent | 2007-11-26 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-c63f6e2efc963a3630953130eb83b2e8cc727846.tar.bz2 |
2007-11-26 Joel Sherrill <joel.sherrill@oarcorp.com>
* clock/ckinit.c, startup/bspstart.c: Eliminate the
clicks_per_microsecond field in the MIPS CPU Table and define another
mechanism for drivers to obtain this information.
Diffstat (limited to 'c/src/lib/libbsp/mips')
-rw-r--r-- | c/src/lib/libbsp/mips/hurricane/ChangeLog | 6 | ||||
-rw-r--r-- | c/src/lib/libbsp/mips/hurricane/clock/ckinit.c | 83 | ||||
-rw-r--r-- | c/src/lib/libbsp/mips/hurricane/startup/bspstart.c | 9 |
3 files changed, 49 insertions, 49 deletions
diff --git a/c/src/lib/libbsp/mips/hurricane/ChangeLog b/c/src/lib/libbsp/mips/hurricane/ChangeLog index e5f5a191aa..ad48ddf02b 100644 --- a/c/src/lib/libbsp/mips/hurricane/ChangeLog +++ b/c/src/lib/libbsp/mips/hurricane/ChangeLog @@ -1,3 +1,9 @@ +2007-11-26 Joel Sherrill <joel.sherrill@oarcorp.com> + + * clock/ckinit.c, startup/bspstart.c: Eliminate the + clicks_per_microsecond field in the MIPS CPU Table and define another + mechanism for drivers to obtain this information. + 2007-04-12 Ralf Corsépius <ralf.corsepius@rtems.org> * bsp_specs: Remove qrtems_debug. diff --git a/c/src/lib/libbsp/mips/hurricane/clock/ckinit.c b/c/src/lib/libbsp/mips/hurricane/clock/ckinit.c index 55fbeaa615..f1096bd3b6 100644 --- a/c/src/lib/libbsp/mips/hurricane/clock/ckinit.c +++ b/c/src/lib/libbsp/mips/hurricane/clock/ckinit.c @@ -43,17 +43,12 @@ #include <rtems.h> #include <rtems/libio.h> +extern uint32_t bsp_clicks_per_microsecond; + #define EXT_INT1 0x800 /* external interrupt 5 */ #include "clock.h" -/* formerly in the BSP */ -#if 0 -#define CLOCKS_PER_MICROSECOND ( CPU_CLOCK_RATE_MHZ ) /* equivalent to CPU clock speed in MHz */ -#endif - -#define CLOCKS_PER_MICROSECOND \ - rtems_cpu_configuration_get_clicks_per_microsecond() /* to avoid including the bsp */ mips_isr_entry set_vector( rtems_isr_entry, rtems_vector_number, int ); @@ -127,7 +122,7 @@ rtems_isr Clock_isr( * perform any timer dependent tasks */ - reset_wdt(); /* Reset hardware watchdog timer */ + reset_wdt(); /* Reset hardware watchdog timer */ Clock_driver_ticks += 1; @@ -156,42 +151,42 @@ void Install_clock( rtems_isr_entry clock_isr ) { - /* - * Initialize the clock tick device driver variables - */ - - Clock_driver_ticks = 0; - Clock_isrs = rtems_configuration_get_milliseconds_per_tick(); - - mips_timer_rate = - rtems_configuration_get_microseconds_per_tick() * CLOCKS_PER_MICROSECOND; - - /* - * Hardware specific initialize goes here - */ - - /* Set up USC heartbeat timer to generate interrupts */ - disable_hbi(); /* Disable heartbeat interrupt in USC */ - - /* Install interrupt handler */ - Old_ticker = (rtems_isr_entry) set_vector( USC_isr, CLOCK_VECTOR, 1 ); - - init_hbt(); /* Initialize heartbeat timer */ - - reset_wdt(); /* Reset watchdog timer */ - - enable_wdi(); /* Enable watchdog interrupt in USC */ - - enable_hbi(); /* Enable heartbeat interrupt in USC */ - - /* Enable USC interrupt in MIPS processor */ - mips_enable_in_interrupt_mask(CLOCK_VECTOR_MASK); - - /* - * Schedule the clock cleanup routine to execute if the application exits. - */ - - atexit( Clock_exit ); + /* + * Initialize the clock tick device driver variables + */ + + Clock_driver_ticks = 0; + Clock_isrs = rtems_configuration_get_milliseconds_per_tick(); + + mips_timer_rate = rtems_configuration_get_microseconds_per_tick() * + bsp_clicks_per_microsecond; + + /* + * Hardware specific initialize goes here + */ + + /* Set up USC heartbeat timer to generate interrupts */ + disable_hbi(); /* Disable heartbeat interrupt in USC */ + + /* Install interrupt handler */ + Old_ticker = (rtems_isr_entry) set_vector( USC_isr, CLOCK_VECTOR, 1 ); + + init_hbt(); /* Initialize heartbeat timer */ + + reset_wdt(); /* Reset watchdog timer */ + + enable_wdi(); /* Enable watchdog interrupt in USC */ + + enable_hbi(); /* Enable heartbeat interrupt in USC */ + + /* Enable USC interrupt in MIPS processor */ + mips_enable_in_interrupt_mask(CLOCK_VECTOR_MASK); + + /* + * Schedule the clock cleanup routine to execute if the application exits. + */ + + atexit( Clock_exit ); } /* diff --git a/c/src/lib/libbsp/mips/hurricane/startup/bspstart.c b/c/src/lib/libbsp/mips/hurricane/startup/bspstart.c index b75c1340b1..a9cc27e59b 100644 --- a/c/src/lib/libbsp/mips/hurricane/startup/bspstart.c +++ b/c/src/lib/libbsp/mips/hurricane/startup/bspstart.c @@ -19,6 +19,8 @@ #include <bsp.h> #include <rtems/libio.h> #include <rtems/libcsupport.h> + +uint32_t bsp_clicks_per_microsecond; /* * The original table from the application and our copy of it with @@ -108,10 +110,7 @@ void bsp_start( void ) Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */ Cpu_table.postdriver_hook = bsp_postdriver_hook; Cpu_table.interrupt_stack_size = CONFIGURE_INTERRUPT_STACK_MEMORY; - Cpu_table.clicks_per_microsecond = CPU_CLOCK_RATE_MHZ; - - mips_install_isr_entries(); /* Install generic MIPS exception handler */ - -/* init_exc_vecs(); */ /* Install BSP specific exception handler */ + bsp_clicks_per_microsecond = CPU_CLOCK_RATE_MHZ; + mips_install_isr_entries(); /* Install generic MIPS exception handler */ } |