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.
This commit is contained in:
Joel Sherrill
2007-11-26 22:36:18 +00:00
parent e4d4eb9c54
commit c63f6e2efc
3 changed files with 45 additions and 45 deletions

View File

@@ -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.

View File

@@ -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
*/
/*
* Initialize the clock tick device driver variables
*/
Clock_driver_ticks = 0;
Clock_isrs = rtems_configuration_get_milliseconds_per_tick();
Clock_driver_ticks = 0;
Clock_isrs = rtems_configuration_get_milliseconds_per_tick();
mips_timer_rate =
rtems_configuration_get_microseconds_per_tick() * CLOCKS_PER_MICROSECOND;
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.
*/
/*
* 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 );
atexit( Clock_exit );
}
/*

View File

@@ -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 */
}