Skip to content

Commit

Permalink
[MIPS] Add BUG_ON assertion for attempt to run kernel on the wrong CP…
Browse files Browse the repository at this point in the history
…U type.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  • Loading branch information
Franck Bui-Huu authored and Ralf Baechle committed Oct 11, 2007
1 parent 89a8a5a commit dec8b1c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions arch/mips/kernel/cpu-probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit dec8b1c

Please sign in to comment.