From 89f97fe9030bf5a5665328f751b55f73c822f85c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Sat, 12 Jan 2008 23:56:47 +0000 Subject: [PATCH] We shouldn't trust the TOS, but for now use the cookie jar to find the cpu type and if it has lpstop. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23461 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/boot/platform/atari_m68k/cpu.cpp | 29 ++++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/system/boot/platform/atari_m68k/cpu.cpp b/src/system/boot/platform/atari_m68k/cpu.cpp index 686d4b256a..6c211e71fe 100644 --- a/src/system/boot/platform/atari_m68k/cpu.cpp +++ b/src/system/boot/platform/atari_m68k/cpu.cpp @@ -8,6 +8,7 @@ #include "cpu.h" +#include "toscalls.h" #include #include @@ -28,16 +29,23 @@ # define TRACE(x) ; #endif -bool gCpuHasLPSTOP = false; - static status_t check_cpu_features() { -#warning M68K: check for LPSTOP - if (false) - gCpuHasLPSTOP = true; +#warning M68K: TODO: probe ourselves, we shouldn't trust the TOS! -#warning M68K: check for >= 020 + const tos_cookie *c = tos_find_cookie('_CPU'); + if (!c) { + panic("can't get a cookie (_CPU)! Mum, I'm hungry!"); + return EINVAL; + } + +#warning M68K: check for 020 + mmu + if (c->ivalue < 30/*20*/) + return EINVAL; + + gKernelArgs.arch_args.has_lpstop = (c->ivalue >= 60)?true:false; +#warning M68K: add cpu type to kern args return B_OK; } @@ -50,13 +58,8 @@ extern "C" void spin(bigtime_t microseconds) { bigtime_t time = system_time(); - if (gCpuHasLPSTOP) { - while ((system_time() - time) < microseconds) - asm volatile ("nop;");//asm volatile ("lpstop;"); - } else { - while ((system_time() - time) < microseconds) - asm volatile ("nop;"); - } + while ((system_time() - time) < microseconds) + asm volatile ("nop;"); }