Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:23:48

0001 /**
0002  *  @file
0003  *
0004  *  This ISR is used to bump a count of interval "overflow" interrupts which
0005  *  have occurred since the timer was started. The number of overflows is taken
0006  *  into account in the benchmark_timer_read() routine.
0007  */
0008 
0009 /*
0010  *  COPYRIGHT (c) 1989-2014.
0011  *  On-Line Applications Research Corporation (OAR).
0012  *
0013  *  The license and distribution terms for this file may be
0014  *  found in the file LICENSE in this distribution or at
0015  *  http://www.rtems.org/license/LICENSE.
0016  *
0017  *  Modifications of respective RTEMS file: COPYRIGHT (c) 1994.
0018  *  Copyright (c) 1998, National Research Council of Canada
0019  */
0020 
0021 #include <rtems/asm.h>
0022 
0023 BEGIN_CODE
0024 
0025 .set INTR_CLEAR_REG,    0xfff40074      | interrupt clear register
0026 .set T1_CNTRL_REG,      0xfff40060      | tick timer 1 control register
0027 .set CLEAR_INT,         0x01000000      | clear tick 1 interrupt
0028 .set CLEAR_OVF,         0x00000004      | clear tick 1 overflow counter
0029 
0030         PUBLIC (Ttimer_val)
0031         PUBLIC (timerisr)
0032 SYM (timerisr):
0033         move.l  a0, -(a7)               | save a0
0034         move.l  d0, -(a7)               | save d0
0035         move.w  sr, -(a7)               | save ccr
0036         movea.l #INTR_CLEAR_REG, a0     | a0 = addr of intr clr reg
0037         ori.l   #CLEAR_INT, (a0)        | clear tick timer 1 intr
0038         movea.l #T1_CNTRL_REG, a0       | a0 = addr of t1 cntrl reg
0039         move.l  (a0), d0                | read overflow counter
0040         lsr.l   #4, d0                  | put overflow in low order bits
0041         andi.l  #0xF, d0                | keep only overflow
0042         add.l   d0, SYM (Ttimer_val)    | increment timer value
0043         ori.l   #CLEAR_OVF, (a0)        | clear overflow counter
0044         move.w  (a7)+, sr               | restore ccr
0045         move.l  (a7)+, d0               | restore d0
0046         move.l  (a7)+, a0               | restore a0
0047         rte
0048 
0049 END_CODE
0050 END