Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes...
[cascardo/linux.git] / arch / mips / include / asm / fpu_emulator.h
index e518957..aecada6 100644 (file)
 
 #include <asm/break.h>
 #include <asm/inst.h>
+#include <asm/local.h>
+
+#ifdef CONFIG_DEBUG_FS
 
 struct mips_fpu_emulator_stats {
-       unsigned int emulated;
-       unsigned int loads;
-       unsigned int stores;
-       unsigned int cp1ops;
-       unsigned int cp1xops;
-       unsigned int errors;
+       local_t emulated;
+       local_t loads;
+       local_t stores;
+       local_t cp1ops;
+       local_t cp1xops;
+       local_t errors;
 };
 
-extern struct mips_fpu_emulator_stats fpuemustats;
+DECLARE_PER_CPU(struct mips_fpu_emulator_stats, fpuemustats);
+
+#define MIPS_FPU_EMU_INC_STATS(M)                                      \
+       cpu_local_wrap(__local_inc(&__get_cpu_var(fpuemustats).M))
+
+#else
+#define MIPS_FPU_EMU_INC_STATS(M) do { } while (0)
+#endif /* CONFIG_DEBUG_FS */
 
 extern int mips_dsemul(struct pt_regs *regs, mips_instruction ir,
        unsigned long cpc);