diff options
author | Franck Bui-Huu <vagabon.xyz@gmail.com> | 2007-10-08 16:11:51 +0200 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2007-10-11 23:46:18 +0100 |
commit | dec8b1ca990055f3a8954ac3bc98fdb785af52e4 (patch) | |
tree | 77fd9bb17cbb382d0488a19c172140be240fea66 /arch/mips/kernel/cpu-probe.c | |
parent | 89a8a5a6c965d3dd2571a263ef59e7b23a036d5e (diff) | |
download | kernel_samsung_espresso10-dec8b1ca990055f3a8954ac3bc98fdb785af52e4.zip kernel_samsung_espresso10-dec8b1ca990055f3a8954ac3bc98fdb785af52e4.tar.gz kernel_samsung_espresso10-dec8b1ca990055f3a8954ac3bc98fdb785af52e4.tar.bz2 |
[MIPS] Add BUG_ON assertion for attempt to run kernel on the wrong CPU type.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel/cpu-probe.c')
-rw-r--r-- | arch/mips/kernel/cpu-probe.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c index 234c7f5..c8c47a2 100644 --- a/arch/mips/kernel/cpu-probe.c +++ b/arch/mips/kernel/cpu-probe.c @@ -922,6 +922,14 @@ __init void cpu_probe(void) default: c->cputype = CPU_UNKNOWN; } + + /* + * Platform code can force the cpu type to optimize code + * generation. In that case be sure the cpu type is correctly + * manually setup otherwise it could trigger some nasty bugs. + */ + BUG_ON(current_cpu_type() != c->cputype); + if (c->options & MIPS_CPU_FPU) { c->fpu_id = cpu_get_fpu_id(); |