source: rtems/c/src/lib/libbsp/m68k/mvme167/timer/timerisr.S @ 674a980

4.104.114.95
Last change on this file since 674a980 was 674a980, checked in by Joel Sherrill <joel.sherrill@…>, on 08/31/08 at 16:38:22

2008-08-31 Joel Sherrill <joel.sherrill@…>

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