/* * Copyright 2004-2005, Axel Dörfler, axeld@pinc-software.de. All rights reserved. * Distributed under the terms of the MIT License. * * calculate_cpu_conversion_factor() was written by Travis Geiselbrecht and * licensed under the NewOS license. */ #include "cpu.h" #include "rom_calls.h" #include #include #include #include #include #include #include #include #include #include //#define TRACE_CPU #ifdef TRACE_CPU # define TRACE(x) dprintf x #else # define TRACE(x) ; #endif #warning M68K: add set_vbr() static status_t check_cpu_features() { //TODO return B_ERROR; } #warning M68K: move and implement system_time() static bigtime_t gSystemTimeCounter = 0; //HACK extern "C" bigtime_t system_time(void) { return gSystemTimeCounter++; } // #pragma mark - extern "C" void spin(bigtime_t microseconds) { bigtime_t time = system_time(); while ((system_time() - time) < microseconds) asm volatile ("nop;"); } extern "C" void cpu_init() { if (check_cpu_features() != B_OK) panic("You need a 68020 or higher in order to boot!\n"); gKernelArgs.num_cpus = 1; // this will eventually be corrected later on // ...or not! }