2002-07-09 16:24:59 +04:00
|
|
|
/*
|
2004-10-21 05:45:43 +04:00
|
|
|
** Copyright 2002-2004, The Haiku Team. All rights reserved.
|
|
|
|
** Distributed under the terms of the Haiku License.
|
|
|
|
**
|
2002-07-09 16:24:59 +04:00
|
|
|
** 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
|
|
|
}
|