1*7c478bd9Sstevel@tonic-gate/*
2*7c478bd9Sstevel@tonic-gate * CDDL HEADER START
3*7c478bd9Sstevel@tonic-gate *
4*7c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the
5*7c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only
6*7c478bd9Sstevel@tonic-gate * (the "License").  You may not use this file except in compliance
7*7c478bd9Sstevel@tonic-gate * with the License.
8*7c478bd9Sstevel@tonic-gate *
9*7c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing.
11*7c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions
12*7c478bd9Sstevel@tonic-gate * and limitations under the License.
13*7c478bd9Sstevel@tonic-gate *
14*7c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each
15*7c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the
17*7c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying
18*7c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner]
19*7c478bd9Sstevel@tonic-gate *
20*7c478bd9Sstevel@tonic-gate * CDDL HEADER END
21*7c478bd9Sstevel@tonic-gate */
22*7c478bd9Sstevel@tonic-gate/*
23*7c478bd9Sstevel@tonic-gate * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24*7c478bd9Sstevel@tonic-gate * Use is subject to license terms.
25*7c478bd9Sstevel@tonic-gate */
26*7c478bd9Sstevel@tonic-gate
27*7c478bd9Sstevel@tonic-gate#pragma ident	"%Z%%M%	%I%	%E% SMI"
28*7c478bd9Sstevel@tonic-gate
29*7c478bd9Sstevel@tonic-gate#if defined(__lint)
30*7c478bd9Sstevel@tonic-gate#include <sys/types.h>
31*7c478bd9Sstevel@tonic-gate#include <kmdb/kmdb_asmutil.h>
32*7c478bd9Sstevel@tonic-gate#endif
33*7c478bd9Sstevel@tonic-gate
34*7c478bd9Sstevel@tonic-gate#include <sys/asm_linkage.h>
35*7c478bd9Sstevel@tonic-gate
36*7c478bd9Sstevel@tonic-gate#if defined(__lint)
37*7c478bd9Sstevel@tonic-gate/*ARGSUSED*/
38*7c478bd9Sstevel@tonic-gateuintptr_t
39*7c478bd9Sstevel@tonic-gatecas(uintptr_t *rs1, uintptr_t rs2, uintptr_t rd)
40*7c478bd9Sstevel@tonic-gate{
41*7c478bd9Sstevel@tonic-gate	return (0);
42*7c478bd9Sstevel@tonic-gate}
43*7c478bd9Sstevel@tonic-gate#else
44*7c478bd9Sstevel@tonic-gate
45*7c478bd9Sstevel@tonic-gate	ENTRY(cas)
46*7c478bd9Sstevel@tonic-gate	casx	[%o0], %o1, %o2
47*7c478bd9Sstevel@tonic-gate	retl
48*7c478bd9Sstevel@tonic-gate	mov	%o2, %o0
49*7c478bd9Sstevel@tonic-gate	SET_SIZE(cas)
50*7c478bd9Sstevel@tonic-gate
51*7c478bd9Sstevel@tonic-gate#endif
52*7c478bd9Sstevel@tonic-gate
53*7c478bd9Sstevel@tonic-gate#if defined(__lint)
54*7c478bd9Sstevel@tonic-gate/*ARGSUSED*/
55*7c478bd9Sstevel@tonic-gatevoid
56*7c478bd9Sstevel@tonic-gateflush_windows(void)
57*7c478bd9Sstevel@tonic-gate{
58*7c478bd9Sstevel@tonic-gate}
59*7c478bd9Sstevel@tonic-gate#else
60*7c478bd9Sstevel@tonic-gate
61*7c478bd9Sstevel@tonic-gate	ENTRY(flush_windows)
62*7c478bd9Sstevel@tonic-gate	save
63*7c478bd9Sstevel@tonic-gate	flushw
64*7c478bd9Sstevel@tonic-gate	restore
65*7c478bd9Sstevel@tonic-gate	retl
66*7c478bd9Sstevel@tonic-gate	nop
67*7c478bd9Sstevel@tonic-gate	SET_SIZE(flush_windows)
68*7c478bd9Sstevel@tonic-gate
69*7c478bd9Sstevel@tonic-gate#endif
70*7c478bd9Sstevel@tonic-gate
71*7c478bd9Sstevel@tonic-gate#if defined(__lint)
72*7c478bd9Sstevel@tonic-gate/*ARGSUSED*/
73*7c478bd9Sstevel@tonic-gatevoid
74*7c478bd9Sstevel@tonic-gatemembar_producer(void)
75*7c478bd9Sstevel@tonic-gate{
76*7c478bd9Sstevel@tonic-gate}
77*7c478bd9Sstevel@tonic-gate#else
78*7c478bd9Sstevel@tonic-gate
79*7c478bd9Sstevel@tonic-gate	/*
80*7c478bd9Sstevel@tonic-gate	 * US I has a problem with membars in the delay slot.  We don't care
81*7c478bd9Sstevel@tonic-gate	 * about performance here, so for safety's sake, we'll assume that all
82*7c478bd9Sstevel@tonic-gate	 * the world's an US I.
83*7c478bd9Sstevel@tonic-gate	 */
84*7c478bd9Sstevel@tonic-gate	ENTRY(membar_producer)
85*7c478bd9Sstevel@tonic-gate	membar	#StoreStore
86*7c478bd9Sstevel@tonic-gate	retl
87*7c478bd9Sstevel@tonic-gate	nop
88*7c478bd9Sstevel@tonic-gate	SET_SIZE(membar_producer)
89*7c478bd9Sstevel@tonic-gate
90*7c478bd9Sstevel@tonic-gate#endif
91*7c478bd9Sstevel@tonic-gate
92*7c478bd9Sstevel@tonic-gate#if defined(__lint)
93*7c478bd9Sstevel@tonic-gate/*ARGSUSED*/
94*7c478bd9Sstevel@tonic-gateuint64_t
95*7c478bd9Sstevel@tonic-gaterdasi(uint32_t asi, uintptr_t va)
96*7c478bd9Sstevel@tonic-gate{
97*7c478bd9Sstevel@tonic-gate	return (0);
98*7c478bd9Sstevel@tonic-gate}
99*7c478bd9Sstevel@tonic-gate#else
100*7c478bd9Sstevel@tonic-gate
101*7c478bd9Sstevel@tonic-gate	ENTRY_NP(rdasi)
102*7c478bd9Sstevel@tonic-gate	rd	%asi, %o3
103*7c478bd9Sstevel@tonic-gate	wr	%o0, %asi
104*7c478bd9Sstevel@tonic-gate	ldxa	[%o1]%asi, %o0
105*7c478bd9Sstevel@tonic-gate	retl
106*7c478bd9Sstevel@tonic-gate	wr	%o3, %asi
107*7c478bd9Sstevel@tonic-gate	SET_SIZE(rdasi)
108*7c478bd9Sstevel@tonic-gate
109*7c478bd9Sstevel@tonic-gate#endif
110*7c478bd9Sstevel@tonic-gate
111*7c478bd9Sstevel@tonic-gate#if defined(__lint)
112*7c478bd9Sstevel@tonic-gate/*ARGSUSED*/
113*7c478bd9Sstevel@tonic-gatevoid
114*7c478bd9Sstevel@tonic-gatewrasi(uint32_t asi, uintptr_t va, uint64_t val)
115*7c478bd9Sstevel@tonic-gate{
116*7c478bd9Sstevel@tonic-gate}
117*7c478bd9Sstevel@tonic-gate#else
118*7c478bd9Sstevel@tonic-gate
119*7c478bd9Sstevel@tonic-gate	ENTRY_NP(wrasi)
120*7c478bd9Sstevel@tonic-gate	rd	%asi, %o3
121*7c478bd9Sstevel@tonic-gate	wr	%o0, %asi
122*7c478bd9Sstevel@tonic-gate	stxa	%o2, [%o1]%asi
123*7c478bd9Sstevel@tonic-gate	retl
124*7c478bd9Sstevel@tonic-gate	wr	%o3, %asi
125*7c478bd9Sstevel@tonic-gate	SET_SIZE(wrasi)
126*7c478bd9Sstevel@tonic-gate
127*7c478bd9Sstevel@tonic-gate#endif
128