1713Swesolows /* 2713Swesolows * CDDL HEADER START 3713Swesolows * 4713Swesolows * The contents of this file are subject to the terms of the 5713Swesolows * Common Development and Distribution License (the "License"). 6713Swesolows * You may not use this file except in compliance with the License. 7713Swesolows * 8713Swesolows * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9713Swesolows * or http://www.opensolaris.org/os/licensing. 10713Swesolows * See the License for the specific language governing permissions 11713Swesolows * and limitations under the License. 12713Swesolows * 13713Swesolows * When distributing Covered Code, include this CDDL HEADER in each 14713Swesolows * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15713Swesolows * If applicable, add the following below this CDDL HEADER, with the 16713Swesolows * fields enclosed by brackets "[]" replaced with your own identifying 17713Swesolows * information: Portions Copyright [yyyy] [name of copyright owner] 18713Swesolows * 19713Swesolows * CDDL HEADER END 20713Swesolows */ 21713Swesolows 22713Swesolows /* 23*8286SDave.Plauger@Sun.COM * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 24713Swesolows * Use is subject to license terms. 25713Swesolows */ 26713Swesolows 27713Swesolows #ifndef _ASM_FLUSH_H 28713Swesolows #define _ASM_FLUSH_H 29713Swesolows 30713Swesolows #include <sys/types.h> 31713Swesolows 32713Swesolows #ifdef __cplusplus 33713Swesolows extern "C" { 34713Swesolows #endif 35713Swesolows 36713Swesolows #if !defined(__lint) && defined(__GNUC__) 37713Swesolows 38713Swesolows extern __inline__ void doflush(void * addr)39713Swesolowsdoflush(void *addr) 40713Swesolows { 41713Swesolows #if defined(__sparcv9) 42713Swesolows __asm__ __volatile__( 43713Swesolows "andn %0, 3, %0\n\t" 44713Swesolows "flush %0\n\t" 45*8286SDave.Plauger@Sun.COM : "=r" (addr) 46*8286SDave.Plauger@Sun.COM : "0" (addr)); 47*8286SDave.Plauger@Sun.COM #else 48*8286SDave.Plauger@Sun.COM #error "port me" 49*8286SDave.Plauger@Sun.COM #endif 50*8286SDave.Plauger@Sun.COM } 51*8286SDave.Plauger@Sun.COM 52*8286SDave.Plauger@Sun.COM #endif /* !__lint && __GNUC__ */ 53*8286SDave.Plauger@Sun.COM 54713Swesolows #ifdef __cplusplus 55713Swesolows } 56713Swesolows #endif 57713Swesolows 58713Swesolows #endif /* _ASM_FLUSH_H */ 59