xref: /onnv-gate/usr/src/cmd/mdb/sparc/kmdb/kmdb_asmutil.s (revision 11583:24344dea001d)
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
5*11583SSurya.Prakki@Sun.COM * Common Development and Distribution License (the "License").
6*11583SSurya.Prakki@Sun.COM * 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 */
21*11583SSurya.Prakki@Sun.COM
220Sstevel@tonic-gate/*
23*11583SSurya.Prakki@Sun.COM * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
240Sstevel@tonic-gate * Use is subject to license terms.
250Sstevel@tonic-gate */
260Sstevel@tonic-gate
270Sstevel@tonic-gate/*
280Sstevel@tonic-gate * Utility Assembly routines used by the debugger.
290Sstevel@tonic-gate */
300Sstevel@tonic-gate
310Sstevel@tonic-gate#if defined(__lint)
320Sstevel@tonic-gate#include <sys/types.h>
330Sstevel@tonic-gate#include <kmdb/kmdb_asmutil.h>
340Sstevel@tonic-gate#endif
350Sstevel@tonic-gate
360Sstevel@tonic-gate#include <sys/asm_linkage.h>
370Sstevel@tonic-gate#include <sys/privregs.h>
380Sstevel@tonic-gate#include "mach_asmutil.h"
390Sstevel@tonic-gate
400Sstevel@tonic-gate#if defined(__lint)
410Sstevel@tonic-gateint
420Sstevel@tonic-gateget_nwin(void)
430Sstevel@tonic-gate{
440Sstevel@tonic-gate	return (0);	/* wouldn't that be amusing */
450Sstevel@tonic-gate}
460Sstevel@tonic-gate#else
470Sstevel@tonic-gate
480Sstevel@tonic-gate	ENTRY(get_nwin)
490Sstevel@tonic-gate	GET_NWIN(%g4, %g3);	/* %g4 is scratch, %g3 set to nwin-1 */
500Sstevel@tonic-gate	mov	%g3, %o0
510Sstevel@tonic-gate	retl
520Sstevel@tonic-gate	add	%o0, 1, %o0
530Sstevel@tonic-gate	SET_SIZE(get_nwin)
540Sstevel@tonic-gate
550Sstevel@tonic-gate#endif
560Sstevel@tonic-gate
570Sstevel@tonic-gate#if defined(__lint)
580Sstevel@tonic-gateuintptr_t
590Sstevel@tonic-gateget_fp(void)
600Sstevel@tonic-gate{
610Sstevel@tonic-gate	return (0);
620Sstevel@tonic-gate}
630Sstevel@tonic-gate#else
640Sstevel@tonic-gate
650Sstevel@tonic-gate	ENTRY(get_fp)
660Sstevel@tonic-gate	retl
670Sstevel@tonic-gate	mov	%fp, %o0
680Sstevel@tonic-gate	SET_SIZE(get_fp)
690Sstevel@tonic-gate
700Sstevel@tonic-gate#endif
710Sstevel@tonic-gate
720Sstevel@tonic-gate#if defined(__lint)
730Sstevel@tonic-gatevoid
740Sstevel@tonic-gateinterrupts_on(void)
750Sstevel@tonic-gate{
760Sstevel@tonic-gate}
770Sstevel@tonic-gate#else
780Sstevel@tonic-gate
790Sstevel@tonic-gate	ENTRY(interrupts_on)
800Sstevel@tonic-gate	rdpr	%pstate, %o0
810Sstevel@tonic-gate	bset	PSTATE_IE, %o0
820Sstevel@tonic-gate	retl
830Sstevel@tonic-gate	wrpr	%o0, %pstate
840Sstevel@tonic-gate	SET_SIZE(interrupts_on)
850Sstevel@tonic-gate
860Sstevel@tonic-gate#endif
870Sstevel@tonic-gate
880Sstevel@tonic-gate#if defined(__lint)
890Sstevel@tonic-gatevoid
900Sstevel@tonic-gateinterrupts_off(void)
910Sstevel@tonic-gate{
920Sstevel@tonic-gate}
930Sstevel@tonic-gate#else
940Sstevel@tonic-gate
950Sstevel@tonic-gate	ENTRY(interrupts_off)
960Sstevel@tonic-gate	rdpr	%pstate, %o0
970Sstevel@tonic-gate	bclr	PSTATE_IE, %o0
980Sstevel@tonic-gate	retl
990Sstevel@tonic-gate	wrpr	%o0, %pstate
1000Sstevel@tonic-gate	SET_SIZE(interrupts_off)
1010Sstevel@tonic-gate
1020Sstevel@tonic-gate#endif
1030Sstevel@tonic-gate
1040Sstevel@tonic-gate#if defined(__lint)
1050Sstevel@tonic-gatecaddr_t
1060Sstevel@tonic-gateget_tba(void)
1070Sstevel@tonic-gate{
1080Sstevel@tonic-gate	return (0);
1090Sstevel@tonic-gate}
1100Sstevel@tonic-gate#else
1110Sstevel@tonic-gate
1120Sstevel@tonic-gate	ENTRY(get_tba)
1130Sstevel@tonic-gate	retl
1140Sstevel@tonic-gate	rdpr	%tba, %o0
1150Sstevel@tonic-gate	SET_SIZE(get_tba)
1160Sstevel@tonic-gate
1170Sstevel@tonic-gate#endif
1180Sstevel@tonic-gate
1190Sstevel@tonic-gate#if defined(__lint)
1200Sstevel@tonic-gate/*ARGSUSED*/
121*11583SSurya.Prakki@Sun.COMvoid *
122*11583SSurya.Prakki@Sun.COMset_tba(void *new)
1230Sstevel@tonic-gate{
124*11583SSurya.Prakki@Sun.COM	return (0);
1250Sstevel@tonic-gate}
1260Sstevel@tonic-gate#else
1270Sstevel@tonic-gate
1280Sstevel@tonic-gate	ENTRY(set_tba)
1290Sstevel@tonic-gate	retl
1300Sstevel@tonic-gate	wrpr	%o0, %tba
1310Sstevel@tonic-gate	SET_SIZE(set_tba)
1320Sstevel@tonic-gate
1330Sstevel@tonic-gate#endif
134