4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #pragma ident "%Z%%M% %I% %E% SMI"
29 #include <sys/asm_linkage.h>
30 #include "cheetah_sdc.h"
33 * TARGET_REG and TEMP_REG are macros defined in cheetah_sdc.h
34 * They are set based on some compile time values
36 * as -xarch=v8 -P -D_ASM -DLOCALS -DL0 cheetah_sdc.s -o ch_sdc_l0.o
37 * ch_sdc_l0.o will contain code to test %l0 register
38 * The functions are named after the register it is testing (l1(), l2() etc)
42 * Do some random stuff on TEMP_REGISTER
43 * Do some operations on TARGET_REGISTER
46 * TARGET_REG(unsigned long, unsigned long*, unsigned long*)
48 * i0 = contains the pattern
49 * i1 = location for the observed value
50 * i2 = location for the expected value
57 g1
(unsigned long arg1
, unsigned long
*arg2
, unsigned long
*arg3
)
64 g2
(unsigned long arg1
, unsigned long
*arg2
, unsigned long
*arg3
)
71 g3
(unsigned long arg1
, unsigned long
*arg2
, unsigned long
*arg3
)
78 g4
(unsigned long arg1
, unsigned long
*arg2
, unsigned long
*arg3
)
85 l0
(unsigned long arg1
, unsigned long
*arg2
, unsigned long
*arg3
)
92 l1
(unsigned long arg1
, unsigned long
*arg2
, unsigned long
*arg3
)
99 l2
(unsigned long arg1
, unsigned long
*arg2
, unsigned long
*arg3
)
106 l3
(unsigned long arg1
, unsigned long
*arg2
, unsigned long
*arg3
)
113 l4
(unsigned long arg1
, unsigned long
*arg2
, unsigned long
*arg3
)
120 l5
(unsigned long arg1
, unsigned long
*arg2
, unsigned long
*arg3
)
127 l6
(unsigned long arg1
, unsigned long
*arg2
, unsigned long
*arg3
)
134 l7
(unsigned long arg1
, unsigned long
*arg2
, unsigned long
*arg3
)
141 o0
(unsigned long arg1
, unsigned long
*arg2
, unsigned long
*arg3
)
148 o1
(unsigned long arg1
, unsigned long
*arg2
, unsigned long
*arg3
)
155 o2
(unsigned long arg1
, unsigned long
*arg2
, unsigned long
*arg3
)
162 o3
(unsigned long arg1
, unsigned long
*arg2
, unsigned long
*arg3
)
169 o4
(unsigned long arg1
, unsigned long
*arg2
, unsigned long
*arg3
)
176 o5
(unsigned long arg1
, unsigned long
*arg2
, unsigned long
*arg3
)
183 o7
(unsigned long arg1
, unsigned long
*arg2
, unsigned long
*arg3
)
193 save
%sp
, -SA
(MINFRAME
), %sp
195 setn
0x12345678, %g1
, %TARGET_REG
! initialize the TARGET_REG
199 stx %i0
, [%i1
] ! store the pattern to the first location
233 or %TEMP_REG
, %g0
, %TEMP_REG
234 or %TEMP_REG
, %g0
, %TEMP_REG
239 ldx [%i1
], %TARGET_REG
241 ld [%i1
], %TARGET_REG
243 mov
%TARGET_REG
, %CHECK_REG1
! CHECK_REG1 should contain the
244 ! most recent value of TARGET_REG.
246 mov
%TARGET_REG
, %CHECK_REG2
! CHECK_REG2 should have the same
247 ! value as CHECK_REG1
249 cmp %CHECK_REG1
, %CHECK_REG2
! comparison should pass in non-faulty
256 stx %CHECK_REG1
, [%i1
]
257 stx %CHECK_REG2
, [%i2
]
259 st %CHECK_REG1
, [%i1
]
260 st %CHECK_REG2
, [%i2
]