xref: /OK3568_Linux_fs/kernel/arch/mips/include/asm/wbflush.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun  * Header file for using the wbflush routine
3*4882a593Smuzhiyun  *
4*4882a593Smuzhiyun  * This file is subject to the terms and conditions of the GNU General Public
5*4882a593Smuzhiyun  * License.  See the file "COPYING" in the main directory of this archive
6*4882a593Smuzhiyun  * for more details.
7*4882a593Smuzhiyun  *
8*4882a593Smuzhiyun  * Copyright (c) 1998 Harald Koerfgen
9*4882a593Smuzhiyun  * Copyright (C) 2002 Maciej W. Rozycki
10*4882a593Smuzhiyun  */
11*4882a593Smuzhiyun #ifndef _ASM_WBFLUSH_H
12*4882a593Smuzhiyun #define _ASM_WBFLUSH_H
13*4882a593Smuzhiyun 
14*4882a593Smuzhiyun 
15*4882a593Smuzhiyun #ifdef CONFIG_CPU_HAS_WB
16*4882a593Smuzhiyun 
17*4882a593Smuzhiyun extern void (*__wbflush)(void);
18*4882a593Smuzhiyun extern void wbflush_setup(void);
19*4882a593Smuzhiyun 
20*4882a593Smuzhiyun #define wbflush()			\
21*4882a593Smuzhiyun 	do {				\
22*4882a593Smuzhiyun 		__sync();		\
23*4882a593Smuzhiyun 		__wbflush();		\
24*4882a593Smuzhiyun 	} while (0)
25*4882a593Smuzhiyun 
26*4882a593Smuzhiyun #else /* !CONFIG_CPU_HAS_WB */
27*4882a593Smuzhiyun 
28*4882a593Smuzhiyun #define wbflush_setup() do { } while (0)
29*4882a593Smuzhiyun 
30*4882a593Smuzhiyun #define wbflush() fast_iob()
31*4882a593Smuzhiyun 
32*4882a593Smuzhiyun #endif /* !CONFIG_CPU_HAS_WB */
33*4882a593Smuzhiyun 
34*4882a593Smuzhiyun #endif /* _ASM_WBFLUSH_H */
35