xref: /illumos-gate/usr/src/uts/sparc/asm/flush.h (revision 2b616c6c748ccca60ec7bdc3c781d84203c97b2b)
1*2b616c6cSwesolows /*
2*2b616c6cSwesolows  * CDDL HEADER START
3*2b616c6cSwesolows  *
4*2b616c6cSwesolows  * The contents of this file are subject to the terms of the
5*2b616c6cSwesolows  * Common Development and Distribution License (the "License").
6*2b616c6cSwesolows  * You may not use this file except in compliance with the License.
7*2b616c6cSwesolows  *
8*2b616c6cSwesolows  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*2b616c6cSwesolows  * or http://www.opensolaris.org/os/licensing.
10*2b616c6cSwesolows  * See the License for the specific language governing permissions
11*2b616c6cSwesolows  * and limitations under the License.
12*2b616c6cSwesolows  *
13*2b616c6cSwesolows  * When distributing Covered Code, include this CDDL HEADER in each
14*2b616c6cSwesolows  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*2b616c6cSwesolows  * If applicable, add the following below this CDDL HEADER, with the
16*2b616c6cSwesolows  * fields enclosed by brackets "[]" replaced with your own identifying
17*2b616c6cSwesolows  * information: Portions Copyright [yyyy] [name of copyright owner]
18*2b616c6cSwesolows  *
19*2b616c6cSwesolows  * CDDL HEADER END
20*2b616c6cSwesolows  */
21*2b616c6cSwesolows 
22*2b616c6cSwesolows /*
23*2b616c6cSwesolows  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24*2b616c6cSwesolows  * Use is subject to license terms.
25*2b616c6cSwesolows  */
26*2b616c6cSwesolows 
27*2b616c6cSwesolows #ifndef _ASM_FLUSH_H
28*2b616c6cSwesolows #define	_ASM_FLUSH_H
29*2b616c6cSwesolows 
30*2b616c6cSwesolows #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*2b616c6cSwesolows 
32*2b616c6cSwesolows #include <sys/types.h>
33*2b616c6cSwesolows 
34*2b616c6cSwesolows #ifdef	__cplusplus
35*2b616c6cSwesolows extern "C" {
36*2b616c6cSwesolows #endif
37*2b616c6cSwesolows 
38*2b616c6cSwesolows #if !defined(__lint) && defined(__GNUC__)
39*2b616c6cSwesolows 
40*2b616c6cSwesolows extern __inline__ void
41*2b616c6cSwesolows doflush(void *addr)
42*2b616c6cSwesolows {
43*2b616c6cSwesolows #if defined(__sparcv9)
44*2b616c6cSwesolows 	__asm__ __volatile__(
45*2b616c6cSwesolows 	    "andn	%0, 3, %0\n\t"
46*2b616c6cSwesolows 	    "flush	%0\n\t"
47*2b616c6cSwesolows 	: "=r" (addr)
48*2b616c6cSwesolows 	: "0" (addr));
49*2b616c6cSwesolows #else
50*2b616c6cSwesolows #error	"port me"
51*2b616c6cSwesolows #endif
52*2b616c6cSwesolows }
53*2b616c6cSwesolows 
54*2b616c6cSwesolows #endif	/* !__lint && __GNUC__ */
55*2b616c6cSwesolows 
56*2b616c6cSwesolows #ifdef	__cplusplus
57*2b616c6cSwesolows }
58*2b616c6cSwesolows #endif
59*2b616c6cSwesolows 
60*2b616c6cSwesolows #endif	/* _ASM_FLUSH_H */
61