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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [mp3/] [sw/] [ints/] [handlers.S] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 505 lampret
 
2
#include "../support/spr_defs.h"
3
 
4
        .extern _test
5
        .extern _test
6
        .global _main
7
 
8
 
9
.global _main
10
.global _buserr_except
11
.global _dpf_except
12
.global _ipf_except
13
.global _lpint_except
14
.global _align_except
15
.global _illegal_except
16
.global _hpint_except
17
.global _dtlbmiss_except
18
.global _itlbmiss_except
19
.global _range_except
20
.global _syscall_except
21
.global _res1_except
22
.global _trap_except
23
.global _res2_except
24
 
25
_buserr_except:
26
_dpf_except:
27
_ipf_except:
28
_align_except:
29
_illegal_except:
30
_dtlbmiss_except:
31
_itlbmiss_except:
32
_range_except:
33
_syscall_except:
34
_res1_except:
35
_trap_except:
36
_res2_except:
37
 
38
.org 0x0500
39
_lpint_except:
40
        l.nop
41
        l.nop
42
 
43
# clear TTMR[IP]
44
        l.addi r4,r0,SPR_TTMR
45
        l.movhi r5,hi(SPR_TTMR_RT | SPR_TTMR_IE)
46
        l.addi r5,r5,233
47
        l.mtspr r4,r5,0         # set TTMR
48
 
49
# clear entire PICSR
50
        l.movhi r4,hi(SPR_PICSR)
51
        l.addi r4,r0,lo(SPR_PICSR)
52
        l.addi r5,r0,0x0000
53
        l.mtspr r4,r5,0         # set PICSR
54
 
55
        l.nop
56
        l.rfe
57
        l.nop
58
        l.nop
59
 
60
.org 0x0800
61
_hpint_except:
62
        l.nop
63
        l.nop
64
 
65
# clear TTMR[IP]
66
        l.addi r4,r0,SPR_TTMR
67
        l.movhi r5,hi(SPR_TTMR_RT | SPR_TTMR_IE)
68
        l.addi r5,r5,233
69
        l.mtspr r4,r5,0         # set TTMR
70
 
71
# clear entire PICSR
72
        l.movhi r4,hi(SPR_PICSR)
73
        l.addi r4,r0,lo(SPR_PICSR)
74
        l.addi r5,r0,0x0000
75
        l.mtspr r4,r5,0         # set PICSR
76
 
77
        l.nop
78
        l.rfe
79
        l.nop
80
        l.nop
81
 
82
 
83
.org 0x2000
84
 
85
_main:
86
        l.nop
87
        l.nop
88
 
89
#
90
# set tick to generate an interrupt every, let say 329 cycles
91
#
92
        l.addi r4,r0,SPR_TTMR
93
        l.movhi r5,hi(SPR_TTMR_RT | SPR_TTMR_IE)
94
        l.addi r5,r5,329
95
        l.mtspr r4,r5,0         # set TTMR
96
 
97
#
98
# unmask all ints
99
#
100
        l.movhi r4,hi(SPR_PICMR)
101
        l.addi r4,r0,lo(SPR_PICMR)
102
        l.movhi r5,0xffff
103
        l.addi r5,r5,0xffff
104
        l.mtspr r4,r5,0         # set PICMR
105
 
106
#
107
# Enable exceptions and interrupts
108
#
109
        l.mfspr r5,r0,SPR_SR
110
        l.ori r5,r5,SPR_SR_SUPV|SPR_SR_EXR|SPR_SR_EIR
111
        l.mtspr r0,r5,SPR_SR    # set SR
112
 
113
#
114
# jump to main routine
115
#
116
        l.j _test
117
        l.nop

powered by: WebSVN 2.1.0

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