Rev 59 | Rev 124 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 59 | Rev 105 | ||
---|---|---|---|
1 | # |
1 | # |
2 | # Copyright (C) 2001-2004 Jakub Jermar |
2 | # Copyright (C) 2001-2004 Jakub Jermar |
3 | # All rights reserved. |
3 | # All rights reserved. |
4 | # |
4 | # |
5 | # Redistribution and use in source and binary forms, with or without |
5 | # Redistribution and use in source and binary forms, with or without |
6 | # modification, are permitted provided that the following conditions |
6 | # modification, are permitted provided that the following conditions |
7 | # are met: |
7 | # are met: |
8 | # |
8 | # |
9 | # - Redistributions of source code must retain the above copyright |
9 | # - Redistributions of source code must retain the above copyright |
10 | # notice, this list of conditions and the following disclaimer. |
10 | # notice, this list of conditions and the following disclaimer. |
11 | # - Redistributions in binary form must reproduce the above copyright |
11 | # - Redistributions in binary form must reproduce the above copyright |
12 | # notice, this list of conditions and the following disclaimer in the |
12 | # notice, this list of conditions and the following disclaimer in the |
13 | # documentation and/or other materials provided with the distribution. |
13 | # documentation and/or other materials provided with the distribution. |
14 | # - The name of the author may not be used to endorse or promote products |
14 | # - The name of the author may not be used to endorse or promote products |
15 | # derived from this software without specific prior written permission. |
15 | # derived from this software without specific prior written permission. |
16 | # |
16 | # |
17 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
17 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
18 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
18 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
19 | # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
19 | # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
20 | # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
20 | # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
21 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
21 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
22 | # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
22 | # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
23 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
23 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
26 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | # |
27 | # |
28 | 28 | ||
29 | .text |
29 | .text |
30 | 30 | ||
31 | .macro cp0_read reg |
31 | .macro cp0_read reg |
32 | mfc0 $2,\reg |
32 | mfc0 $2,\reg |
33 | j $31 |
33 | j $31 |
34 | nop |
34 | nop |
35 | .endm |
35 | .endm |
36 | 36 | ||
37 | .macro cp0_write reg |
37 | .macro cp0_write reg |
38 | mtc0 $4,\reg |
38 | mtc0 $4,\reg |
39 | j $31 |
39 | j $31 |
40 | nop |
40 | nop |
41 | .endm |
41 | .endm |
42 | 42 | ||
43 | .set noat |
43 | .set noat |
44 | .set noreorder |
44 | .set noreorder |
45 | .set nomacro |
45 | .set nomacro |
46 | 46 | ||
47 | .global cp0_index_read |
47 | .global cp0_index_read |
48 | .global cp0_index_write |
48 | .global cp0_index_write |
49 | .global cp0_random_read |
49 | .global cp0_random_read |
50 | .global cp0_entry_lo0_read |
50 | .global cp0_entry_lo0_read |
51 | .global cp0_entry_lo0_write |
51 | .global cp0_entry_lo0_write |
52 | .global cp0_entry_lo1_read |
52 | .global cp0_entry_lo1_read |
53 | .global cp0_entry_lo1_write |
53 | .global cp0_entry_lo1_write |
54 | .global cp0_context_read |
54 | .global cp0_context_read |
55 | .global cp0_context_write |
55 | .global cp0_context_write |
56 | .global cp0_pagemask_read |
56 | .global cp0_pagemask_read |
57 | .global cp0_pagemask_write |
57 | .global cp0_pagemask_write |
58 | .global cp0_wired_read |
58 | .global cp0_wired_read |
59 | .global cp0_wired_write |
59 | .global cp0_wired_write |
60 | .global cp0_badvaddr_read |
60 | .global cp0_badvaddr_read |
61 | .global cp0_count_read |
61 | .global cp0_count_read |
62 | .global cp0_count_write |
62 | .global cp0_count_write |
63 | .global cp0_hi_read |
63 | .global cp0_hi_read |
64 | .global cp0_hi_write |
64 | .global cp0_hi_write |
65 | .global cp0_compare_read |
65 | .global cp0_compare_read |
66 | .global cp0_compare_write |
66 | .global cp0_compare_write |
67 | .global cp0_status_read |
67 | .global cp0_status_read |
68 | .global cp0_status_write |
68 | .global cp0_status_write |
69 | .global cp0_cause_read |
69 | .global cp0_cause_read |
70 | .global cp0_epc_read |
70 | .global cp0_epc_read |
71 | .global cp0_epc_write |
71 | .global cp0_epc_write |
72 | .global cp0_prid_read |
72 | .global cp0_prid_read |
73 | 73 | ||
74 | cp0_index_read: cp0_read $0 |
74 | cp0_index_read: cp0_read $0 |
75 | cp0_index_write: cp0_write $0 |
75 | cp0_index_write: cp0_write $0 |
76 | 76 | ||
77 | cp0_random_read: cp0_read $1 |
77 | cp0_random_read: cp0_read $1 |
78 | 78 | ||
79 | cp0_entry_lo0_read: cp0_read $2 |
79 | cp0_entry_lo0_read: cp0_read $2 |
80 | cp0_entry_lo0_write: cp0_write $2 |
80 | cp0_entry_lo0_write: cp0_write $2 |
81 | 81 | ||
82 | cp0_entry_lo1_read: cp0_read $3 |
82 | cp0_entry_lo1_read: cp0_read $3 |
83 | cp0_entry_lo1_write: cp0_write $3 |
83 | cp0_entry_lo1_write: cp0_write $3 |
84 | 84 | ||
85 | cp0_context_read: cp0_read $4 |
85 | cp0_context_read: cp0_read $4 |
86 | cp0_context_write: cp0_write $4 |
86 | cp0_context_write: cp0_write $4 |
87 | 87 | ||
88 | cp0_pagemask_read: cp0_read $5 |
88 | cp0_pagemask_read: cp0_read $5 |
89 | cp0_pagemask_write: cp0_write $5 |
89 | cp0_pagemask_write: cp0_write $5 |
90 | 90 | ||
91 | cp0_wired_read: cp0_read $6 |
91 | cp0_wired_read: cp0_read $6 |
92 | cp0_wired_write: cp0_write $6 |
92 | cp0_wired_write: cp0_write $6 |
93 | 93 | ||
94 | cp0_badvaddr_read: cp0_read $8 |
94 | cp0_badvaddr_read: cp0_read $8 |
95 | 95 | ||
96 | cp0_count_read: cp0_read $9 |
96 | cp0_count_read: cp0_read $9 |
97 | cp0_count_write: cp0_write $9 |
97 | cp0_count_write: cp0_write $9 |
98 | 98 | ||
99 | cp0_entry_hi_read: cp0_read $10 |
99 | cp0_entry_hi_read: cp0_read $10 |
100 | cp0_entry_hi_write: cp0_write $10 |
100 | cp0_entry_hi_write: cp0_write $10 |
101 | 101 | ||
102 | cp0_compare_read: cp0_read $11 |
102 | cp0_compare_read: cp0_read $11 |
103 | cp0_compare_write: cp0_write $11 |
103 | cp0_compare_write: cp0_write $11 |
104 | 104 | ||
105 | cp0_status_read: cp0_read $12 |
105 | cp0_status_read: cp0_read $12 |
106 | cp0_status_write: cp0_write $12 |
106 | cp0_status_write: cp0_write $12 |
107 | 107 | ||
108 | cp0_cause_read: cp0_read $13 |
108 | cp0_cause_read: cp0_read $13 |
109 | 109 | ||
110 | cp0_epc_read: cp0_read $14 |
110 | cp0_epc_read: cp0_read $14 |
111 | cp0_epc_write: cp0_write $14 |
111 | cp0_epc_write: cp0_write $14 |
112 | 112 | ||
113 | cp0_prid_read: cp0_read $15 |
113 | cp0_prid_read: cp0_read $15 |
114 | 114 | ||
115 | 115 | ||
116 | .global tlbp |
116 | .global tlbp |
117 | tlbp: |
117 | tlbp: |
118 | tlbp |
118 | tlbp |
119 | j $31 |
119 | j $31 |
120 | nop |
120 | nop |
121 | 121 | ||
122 | .global tlbr |
122 | .global tlbr |
123 | tlbr: |
123 | tlbr: |
124 | tlbr |
124 | tlbr |
125 | j $31 |
125 | j $31 |
126 | nop |
126 | nop |
127 | 127 | ||
128 | .global tlbwi |
128 | .global tlbwi |
129 | tlbwi: |
129 | tlbwi: |
130 | tlbwi |
130 | tlbwi |
131 | j $31 |
131 | j $31 |
132 | nop |
132 | nop |
133 | 133 | ||
134 | .global tlbwr |
134 | .global tlbwr |
135 | tlbwr: |
135 | tlbwr: |
136 | tlbwr |
136 | tlbwr |
137 | j $31 |
137 | j $31 |
138 | nop |
138 | nop |
139 | 139 | ||
140 | .global cpu_halt |
140 | .global cpu_halt |
141 | cpu_halt: |
141 | cpu_halt: |
142 | j cpu_halt |
142 | j cpu_halt |
143 | nop |
143 | nop |
144 | 144 | ||
145 | 145 | ||
146 | .global memsetb |
146 | .global memsetb |
147 | memsetb: |
147 | memsetb: |
148 | j _memsetb |
148 | j _memsetb |
149 | nop |
149 | nop |
150 | 150 | ||
- | 151 | .global memcopy |
|
- | 152 | memcopy: |
|
- | 153 | j _memcopy |
|
- | 154 | nop |
|
- | 155 | ||
151 | # THIS IS USERSPACE CODE |
156 | # THIS IS USERSPACE CODE |
152 | .global utext |
157 | .global utext |
153 | utext: |
158 | utext: |
154 | j $31 |
159 | j $31 |
155 | nop |
160 | nop |
156 | utext_end: |
161 | utext_end: |
157 | 162 | ||
158 | .data |
163 | .data |
159 | .global utext_size |
164 | .global utext_size |
160 | utext_size: |
165 | utext_size: |
161 | .long utext_end-utext |
166 | .long utext_end-utext |
162 | 167 | ||
163 | 168 | ||
164 |
|
169 |
|
165 | 170 | ||
166 | 171 | ||
167 | 172 |