From 473b4ece7967902bc2acac6dadc21e76ed83acea Mon Sep 17 00:00:00 2001 From: Bruce Ashfield Date: Wed, 4 Apr 2012 13:58:38 -0400 Subject: [PATCH] oprofile/mips: override register writes for qemu mips 64 Even when oprofile timer mode is enabled, during oprofile arch init there are writes to registers that do not exist in the qemu malta 64 bit pseudo machine. To allow initialization to continue and the fallback to oprofile timer mode to take effect, we stub the register writes. These two defines are only appropriate for qemu-system-mips. This should not merge to a common location, and only be applied to emulated boards. Signed-off-by: Bruce Ashfield --- arch/mips/oprofile/op_model_mipsxx.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/arch/mips/oprofile/op_model_mipsxx.c b/arch/mips/oprofile/op_model_mipsxx.c index 54759f1..b0c1381 100644 --- a/arch/mips/oprofile/op_model_mipsxx.c +++ b/arch/mips/oprofile/op_model_mipsxx.c @@ -122,6 +122,17 @@ __define_perf_accessors(perfctrl, 1, 3) __define_perf_accessors(perfctrl, 2, 0) __define_perf_accessors(perfctrl, 3, 1) + +/* These two defines are only appropriate for qemu-system-mips. + They prevent illegal writes to performance registers and allow + oprofile timer mode to continue and be initialized fully. + + This should not merge to a common location, and only be applied + to emulated boards. +*/ +#define w_c0_perfctrl0(reg) {} +#define w_c0_perfcntr0(reg) {} + struct op_mips_model op_model_mipsxx_ops; static struct mipsxx_register_config { -- 1.7.0.4