xref: /titanic_41/usr/src/cmd/mdb/sparc/kmdb/kmdb_asmutil.s (revision 1816cb7076d3ec8a78ef9ac9f895574e13c43645)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License").  You may not use this file except in compliance
7 * with the License.
8 *
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
13 *
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 */
22/*
23 * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24 * Use is subject to license terms.
25 */
26
27#pragma ident	"%Z%%M%	%I%	%E% SMI"
28
29/*
30 * Utility Assembly routines used by the debugger.
31 */
32
33#if defined(__lint)
34#include <sys/types.h>
35#include <kmdb/kmdb_asmutil.h>
36#endif
37
38#include <sys/asm_linkage.h>
39#include <sys/privregs.h>
40#include "mach_asmutil.h"
41
42#if defined(__lint)
43int
44get_nwin(void)
45{
46	return (0);	/* wouldn't that be amusing */
47}
48#else
49
50	ENTRY(get_nwin)
51	GET_NWIN(%g4, %g3);	/* %g4 is scratch, %g3 set to nwin-1 */
52	mov	%g3, %o0
53	retl
54	add	%o0, 1, %o0
55	SET_SIZE(get_nwin)
56
57#endif
58
59#if defined(__lint)
60uintptr_t
61get_fp(void)
62{
63	return (0);
64}
65#else
66
67	ENTRY(get_fp)
68	retl
69	mov	%fp, %o0
70	SET_SIZE(get_fp)
71
72#endif
73
74#if defined(__lint)
75void
76interrupts_on(void)
77{
78}
79#else
80
81	ENTRY(interrupts_on)
82	rdpr	%pstate, %o0
83	bset	PSTATE_IE, %o0
84	retl
85	wrpr	%o0, %pstate
86	SET_SIZE(interrupts_on)
87
88#endif
89
90#if defined(__lint)
91void
92interrupts_off(void)
93{
94}
95#else
96
97	ENTRY(interrupts_off)
98	rdpr	%pstate, %o0
99	bclr	PSTATE_IE, %o0
100	retl
101	wrpr	%o0, %pstate
102	SET_SIZE(interrupts_off)
103
104#endif
105
106#if defined(__lint)
107caddr_t
108get_tba(void)
109{
110	return (0);
111}
112#else
113
114	ENTRY(get_tba)
115	retl
116	rdpr	%tba, %o0
117	SET_SIZE(get_tba)
118
119#endif
120
121#if defined(__lint)
122/*ARGSUSED*/
123void
124set_tba(caddr_t new)
125{
126}
127#else
128
129	ENTRY(set_tba)
130	retl
131	wrpr	%o0, %tba
132	SET_SIZE(set_tba)
133
134#endif
135