kpacket_gen: use constants for cmdlength
[cor.git] / arch / mips / include / asm / tlb.h
blob90f3ad76d9e0b03761ceec49eca71605065d1465
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __ASM_TLB_H
3 #define __ASM_TLB_H
5 #include <asm/cpu-features.h>
6 #include <asm/mipsregs.h>
8 #define _UNIQUE_ENTRYHI(base, idx) \
9 (((base) + ((idx) << (PAGE_SHIFT + 1))) | \
10 (cpu_has_tlbinv ? MIPS_ENTRYHI_EHINV : 0))
11 #define UNIQUE_ENTRYHI(idx) _UNIQUE_ENTRYHI(CKSEG0, idx)
12 #define UNIQUE_GUEST_ENTRYHI(idx) _UNIQUE_ENTRYHI(CKSEG1, idx)
14 static inline unsigned int num_wired_entries(void)
16 unsigned int wired = read_c0_wired();
18 if (cpu_has_mips_r6)
19 wired &= MIPSR6_WIRED_WIRED;
21 return wired;
24 #include <asm-generic/tlb.h>
26 #endif /* __ASM_TLB_H */