Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | /* |
2 | * ========== Copyright Header Begin ========================================== | |
3 | * | |
4 | * OpenSPARC T2 Processor File: ifu_basic_ld.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_PAGE_HV_ALSO | |
39 | #define MAIN_PAGE_NUCLEUS_ALSO | |
40 | ||
41 | #include "hboot.s" | |
42 | ||
43 | /************************************************************************ | |
44 | Test case code start | |
45 | ************************************************************************/ | |
46 | ||
47 | .text | |
48 | .global main | |
49 | ||
50 | main: /* test begin */ | |
51 | ||
52 | ! Get TID in %g6 | |
53 | ta T_RD_THID | |
54 | mov %o1, %g6 | |
55 | sllx %g6, 0x4, %g6 | |
56 | ||
57 | ta T_CHANGE_HPRIV | |
58 | ||
59 | !# LD/ST testing | |
60 | ||
61 | setx user_data_start, %g7, %g1 | |
62 | ||
63 | lduw_1: | |
64 | lduw [%g1 + 0x0], %i0 | |
65 | lduw [%g1 + 0x4], %i1 | |
66 | lduw [%g1 + 0x8], %i2 | |
67 | lduw [%g1 + 0xc], %i3 | |
68 | ||
69 | ldub_1: | |
70 | ldub [%g1 + 0xa0], %o0 | |
71 | ldub [%g1 + 0xa1], %o1 | |
72 | ldub [%g1 + 0xa2], %o2 | |
73 | ldub [%g1 + 0xa3], %o3 | |
74 | ldub [%g1 + 0xa4], %o4 | |
75 | ldub [%g1 + 0xa5], %o5 | |
76 | ldub [%g1 + 0xa6], %o6 | |
77 | ldub [%g1 + 0xa7], %o7 | |
78 | ldub [%g1 + 0x10], %i0 | |
79 | ldub [%g1 + 0x11], %i1 | |
80 | ldub [%g1 + 0x12], %i2 | |
81 | ldub [%g1 + 0x13], %i3 | |
82 | ldub [%g1 + 0x14], %i4 | |
83 | ldub [%g1 + 0x15], %i5 | |
84 | ldub [%g1 + 0x16], %i6 | |
85 | ldub [%g1 + 0x17], %i7 | |
86 | stb %i0, [%g1 + 0xa0] | |
87 | stb %i1, [%g1 + 0xa1] | |
88 | stb %i2, [%g1 + 0xa2] | |
89 | stb %i3, [%g1 + 0xa3] | |
90 | stb %i4, [%g1 + 0xa4] | |
91 | stb %i5, [%g1 + 0xa5] | |
92 | stb %i6, [%g1 + 0xa6] | |
93 | stb %i7, [%g1 + 0xa7] | |
94 | ldub [%g1 + 0xa0], %l0 | |
95 | ldub [%g1 + 0xa1], %l1 | |
96 | ldub [%g1 + 0xa2], %l2 | |
97 | ldub [%g1 + 0xa3], %l3 | |
98 | ldub [%g1 + 0xa4], %l4 | |
99 | ldub [%g1 + 0xa5], %l5 | |
100 | ldub [%g1 + 0xa6], %l6 | |
101 | ldub [%g1 + 0xa7], %l7 | |
102 | ||
103 | ldub_2: | |
104 | ldub [%g1 + 0xa8], %o0 | |
105 | ldub [%g1 + 0xa9], %o1 | |
106 | ldub [%g1 + 0xaa], %o2 | |
107 | ldub [%g1 + 0xab], %o3 | |
108 | ldub [%g1 + 0xac], %o4 | |
109 | ldub [%g1 + 0xad], %o5 | |
110 | ldub [%g1 + 0xae], %o6 | |
111 | ldub [%g1 + 0xaf], %o7 | |
112 | ldub [%g1 + 0x18], %i0 | |
113 | ldub [%g1 + 0x19], %i1 | |
114 | ldub [%g1 + 0x1a], %i2 | |
115 | ldub [%g1 + 0x1b], %i3 | |
116 | ldub [%g1 + 0x1c], %i4 | |
117 | ldub [%g1 + 0x1d], %i5 | |
118 | ldub [%g1 + 0x1e], %i6 | |
119 | ldub [%g1 + 0x1f], %i7 | |
120 | stb %i0, [%g1 + 0xa8] | |
121 | stb %i1, [%g1 + 0xa9] | |
122 | stb %i2, [%g1 + 0xaa] | |
123 | stb %i3, [%g1 + 0xab] | |
124 | stb %i4, [%g1 + 0xac] | |
125 | stb %i5, [%g1 + 0xad] | |
126 | stb %i6, [%g1 + 0xae] | |
127 | stb %i7, [%g1 + 0xaf] | |
128 | ldub [%g1 + 0xa8], %l0 | |
129 | ldub [%g1 + 0xa9], %l1 | |
130 | ldub [%g1 + 0xaa], %l2 | |
131 | ldub [%g1 + 0xab], %l3 | |
132 | ldub [%g1 + 0xac], %l4 | |
133 | ldub [%g1 + 0xad], %l5 | |
134 | ldub [%g1 + 0xae], %l6 | |
135 | ldub [%g1 + 0xaf], %l7 | |
136 | ||
137 | lduh_1: | |
138 | lduh [%g1 + 0xb0], %o0 | |
139 | lduh [%g1 + 0xb2], %o1 | |
140 | lduh [%g1 + 0xb4], %o2 | |
141 | lduh [%g1 + 0xb6], %o3 | |
142 | lduh [%g1 + 0x20], %i0 | |
143 | lduh [%g1 + 0x22], %i1 | |
144 | lduh [%g1 + 0x24], %i2 | |
145 | lduh [%g1 + 0x26], %i3 | |
146 | sth %i0, [%g1 + 0xb0] | |
147 | sth %i1, [%g1 + 0xb2] | |
148 | sth %i2, [%g1 + 0xb4] | |
149 | sth %i3, [%g1 + 0xb6] | |
150 | lduh [%g1 + 0xb0], %l0 | |
151 | lduh [%g1 + 0xb2], %l1 | |
152 | lduh [%g1 + 0xb4], %l2 | |
153 | lduh [%g1 + 0xb6], %l3 | |
154 | ||
155 | lduh_2: | |
156 | lduh [%g1 + 0xb8], %o0 | |
157 | lduh [%g1 + 0xba], %o1 | |
158 | lduh [%g1 + 0xbc], %o2 | |
159 | lduh [%g1 + 0xbe], %o3 | |
160 | lduh [%g1 + 0x28], %i0 | |
161 | lduh [%g1 + 0x2a], %i1 | |
162 | lduh [%g1 + 0x2c], %i2 | |
163 | lduh [%g1 + 0x2e], %i3 | |
164 | sth %i0, [%g1 + 0xb8] | |
165 | sth %i1, [%g1 + 0xba] | |
166 | sth %i2, [%g1 + 0xbc] | |
167 | sth %i3, [%g1 + 0xbe] | |
168 | lduh [%g1 + 0xb8], %l0 | |
169 | lduh [%g1 + 0xba], %l1 | |
170 | lduh [%g1 + 0xbc], %l2 | |
171 | lduh [%g1 + 0xbe], %l3 | |
172 | ||
173 | lduw_2: | |
174 | lduw [%g1 + 0xc0], %o0 | |
175 | lduw [%g1 + 0xc4], %o1 | |
176 | lduw [%g1 + 0xc8], %o2 | |
177 | lduw [%g1 + 0xcc], %o3 | |
178 | lduw [%g1 + 0x30], %i0 | |
179 | lduw [%g1 + 0x34], %i1 | |
180 | lduw [%g1 + 0x38], %i2 | |
181 | lduw [%g1 + 0x3c], %i3 | |
182 | stw %i0, [%g1 + 0xc0] | |
183 | stw %i1, [%g1 + 0xc4] | |
184 | stw %i2, [%g1 + 0xc8] | |
185 | stw %i3, [%g1 + 0xcc] | |
186 | lduw [%g1 + 0xc0], %l0 | |
187 | lduw [%g1 + 0xc4], %l1 | |
188 | lduw [%g1 + 0xc8], %l2 | |
189 | lduw [%g1 + 0xcc], %l3 | |
190 | ||
191 | ldx_1: | |
192 | ldx [%g1 + 0xd0], %o0 | |
193 | ldx [%g1 + 0xd8], %o1 | |
194 | ldx [%g1 + 0x40], %i0 | |
195 | ldx [%g1 + 0x48], %i1 | |
196 | stx %i0, [%g1 + 0xd0] | |
197 | stx %i2, [%g1 + 0xd8] | |
198 | ldx [%g1 + 0x40], %l0 | |
199 | ldx [%g1 + 0x48], %l1 | |
200 | ||
201 | ld_1: | |
202 | ld [%g1 + 0xe0], %f0 | |
203 | ld [%g1 + 0xe4], %f1 | |
204 | ld [%g1 + 0xe8], %f2 | |
205 | ld [%g1 + 0xec], %f3 | |
206 | ld [%g1 + 0x50], %f0 | |
207 | ld [%g1 + 0x54], %f1 | |
208 | ld [%g1 + 0x58], %f2 | |
209 | ld [%g1 + 0x5c], %f3 | |
210 | st %f0, [%g1 + 0xe0] | |
211 | st %f1, [%g1 + 0xe4] | |
212 | st %f2, [%g1 + 0xe8] | |
213 | st %f3, [%g1 + 0xec] | |
214 | ld [%g1 + 0xe0], %f0 | |
215 | ld [%g1 + 0xe4], %f1 | |
216 | ld [%g1 + 0xe8], %f2 | |
217 | ld [%g1 + 0xec], %f3 | |
218 | ||
219 | ||
220 | !# !# Ld to I/O space | |
221 | !#ld_IO: setx 0xc000000000, %i0, %l0 | |
222 | !# setx 0x0123456789abcdef, %i0, %l1 | |
223 | !# setx 0xfedcba9876543210, %i0, %l2 | |
224 | !# ldx [%l0], %l3 | |
225 | !# stx %l1, [%l0+0x0] | |
226 | !# stx %l2, [%l0+0x8] | |
227 | !# ldub [%l0+0x0], %l4 | |
228 | !# ldub [%l0+0x1], %l4 | |
229 | !# ldub [%l0+0x2], %l4 | |
230 | !# ldub [%l0+0x3], %l4 | |
231 | !# ldub [%l0+0x4], %l4 | |
232 | !# ldub [%l0+0x5], %l4 | |
233 | !# ldub [%l0+0x6], %l4 | |
234 | !# ldub [%l0+0x7], %l4 | |
235 | !# ldub [%l0+0x8], %l4 | |
236 | !# ldub [%l0+0x9], %l4 | |
237 | !# ldub [%l0+0xa], %l4 | |
238 | !# ldub [%l0+0xb], %l4 | |
239 | !# ldub [%l0+0xc], %l4 | |
240 | !# ldub [%l0+0xd], %l4 | |
241 | !# ldub [%l0+0xe], %l4 | |
242 | !# ldub [%l0+0xf], %l4 | |
243 | !# | |
244 | !# lduh [%l0+0x0], %l5 | |
245 | !# lduh [%l0+0x2], %l5 | |
246 | !# lduh [%l0+0x4], %l5 | |
247 | !# lduh [%l0+0x6], %l5 | |
248 | !# lduh [%l0+0x8], %l5 | |
249 | !# lduh [%l0+0xa], %l5 | |
250 | !# | |
251 | !# lduw [%l0+0x0], %l6 | |
252 | !# lduw [%l0+0x4], %l6 | |
253 | !# lduw [%l0+0x8], %l6 | |
254 | !# lduw [%l0+0xc], %l6 | |
255 | !# | |
256 | !# ldx [%l0+0x0], %l7 | |
257 | !# ldx [%l0+0x8], %l7 | |
258 | ||
259 | !# !# Ld from I/O Space Random 0x82 | |
260 | !# ld_IO2: setx 0x8200000000, %i0, %l0 | |
261 | !# !# Each thread must use a different random addr (ldst_sync limitation) | |
262 | !# add %l0, %g6, %l0 | |
263 | !# ldx [%l0+0x0], %l3 | |
264 | !# ldx [%l0+0x0], %l3 | |
265 | !# ldx [%l0+0x8], %l3 | |
266 | !# ldx [%l0+0x8], %l3 | |
267 | ||
268 | EXIT_GOOD /* test finish */ | |
269 | ||
270 | /** these files just include for adding into the spc2 released - auditdir can pick up */ | |
271 | /* | |
272 | #include "interrupt0x60_thread_init.s" | |
273 | #include "system_init.s" | |
274 | #include "interrupt0x60_sys_init.s" | |
275 | #include "interrupt0x60_handler.s" | |
276 | #include "ssi_defines.h" | |
277 | #include "interrupt0x60_defines.h" | |
278 | */ | |
279 | ||
280 | /************************************************************************ | |
281 | Test case data start | |
282 | ************************************************************************/ | |
283 | .data | |
284 | ||
285 | user_data_start: | |
286 | .xword 0xffffffff00000dad | |
287 | .xword 0x08090a0b0c0d0e0f | |
288 | .xword 0x1011121314151617 | |
289 | .xword 0x18191a1b1c1d1e1f | |
290 | .xword 0x2021222324252627 | |
291 | .xword 0x28292a2b2c2d2e2f | |
292 | .xword 0x3031323334353637 | |
293 | .xword 0x38393a3b3c3d3e3f | |
294 | .xword 0x4041424344454647 | |
295 | .xword 0x48494a4b4c4d4e4f | |
296 | .xword 0x5051525354555657 | |
297 | .xword 0x58595a5b5c5d5e5f | |
298 | .xword 0x6061626364656667 | |
299 | .xword 0x68696a6b6c6d6e6f | |
300 | .xword 0x7071727374757677 | |
301 | .xword 0x78797a7b7c7d7e7f | |
302 | .xword 0x8081828384858687 | |
303 | .xword 0x88898a8b8c8d8e8f | |
304 | .xword 0x9091929394959697 | |
305 | .xword 0x98999a9b9c9d9e9f | |
306 | .xword 0xa0a1a2a3a4a5a6a7 | |
307 | .xword 0xa8a9aaabacadaeaf | |
308 | .xword 0xb0b1b2b3b4b5b6b7 | |
309 | .xword 0xb8b9babbbcbdbebf | |
310 | .xword 0xc0c1c2c3c4c5c6c7 | |
311 | .xword 0xc8c9cacbcccdcecf | |
312 | .xword 0xd0d1d2d3d4d5d6d7 | |
313 | .xword 0xd8d9dadbdcdddedf | |
314 | .xword 0xe0e1e2e3e4e5e6e7 | |
315 | .xword 0xe8e9eaebecedeeef | |
316 | .xword 0xf0f1f2f3f4f5f6f7 | |
317 | .xword 0xf8f9fafbfcfdfeff | |
318 | .end |