1 /* 2 * Copyright 2004-2005, Axel Dörfler, axeld@pinc-software.de. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * calculate_cpu_conversion_factor() was written by Travis Geiselbrecht and 6 * licensed under the NewOS license. 7 */ 8 9 10 #include "cpu.h" 11 12 #include <OS.h> 13 #include <boot/platform.h> 14 #include <boot/stdio.h> 15 #include <boot/kernel_args.h> 16 #include <boot/stage2.h> 17 #include <arch/cpu.h> 18 #include <arch_kernel.h> 19 #include <arch_system_info.h> 20 21 #include <string.h> 22 23 24 //#define TRACE_CPU 25 #ifdef TRACE_CPU 26 # define TRACE(x) dprintf x 27 #else 28 # define TRACE(x) ; 29 #endif 30 31 32 extern "C" void 33 spin(bigtime_t microseconds) 34 { 35 #warning U-Boot:TODO!! 36 // TODO: use API if available 37 38 // fallback to arch-specific code 39 arch_spin(microseconds); 40 } 41 42 43 extern "C" void 44 cpu_init() 45 { 46 gKernelArgs.num_cpus = 1; 47 // this will eventually be corrected later on 48 49 if (boot_arch_cpu_init() != B_OK) 50 panic("You need a 6502 or higher in order to boot!\n"); 51 } 52 53