OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [lib/] [libcpu/] [a29k/] [clock/] [clock.S] - Blame information for rev 507

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
;
2
;       .include "register.ah"
3
        .include "amd.ah"
4
        .include "pswmacro.ah"
5
 
6
        .text
7
;       .equ    IN,0x2000000
8
        .reg    CLOCK,gr78
9
        .reg    SECS,gr79
10
        .equ    CPUCLK,16
11
        .equ    RATE,100
12
        .reg    it0,gr64
13
        .reg    it1,gr65
14
        .reg    v0,gr96
15
timer_clear_sup:
16
        const   it0,IN
17
        consth  it0,IN
18
        mfsr    it1,tmr
19
        andn    it1,it1,it0
20
        mtsr    tmr,it1
21
        const   it0,RATE
22
        cplt    it0,CLOCK,it0
23
        jmpf    it0,carry
24
        add     CLOCK,CLOCK,1
25
        iret
26
carry:
27
        const   CLOCK,0
28
        add     SECS,SECS,1
29
        iret
30
 
31
        .equ    TICKS,(CPUCLK*1000000/RATE)
32
;       .equ    IE,0x1000000
33
timer_init_sup:
34
        const   it0,TICKS
35
        consth  it0,TICKS
36
        mtsr    tmc,it0
37
        const   it0,(IE|TICKS)
38
        consth  it0,(IE|TICKS)
39
        mtsr    tmr,it0
40
        const   SECS,0
41
        const   CLOCK,0
42
        iret
43
 
44
timer_get_sup:
45
        add     gr96,SECS,0
46
        iret
47
 
48
timer_disable_sup:
49
        mfsr    it0,ops
50
        const   it1,TD
51
        consth  it1,TD
52
        andn    it0,it1,it0
53
        mtsr    ops,it0
54
        iret
55
 
56
        .global _a29k_init_timer
57
_a29k_init_timer:
58
        push    msp,lr0
59
        const   lr2,INIT_TIMER
60
        consth  lr2,INIT_TIMER
61
        const   lr3,timer_init_sup
62
        consth  lr3,timer_init_sup
63
        const   v0,__settrap
64
        consth  v0,__settrap
65
        calli   lr0,v0
66
        nop
67
 
68
        const   lr2,CLEAR_TIMER
69
        consth  lr2,CLEAR_TIMER
70
        const   lr3,timer_clear_sup
71
        consth  lr3,timer_clear_sup
72
        const   v0,__settrap
73
        consth  v0,__settrap
74
        calli   lr0,v0
75
        nop
76
 
77
        const   lr2,DISABLE_TIMER
78
        consth  lr2,DISABLE_TIMER
79
        const   lr3,timer_disable_sup
80
        consth  lr3,timer_disable_sup
81
        const   v0,__settrap
82
        consth  v0,__settrap
83
        calli   lr0,v0
84
        nop
85
 
86
        const   lr2,GET_TIMER
87
        consth  lr2,GET_TIMER
88
        const   lr3,timer_get_sup
89
        consth  lr3,timer_get_sup
90
        const   v0,__settrap
91
        consth  v0,__settrap
92
        calli   lr0,v0
93
        nop
94
 
95
        asneq   INIT_TIMER,gr1,gr1
96
        pop     lr0,msp
97
        jmpi    lr0
98
        nop
99
 
100
        .global _a29k_clear_timer
101
_a29k_clear_timer:
102
;       asneq   CLEAR_TIMER,gr1,gr1
103
        jmpi lr0
104
        nop
105
 
106
        .global _a29k_disable_timer
107
_a29k_disable_timer:
108
        asneq   DISABLE_TIMER,gr1,gr1
109
        jmpi lr0
110
        nop
111
 
112
        .global _a29k_get_timer
113
_a29k_get_timer:
114
        asneq   GET_TIMER,gr1,gr1
115
        jmpi lr0
116
        nop

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.