xref: /onnv-gate/usr/src/uts/sun4v/ml/mach_subr_asm.s (revision 12235:a4f889396df4)
10Sstevel@tonic-gate/*
20Sstevel@tonic-gate * CDDL HEADER START
30Sstevel@tonic-gate *
40Sstevel@tonic-gate * The contents of this file are subject to the terms of the
51991Sheppo * Common Development and Distribution License (the "License").
61991Sheppo * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate *
80Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate * See the License for the specific language governing permissions
110Sstevel@tonic-gate * and limitations under the License.
120Sstevel@tonic-gate *
130Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate *
190Sstevel@tonic-gate * CDDL HEADER END
200Sstevel@tonic-gate */
210Sstevel@tonic-gate/*
22*12235Sprashanth.sreenivasa@oracle.com * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
230Sstevel@tonic-gate */
240Sstevel@tonic-gate
250Sstevel@tonic-gate/*
260Sstevel@tonic-gate * General machine architecture & implementation specific
270Sstevel@tonic-gate * assembly language routines.
280Sstevel@tonic-gate */
290Sstevel@tonic-gate#if defined(lint)
300Sstevel@tonic-gate#include <sys/types.h>
310Sstevel@tonic-gate#include <sys/t_lock.h>
320Sstevel@tonic-gate#else	/* lint */
330Sstevel@tonic-gate#include "assym.h"
340Sstevel@tonic-gate#endif	/* lint */
350Sstevel@tonic-gate
36*12235Sprashanth.sreenivasa@oracle.com#define CPU_MODULE /* need it for NSEC_SHIFT used by NATIVE_TIME_TO_NSEC() */
37*12235Sprashanth.sreenivasa@oracle.com
380Sstevel@tonic-gate#include <sys/asm_linkage.h>
390Sstevel@tonic-gate#include <sys/machsystm.h>
400Sstevel@tonic-gate#include <sys/machthread.h>
4111172SHaik.Aftandilian@Sun.COM#include <sys/machclock.h>
420Sstevel@tonic-gate#include <sys/privregs.h>
430Sstevel@tonic-gate#include <sys/cmpregs.h>
440Sstevel@tonic-gate#include <sys/clock.h>
450Sstevel@tonic-gate#include <sys/fpras.h>
463266Sjb145095#include <sys/soft_state.h>
470Sstevel@tonic-gate
480Sstevel@tonic-gate#if defined(lint)
4911172SHaik.Aftandilian@Sun.COM
5011172SHaik.Aftandilian@Sun.COMuint64_t
5111172SHaik.Aftandilian@Sun.COMultra_gettick(void)
5211172SHaik.Aftandilian@Sun.COM{ return (0); }
5311172SHaik.Aftandilian@Sun.COM
5411172SHaik.Aftandilian@Sun.COM#else	/* lint */
5511172SHaik.Aftandilian@Sun.COM
5611172SHaik.Aftandilian@Sun.COM/*
5711172SHaik.Aftandilian@Sun.COM * This isn't the routine you're looking for.
5811172SHaik.Aftandilian@Sun.COM *
5911172SHaik.Aftandilian@Sun.COM * The routine simply returns the value of %tick on the *current* processor.
6011172SHaik.Aftandilian@Sun.COM * Most of the time, gettick() [which in turn maps to %stick on platforms
6111172SHaik.Aftandilian@Sun.COM * that have different CPU %tick rates] is what you want.
6211172SHaik.Aftandilian@Sun.COM */
6311172SHaik.Aftandilian@Sun.COM
6411172SHaik.Aftandilian@Sun.COM	ENTRY(ultra_gettick)
6511172SHaik.Aftandilian@Sun.COM	RD_TICK(%o0,%o1,%o2,__LINE__)
6611172SHaik.Aftandilian@Sun.COM	retl
6711172SHaik.Aftandilian@Sun.COM	nop
6811172SHaik.Aftandilian@Sun.COM	SET_SIZE(ultra_gettick)
6911172SHaik.Aftandilian@Sun.COM
7011172SHaik.Aftandilian@Sun.COM#endif	/* lint */
7111172SHaik.Aftandilian@Sun.COM
7211172SHaik.Aftandilian@Sun.COM#if defined(lint)
730Sstevel@tonic-gate/* ARGSUSED */
740Sstevel@tonic-gatevoid
750Sstevel@tonic-gateset_mmfsa_scratchpad(caddr_t vaddr)
760Sstevel@tonic-gate{ }
770Sstevel@tonic-gate
780Sstevel@tonic-gate#else	/* lint */
790Sstevel@tonic-gate
800Sstevel@tonic-gate	ENTRY(set_mmfsa_scratchpad)
810Sstevel@tonic-gate	stxa	%o0, [%g0]ASI_SCRATCHPAD
820Sstevel@tonic-gate	retl
830Sstevel@tonic-gate	nop
840Sstevel@tonic-gate	SET_SIZE(set_mmfsa_scratchpad)
850Sstevel@tonic-gate#endif	/* lint */
860Sstevel@tonic-gate
870Sstevel@tonic-gate#if defined(lint)
880Sstevel@tonic-gatecaddr_t
890Sstevel@tonic-gateget_mmfsa_scratchpad()
900Sstevel@tonic-gate{  return (0); }
910Sstevel@tonic-gate
920Sstevel@tonic-gate#else	/* lint */
930Sstevel@tonic-gate
940Sstevel@tonic-gate	ENTRY(get_mmfsa_scratchpad)
950Sstevel@tonic-gate	ldxa	[%g0]ASI_SCRATCHPAD, %o0
960Sstevel@tonic-gate	retl
970Sstevel@tonic-gate	nop
980Sstevel@tonic-gate	SET_SIZE(get_mmfsa_scratchpad)
990Sstevel@tonic-gate#endif	/* lint */
1000Sstevel@tonic-gate
1011991Sheppo
1021991Sheppo
1031991Sheppo#if defined(lint)
1041991Sheppo/* ARGSUSED */
1051991Sheppovoid
1061991Sheppocpu_intrq_unregister_powerdown(uint64_t doneflag_va)
1071991Sheppo{}
1081991Sheppo
1091991Sheppo#else	/* lint */
1101991Sheppo
1111991Sheppo/*
1121991Sheppo * Called from a x-trap at tl1 must use %g1 as arg
1131991Sheppo * and save/restore %o0-%o5 after hypervisor calls
1141991Sheppo */
1151991Sheppo
1161991Sheppo	ENTRY(cpu_intrq_unregister_powerdown)
1171991Sheppo
1181991Sheppo	CPU_ADDR(%g2, %g3)
1191991Sheppo	add %g2, CPU_MCPU, %g2
1201991Sheppo	/*
1211991Sheppo	 * Save %o regs
1221991Sheppo	 */
1231991Sheppo	mov %o0, %g3
1241991Sheppo	mov %o1, %g4
1251991Sheppo	mov %o2, %g5
1261991Sheppo	mov %o5, %g6
1271991Sheppo
1281991Sheppo	ldx [%g2 + MCPU_CPU_Q_BASE], %o1
1291991Sheppo	mov INTR_CPU_Q, %o0
1301991Sheppo	call hv_cpu_qconf
1311991Sheppo	mov %g0, %o2
1321991Sheppo
1331991Sheppo	ldx [%g2 + MCPU_DEV_Q_BASE], %o1
1341991Sheppo	mov INTR_DEV_Q, %o0
1351991Sheppo	call hv_cpu_qconf
1361991Sheppo	mov %g0, %o2
1371991Sheppo
1381991Sheppo	ldx [%g2 + MCPU_RQ_BASE], %o1
1391991Sheppo	mov CPU_RQ, %o0
1401991Sheppo	call hv_cpu_qconf
1411991Sheppo	mov %g0, %o2
1421991Sheppo
1431991Sheppo	ldx [%g2 + MCPU_NRQ_BASE], %o1
1441991Sheppo	mov CPU_NRQ, %o0
1451991Sheppo	call hv_cpu_qconf
1461991Sheppo	mov %g0, %o2
1471991Sheppo
1481991Sheppo	/*
1491991Sheppo	 * set done flag to 0
1501991Sheppo	 */
1511991Sheppo	stub %g0, [%g1]
1521991Sheppo
1531991Sheppo	/*
1541991Sheppo	 * Restore %o regs
1551991Sheppo	 */
1561991Sheppo	mov %g3, %o0
1571991Sheppo	mov %g4, %o1
1581991Sheppo	mov %g5, %o2
1591991Sheppo	mov %g6, %o5
1601991Sheppo
1611991Sheppo	/*
1621991Sheppo	 * This CPU is on its way out. Spin here
1631991Sheppo	 * until the DR unconfigure code stops it.
1641991Sheppo	 * Returning would put it back in the OS
1651991Sheppo	 * where it might grab resources like locks,
1661991Sheppo	 * causing some nastiness to occur.
1671991Sheppo	 */
1681991Sheppo0:
1691991Sheppo	ba,a	0b
1701991Sheppo
1711991Sheppo	SET_SIZE(cpu_intrq_unregister_powerdown)
1721991Sheppo#endif	/* lint */
1731991Sheppo
1741991Sheppo
1750Sstevel@tonic-gate#if defined(lint)
1760Sstevel@tonic-gate/* ARGSUSED */
1770Sstevel@tonic-gateint
1780Sstevel@tonic-gategetprocessorid(void)
1790Sstevel@tonic-gate{ return (0); }
1800Sstevel@tonic-gate
1810Sstevel@tonic-gate#else	/* lint */
1820Sstevel@tonic-gate
1830Sstevel@tonic-gate/*
1840Sstevel@tonic-gate * Get the processor ID.
1850Sstevel@tonic-gate * === MID reg as specified in 15dec89 sun4u spec, sec 5.4.3
1860Sstevel@tonic-gate */
1870Sstevel@tonic-gate
1880Sstevel@tonic-gate	ENTRY(getprocessorid)
1890Sstevel@tonic-gate	CPU_INDEX(%o0, %o1)
1900Sstevel@tonic-gate	retl
1910Sstevel@tonic-gate	nop
1920Sstevel@tonic-gate	SET_SIZE(getprocessorid)
1930Sstevel@tonic-gate
1940Sstevel@tonic-gate#endif	/* lint */
1950Sstevel@tonic-gate
1960Sstevel@tonic-gate#if defined(lint) || defined(__lint)
1970Sstevel@tonic-gate
1980Sstevel@tonic-gate/* ARGSUSED */
1990Sstevel@tonic-gatehrtime_t
2000Sstevel@tonic-gatetick2ns(hrtime_t tick, uint_t cpuid)
2010Sstevel@tonic-gate{ return 0; }
2020Sstevel@tonic-gate
2030Sstevel@tonic-gate#else	/* lint */
2040Sstevel@tonic-gate
2050Sstevel@tonic-gate	ENTRY_NP(tick2ns)
2060Sstevel@tonic-gate	!
207*12235Sprashanth.sreenivasa@oracle.com	! Use nsec_scale for sun4v which is based on %stick
2080Sstevel@tonic-gate	!
209*12235Sprashanth.sreenivasa@oracle.com	NATIVE_TIME_TO_NSEC(%o0, %o2, %o3)
2100Sstevel@tonic-gate	retl
2110Sstevel@tonic-gate	nop
2120Sstevel@tonic-gate	SET_SIZE(tick2ns)
2130Sstevel@tonic-gate
2140Sstevel@tonic-gate#endif  /* lint */
2150Sstevel@tonic-gate
2160Sstevel@tonic-gate#if defined(lint)
2170Sstevel@tonic-gate
2180Sstevel@tonic-gate/* ARGSUSED */
2190Sstevel@tonic-gatevoid
2200Sstevel@tonic-gateset_cmp_error_steering(void)
2210Sstevel@tonic-gate{}
2220Sstevel@tonic-gate
2230Sstevel@tonic-gate#else	/* lint */
2240Sstevel@tonic-gate
2250Sstevel@tonic-gate	ENTRY(set_cmp_error_steering)
2260Sstevel@tonic-gate	retl
2270Sstevel@tonic-gate	nop
2280Sstevel@tonic-gate	SET_SIZE(set_cmp_error_steering)
2290Sstevel@tonic-gate
2300Sstevel@tonic-gate#endif	/* lint */
2310Sstevel@tonic-gate
2320Sstevel@tonic-gate#if defined(lint)
2330Sstevel@tonic-gate
2340Sstevel@tonic-gate/* ARGSUSED */
2350Sstevel@tonic-gateuint64_t
2360Sstevel@tonic-gateultra_getver(void)
2370Sstevel@tonic-gate{
2380Sstevel@tonic-gate	return (0);
2390Sstevel@tonic-gate}
2400Sstevel@tonic-gate
2410Sstevel@tonic-gate#else /* lint */
2420Sstevel@tonic-gate
2430Sstevel@tonic-gate	ENTRY(ultra_getver)
2440Sstevel@tonic-gate	retl
2450Sstevel@tonic-gate	mov	-1, %o0		! XXXQ no version available
2460Sstevel@tonic-gate	SET_SIZE(ultra_getver)
2470Sstevel@tonic-gate
2480Sstevel@tonic-gate#endif /* lint */
2490Sstevel@tonic-gate
2500Sstevel@tonic-gate#if defined(lint)
2510Sstevel@tonic-gate
2520Sstevel@tonic-gateint
2530Sstevel@tonic-gatefpras_chkfn_type1(void)
2540Sstevel@tonic-gate{ return 0; }
2550Sstevel@tonic-gate
2560Sstevel@tonic-gate#else	/* lint */
2570Sstevel@tonic-gate
2580Sstevel@tonic-gate	/*
2590Sstevel@tonic-gate	 * Check instructions using just the AX pipelines, designed by
2600Sstevel@tonic-gate	 * C.B. Liaw of PNP.
2610Sstevel@tonic-gate	 *
2620Sstevel@tonic-gate	 * This function must match a struct fpras_chkfn and must be
2630Sstevel@tonic-gate	 * block aligned.  A zero return means all was well.  These
2640Sstevel@tonic-gate	 * instructions are chosen to be sensitive to bit corruptions
2650Sstevel@tonic-gate	 * on the fpras rewrite, so if a bit corruption still produces
2660Sstevel@tonic-gate	 * a valid instruction we should still get an incorrect result
2670Sstevel@tonic-gate	 * here.  This function is never called directly - it is copied
2680Sstevel@tonic-gate	 * into per-cpu and per-operation buffers;  it must therefore
2690Sstevel@tonic-gate	 * be absolutely position independent.  If an illegal instruction
2700Sstevel@tonic-gate	 * is encountered then the trap handler trampolines to the final
2710Sstevel@tonic-gate	 * three instructions of this function.
2720Sstevel@tonic-gate	 *
2730Sstevel@tonic-gate	 * We want two instructions that are complements of one another,
2740Sstevel@tonic-gate	 * and which can perform a calculation with a known result.
2750Sstevel@tonic-gate	 *
2760Sstevel@tonic-gate	 * SETHI:
2770Sstevel@tonic-gate	 *
2780Sstevel@tonic-gate	 * | 0 0 |  rd   | 1 0 0 |	imm22				|
2790Sstevel@tonic-gate	 *  31 30 29   25 24   22 21				       0
2800Sstevel@tonic-gate	 *
2810Sstevel@tonic-gate	 * ADDCCC with two source registers:
2820Sstevel@tonic-gate	 *
2830Sstevel@tonic-gate	 * | 1 0 |  rd   | 0 1 1   0 0 0 |  rs1  | 0 |	   -	|  rs2  |
2840Sstevel@tonic-gate	 *  31 30 29   25 24           19 18   14 13  12       5 4     0
2850Sstevel@tonic-gate	 *
2860Sstevel@tonic-gate	 * We can choose rd and imm2 of the SETHI and rd, rs1 and rs2 of
2870Sstevel@tonic-gate	 * the ADDCCC to obtain instructions that are complements in all but
2880Sstevel@tonic-gate	 * bit 30.
2890Sstevel@tonic-gate	 *
2900Sstevel@tonic-gate	 * Registers are numbered as follows:
2910Sstevel@tonic-gate	 *
2920Sstevel@tonic-gate	 * r[31]	%i7
2930Sstevel@tonic-gate	 * r[30]	%i6
2940Sstevel@tonic-gate	 * r[29]	%i5
2950Sstevel@tonic-gate	 * r[28]	%i4
2960Sstevel@tonic-gate	 * r[27]	%i3
2970Sstevel@tonic-gate	 * r[26]	%i2
2980Sstevel@tonic-gate	 * r[25]	%i1
2990Sstevel@tonic-gate	 * r[24]	%i0
3000Sstevel@tonic-gate	 * r[23]	%l7
3010Sstevel@tonic-gate	 * r[22]	%l6
3020Sstevel@tonic-gate	 * r[21]	%l5
3030Sstevel@tonic-gate	 * r[20]	%l4
3040Sstevel@tonic-gate	 * r[19]	%l3
3050Sstevel@tonic-gate	 * r[18]	%l2
3060Sstevel@tonic-gate	 * r[17]	%l1
3070Sstevel@tonic-gate	 * r[16]	%l0
3080Sstevel@tonic-gate	 * r[15]	%o7
3090Sstevel@tonic-gate	 * r[14]	%o6
3100Sstevel@tonic-gate	 * r[13]	%o5
3110Sstevel@tonic-gate	 * r[12]	%o4
3120Sstevel@tonic-gate	 * r[11]	%o3
3130Sstevel@tonic-gate	 * r[10]	%o2
3140Sstevel@tonic-gate	 * r[9]		%o1
3150Sstevel@tonic-gate	 * r[8]		%o0
3160Sstevel@tonic-gate	 * r[7]		%g7
3170Sstevel@tonic-gate	 * r[6]		%g6
3180Sstevel@tonic-gate	 * r[5]		%g5
3190Sstevel@tonic-gate	 * r[4]		%g4
3200Sstevel@tonic-gate	 * r[3]		%g3
3210Sstevel@tonic-gate	 * r[2]		%g2
3220Sstevel@tonic-gate	 * r[1]		%g1
3230Sstevel@tonic-gate	 * r[0]		%g0
3240Sstevel@tonic-gate	 *
3250Sstevel@tonic-gate	 * For register r[n], register r[31-n] is the complement.  We must
3260Sstevel@tonic-gate	 * avoid use of %i6/%i7 and %o6/%o7 as well as %g7.  Clearly we need
3270Sstevel@tonic-gate	 * to use a local or input register as one half of the pair, which
3280Sstevel@tonic-gate	 * requires us to obtain our own register window or take steps
3290Sstevel@tonic-gate	 * to preserve any local or input we choose to use.  We choose
3300Sstevel@tonic-gate	 * %o1 as rd for the SETHI, so rd of the ADDCCC must be %l6.
3310Sstevel@tonic-gate	 * We'll use %o1 as rs1 and %l6 as rs2 of the ADDCCC, which then
3320Sstevel@tonic-gate	 * requires that imm22 be 0b111 10110 1 11111111 01001 or 0x3dbfe9,
3330Sstevel@tonic-gate	 * or %hi(0xf6ffa400).  This determines the value of the constant
3340Sstevel@tonic-gate	 * CBV2 below.
3350Sstevel@tonic-gate	 *
3360Sstevel@tonic-gate	 * The constant CBV1 is chosen such that an initial subcc %g0, CBV1
3370Sstevel@tonic-gate	 * will set the carry bit and every addccc thereafter will continue
3380Sstevel@tonic-gate	 * to generate a carry.  Other values are possible for CBV1 - this
3390Sstevel@tonic-gate	 * is just one that works this way.
3400Sstevel@tonic-gate	 *
3410Sstevel@tonic-gate	 * Finally CBV3 is the expected answer when we perform our repeated
3420Sstevel@tonic-gate	 * calculations on CBV1 and CBV2 - it is not otherwise specially
3430Sstevel@tonic-gate	 * derived.  If this result is not obtained then a corruption has
3440Sstevel@tonic-gate	 * occured during the FPRAS_REWRITE of one of the two blocks of
3450Sstevel@tonic-gate	 * 16 instructions.  A corruption could also result in an illegal
3460Sstevel@tonic-gate	 * instruction or other unexpected trap - we catch illegal
3470Sstevel@tonic-gate	 * instruction traps in the PC range and trampoline to the
3480Sstevel@tonic-gate	 * last instructions of the function to return a failure indication.
3490Sstevel@tonic-gate	 *
3500Sstevel@tonic-gate	 */
3510Sstevel@tonic-gate
3520Sstevel@tonic-gate#define	CBV1		0xc11
3530Sstevel@tonic-gate#define	CBV2		0xf6ffa400
3540Sstevel@tonic-gate#define	CBV3		0x66f9d800
3550Sstevel@tonic-gate#define	CBR1		%o1
3560Sstevel@tonic-gate#define	CBR2		%l6
3570Sstevel@tonic-gate#define	CBO2		%o2
3580Sstevel@tonic-gate#define	SETHI_CBV2_CBR1		sethi %hi(CBV2), CBR1
3590Sstevel@tonic-gate#define	ADDCCC_CBR1_CBR2_CBR2	addccc CBR1, CBR2, CBR2
3600Sstevel@tonic-gate
3610Sstevel@tonic-gate	.align	64
3620Sstevel@tonic-gate	ENTRY_NP(fpras_chkfn_type1)
3630Sstevel@tonic-gate	mov	CBR2, CBO2		! 1, preserve CBR2 of (callers) window
3640Sstevel@tonic-gate	mov	FPRAS_OK, %o0		! 2, default return value
3650Sstevel@tonic-gate	ba,pt	%icc, 1f		! 3
3660Sstevel@tonic-gate	  subcc %g0, CBV1, CBR2		! 4
3670Sstevel@tonic-gate					! 5 - 16
3680Sstevel@tonic-gate	.align	64
3690Sstevel@tonic-gate1:	SETHI_CBV2_CBR1			! 1
3700Sstevel@tonic-gate	ADDCCC_CBR1_CBR2_CBR2		! 2
3710Sstevel@tonic-gate	SETHI_CBV2_CBR1			! 3
3720Sstevel@tonic-gate	ADDCCC_CBR1_CBR2_CBR2		! 4
3730Sstevel@tonic-gate	SETHI_CBV2_CBR1			! 5
3740Sstevel@tonic-gate	ADDCCC_CBR1_CBR2_CBR2		! 6
3750Sstevel@tonic-gate	SETHI_CBV2_CBR1			! 7
3760Sstevel@tonic-gate	ADDCCC_CBR1_CBR2_CBR2		! 8
3770Sstevel@tonic-gate	SETHI_CBV2_CBR1			! 9
3780Sstevel@tonic-gate	ADDCCC_CBR1_CBR2_CBR2		! 10
3790Sstevel@tonic-gate	SETHI_CBV2_CBR1			! 11
3800Sstevel@tonic-gate	ADDCCC_CBR1_CBR2_CBR2		! 12
3810Sstevel@tonic-gate	SETHI_CBV2_CBR1			! 13
3820Sstevel@tonic-gate	ADDCCC_CBR1_CBR2_CBR2		! 14
3830Sstevel@tonic-gate	SETHI_CBV2_CBR1			! 15
3840Sstevel@tonic-gate	ADDCCC_CBR1_CBR2_CBR2		! 16
3850Sstevel@tonic-gate
3860Sstevel@tonic-gate	ADDCCC_CBR1_CBR2_CBR2		! 1
3870Sstevel@tonic-gate	SETHI_CBV2_CBR1			! 2
3880Sstevel@tonic-gate	ADDCCC_CBR1_CBR2_CBR2		! 3
3890Sstevel@tonic-gate	SETHI_CBV2_CBR1			! 4
3900Sstevel@tonic-gate	ADDCCC_CBR1_CBR2_CBR2		! 5
3910Sstevel@tonic-gate	SETHI_CBV2_CBR1			! 6
3920Sstevel@tonic-gate	ADDCCC_CBR1_CBR2_CBR2		! 7
3930Sstevel@tonic-gate	SETHI_CBV2_CBR1			! 8
3940Sstevel@tonic-gate	ADDCCC_CBR1_CBR2_CBR2		! 9
3950Sstevel@tonic-gate	SETHI_CBV2_CBR1			! 10
3960Sstevel@tonic-gate	ADDCCC_CBR1_CBR2_CBR2		! 11
3970Sstevel@tonic-gate	SETHI_CBV2_CBR1			! 12
3980Sstevel@tonic-gate	ADDCCC_CBR1_CBR2_CBR2		! 13
3990Sstevel@tonic-gate	SETHI_CBV2_CBR1			! 14
4000Sstevel@tonic-gate	ADDCCC_CBR1_CBR2_CBR2		! 15
4010Sstevel@tonic-gate	SETHI_CBV2_CBR1			! 16
4020Sstevel@tonic-gate
4030Sstevel@tonic-gate	addc	CBR1, CBR2, CBR2	! 1
4040Sstevel@tonic-gate	sethi	%hi(CBV3), CBR1		! 2
4050Sstevel@tonic-gate	cmp	CBR1, CBR2		! 3
4060Sstevel@tonic-gate	movnz	%icc, FPRAS_BADCALC, %o0! 4, how detected
4070Sstevel@tonic-gate	retl				! 5
4080Sstevel@tonic-gate	  mov	CBO2, CBR2		! 6, restore borrowed register
4090Sstevel@tonic-gate	.skip 4*(13-7+1)		! 7 - 13
4100Sstevel@tonic-gate					!
4110Sstevel@tonic-gate					! illegal instr'n trap comes here
4120Sstevel@tonic-gate					!
4130Sstevel@tonic-gate	mov	CBO2, CBR2		! 14, restore borrowed register
4140Sstevel@tonic-gate	retl				! 15
4150Sstevel@tonic-gate	  mov	FPRAS_BADTRAP, %o0	! 16, how detected
4160Sstevel@tonic-gate	SET_SIZE(fpras_chkfn_type1)
4173266Sjb145095#endif	/* lint */
4180Sstevel@tonic-gate
4193266Sjb145095#if defined(lint)
4203266Sjb145095char	soft_state_message_strings[SOLARIS_SOFT_STATE_MSG_CNT][SSM_SIZE];
4213266Sjb145095#else	/* lint */
4223266Sjb145095	.seg	".data"
4233266Sjb145095	.global soft_state_message_strings
4243266Sjb145095
4253266Sjb145095	.align	SSM_SIZE
4263266Sjb145095soft_state_message_strings:
4273266Sjb145095	.asciz	SOLARIS_SOFT_STATE_BOOT_MSG_STR
4283266Sjb145095	.align	SSM_SIZE
4293266Sjb145095	.asciz	SOLARIS_SOFT_STATE_RUN_MSG_STR
4303266Sjb145095	.align	SSM_SIZE
4313266Sjb145095	.asciz	SOLARIS_SOFT_STATE_HALT_MSG_STR
4323266Sjb145095	.align	SSM_SIZE
4333266Sjb145095	.asciz	SOLARIS_SOFT_STATE_POWER_MSG_STR
4343266Sjb145095	.align	SSM_SIZE
4353266Sjb145095	.asciz	SOLARIS_SOFT_STATE_PANIC_MSG_STR
4363266Sjb145095	.align	SSM_SIZE
4373266Sjb145095	.asciz	SOLARIS_SOFT_STATE_REBOOT_MSG_STR
4383266Sjb145095	.align	SSM_SIZE
4393266Sjb145095	.asciz	SOLARIS_SOFT_STATE_DEBUG_MSG_STR
4403266Sjb145095	.align	SSM_SIZE
4413266Sjb145095	.skip	SSM_SIZE			/* saved message */
4423266Sjb145095	.nword	0
4433266Sjb145095
4443266Sjb145095	.seg	".text"
4450Sstevel@tonic-gate#endif	/* lint */
446