diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2005-08-17 22:03:22 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2005-08-17 22:03:22 +0000 |
commit | 1b269c562424c2a3b9be7c743fd7e72a995bacbd (patch) | |
tree | 0a2185704bd6a6bcfa3e8244fb541f4d3d64f9fe /c/src/lib/libbsp/m68k/av5282/timer/timer.c | |
parent | 2005-08-17 Lars Munch <lars@segv.dk> (diff) | |
download | rtems-1b269c562424c2a3b9be7c743fd7e72a995bacbd.tar.bz2 |
2005-08-17 Mike Bertosh <mbertosh@motioncontrol.org>
* .cvsignore, Makefile.am, README, bsp_specs, configure.ac,
clock/clock.c, console/console.c, include/bsp.h,
include/bspopts.h.in, include/coverhd.h, include/tm27.h,
network/network.c, start/start.S, startup/bspclean.c,
startup/bspstart.c, startup/init5282.c, startup/linkcmds,
startup/linkcmdsflash, startup/linkcmdsram, timer/timer.c: New files.
Diffstat (limited to '')
-rw-r--r-- | c/src/lib/libbsp/m68k/av5282/timer/timer.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/m68k/av5282/timer/timer.c b/c/src/lib/libbsp/m68k/av5282/timer/timer.c new file mode 100644 index 0000000000..3afd7b09f1 --- /dev/null +++ b/c/src/lib/libbsp/m68k/av5282/timer/timer.c @@ -0,0 +1,43 @@ +/* + * Timer Init + * + * Use the last DMA timer (DTIM3) as the diagnostic timer. + */ + +#include <rtems.h> +#include <bsp.h> + +void +Timer_initialize(void) +{ + int preScaleDivisor = 58; + int div = MCF5282_TIMER_DTMR_CLK_DIV1; + MCF5282_TIMER3_DTRR = 0x2710; + MCF5282_TIMER3_DTMR = 0; + MCF5282_TIMER3_DTMR = MCF5282_TIMER_DTMR_PS(preScaleDivisor - 1) | div | + MCF5282_TIMER_DTMR_RST; +} + +/* + * Return timer value in microsecond units + */ +int +Read_timer(void) +{ + return MCF5282_TIMER3_DTCN; +} + +/* + * Empty function call used in loops to measure basic cost of looping + * in Timing Test Suite. + */ +rtems_status_code +Empty_function(void) +{ + return RTEMS_SUCCESSFUL; +} + +void +Set_find_average_overhead(rtems_boolean find_flag) +{ +} |