2002-07-09 16:24:59 +04:00
|
|
|
/*
|
2005-03-17 20:06:56 +03:00
|
|
|
* Copyright 2002-2005, Axel Dörfler, axeld@pinc-software.de.
|
2004-12-14 02:02:18 +03:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*
|
|
|
|
* Copyright 2002, Travis Geiselbrecht. All rights reserved.
|
|
|
|
* Distributed under the terms of the NewOS License.
|
|
|
|
*/
|
2003-05-03 20:20:38 +04:00
|
|
|
|
2004-10-21 05:45:43 +04:00
|
|
|
/* This file contains the cpu functions (init, etc). */
|
2003-05-03 20:20:38 +04:00
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
#include <kernel.h>
|
|
|
|
#include <cpu.h>
|
|
|
|
#include <vm.h>
|
|
|
|
#include <arch/cpu.h>
|
2003-10-08 03:12:37 +04:00
|
|
|
#include <boot/kernel_args.h>
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
2004-10-21 05:45:43 +04:00
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
/* global per-cpu structure */
|
|
|
|
cpu_ent cpu[MAX_BOOT_CPUS];
|
|
|
|
|
2003-05-03 20:20:38 +04:00
|
|
|
|
2004-10-21 05:45:43 +04:00
|
|
|
status_t
|
|
|
|
cpu_init(kernel_args *args)
|
2002-07-09 16:24:59 +04:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
memset(cpu, 0, sizeof(cpu));
|
2004-10-21 05:45:43 +04:00
|
|
|
for (i = 0; i < MAX_BOOT_CPUS; i++) {
|
2002-07-09 16:24:59 +04:00
|
|
|
cpu[i].info.cpu_num = i;
|
|
|
|
}
|
|
|
|
|
2004-10-21 05:45:43 +04:00
|
|
|
return arch_cpu_init(args);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
status_t
|
|
|
|
cpu_init_post_vm(kernel_args *args)
|
|
|
|
{
|
|
|
|
return arch_cpu_init_post_vm(args);
|
2002-07-09 16:24:59 +04:00
|
|
|
}
|
|
|
|
|
2003-05-03 20:20:38 +04:00
|
|
|
|
2004-10-21 05:45:43 +04:00
|
|
|
status_t
|
|
|
|
cpu_preboot_init(kernel_args *args)
|
2002-07-09 16:24:59 +04:00
|
|
|
{
|
2004-10-21 05:45:43 +04:00
|
|
|
return arch_cpu_preboot_init(args);
|
2002-07-09 16:24:59 +04:00
|
|
|
}
|
2005-03-17 20:06:56 +03:00
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
clear_caches(void *address, size_t length, uint32 flags)
|
|
|
|
{
|
|
|
|
// ToDo: implement me!
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// #pragma mark -
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
_user_clear_caches(void *address, size_t length, uint32 flags)
|
|
|
|
{
|
|
|
|
clear_caches(address, length, flags);
|
|
|
|
}
|
|
|
|
|