source: rtems/bsps/m68k/mvme167/btimer/timerisr.S @ e0dd8a5a

5
Last change on this file since e0dd8a5a was e0dd8a5a, checked in by Sebastian Huber <sebastian.huber@…>, on 04/20/18 at 10:08:42

bsps: Move benchmark timer to bsps

This patch is a part of the BSP source reorganization.

Update #3285.

  • Property mode set to 100644
File size: 1.8 KB
Line 
1/**
2 *  @file
3 *
4 *  This ISR is used to bump a count of interval "overflow" interrupts which
5 *  have occurred since the timer was started. The number of overflows is taken
6 *  into account in the benchmark_timer_read() routine.
7 */
8
9/*
10 *  COPYRIGHT (c) 1989-2014.
11 *  On-Line Applications Research Corporation (OAR).
12 *
13 *  The license and distribution terms for this file may be
14 *  found in the file LICENSE in this distribution or at
15 *  http://www.rtems.org/license/LICENSE.
16 *
17 *  Modifications of respective RTEMS file: COPYRIGHT (c) 1994.
18 *  Copyright (c) 1998, National Research Council of Canada
19 */
20
21#include <rtems/asm.h>
22
23BEGIN_CODE
24
25.set INTR_CLEAR_REG,    0xfff40074      | interrupt clear register
26.set T1_CNTRL_REG,      0xfff40060      | tick timer 1 control register
27.set CLEAR_INT,         0x01000000      | clear tick 1 interrupt
28.set CLEAR_OVF,         0x00000004      | clear tick 1 overflow counter
29
30        PUBLIC (Ttimer_val)
31        PUBLIC (timerisr)
32SYM (timerisr):
33        move.l  a0, -(a7)               | save a0
34        move.l  d0, -(a7)               | save d0
35        move.w  sr, -(a7)               | save ccr
36        movea.l #INTR_CLEAR_REG, a0     | a0 = addr of intr clr reg
37        ori.l   #CLEAR_INT, (a0)        | clear tick timer 1 intr
38        movea.l #T1_CNTRL_REG, a0       | a0 = addr of t1 cntrl reg
39        move.l  (a0), d0                | read overflow counter
40        lsr.l   #4, d0                  | put overflow in low order bits
41        andi.l  #0xF, d0                | keep only overflow
42        add.l   d0, SYM (Ttimer_val)    | increment timer value
43        ori.l   #CLEAR_OVF, (a0)        | clear overflow counter
44        move.w  (a7)+, sr               | restore ccr
45        move.l  (a7)+, d0               | restore d0
46        move.l  (a7)+, a0               | restore a0
47        rte
48
49END_CODE
50END
Note: See TracBrowser for help on using the repository browser.