1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __MIPS_ASM_GINVT_H__
3 #define __MIPS_ASM_GINVT_H__
5 #include <asm/mipsregs.h>
13 #ifdef TOOLCHAIN_SUPPORTS_GINV
14 # define _ASM_SET_GINV ".set ginv\n"
16 _ASM_MACRO_1R1I(ginvt
, rs
, type
,
17 _ASM_INSN_IF_MIPS(0x7c0000bd | (__rs
<< 21) | (\\type
<< 8))
18 _ASM_INSN32_IF_MM(0x0000717c | (__rs
<< 16) | (\\type
<< 9)));
19 # define _ASM_SET_GINV
22 static __always_inline
void ginvt(unsigned long addr
, enum ginvt_type type
)
30 : "r"(addr
), "i"(type
)
34 static inline void ginvt_full(void)
39 static inline void ginvt_va(unsigned long addr
)
41 addr
&= PAGE_MASK
<< 1;
42 ginvt(addr
, GINVT_VA
);
45 static inline void ginvt_mmid(void)
50 static inline void ginvt_va_mmid(unsigned long addr
)
52 addr
&= PAGE_MASK
<< 1;
53 ginvt(addr
, GINVT_VA
| GINVT_MMID
);
56 #endif /* __MIPS_ASM_GINVT_H__ */