[MIPS] Add BUG_ON assertion for attempt to run kernel on the wrong CPU type.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
This commit is contained in:
Franck Bui-Huu 2007-10-08 16:11:51 +02:00 коммит произвёл Ralf Baechle
Родитель 89a8a5a6c9
Коммит dec8b1ca99
1 изменённых файлов: 8 добавлений и 0 удалений

Просмотреть файл

@ -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();