source: rtems/bsps/m68k/gen68360/btimer/btimer.c @ 753873e5

Last change on this file since 753873e5 was 753873e5, checked in by Joel Sherrill <joel@…>, on 03/22/22 at 20:03:30

Update Eric Norum contact info and start to normalize file headers

  • Property mode set to 100644
File size: 1.4 KB
Line 
1/*
2 * Use TIMER 1 and TIMER 2 for Timing Test Suite
3 * The hardware on the MC68360 makes these routines very simple.
4 *
5 *  NOTE: It is important that the timer start/stop overhead be
6 *        determined when porting or modifying this code.
7 *
8 */
9
10/*
11 * Based on the `gen68302' board support package, and covered by the
12 * original distribution terms.
13 *
14 * Copyright (c) 1996 Eric Norum <eric@norum.ca>
15 *
16 * COPYRIGHT (c) 1989-1999.
17 * On-Line Applications Research Corporation (OAR).
18 *
19 * The license and distribution terms for this file may be
20 * found in the file LICENSE in this distribution or at
21 * http://www.rtems.org/license/LICENSE.
22 */
23
24#include <rtems.h>
25#include <rtems/btimer.h>
26#include <bsp.h>
27#include <rtems/m68k/m68360.h>
28
29void
30benchmark_timer_initialize (void)
31{
32        /*
33         * Reset timers 1 and 2
34         */
35        m360.tgcr &= ~0x00FF;
36        m360.tcn1 = 0;
37        m360.tcn2 = 0;
38        m360.ter1 = 0xFFFF;
39        m360.ter2 = 0xFFFF;
40
41        /*
42         * Cascade timers 1 and 2
43         */
44        m360.tgcr |= 0x0080;
45
46        /*
47         * Configure timers 1 and 2 to a single 32-bit, 1 MHz timer.
48         * HARDWARE:
49         *      Change the `25' to match your processor clock
50         */
51        m360.tmr2 = ((25-1) << 8) | 0x2;
52        m360.tmr1 = 0;
53
54        /*
55         * Start the timers
56         */
57        m360.tgcr |=  0x0011;
58}
59
60/*
61 * Return timer value in microsecond units
62 */
63uint32_t
64benchmark_timer_read (void)
65{
66        unsigned short val;
67
68        val = m360.tcn1;
69        return val;
70}
71
72void
73benchmark_timer_disable_subtracting_average_overhead(bool find_flag)
74{
75}
Note: See TracBrowser for help on using the repository browser.