summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/sh/simsh4
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2007-11-26 23:02:17 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2007-11-26 23:02:17 +0000
commitfa920f122d77578b0e2492df87a7c7d1552ed8a8 (patch)
tree526794dcd9a9d056ae7809dfa3d3a75a88405355 /c/src/lib/libbsp/sh/simsh4
parent2007-11-26 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-fa920f122d77578b0e2492df87a7c7d1552ed8a8.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 SuperH CPU Table and define another mechanism for drivers to obtain this information.
Diffstat (limited to 'c/src/lib/libbsp/sh/simsh4')
-rw-r--r--c/src/lib/libbsp/sh/simsh4/ChangeLog6
-rw-r--r--c/src/lib/libbsp/sh/simsh4/clock/ckinit.c29
-rw-r--r--c/src/lib/libbsp/sh/simsh4/startup/bspstart.c4
3 files changed, 24 insertions, 15 deletions
diff --git a/c/src/lib/libbsp/sh/simsh4/ChangeLog b/c/src/lib/libbsp/sh/simsh4/ChangeLog
index 8789e43923..4c893c731b 100644
--- a/c/src/lib/libbsp/sh/simsh4/ChangeLog
+++ b/c/src/lib/libbsp/sh/simsh4/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 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
diff --git a/c/src/lib/libbsp/sh/simsh4/clock/ckinit.c b/c/src/lib/libbsp/sh/simsh4/clock/ckinit.c
index 1d4b23e661..69d22948df 100644
--- a/c/src/lib/libbsp/sh/simsh4/clock/ckinit.c
+++ b/c/src/lib/libbsp/sh/simsh4/clock/ckinit.c
@@ -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 --
diff --git a/c/src/lib/libbsp/sh/simsh4/startup/bspstart.c b/c/src/lib/libbsp/sh/simsh4/startup/bspstart.c
index 5eaa59989a..c9d09020b2 100644
--- a/c/src/lib/libbsp/sh/simsh4/startup/bspstart.c
+++ b/c/src/lib/libbsp/sh/simsh4/startup/bspstart.c
@@ -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;
}