File indexing completed on 2025-05-11 08:23:48
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
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