17c478bdstevel@tonic-gate/*
27c478bdstevel@tonic-gate * CDDL HEADER START
37c478bdstevel@tonic-gate *
47c478bdstevel@tonic-gate * The contents of this file are subject to the terms of the
52840650sudheer * Common Development and Distribution License (the "License").
62840650sudheer * You may not use this file except in compliance with the License.
77c478bdstevel@tonic-gate *
87c478bdstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bdstevel@tonic-gate * or http://www.opensolaris.org/os/licensing.
107c478bdstevel@tonic-gate * See the License for the specific language governing permissions
117c478bdstevel@tonic-gate * and limitations under the License.
127c478bdstevel@tonic-gate *
137c478bdstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each
147c478bdstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bdstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the
167c478bdstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying
177c478bdstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bdstevel@tonic-gate *
197c478bdstevel@tonic-gate * CDDL HEADER END
207c478bdstevel@tonic-gate */
217c478bdstevel@tonic-gate/*
222840650sudheer * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
237c478bdstevel@tonic-gate * Use is subject to license terms.
247c478bdstevel@tonic-gate */
257c478bdstevel@tonic-gate
267c478bdstevel@tonic-gate#pragma ident	"%Z%%M%	%I%	%E% SMI"
277c478bdstevel@tonic-gate
287c478bdstevel@tonic-gate#if defined(lint) || defined(__lint)
297c478bdstevel@tonic-gate#include <sys/dtrace_impl.h>
307c478bdstevel@tonic-gate#else
317c478bdstevel@tonic-gate#include <sys/asm_linkage.h>
327c478bdstevel@tonic-gate#include <sys/privregs.h>
337c478bdstevel@tonic-gate#include <sys/fsr.h>
347c478bdstevel@tonic-gate#include <sys/asi.h>
352840650sudheer#include "assym.h"
367c478bdstevel@tonic-gate#endif
377c478bdstevel@tonic-gate
387c478bdstevel@tonic-gate#if defined(lint) || defined(__lint)
397c478bdstevel@tonic-gate
407c478bdstevel@tonic-gateint
417c478bdstevel@tonic-gatedtrace_getipl(void)
427c478bdstevel@tonic-gate{ return (0); }
437c478bdstevel@tonic-gate
447c478bdstevel@tonic-gate#else	/* lint */
457c478bdstevel@tonic-gate
467c478bdstevel@tonic-gate	ENTRY_NP(dtrace_getipl)
477c478bdstevel@tonic-gate	retl
487c478bdstevel@tonic-gate	rdpr	%pil, %o0
497c478bdstevel@tonic-gate	SET_SIZE(dtrace_getipl)
507c478bdstevel@tonic-gate
517c478bdstevel@tonic-gate#endif	/* lint */
527c478bdstevel@tonic-gate
537c478bdstevel@tonic-gate#if defined(lint) || defined(__lint)
547c478bdstevel@tonic-gate
557c478bdstevel@tonic-gateuint_t
567c478bdstevel@tonic-gatedtrace_getotherwin(void)
577c478bdstevel@tonic-gate{ return (0); }
587c478bdstevel@tonic-gate
597c478bdstevel@tonic-gate#else	/* lint */
607c478bdstevel@tonic-gate
617c478bdstevel@tonic-gate	ENTRY_NP(dtrace_getotherwin)
627c478bdstevel@tonic-gate	retl
637c478bdstevel@tonic-gate	rdpr	%otherwin, %o0
647c478bdstevel@tonic-gate	SET_SIZE(dtrace_getotherwin)
657c478bdstevel@tonic-gate
667c478bdstevel@tonic-gate#endif	/* lint */
677c478bdstevel@tonic-gate
687c478bdstevel@tonic-gate#if defined(lint) || defined(__lint)
697c478bdstevel@tonic-gate
707c478bdstevel@tonic-gateuint_t
717c478bdstevel@tonic-gatedtrace_getfprs(void)
727c478bdstevel@tonic-gate{ return (0); }
737c478bdstevel@tonic-gate
747c478bdstevel@tonic-gate#else	/* lint */
757c478bdstevel@tonic-gate
767c478bdstevel@tonic-gate	ENTRY_NP(dtrace_getfprs)
777c478bdstevel@tonic-gate	retl
787c478bdstevel@tonic-gate	rd	%fprs, %o0
797c478bdstevel@tonic-gate	SET_SIZE(dtrace_getfprs)
807c478bdstevel@tonic-gate
817c478bdstevel@tonic-gate#endif	/* lint */
827c478bdstevel@tonic-gate
837c478bdstevel@tonic-gate#if defined(lint) || defined(__lint)
847c478bdstevel@tonic-gate
857c478bdstevel@tonic-gate/*ARGSUSED*/
867c478bdstevel@tonic-gatevoid
877c478bdstevel@tonic-gatedtrace_getfsr(uint64_t *val)
887c478bdstevel@tonic-gate{}
897c478bdstevel@tonic-gate
907c478bdstevel@tonic-gate#else	/* lint */
917c478bdstevel@tonic-gate
927c478bdstevel@tonic-gate	ENTRY_NP(dtrace_getfsr)
937c478bdstevel@tonic-gate	rdpr	%pstate, %o1
947c478bdstevel@tonic-gate	andcc	%o1, PSTATE_PEF, %g0
957c478bdstevel@tonic-gate	bz,pn	%xcc, 1f
967c478bdstevel@tonic-gate	nop
977c478bdstevel@tonic-gate	rd	%fprs, %o1
987c478bdstevel@tonic-gate	andcc	%o1, FPRS_FEF, %g0
997c478bdstevel@tonic-gate	bz,pn	%xcc, 1f
1007c478bdstevel@tonic-gate	nop
1017c478bdstevel@tonic-gate	retl
1027c478bdstevel@tonic-gate	stx	%fsr, [%o0]
1037c478bdstevel@tonic-gate1:
1047c478bdstevel@tonic-gate	retl
1057c478bdstevel@tonic-gate	stx	%g0, [%o0]
1067c478bdstevel@tonic-gate	SET_SIZE(dtrace_getfsr)
1077c478bdstevel@tonic-gate
1087c478bdstevel@tonic-gate#endif	/* lint */
1097c478bdstevel@tonic-gate
1107c478bdstevel@tonic-gate#if defined(lint) || defined(__lint)
1117c478bdstevel@tonic-gate
1127c478bdstevel@tonic-gategreg_t
1137c478bdstevel@tonic-gatedtrace_getfp(void)
1147c478bdstevel@tonic-gate{ return (0); }
1157c478bdstevel@tonic-gate
1167c478bdstevel@tonic-gate#else	/* lint */
1177c478bdstevel@tonic-gate
1187c478bdstevel@tonic-gate	ENTRY_NP(dtrace_getfp)
1197c478bdstevel@tonic-gate	retl
1207c478bdstevel@tonic-gate	mov	%fp, %o0
1217c478bdstevel@tonic-gate	SET_SIZE(dtrace_getfp)
1227c478bdstevel@tonic-gate
1237c478bdstevel@tonic-gate#endif	/* lint */
1247c478bdstevel@tonic-gate
1257c478bdstevel@tonic-gate#if defined(lint) || defined(__lint)
1267c478bdstevel@tonic-gate
1277c478bdstevel@tonic-gatevoid
1287c478bdstevel@tonic-gatedtrace_flush_user_windows(void)
1297c478bdstevel@tonic-gate{}
1307c478bdstevel@tonic-gate
1317c478bdstevel@tonic-gate#else
1327c478bdstevel@tonic-gate
1337c478bdstevel@tonic-gate	ENTRY_NP(dtrace_flush_user_windows)
1347c478bdstevel@tonic-gate	rdpr	%otherwin, %g1
1357c478bdstevel@tonic-gate	brz	%g1, 3f
1367c478bdstevel@tonic-gate	clr	%g2
1377c478bdstevel@tonic-gate1:
1387c478bdstevel@tonic-gate	save	%sp, -WINDOWSIZE, %sp
1397c478bdstevel@tonic-gate	rdpr	%otherwin, %g1
1407c478bdstevel@tonic-gate	brnz	%g1, 1b
1417c478bdstevel@tonic-gate	add	%g2, 1, %g2
1427c478bdstevel@tonic-gate2:
1437c478bdstevel@tonic-gate	sub	%g2, 1, %g2		! restore back to orig window
1447c478bdstevel@tonic-gate	brnz	%g2, 2b
1457c478bdstevel@tonic-gate	restore
1467c478bdstevel@tonic-gate3:
1477c478bdstevel@tonic-gate	retl
1487c478bdstevel@tonic-gate	nop
1497c478bdstevel@tonic-gate	SET_SIZE(dtrace_flush_user_windows)
1507c478bdstevel@tonic-gate
1517c478bdstevel@tonic-gate#endif	/* lint */
1527c478bdstevel@tonic-gate
1537c478bdstevel@tonic-gate#if defined(lint) || defined(__lint)
1547c478bdstevel@tonic-gate
1557c478bdstevel@tonic-gateuint32_t
1567c478bdstevel@tonic-gatedtrace_cas32(uint32_t *target, uint32_t cmp, uint32_t new)
1577c478bdstevel@tonic-gate{
1587c478bdstevel@tonic-gate	uint32_t old;
1597c478bdstevel@tonic-gate
1607c478bdstevel@tonic-gate	if ((old = *target) == cmp)
1617c478bdstevel@tonic-gate		*target = new;
1627c478bdstevel@tonic-gate	return (old);
1637c478bdstevel@tonic-gate}
1647c478bdstevel@tonic-gate
1657c478bdstevel@tonic-gatevoid *
1667c478bdstevel@tonic-gatedtrace_casptr(void *target, void *cmp, void *new)
1677c478bdstevel@tonic-gate{
1687c478bdstevel@tonic-gate	void *old;
1697c478bdstevel@tonic-gate
1707c478bdstevel@tonic-gate	if ((old = *(void **)target) == cmp)
1717c478bdstevel@tonic-gate		*(void **)target = new;
1727c478bdstevel@tonic-gate	return (old);
1737c478bdstevel@tonic-gate}
1747c478bdstevel@tonic-gate
1757c478bdstevel@tonic-gate#else	/* lint */
1767c478bdstevel@tonic-gate
1777c478bdstevel@tonic-gate	ENTRY(dtrace_cas32)
1787c478bdstevel@tonic-gate	cas	[%o0], %o1, %o2
1797c478bdstevel@tonic-gate	retl
1807c478bdstevel@tonic-gate	mov	%o2, %o0
1817c478bdstevel@tonic-gate	SET_SIZE(dtrace_cas32)
1827c478bdstevel@tonic-gate
1837c478bdstevel@tonic-gate	ENTRY(dtrace_casptr)
1847c478bdstevel@tonic-gate	casn	[%o0], %o1, %o2
1857c478bdstevel@tonic-gate	retl
1867c478bdstevel@tonic-gate	mov	%o2, %o0
1877c478bdstevel@tonic-gate	SET_SIZE(dtrace_casptr)
1887c478bdstevel@tonic-gate
1897c478bdstevel@tonic-gate#endif	/* lint */
1907c478bdstevel@tonic-gate
1917c478bdstevel@tonic-gate#if defined(lint)
1927c478bdstevel@tonic-gate
1937c478bdstevel@tonic-gate/*ARGSUSED*/
1947c478bdstevel@tonic-gateuintptr_t
1957c478bdstevel@tonic-gatedtrace_caller(int aframes)
1967c478bdstevel@tonic-gate{
1977c478bdstevel@tonic-gate	return (0);
1987c478bdstevel@tonic-gate}
1997c478bdstevel@tonic-gate
2007c478bdstevel@tonic-gate#else	/* lint */
2017c478bdstevel@tonic-gate
2027c478bdstevel@tonic-gate	ENTRY(dtrace_caller)
2037c478bdstevel@tonic-gate	sethi	%hi(nwin_minus_one), %g4
2047c478bdstevel@tonic-gate	ld	[%g4 + %lo(nwin_minus_one)], %g4
2057c478bdstevel@tonic-gate	rdpr	%canrestore, %g2
2067c478bdstevel@tonic-gate	cmp	%g2, %o0
2077c478bdstevel@tonic-gate	bl	%icc, 1f
2087c478bdstevel@tonic-gate	rdpr	%cwp, %g1
2097c478bdstevel@tonic-gate	sub	%g1, %o0, %g3
2107c478bdstevel@tonic-gate	brgez,a,pt %g3, 0f
2117c478bdstevel@tonic-gate	wrpr	%g3, %cwp
2127c478bdstevel@tonic-gate
2137c478bdstevel@tonic-gate	!
2147c478bdstevel@tonic-gate	! CWP minus the number of frames is negative; we must perform the
2157c478bdstevel@tonic-gate	! arithmetic modulo MAXWIN.
2167c478bdstevel@tonic-gate	!
2177c478bdstevel@tonic-gate	add	%g4, %g3, %g3
2187c478bdstevel@tonic-gate	inc	%g3
2197c478bdstevel@tonic-gate	wrpr	%g3, %cwp
2207c478bdstevel@tonic-gate0:
2217c478bdstevel@tonic-gate	mov	%i7, %g4
2227c478bdstevel@tonic-gate	wrpr	%g1, %cwp
2237c478bdstevel@tonic-gate	retl
2247c478bdstevel@tonic-gate	mov	%g4, %o0
2257c478bdstevel@tonic-gate1:
2267c478bdstevel@tonic-gate	!
2277c478bdstevel@tonic-gate	! The caller has been flushed to the stack.  This is unlikely
2287c478bdstevel@tonic-gate	! (interrupts are disabled in dtrace_probe()), but possible (the
2297c478bdstevel@tonic-gate	! interrupt inducing the spill may have been taken before the
2307c478bdstevel@tonic-gate	! call to dtrace_probe()).
2317c478bdstevel@tonic-gate	!
2327c478bdstevel@tonic-gate	retl
2337c478bdstevel@tonic-gate	mov	-1, %o0
2347c478bdstevel@tonic-gate	SET_SIZE(dtrace_caller)
2357c478bdstevel@tonic-gate
2367c478bdstevel@tonic-gate#endif
2377c478bdstevel@tonic-gate
2387c478bdstevel@tonic-gate#if defined(lint)
2397c478bdstevel@tonic-gate
2407c478bdstevel@tonic-gate/*ARGSUSED*/
2417c478bdstevel@tonic-gateint
2427c478bdstevel@tonic-gatedtrace_fish(int aframes, int reg, uintptr_t *regval)
2437c478bdstevel@tonic-gate{
2447c478bdstevel@tonic-gate	return (0);
2457c478bdstevel@tonic-gate}
2467c478bdstevel@tonic-gate
2477c478bdstevel@tonic-gate#else	/* lint */
2487c478bdstevel@tonic-gate
2497c478bdstevel@tonic-gate	ENTRY(dtrace_fish)
2507c478bdstevel@tonic-gate
2517c478bdstevel@tonic-gate	rd	%pc, %g5
2527c478bdstevel@tonic-gate	ba	0f
2537c478bdstevel@tonic-gate	add	%g5, 12, %g5
2547c478bdstevel@tonic-gate	mov	%l0, %g4
2557c478bdstevel@tonic-gate	mov	%l1, %g4
2567c478bdstevel@tonic-gate	mov	%l2, %g4
2577c478bdstevel@tonic-gate	mov	%l3, %g4
2587c478bdstevel@tonic-gate	mov	%l4, %g4
2597c478bdstevel@tonic-gate	mov	%l5, %g4
2607c478bdstevel@tonic-gate	mov	%l6, %g4
2617c478bdstevel@tonic-gate	mov	%l7, %g4
2627c478bdstevel@tonic-gate	mov	%i0, %g4
2637c478bdstevel@tonic-gate	mov	%i1, %g4
2647c478bdstevel@tonic-gate	mov	%i2, %g4
2657c478bdstevel@tonic-gate	mov	%i3, %g4
2667c478bdstevel@tonic-gate	mov	%i4, %g4
2677c478bdstevel@tonic-gate	mov	%i5, %g4
2687c478bdstevel@tonic-gate	mov	%i6, %g4
2697c478bdstevel@tonic-gate	mov	%i7, %g4
2707c478bdstevel@tonic-gate0:
2717c478bdstevel@tonic-gate	sub	%o1, 16, %o1		! Can only retrieve %l's and %i's
2727c478bdstevel@tonic-gate	sll	%o1, 2, %o1		! Multiply by instruction size
2737c478bdstevel@tonic-gate	add	%g5, %o1, %g5		! %g5 now contains the instr. to pick
2747c478bdstevel@tonic-gate
2757c478bdstevel@tonic-gate	sethi	%hi(nwin_minus_one), %g4
2767c478bdstevel@tonic-gate	ld	[%g4 + %lo(nwin_minus_one)], %g4
2777c478bdstevel@tonic-gate
2787c478bdstevel@tonic-gate	!
2797c478bdstevel@tonic-gate	! First we need to see if the frame that we're fishing in is still
2807c478bdstevel@tonic-gate	! contained in the register windows.
2817c478bdstevel@tonic-gate	!
2827c478bdstevel@tonic-gate	rdpr	%canrestore, %g2
2837c478bdstevel@tonic-gate	cmp	%g2, %o0
2847c478bdstevel@tonic-gate	bl	%icc, 2f
2857c478bdstevel@tonic-gate	rdpr	%cwp, %g1
2867c478bdstevel@tonic-gate	sub	%g1, %o0, %g3
2877c478bdstevel@tonic-gate	brgez,a,pt %g3, 0f
2887c478bdstevel@tonic-gate	wrpr	%g3, %cwp
2897c478bdstevel@tonic-gate
2907c478bdstevel@tonic-gate	!
2917c478bdstevel@tonic-gate	! CWP minus the number of frames is negative; we must perform the
2927c478bdstevel@tonic-gate	! arithmetic modulo MAXWIN.
2937c478bdstevel@tonic-gate	!
2947c478bdstevel@tonic-gate	add	%g4, %g3, %g3
2957c478bdstevel@tonic-gate	inc	%g3
2967c478bdstevel@tonic-gate	wrpr	%g3, %cwp
2977c478bdstevel@tonic-gate0:
2987c478bdstevel@tonic-gate	jmp	%g5
2997c478bdstevel@tonic-gate	ba	1f
3007c478bdstevel@tonic-gate1:
3017c478bdstevel@tonic-gate	wrpr	%g1, %cwp
3027c478bdstevel@tonic-gate	stn	%g4, [%o2]
3037c478bdstevel@tonic-gate	retl
3047c478bdstevel@tonic-gate	clr	%o0			! Success; return 0.
3057c478bdstevel@tonic-gate2:
3067c478bdstevel@tonic-gate	!
3077c478bdstevel@tonic-gate	! The frame that we're looking for has been flushed to the stack; the
3087c478bdstevel@tonic-gate	! caller will be forced to
3097c478bdstevel@tonic-gate	!
3107c478bdstevel@tonic-gate	retl
3117c478bdstevel@tonic-gate	add	%g2, 1, %o0		! Failure; return deepest frame + 1
3127c478bdstevel@tonic-gate	SET_SIZE(dtrace_fish)
3137c478bdstevel@tonic-gate
3147c478bdstevel@tonic-gate#endif
3157c478bdstevel@tonic-gate
3167c478bdstevel@tonic-gate#if defined(lint)
3177c478bdstevel@tonic-gate
3187c478bdstevel@tonic-gate/*ARGSUSED*/
3197c478bdstevel@tonic-gatevoid
3202840650sudheerdtrace_copyin(uintptr_t uaddr, uintptr_t kaddr, size_t size,
3212840650sudheer    volatile uint16_t *flags)
3227c478bdstevel@tonic-gate{}
3237c478bdstevel@tonic-gate
3247c478bdstevel@tonic-gate#else
3257c478bdstevel@tonic-gate
3267c478bdstevel@tonic-gate	ENTRY(dtrace_copyin)
3277c478bdstevel@tonic-gate	tst	%o2
3282840650sudheer	bz	2f
3297c478bdstevel@tonic-gate	clr	%g1
3307c478bdstevel@tonic-gate	lduba	[%o0 + %g1]ASI_USER, %g2
3317c478bdstevel@tonic-gate0:
3322840650sudheer	! check for an error if the count is 4k-aligned
3332840650sudheer	andcc	%g1, 0xfff, %g0
3342840650sudheer	bnz,pt	%icc, 1f
3357c478bdstevel@tonic-gate	stub	%g2, [%o1 + %g1]
3362840650sudheer	lduh	[%o3], %g3
3372840650sudheer	andcc	%g3, CPU_DTRACE_BADADDR, %g0
3382840650sudheer	bnz,pn	%icc, 2f
3392840650sudheer	nop
3402840650sudheer1:
3417c478bdstevel@tonic-gate	inc	%g1
3427c478bdstevel@tonic-gate	cmp	%g1, %o2
3437c478bdstevel@tonic-gate	bl,a	0b
3447c478bdstevel@tonic-gate	lduba	[%o0 + %g1]ASI_USER, %g2
3452840650sudheer2:
3467c478bdstevel@tonic-gate	retl
3477c478bdstevel@tonic-gate	nop
3487c478bdstevel@tonic-gate
3497c478bdstevel@tonic-gate	SET_SIZE(dtrace_copyin)
3507c478bdstevel@tonic-gate
3517c478bdstevel@tonic-gate#endif
3527c478bdstevel@tonic-gate
3537c478bdstevel@tonic-gate#if defined(lint)
3547c478bdstevel@tonic-gate
3557c478bdstevel@tonic-gate/*ARGSUSED*/
3567c478bdstevel@tonic-gatevoid
3572840650sudheerdtrace_copyinstr(uintptr_t uaddr, uintptr_t kaddr, size_t size,
3582840650sudheer    volatile  uint16_t *flags)
3597c478bdstevel@tonic-gate{}
3607c478bdstevel@tonic-gate
3617c478bdstevel@tonic-gate#else
3627c478bdstevel@tonic-gate
3637c478bdstevel@tonic-gate	ENTRY(dtrace_copyinstr)
3647c478bdstevel@tonic-gate	tst	%o2
3652840650sudheer	bz	2f
3667c478bdstevel@tonic-gate	clr	%g1
3677c478bdstevel@tonic-gate	lduba	[%o0 + %g1]ASI_USER, %g2
3687c478bdstevel@tonic-gate0:
3697c478bdstevel@tonic-gate	stub	%g2, [%o1 + %g1]		! Store byte
3702840650sudheer
3712840650sudheer	! check for an error if the count is 4k-aligned
3722840650sudheer	andcc	%g1, 0xfff, %g0
3732840650sudheer	bnz,pt	%icc, 1f
3742840650sudheer	inc	%g1
3752840650sudheer	lduh	[%o3], %g3
3762840650sudheer	andcc	%g3, CPU_DTRACE_BADADDR, %g0
3772840650sudheer	bnz,pn	%icc, 2f
3782840650sudheer	nop
3792840650sudheer1:
3807c478bdstevel@tonic-gate	cmp	%g2, 0				! Was that '\0'?
3812840650sudheer	be	2f				! If so, we're done
3827c478bdstevel@tonic-gate	cmp	%g1, %o2			! Compare to limit
3837c478bdstevel@tonic-gate	bl,a	0b				! If less, take another lap
3847c478bdstevel@tonic-gate	lduba	[%o0 + %g1]ASI_USER, %g2	!   delay: load user byte
3852840650sudheer2:
3867c478bdstevel@tonic-gate	retl
3877c478bdstevel@tonic-gate	nop
3887c478bdstevel@tonic-gate
3897c478bdstevel@tonic-gate	SET_SIZE(dtrace_copyinstr)
3907c478bdstevel@tonic-gate
3917c478bdstevel@tonic-gate#endif
3927c478bdstevel@tonic-gate
3937c478bdstevel@tonic-gate#if defined(lint)
3947c478bdstevel@tonic-gate
3957c478bdstevel@tonic-gate/*ARGSUSED*/
3967c478bdstevel@tonic-gatevoid
3972840650sudheerdtrace_copyout(uintptr_t kaddr, uintptr_t uaddr, size_t size,
3982840650sudheer    volatile  uint16_t *flags)
3997c478bdstevel@tonic-gate{}
4007c478bdstevel@tonic-gate
4017c478bdstevel@tonic-gate#else
4027c478bdstevel@tonic-gate
4037c478bdstevel@tonic-gate	ENTRY(dtrace_copyout)
4047c478bdstevel@tonic-gate	tst	%o2
4052840650sudheer	bz	2f
4067c478bdstevel@tonic-gate	clr	%g1
4077c478bdstevel@tonic-gate	ldub	[%o0 + %g1], %g2
4087c478bdstevel@tonic-gate0:
4092840650sudheer	! check for an error if the count is 4k-aligned
4102840650sudheer	andcc	%g1, 0xfff, %g0
4112840650sudheer	bnz,pt	%icc, 1f
4127c478bdstevel@tonic-gate	stba	%g2, [%o1 + %g1]ASI_USER
4132840650sudheer	lduh	[%o3], %g3
4142840650sudheer	andcc	%g3, CPU_DTRACE_BADADDR, %g0
4152840650sudheer	bnz,pn	%icc, 2f
4162840650sudheer	nop
4172840650sudheer1:
4187c478bdstevel@tonic-gate	inc	%g1
4197c478bdstevel@tonic-gate	cmp	%g1, %o2
4207c478bdstevel@tonic-gate	bl,a	0b
4217c478bdstevel@tonic-gate	ldub	[%o0 + %g1], %g2
4222840650sudheer2:
4237c478bdstevel@tonic-gate	retl
4247c478bdstevel@tonic-gate	nop
4257c478bdstevel@tonic-gate	SET_SIZE(dtrace_copyout)
4267c478bdstevel@tonic-gate
4277c478bdstevel@tonic-gate#endif
4287c478bdstevel@tonic-gate
4297c478bdstevel@tonic-gate#if defined(lint)
4307c478bdstevel@tonic-gate
4317c478bdstevel@tonic-gate/*ARGSUSED*/
4327c478bdstevel@tonic-gatevoid
4332840650sudheerdtrace_copyoutstr(uintptr_t kaddr, uintptr_t uaddr, size_t size,
4342840650sudheer    volatile  uint16_t *flags)
4357c478bdstevel@tonic-gate{}
4367c478bdstevel@tonic-gate
4377c478bdstevel@tonic-gate#else
4387c478bdstevel@tonic-gate
4397c478bdstevel@tonic-gate	ENTRY(dtrace_copyoutstr)
4407c478bdstevel@tonic-gate	tst	%o2
4412840650sudheer	bz	2f
4427c478bdstevel@tonic-gate	clr	%g1
4437c478bdstevel@tonic-gate	ldub	[%o0 + %g1], %g2
4447c478bdstevel@tonic-gate0:
4457c478bdstevel@tonic-gate	stba	%g2, [%o1 + %g1]ASI_USER
4462840650sudheer
4472840650sudheer	! check for an error if the count is 4k-aligned
4482840650sudheer	andcc	%g1, 0xfff, %g0
4492840650sudheer	bnz,pt  %icc, 1f
4507c478bdstevel@tonic-gate	inc	%g1
4512840650sudheer	lduh	[%o3], %g3
4522840650sudheer	andcc	%g3, CPU_DTRACE_BADADDR, %g0
4532840650sudheer	bnz,pn	%icc, 2f
4542840650sudheer	nop
4552840650sudheer1:
4562840650sudheer	cmp	%g2, 0
4572840650sudheer	be	2f
4587c478bdstevel@tonic-gate	cmp	%g1, %o2
4597c478bdstevel@tonic-gate	bl,a	0b
4607c478bdstevel@tonic-gate	ldub	[%o0 + %g1], %g2
4612840650sudheer2:
4627c478bdstevel@tonic-gate	retl
4637c478bdstevel@tonic-gate	nop
4647c478bdstevel@tonic-gate	SET_SIZE(dtrace_copyoutstr)
4657c478bdstevel@tonic-gate
4667c478bdstevel@tonic-gate#endif
4677c478bdstevel@tonic-gate
4687c478bdstevel@tonic-gate#if defined(lint)
4697c478bdstevel@tonic-gate
4707c478bdstevel@tonic-gate/*ARGSUSED*/
4717c478bdstevel@tonic-gateuintptr_t
4727c478bdstevel@tonic-gatedtrace_fulword(void *addr)
4737c478bdstevel@tonic-gate{ return (0); }
4747c478bdstevel@tonic-gate
4757c478bdstevel@tonic-gate#else
4767c478bdstevel@tonic-gate
4777c478bdstevel@tonic-gate	ENTRY(dtrace_fulword)
4787c478bdstevel@tonic-gate	clr	%o1
4797c478bdstevel@tonic-gate	ldna	[%o0]ASI_USER, %o1
4807c478bdstevel@tonic-gate	retl
4817c478bdstevel@tonic-gate	mov	%o1, %o0
4827c478bdstevel@tonic-gate	SET_SIZE(dtrace_fulword)
4837c478bdstevel@tonic-gate
4847c478bdstevel@tonic-gate#endif
4857c478bdstevel@tonic-gate
4867c478bdstevel@tonic-gate#if defined(lint)
4877c478bdstevel@tonic-gate
4887c478bdstevel@tonic-gate/*ARGSUSED*/
4897c478bdstevel@tonic-gateuint8_t
4907c478bdstevel@tonic-gatedtrace_fuword8(void *addr)
4917c478bdstevel@tonic-gate{ return (0); }
4927c478bdstevel@tonic-gate
4937c478bdstevel@tonic-gate#else
4947c478bdstevel@tonic-gate
4957c478bdstevel@tonic-gate	ENTRY(dtrace_fuword8)
4967c478bdstevel@tonic-gate	clr	%o1
4977c478bdstevel@tonic-gate	lduba	[%o0]ASI_USER, %o1
4987c478bdstevel@tonic-gate	retl
4997c478bdstevel@tonic-gate	mov	%o1, %o0
5007c478bdstevel@tonic-gate	SET_SIZE(dtrace_fuword8)
5017c478bdstevel@tonic-gate
5027c478bdstevel@tonic-gate#endif
5037c478bdstevel@tonic-gate
5047c478bdstevel@tonic-gate#if defined(lint)
5057c478bdstevel@tonic-gate
5067c478bdstevel@tonic-gate/*ARGSUSED*/
5077c478bdstevel@tonic-gateuint16_t
5087c478bdstevel@tonic-gatedtrace_fuword16(void *addr)
5097c478bdstevel@tonic-gate{ return (0); }
5107c478bdstevel@tonic-gate
5117c478bdstevel@tonic-gate#else
5127c478bdstevel@tonic-gate
5137c478bdstevel@tonic-gate	ENTRY(dtrace_fuword16)
5147c478bdstevel@tonic-gate	clr	%o1
5157c478bdstevel@tonic-gate	lduha	[%o0]ASI_USER, %o1
5167c478bdstevel@tonic-gate	retl
5177c478bdstevel@tonic-gate	mov	%o1, %o0
5187c478bdstevel@tonic-gate	SET_SIZE(dtrace_fuword16)
5197c478bdstevel@tonic-gate
5207c478bdstevel@tonic-gate#endif
5217c478bdstevel@tonic-gate
5227c478bdstevel@tonic-gate#if defined(lint)
5237c478bdstevel@tonic-gate
5247c478bdstevel@tonic-gate/*ARGSUSED*/
5257c478bdstevel@tonic-gateuint32_t
5267c478bdstevel@tonic-gatedtrace_fuword32(void *addr)
5277c478bdstevel@tonic-gate{ return (0); }
5287c478bdstevel@tonic-gate
5297c478bdstevel@tonic-gate#else
5307c478bdstevel@tonic-gate
5317c478bdstevel@tonic-gate	ENTRY(dtrace_fuword32)
5327c478bdstevel@tonic-gate	clr	%o1
5337c478bdstevel@tonic-gate	lda	[%o0]ASI_USER, %o1
5347c478bdstevel@tonic-gate	retl
5357c478bdstevel@tonic-gate	mov	%o1, %o0
5367c478bdstevel@tonic-gate	SET_SIZE(dtrace_fuword32)
5377c478bdstevel@tonic-gate
5387c478bdstevel@tonic-gate#endif
5397c478bdstevel@tonic-gate
5407c478bdstevel@tonic-gate#if defined(lint)
5417c478bdstevel@tonic-gate
5427c478bdstevel@tonic-gate/*ARGSUSED*/
5437c478bdstevel@tonic-gateuint64_t
5447c478bdstevel@tonic-gatedtrace_fuword64(void *addr)
5457c478bdstevel@tonic-gate{ return (0); }
5467c478bdstevel@tonic-gate
5477c478bdstevel@tonic-gate#else
5487c478bdstevel@tonic-gate
5497c478bdstevel@tonic-gate	ENTRY(dtrace_fuword64)
5507c478bdstevel@tonic-gate	clr	%o1
5517c478bdstevel@tonic-gate	ldxa	[%o0]ASI_USER, %o1
5527c478bdstevel@tonic-gate	retl
5537c478bdstevel@tonic-gate	mov	%o1, %o0
5547c478bdstevel@tonic-gate	SET_SIZE(dtrace_fuword64)
5557c478bdstevel@tonic-gate
5567c478bdstevel@tonic-gate#endif
5577c478bdstevel@tonic-gate
5587c478bdstevel@tonic-gate#if defined(lint)
5597c478bdstevel@tonic-gate
5607c478bdstevel@tonic-gate/*ARGSUSED*/
5617c478bdstevel@tonic-gateint
5627c478bdstevel@tonic-gatedtrace_getupcstack_top(uint64_t *pcstack, int pcstack_limit, uintptr_t *sp)
5637c478bdstevel@tonic-gate{ return (0); }
5647c478bdstevel@tonic-gate
5657c478bdstevel@tonic-gate#else
5667c478bdstevel@tonic-gate
5677c478bdstevel@tonic-gate	/*
5687c478bdstevel@tonic-gate	 * %g1	pcstack
5697c478bdstevel@tonic-gate	 * %g2	current window
5707c478bdstevel@tonic-gate	 * %g3	maxwin (nwindows - 1)
5717c478bdstevel@tonic-gate	 * %g4	saved %cwp (so we can get back to the original window)
5727c478bdstevel@tonic-gate	 * %g5	iteration count
5737c478bdstevel@tonic-gate	 * %g6	saved %fp
5747c478bdstevel@tonic-gate	 *
5757c478bdstevel@tonic-gate	 * %o0	pcstack / return value (iteration count)
5767c478bdstevel@tonic-gate	 * %o1	pcstack_limit
5777c478bdstevel@tonic-gate	 * %o2	last_fp
5787c478bdstevel@tonic-gate	 */
5797c478bdstevel@tonic-gate
5807c478bdstevel@tonic-gate	ENTRY(dtrace_getupcstack_top)
5817c478bdstevel@tonic-gate	mov	%o0, %g1		! we need the pcstack pointer while
5827c478bdstevel@tonic-gate					! we're visiting other windows
5837c478bdstevel@tonic-gate
5847c478bdstevel@tonic-gate	rdpr	%otherwin, %g5		! compute the number of iterations
5857c478bdstevel@tonic-gate	cmp	%g5, %o1		! (windows to observe) by taking the
5867c478bdstevel@tonic-gate	movg	%icc, %o1, %g5		! min of %otherwin and pcstack_limit
5877c478bdstevel@tonic-gate
5887c478bdstevel@tonic-gate	brlez,a,pn %g5, 2f		! return 0 if count <= 0
5897c478bdstevel@tonic-gate	clr	%o0
5907c478bdstevel@tonic-gate
5917c478bdstevel@tonic-gate	sethi	%hi(nwin_minus_one), %g3 ! hang onto maxwin since we'll need
5927c478bdstevel@tonic-gate	ld	[%g3 + %lo(nwin_minus_one)], %g3 ! it for our modular arithmetic
5937c478bdstevel@tonic-gate
5947c478bdstevel@tonic-gate	rdpr	%cwp, %g4		! remember our window so we can return
5957c478bdstevel@tonic-gate	rdpr	%canrestore, %g2	! compute the first non-user window
5960b38a8bahl	subcc	%g4, %g2, %g2		! current = %cwp - %canrestore
5977c478bdstevel@tonic-gate
5987c478bdstevel@tonic-gate	bge,pt	%xcc, 1f		! good to go if current is >= 0
5997c478bdstevel@tonic-gate	mov	%g5, %o0		! we need to return the count
6007c478bdstevel@tonic-gate
6017c478bdstevel@tonic-gate	add	%g2, %g3, %g2		! normalize our current window if it's
6027c478bdstevel@tonic-gate	add	%g2, 1, %g2		! less than zero
6037c478bdstevel@tonic-gate
6047c478bdstevel@tonic-gate	! note that while it's tempting, we can't execute restore to decrement
6057c478bdstevel@tonic-gate	! the %cwp by one (mod nwindows) because we're in the user's windows
6067c478bdstevel@tonic-gate1:
6077c478bdstevel@tonic-gate	deccc	%g2			! decrement the current window
6087c478bdstevel@tonic-gate	movl	%xcc, %g3, %g2		! normalize if it's negative (-1)
6097c478bdstevel@tonic-gate
6107c478bdstevel@tonic-gate	wrpr	%g2, %cwp		! change windows
6117c478bdstevel@tonic-gate
6127c478bdstevel@tonic-gate	stx	%i7, [%g1]		! stash the return address in pcstack
6137c478bdstevel@tonic-gate
6147c478bdstevel@tonic-gate	deccc	%g5			! decrement the count
6157c478bdstevel@tonic-gate	bnz,pt	%icc, 1b		! we iterate until the count reaches 0
6167c478bdstevel@tonic-gate	add	%g1, 8, %g1		! increment the pcstack pointer
6177c478bdstevel@tonic-gate
6187c478bdstevel@tonic-gate	mov	%i6, %g6		! stash the last frame pointer we
6197c478bdstevel@tonic-gate					! encounter so the caller can
6207c478bdstevel@tonic-gate					! continue the stack walk in memory
6217c478bdstevel@tonic-gate
6227c478bdstevel@tonic-gate	wrpr	%g4, %cwp		! change back to the original window
6237c478bdstevel@tonic-gate
6247c478bdstevel@tonic-gate	stn	%g6, [%o2]		! return the last frame pointer
6257c478bdstevel@tonic-gate
6267c478bdstevel@tonic-gate2:
6277c478bdstevel@tonic-gate	retl
6287c478bdstevel@tonic-gate	nop
6297c478bdstevel@tonic-gate	SET_SIZE(dtrace_getupcstack_top)
6307c478bdstevel@tonic-gate
6317c478bdstevel@tonic-gate#endif
6327c478bdstevel@tonic-gate
6330b38a8bahl#if defined(lint)
6340b38a8bahl
6350b38a8bahl/*ARGSUSED*/
6360b38a8bahlint
6370b38a8bahldtrace_getustackdepth_top(uintptr_t *sp)
6380b38a8bahl{ return (0); }
6390b38a8bahl
6400b38a8bahl#else
6410b38a8bahl
6420b38a8bahl	ENTRY(dtrace_getustackdepth_top)
6430b38a8bahl	mov	%o0, %o2
6440b38a8bahl	rdpr	%otherwin, %o0
6450b38a8bahl
6460b38a8bahl	brlez,a,pn %o0, 2f		! return 0 if there are no user wins
6470b38a8bahl	clr	%o0
6480b38a8bahl
6490b38a8bahl	rdpr	%cwp, %g4		! remember our window so we can return
6500b38a8bahl	rdpr	%canrestore, %g2	! compute the first user window
6510b38a8bahl	sub	%g4, %g2, %g2		! current = %cwp - %canrestore -
6520b38a8bahl	subcc	%g2, %o0, %g2		!     %otherwin
6530b38a8bahl
6540b38a8bahl	bge,pt	%xcc, 1f		! normalize the window if necessary
6550b38a8bahl	sethi	%hi(nwin_minus_one), %g3
6560b38a8bahl	ld	[%g3 + %lo(nwin_minus_one)], %g3
6570b38a8bahl	add	%g2, %g3, %g2
6580b38a8bahl	add	%g2, 1, %g2
6590b38a8bahl
6600b38a8bahl1:
6610b38a8bahl	wrpr	%g2, %cwp		! change to the first user window
6620b38a8bahl	mov	%i6, %g6		! stash the frame pointer
6630b38a8bahl	wrpr	%g4, %cwp		! change back to the original window
6640b38a8bahl
6650b38a8bahl	stn	%g6, [%o2]		! return the frame pointer
6660b38a8bahl
6670b38a8bahl2:
6680b38a8bahl	retl
6690b38a8bahl	nop
6700b38a8bahl	SET_SIZE(dtrace_getustackdepth_top)
6710b38a8bahl
6720b38a8bahl#endif
6730b38a8bahl
6747c478bdstevel@tonic-gate#if defined(lint) || defined(__lint)
6757c478bdstevel@tonic-gate
6767c478bdstevel@tonic-gate/* ARGSUSED */
6777c478bdstevel@tonic-gateulong_t
6787c478bdstevel@tonic-gatedtrace_getreg_win(uint_t reg, uint_t depth)
6797c478bdstevel@tonic-gate{ return (0); }
6807c478bdstevel@tonic-gate
6817c478bdstevel@tonic-gate#else	/* lint */
6827c478bdstevel@tonic-gate
6837c478bdstevel@tonic-gate	ENTRY(dtrace_getreg_win)
6847c478bdstevel@tonic-gate	sub	%o0, 16, %o0
6857c478bdstevel@tonic-gate	cmp	%o0, 16			! %o0 must begin in the range [16..32)
6867c478bdstevel@tonic-gate	blu,pt	%xcc, 1f
6877c478bdstevel@tonic-gate	nop
6887c478bdstevel@tonic-gate	retl
6897c478bdstevel@tonic-gate	clr	%o0
6907c478bdstevel@tonic-gate
6917c478bdstevel@tonic-gate1:
6927c478bdstevel@tonic-gate	set	dtrace_getreg_win_table, %g3
6937c478bdstevel@tonic-gate	sll	%o0, 2, %o0
6947c478bdstevel@tonic-gate	add	%g3, %o0, %g3
6957c478bdstevel@tonic-gate
6967c478bdstevel@tonic-gate	rdpr	%canrestore, %o3
6977c478bdstevel@tonic-gate	rdpr	%cwp, %g2
6987c478bdstevel@tonic-gate
6997c478bdstevel@tonic-gate	! Set %cwp to be (%cwp - %canrestore - %o1) mod NWINDOWS
7007c478bdstevel@tonic-gate
7017c478bdstevel@tonic-gate	sub	%g2, %o3, %o2		! %o2 is %cwp - %canrestore
7027c478bdstevel@tonic-gate	subcc	%o2, %o1, %o4
7037c478bdstevel@tonic-gate	bge,a,pn %xcc, 2f
7047c478bdstevel@tonic-gate	wrpr	%o4, %cwp
7057c478bdstevel@tonic-gate
7067c478bdstevel@tonic-gate	sethi	%hi(nwin_minus_one), %o3
7077c478bdstevel@tonic-gate	ld	[%o3 + %lo(nwin_minus_one)], %o3
7087c478bdstevel@tonic-gate
7097c478bdstevel@tonic-gate	add	%o2, %o3, %o4
7107c478bdstevel@tonic-gate	wrpr	%o4, %cwp
7117c478bdstevel@tonic-gate2:
7127c478bdstevel@tonic-gate	jmp	%g3
7137c478bdstevel@tonic-gate	ba	3f
7147c478bdstevel@tonic-gate3:
7157c478bdstevel@tonic-gate	wrpr	%g2, %cwp
7167c478bdstevel@tonic-gate	retl
7177c478bdstevel@tonic-gate	mov	%g1, %o0
7187c478bdstevel@tonic-gate
7197c478bdstevel@tonic-gatedtrace_getreg_win_table:
7207c478bdstevel@tonic-gate	mov	%l0, %g1
7217c478bdstevel@tonic-gate	mov	%l1, %g1
7227c478bdstevel@tonic-gate	mov	%l2, %g1
7237c478bdstevel@tonic-gate	mov	%l3, %g1
7247c478bdstevel@tonic-gate	mov	%l4, %g1
7257c478bdstevel@tonic-gate	mov	%l5, %g1
7267c478bdstevel@tonic-gate	mov	%l6, %g1
7277c478bdstevel@tonic-gate	mov	%l7, %g1
7287c478bdstevel@tonic-gate	mov	%i0, %g1
7297c478bdstevel@tonic-gate	mov	%i1, %g1
7307c478bdstevel@tonic-gate	mov	%i2, %g1
7317c478bdstevel@tonic-gate	mov	%i3, %g1
7327c478bdstevel@tonic-gate	mov	%i4, %g1
7337c478bdstevel@tonic-gate	mov	%i5, %g1
7347c478bdstevel@tonic-gate	mov	%i6, %g1
7357c478bdstevel@tonic-gate	mov	%i7, %g1
7367c478bdstevel@tonic-gate	SET_SIZE(dtrace_getreg_win)
7377c478bdstevel@tonic-gate
7387c478bdstevel@tonic-gate#endif	/* lint */
7397c478bdstevel@tonic-gate
7407c478bdstevel@tonic-gate#if defined(lint) || defined(__lint)
7417c478bdstevel@tonic-gate
7427c478bdstevel@tonic-gate/* ARGSUSED */
7437c478bdstevel@tonic-gatevoid
7447c478bdstevel@tonic-gatedtrace_putreg_win(uint_t reg, ulong_t value)
7457c478bdstevel@tonic-gate{}
7467c478bdstevel@tonic-gate
7477c478bdstevel@tonic-gate#else	/* lint */
7487c478bdstevel@tonic-gate
7497c478bdstevel@tonic-gate	ENTRY(dtrace_putreg_win)
7507c478bdstevel@tonic-gate	sub	%o0, 16, %o0
7517c478bdstevel@tonic-gate	cmp	%o0, 16			! %o0 must be in the range [16..32)
7527c478bdstevel@tonic-gate	blu,pt	%xcc, 1f
7537c478bdstevel@tonic-gate	nop
7547c478bdstevel@tonic-gate	retl
7557c478bdstevel@tonic-gate	nop
7567c478bdstevel@tonic-gate
7577c478bdstevel@tonic-gate1:
7587c478bdstevel@tonic-gate	mov	%o1, %g1		! move the value into a global register
7597c478bdstevel@tonic-gate
7607c478bdstevel@tonic-gate	set	dtrace_putreg_table, %g3
7617c478bdstevel@tonic-gate	sll	%o0, 2, %o0
7627c478bdstevel@tonic-gate	add	%g3, %o0, %g3
7637c478bdstevel@tonic-gate
7647c478bdstevel@tonic-gate	rdpr	%canrestore, %o3
7657c478bdstevel@tonic-gate	rdpr	%cwp, %g2
7667c478bdstevel@tonic-gate
7677c478bdstevel@tonic-gate	! Set %cwp to be (%cwp - %canrestore - 1) mod NWINDOWS
7687c478bdstevel@tonic-gate
7697c478bdstevel@tonic-gate	sub	%g2, %o3, %o2		! %o2 is %cwp - %canrestore
7707c478bdstevel@tonic-gate	subcc	%o2, 1, %o4
7717c478bdstevel@tonic-gate	bge,a,pn %xcc, 2f
7727c478bdstevel@tonic-gate	wrpr	%o4, %cwp
7737c478bdstevel@tonic-gate
7747c478bdstevel@tonic-gate	sethi	%hi(nwin_minus_one), %o3
7757c478bdstevel@tonic-gate	ld	[%o3 + %lo(nwin_minus_one)], %o3
7767c478bdstevel@tonic-gate	add	%o2, %o3, %o4
7777c478bdstevel@tonic-gate	wrpr	%o4, %cwp
7787c478bdstevel@tonic-gate2:
7797c478bdstevel@tonic-gate	jmp	%g3
7807c478bdstevel@tonic-gate	ba	3f
7817c478bdstevel@tonic-gate3:
7827c478bdstevel@tonic-gate	wrpr	%g2, %cwp
7837c478bdstevel@tonic-gate	retl
7847c478bdstevel@tonic-gate	nop
7857c478bdstevel@tonic-gate
7867c478bdstevel@tonic-gatedtrace_putreg_table:
7877c478bdstevel@tonic-gate	mov	%g1, %l0
7887c478bdstevel@tonic-gate	mov	%g1, %l1
7897c478bdstevel@tonic-gate	mov	%g1, %l2
7907c478bdstevel@tonic-gate	mov	%g1, %l3
7917c478bdstevel@tonic-gate	mov	%g1, %l4
7927c478bdstevel@tonic-gate	mov	%g1, %l5
7937c478bdstevel@tonic-gate	mov	%g1, %l6
7947c478bdstevel@tonic-gate	mov	%g1, %l7
7957c478bdstevel@tonic-gate	mov	%g1, %i0
7967c478bdstevel@tonic-gate	mov	%g1, %i1
7977c478bdstevel@tonic-gate	mov	%g1, %i2
7987c478bdstevel@tonic-gate	mov	%g1, %i3
7997c478bdstevel@tonic-gate	mov	%g1, %i4
8007c478bdstevel@tonic-gate	mov	%g1, %i5
8017c478bdstevel@tonic-gate	mov	%g1, %i6
8027c478bdstevel@tonic-gate	mov	%g1, %i7
8037c478bdstevel@tonic-gate	SET_SIZE(dtrace_putreg_win)
8047c478bdstevel@tonic-gate
8057c478bdstevel@tonic-gate#endif	/* lint */
8067c478bdstevel@tonic-gate
8077c478bdstevel@tonic-gate#if defined(lint) || defined(__lint)
8087c478bdstevel@tonic-gate
8097c478bdstevel@tonic-gate/*ARGSUSED*/
8107c478bdstevel@tonic-gatevoid
8117c478bdstevel@tonic-gatedtrace_probe_error(dtrace_state_t *state, dtrace_epid_t epid, int which,
8127c478bdstevel@tonic-gate    int fault, int fltoffs, uintptr_t illval)
8137c478bdstevel@tonic-gate{}
8147c478bdstevel@tonic-gate
8157c478bdstevel@tonic-gate#else	/* lint */
8167c478bdstevel@tonic-gate
8177c478bdstevel@tonic-gate	ENTRY(dtrace_probe_error)
8187c478bdstevel@tonic-gate	save	%sp, -SA(MINFRAME), %sp
8197c478bdstevel@tonic-gate	sethi	%hi(dtrace_probeid_error), %l0
8207c478bdstevel@tonic-gate	ld	[%l0 + %lo(dtrace_probeid_error)], %o0
8217c478bdstevel@tonic-gate	mov	%i0, %o1
8227c478bdstevel@tonic-gate	mov	%i1, %o2
8237c478bdstevel@tonic-gate	mov	%i2, %o3
8247c478bdstevel@tonic-gate	mov	%i3, %o4
8257c478bdstevel@tonic-gate	call	dtrace_probe
8267c478bdstevel@tonic-gate	mov	%i4, %o5
8277c478bdstevel@tonic-gate	ret
8287c478bdstevel@tonic-gate	restore
8297c478bdstevel@tonic-gate	SET_SIZE(dtrace_probe_error)
8307c478bdstevel@tonic-gate
8317c478bdstevel@tonic-gate#endif
832