Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | /* |
2 | * ========== Copyright Header Begin ========================================== | |
3 | * | |
4 | * OpenSPARC T2 Processor File: tso_n1_self_mod203.s | |
5 | * Copyright (C) 1995-2007 Sun Microsystems, Inc. All Rights Reserved | |
6 | * 4150 Network Circle, Santa Clara, California 95054, U.S.A. | |
7 | * | |
8 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
9 | * | |
10 | * This program is free software; you can redistribute it and/or modify | |
11 | * it under the terms of the GNU General Public License as published by | |
12 | * the Free Software Foundation; version 2 of the License. | |
13 | * | |
14 | * This program is distributed in the hope that it will be useful, | |
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | * GNU General Public License for more details. | |
18 | * | |
19 | * You should have received a copy of the GNU General Public License | |
20 | * along with this program; if not, write to the Free Software | |
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
22 | * | |
23 | * For the avoidance of doubt, and except that if any non-GPL license | |
24 | * choice is available it will apply instead, Sun elects to use only | |
25 | * the General Public License version 2 (GPLv2) at this time for any | |
26 | * software where a choice of GPL license versions is made | |
27 | * available with the language indicating that GPLv2 or any later version | |
28 | * may be used, or where a choice of which version of the GPL is applied is | |
29 | * otherwise unspecified. | |
30 | * | |
31 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, | |
32 | * CA 95054 USA or visit www.sun.com if you need additional information or | |
33 | * have any questions. | |
34 | * | |
35 | * | |
36 | * ========== Copyright Header End ============================================ | |
37 | */ | |
38 | #define MAIN_BASE_DATA_ADDR 0x160000 | |
39 | #define MAIN_BASE_TEXT_ADDR 0x150000 | |
40 | #define MAIN_BASE_DATA_ADDR_RA 0x100160000 | |
41 | #define MAIN_BASE_TEXT_ADDR_RA 0x100150000 | |
42 | ||
43 | #define USER_PAGE_CUSTOM_MAP | |
44 | #include "hboot.s" | |
45 | ||
46 | SECTION .MAIN TEXT_VA=0x150000, DATA_VA=0x160000 | |
47 | ||
48 | attr_text { | |
49 | Name = .MAIN, | |
50 | VA=MAIN_BASE_TEXT_ADDR, | |
51 | RA=MAIN_BASE_TEXT_ADDR_RA, | |
52 | PA=ra2pa(MAIN_BASE_TEXT_ADDR_RA,0), | |
53 | part_0_ctx_nonzero_tsb_config_0, | |
54 | TTE_G=0, TTE_Context=PCONTEXT, TTE_V=1, TTE_Size=0, TTE_NFO=0, | |
55 | TTE_IE=0, TTE_Soft2=0, TTE_Diag=0, TTE_Soft=0, | |
56 | TTE_L=0, TTE_CP=1, TTE_CV=1, TTE_E=0, TTE_EP=1, TTE_P=0, TTE_W=1 | |
57 | } | |
58 | attr_data { | |
59 | Name = .MAIN, | |
60 | VA=MAIN_BASE_DATA_ADDR, | |
61 | RA=MAIN_BASE_DATA_ADDR_RA, | |
62 | PA=ra2pa(MAIN_BASE_DATA_ADDR_RA,0), | |
63 | part_0_ctx_nonzero_tsb_config_0, | |
64 | TTE_G=0, TTE_Context=PCONTEXT, TTE_V=1, TTE_Size=0, TTE_NFO=0, | |
65 | TTE_IE=0, TTE_Soft2=0, TTE_Diag=0, TTE_Soft=0, | |
66 | TTE_L=0, TTE_CP=1, TTE_CV=1, TTE_E=0, TTE_P=0, TTE_W=1 | |
67 | } | |
68 | ||
69 | .text | |
70 | .global main | |
71 | ||
72 | main: clr %l0 | |
73 | ||
74 | th_fork(main) | |
75 | ||
76 | main_0: | |
77 | ||
78 | add %g0, 0x20, %i3 ! loop counter | |
79 | ||
80 | loop0: | |
81 | clr %l1 | |
82 | execute1: | |
83 | set main01,%i0 | |
84 | jmpl %i0,%o7 | |
85 | nop | |
86 | add %l1, %l0, %l1 | |
87 | nop | |
88 | nop | |
89 | ||
90 | modify1: | |
91 | set main02,%i0 !get some known data into the store reg. | |
92 | set main01,%i1 !change the data at main1 | |
93 | ld [%i1],%l0 | |
94 | ld [%i0],%l0 | |
95 | st %i1, [%i1] | |
96 | cas [%i1], %i1, %l0 | |
97 | flush %i1 !update the I$ to be consistent with the l2 | |
98 | ||
99 | execute2: | |
100 | set main01,%i0 | |
101 | jmpl %i0,%o7 !the jump causes a new cache line to be | |
102 | nop !loaded into the ecache and the icache. | |
103 | add %l1, %l0, %l1 | |
104 | nop | |
105 | nop | |
106 | ||
107 | modify2: | |
108 | set main03,%i0 !get some known data into the store reg. | |
109 | set main01,%i1 !change the data at main1 | |
110 | ld [%i1],%l0 | |
111 | ld [%i0],%l0 | |
112 | st %l0,[%i1] | |
113 | st %i1, [%i1] | |
114 | cas [%i1], %i1, %l0 | |
115 | flush %i1 !update the I$ to be consistent with the l2 | |
116 | ||
117 | execute3: | |
118 | set main01,%i0 | |
119 | jmpl %i0,%o7 !the jump causes a new cache line to be | |
120 | nop !loaded into the ecache and the icache. | |
121 | add %l1, %l0, %l1 | |
122 | nop | |
123 | nop | |
124 | ||
125 | modify3: | |
126 | set main04,%i0 !get some known data into the store reg. | |
127 | set main01,%i1 !change the data at main1 | |
128 | ld [%i1],%l0 | |
129 | ld [%i0],%l0 | |
130 | st %l0,[%i1] | |
131 | st %i1, [%i1] | |
132 | cas [%i1], %i1, %l0 | |
133 | flush %i1 !update the I$ to be consistent with the l2 | |
134 | ||
135 | execute4: | |
136 | set main01,%i0 | |
137 | jmpl %i0,%o7 !the jump causes a new cache line to be | |
138 | nop !loaded into the ecache and the icache. | |
139 | add %l1, %l0, %l1 | |
140 | nop | |
141 | nop | |
142 | ||
143 | modify4: | |
144 | set main05,%i0 !get some known data into the store reg. | |
145 | set main01,%i1 !change the data at main1 | |
146 | ld [%i1],%l0 | |
147 | ld [%i0],%l0 | |
148 | st %l0,[%i1] | |
149 | st %i1, [%i1] | |
150 | cas [%i1], %i1, %l0 | |
151 | flush %i1 !update the I$ to be consistent with the l2 | |
152 | ||
153 | execute5: | |
154 | set main01,%i0 | |
155 | jmpl %i0,%o7 !the jump causes a new cache line to be | |
156 | nop !loaded into the ecache and the icache. | |
157 | add %l1, %l0, %l1 | |
158 | nop | |
159 | nop | |
160 | ||
161 | set 15, %i0 | |
162 | subcc %i0, %l1, %i0 | |
163 | bnz bad_end | |
164 | nop | |
165 | ||
166 | modify5: | |
167 | set main06,%i0 !get some known data into the store reg. | |
168 | set main01,%i1 !change the data at main1 | |
169 | ld [%i1],%l0 | |
170 | ld [%i0],%l0 | |
171 | st %l0,[%i1] | |
172 | st %i1, [%i1] | |
173 | cas [%i1], %i1, %l0 | |
174 | flush %i1 !update the I$ to be consistent with the l2 | |
175 | ||
176 | dec %i3 | |
177 | brnz %i3, loop0 | |
178 | nop | |
179 | ||
180 | normal_end: | |
181 | ta T_GOOD_TRAP | |
182 | bad_end: | |
183 | ta T_BAD_TRAP | |
184 | ||
185 | !--------------------------------------------------------------------------- | |
186 | ALIGN_PAGE_8K | |
187 | user_text2_start: | |
188 | main01: | |
189 | mov 1,%l0 ! Replaced with copied_code second pass | |
190 | jmpl %o7+8, %g0 | |
191 | nop | |
192 | main02: | |
193 | mov 2,%l0 | |
194 | nop | |
195 | nop | |
196 | nop | |
197 | nop | |
198 | nop | |
199 | nop | |
200 | nop | |
201 | nop | |
202 | nop | |
203 | main03: | |
204 | mov 3,%l0 | |
205 | nop | |
206 | nop | |
207 | nop | |
208 | nop | |
209 | nop | |
210 | nop | |
211 | nop | |
212 | nop | |
213 | nop | |
214 | nop | |
215 | nop | |
216 | nop | |
217 | nop | |
218 | nop | |
219 | nop | |
220 | nop | |
221 | nop | |
222 | nop | |
223 | nop | |
224 | ||
225 | main04: | |
226 | mov 4,%l0 | |
227 | nop | |
228 | nop | |
229 | nop | |
230 | nop | |
231 | nop | |
232 | nop | |
233 | nop | |
234 | nop | |
235 | main05: | |
236 | mov 5,%l0 | |
237 | nop | |
238 | nop | |
239 | nop | |
240 | nop | |
241 | nop | |
242 | ||
243 | main06: | |
244 | mov 1,%l0 | |
245 | nop | |
246 | nop | |
247 | nop | |
248 | nop | |
249 | nop | |
250 | user_text2_end: | |
251 | ||
252 | main_1: | |
253 | main_4: | |
254 | set main01,%i1 ! look at main1 | |
255 | set main02,%i2 ! look at main1 | |
256 | set main03,%i3 ! look at main1 | |
257 | set main04,%i4 ! look at main1 | |
258 | set main05,%i5 ! look at main1 | |
259 | set main06,%i6 ! look at main1 | |
260 | ||
261 | setx 0x100, %o2, %o3 ! loop counter | |
262 | ||
263 | loop1or4_2: | |
264 | ld [%i1], %l0 | |
265 | ld [%i1 + 0x10], %l1 | |
266 | nop | |
267 | ld [%i2], %l0 | |
268 | ld [%i2 + 0x10], %l1 | |
269 | nop | |
270 | ld [%i3], %l0 | |
271 | ld [%i3 + 0x10], %l1 | |
272 | nop | |
273 | ld [%i4], %l0 | |
274 | ld [%i4 + 0x10], %l1 | |
275 | nop | |
276 | ld [%i5], %l0 | |
277 | ld [%i5 + 0x10], %l1 | |
278 | nop | |
279 | ld [%i6], %l0 | |
280 | ld [%i6 + 0x10], %l1 | |
281 | nop | |
282 | ||
283 | dec %o3 | |
284 | brnz %o3, loop1or4_2 | |
285 | nop | |
286 | ||
287 | ta T_GOOD_TRAP | |
288 | ||
289 | /*********************************************************************** | |
290 | Test case data start | |
291 | ***********************************************************************/ | |
292 | .data | |
293 | user_data_start: | |
294 | .word 0x0 | |
295 | user_data_end: |