xref: /illumos-gate/usr/src/uts/sparc/asm/flush.h (revision 6b7143d774683daf27dfb2e93ab48d1ade1a3477)
12b616c6cSwesolows /*
22b616c6cSwesolows  * CDDL HEADER START
32b616c6cSwesolows  *
42b616c6cSwesolows  * The contents of this file are subject to the terms of the
52b616c6cSwesolows  * Common Development and Distribution License (the "License").
62b616c6cSwesolows  * You may not use this file except in compliance with the License.
72b616c6cSwesolows  *
82b616c6cSwesolows  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
92b616c6cSwesolows  * or http://www.opensolaris.org/os/licensing.
102b616c6cSwesolows  * See the License for the specific language governing permissions
112b616c6cSwesolows  * and limitations under the License.
122b616c6cSwesolows  *
132b616c6cSwesolows  * When distributing Covered Code, include this CDDL HEADER in each
142b616c6cSwesolows  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
152b616c6cSwesolows  * If applicable, add the following below this CDDL HEADER, with the
162b616c6cSwesolows  * fields enclosed by brackets "[]" replaced with your own identifying
172b616c6cSwesolows  * information: Portions Copyright [yyyy] [name of copyright owner]
182b616c6cSwesolows  *
192b616c6cSwesolows  * CDDL HEADER END
202b616c6cSwesolows  */
212b616c6cSwesolows 
222b616c6cSwesolows /*
235c7544f7SDavid Plauger  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
242b616c6cSwesolows  * Use is subject to license terms.
252b616c6cSwesolows  */
262b616c6cSwesolows 
272b616c6cSwesolows #ifndef _ASM_FLUSH_H
282b616c6cSwesolows #define	_ASM_FLUSH_H
292b616c6cSwesolows 
30*6b7143d7SRichard Lowe #include <sys/ccompile.h>
312b616c6cSwesolows #include <sys/types.h>
322b616c6cSwesolows 
332b616c6cSwesolows #ifdef	__cplusplus
342b616c6cSwesolows extern "C" {
352b616c6cSwesolows #endif
362b616c6cSwesolows 
372b616c6cSwesolows #if !defined(__lint) && defined(__GNUC__)
382b616c6cSwesolows 
39*6b7143d7SRichard Lowe extern __GNU_INLINE void
doflush(void * addr)402b616c6cSwesolows doflush(void *addr)
412b616c6cSwesolows {
422b616c6cSwesolows #if defined(__sparcv9)
432b616c6cSwesolows 	__asm__ __volatile__(
442b616c6cSwesolows 	    "andn	%0, 3, %0\n\t"
452b616c6cSwesolows 	    "flush	%0\n\t"
462b616c6cSwesolows 	    : "=r" (addr)
472b616c6cSwesolows 	    : "0" (addr));
482b616c6cSwesolows #else
492b616c6cSwesolows #error	"port me"
502b616c6cSwesolows #endif
512b616c6cSwesolows }
522b616c6cSwesolows 
532b616c6cSwesolows #endif	/* !__lint && __GNUC__ */
542b616c6cSwesolows 
552b616c6cSwesolows #ifdef	__cplusplus
562b616c6cSwesolows }
572b616c6cSwesolows #endif
582b616c6cSwesolows 
592b616c6cSwesolows #endif	/* _ASM_FLUSH_H */
60