xref: /titanic_51/usr/src/cmd/mdb/sparc/v9/kmdb/kmdb_v9asmutil.s (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
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 2004 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#if defined(__lint)
30#include <sys/types.h>
31#include <kmdb/kmdb_asmutil.h>
32#endif
33
34#include <sys/asm_linkage.h>
35
36#if defined(__lint)
37/*ARGSUSED*/
38uintptr_t
39cas(uintptr_t *rs1, uintptr_t rs2, uintptr_t rd)
40{
41	return (0);
42}
43#else
44
45	ENTRY(cas)
46	casx	[%o0], %o1, %o2
47	retl
48	mov	%o2, %o0
49	SET_SIZE(cas)
50
51#endif
52
53#if defined(__lint)
54/*ARGSUSED*/
55void
56flush_windows(void)
57{
58}
59#else
60
61	ENTRY(flush_windows)
62	save
63	flushw
64	restore
65	retl
66	nop
67	SET_SIZE(flush_windows)
68
69#endif
70
71#if defined(__lint)
72/*ARGSUSED*/
73void
74membar_producer(void)
75{
76}
77#else
78
79	/*
80	 * US I has a problem with membars in the delay slot.  We don't care
81	 * about performance here, so for safety's sake, we'll assume that all
82	 * the world's an US I.
83	 */
84	ENTRY(membar_producer)
85	membar	#StoreStore
86	retl
87	nop
88	SET_SIZE(membar_producer)
89
90#endif
91
92#if defined(__lint)
93/*ARGSUSED*/
94uint64_t
95rdasi(uint32_t asi, uintptr_t va)
96{
97	return (0);
98}
99#else
100
101	ENTRY_NP(rdasi)
102	rd	%asi, %o3
103	wr	%o0, %asi
104	ldxa	[%o1]%asi, %o0
105	retl
106	wr	%o3, %asi
107	SET_SIZE(rdasi)
108
109#endif
110
111#if defined(__lint)
112/*ARGSUSED*/
113void
114wrasi(uint32_t asi, uintptr_t va, uint64_t val)
115{
116}
117#else
118
119	ENTRY_NP(wrasi)
120	rd	%asi, %o3
121	wr	%o0, %asi
122	stxa	%o2, [%o1]%asi
123	retl
124	wr	%o3, %asi
125	SET_SIZE(wrasi)
126
127#endif
128