2007-11-26 Joel Sherrill <joel.sherrill@oarcorp.com>

* clock/ckinit.c, startup/bspstart.c: Eliminate the
	clicks_per_microsecond field in the SuperH CPU Table and define
	another mechanism for drivers to obtain this information.
This commit is contained in:
Joel Sherrill
2007-11-26 23:02:17 +00:00
parent 26d47f8e73
commit fa920f122d
3 changed files with 24 additions and 15 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 SuperH CPU Table and define
another mechanism for drivers to obtain this information.
2007-05-03 Joel Sherrill <joel@OARcorp.com>
* startup/linkcmds: Handle .data.* sections

View File

@@ -19,6 +19,8 @@
#include <bsp.h>
#include <rtems/libio.h>
extern uint32_t bsp_clicks_per_second;
/*
* Clock_driver_ticks is a monotonically increasing counter of the
* number of clock ticks since the driver was initialized.
@@ -95,23 +97,22 @@ Clock_exit(void)
static void
Install_clock(rtems_isr_entry clock_isr)
{
uint32_t period;
Clock_driver_ticks = 0;
if (BSP_Configuration.ticks_per_timeslice)
{
rtems_isr_entry old_isr;
period = Cpu_table.clicks_per_second /
BSP_Configuration.ticks_per_timeslice;
uint32_t period;
/* Configure timer interrupts */
set_clock_period(period);
Clock_driver_ticks = 0;
if (BSP_Configuration.ticks_per_timeslice) {
rtems_isr_entry old_isr;
period = bsp_clicks_per_second / BSP_Configuration.ticks_per_timeslice;
/* Register the interrupt handler */
rtems_interrupt_catch(clock_isr, CLOCK_VECTOR, &old_isr);
/* Configure timer interrupts */
set_clock_period(period);
/* Register the driver exit procedure so we can shutdown */
atexit(Clock_exit);
}
/* Register the interrupt handler */
rtems_interrupt_catch(clock_isr, CLOCK_VECTOR, &old_isr);
/* Register the driver exit procedure so we can shutdown */
atexit(Clock_exit);
}
}
/* Clock_initialize --

View File

@@ -31,6 +31,8 @@
#include <string.h>
extern uint32_t bsp_clicks_per_second;
/*
* The original table from the application and our copy of it with
* some changes.
@@ -136,5 +138,5 @@ void bsp_start(void)
Cpu_table.interrupt_stack_size = CONFIGURE_INTERRUPT_STACK_MEMORY;
#endif
Cpu_table.clicks_per_second = CPU_CLOCK_RATE_HZ ;
bsp_clicks_per_second = CPU_CLOCK_RATE_HZ;
}