]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/mips/include/asm/tlb.h
MIPS: Mask out limit field when calculating wired entry count
[karo-tx-linux.git] / arch / mips / include / asm / tlb.h
index 4a2349302b552c5a7c4772c235553b4bdbef4695..dd179fd8acdac4a6e9f47257f79263f4a6432c46 100644 (file)
@@ -1,6 +1,9 @@
 #ifndef __ASM_TLB_H
 #define __ASM_TLB_H
 
+#include <asm/cpu-features.h>
+#include <asm/mipsregs.h>
+
 /*
  * MIPS doesn't need any special per-pte or per-vma handling, except
  * we need to flush cache for area to be unmapped.
                ((CKSEG0 + ((idx) << (PAGE_SHIFT + 1))) |               \
                 (cpu_has_tlbinv ? MIPS_ENTRYHI_EHINV : 0))
 
+static inline unsigned int num_wired_entries(void)
+{
+       unsigned int wired = read_c0_wired();
+
+       if (cpu_has_mips_r6)
+               wired &= MIPSR6_WIRED_WIRED;
+
+       return wired;
+}
+
 #include <asm-generic/tlb.h>
 
 #endif /* __ASM_TLB_H */