Compile APIC and timer code for x86_64, and create an area for the IDT.
This commit is contained in:
@@ -11,6 +11,8 @@
|
||||
|
||||
#include <boot/kernel_args.h>
|
||||
#include <cpu.h>
|
||||
#include <vm/vm.h>
|
||||
#include <vm/vm_priv.h>
|
||||
|
||||
#include <arch/x86/apic.h>
|
||||
#include <arch/x86/descriptors.h>
|
||||
@@ -187,9 +189,13 @@ arch_int_init_post_vm(kernel_args* args)
|
||||
{
|
||||
// Always init the local apic as it can be used for timers even if we
|
||||
// don't end up using the io apic
|
||||
//apic_init(args);
|
||||
apic_init(args);
|
||||
|
||||
// TODO: create area for IDT.
|
||||
// Create an area for the IDT.
|
||||
area_id area = create_area("idt", (void**)&sIDT, B_EXACT_ADDRESS,
|
||||
B_PAGE_SIZE, B_ALREADY_WIRED, B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA);
|
||||
if (area < 0)
|
||||
return area;
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
@@ -331,7 +331,7 @@ arch_thread_init(struct kernel_args *args)
|
||||
status_t
|
||||
arch_team_init_team_struct(Team *p, bool kernel)
|
||||
{
|
||||
return B_ERROR;
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -415,27 +415,6 @@ arch_restore_fork_frame(struct arch_fork_arg* arg)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
arch_timer_set_hardware_timer(bigtime_t timeout)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
arch_timer_clear_hardware_timer(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
arch_init_timer(kernel_args *args)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// The software breakpoint instruction (int3).
|
||||
const uint8 kX86SoftwareBreakpoint[1] = { 0xcc };
|
||||
|
||||
|
||||
@@ -50,10 +50,8 @@ if $(TARGET_ARCH) = x86_64 {
|
||||
arch_real_time_clock.cpp
|
||||
arch_smp.cpp
|
||||
arch_thread.cpp
|
||||
arch_timer.cpp
|
||||
arch_system_info.cpp
|
||||
arch_user_debugger.cpp
|
||||
apic.cpp
|
||||
apm.cpp
|
||||
bios.cpp
|
||||
ioapic.cpp
|
||||
@@ -77,11 +75,6 @@ if $(TARGET_ARCH) = x86_64 {
|
||||
X86PagingMethodPAE.cpp
|
||||
X86PagingStructuresPAE.cpp
|
||||
X86VMTranslationMapPAE.cpp
|
||||
|
||||
# timers
|
||||
x86_apic.cpp
|
||||
x86_hpet.cpp
|
||||
x86_pit.cpp
|
||||
;
|
||||
}
|
||||
|
||||
@@ -90,8 +83,10 @@ local archGenericSources =
|
||||
arch_debug_console.cpp
|
||||
arch_int.cpp
|
||||
arch_platform.cpp
|
||||
arch_timer.cpp
|
||||
arch_vm.cpp
|
||||
arch_vm_translation_map.cpp
|
||||
apic.cpp
|
||||
pic.cpp
|
||||
|
||||
# paging
|
||||
@@ -99,6 +94,11 @@ local archGenericSources =
|
||||
X86PagingMethod.cpp
|
||||
X86PagingStructures.cpp
|
||||
X86VMTranslationMap.cpp
|
||||
|
||||
# timers
|
||||
x86_apic.cpp
|
||||
x86_hpet.cpp
|
||||
x86_pit.cpp
|
||||
;
|
||||
|
||||
KernelMergeObject kernel_arch_x86.o :
|
||||
|
||||
@@ -88,8 +88,9 @@ apic_init(kernel_args *args)
|
||||
status_t
|
||||
apic_per_cpu_init(kernel_args *args, int32 cpu)
|
||||
{
|
||||
dprintf("setting up apic for CPU %ld: apic id %lu, version %lu\n", cpu,
|
||||
apic_local_id(), apic_read(APIC_VERSION));
|
||||
dprintf("setting up apic for CPU %" B_PRId32 ": apic id %" B_PRIu32 ", "
|
||||
"version %" B_PRIu32 "\n", cpu, apic_local_id(),
|
||||
apic_read(APIC_VERSION));
|
||||
|
||||
/* set spurious interrupt vector to 0xff */
|
||||
uint32 config = apic_read(APIC_SPURIOUS_INTR_VECTOR) & 0xffffff00;
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#include <arch/x86/smp_priv.h>
|
||||
#include <arch/x86/timer.h>
|
||||
|
||||
#include "interrupts.h"
|
||||
|
||||
//#define TRACE_TIMER
|
||||
#ifdef TRACE_TIMER
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
|
||||
|
||||
//#define TRACE_VM
|
||||
#define TRACE_FAULTS
|
||||
//#define TRACE_FAULTS
|
||||
#ifdef TRACE_VM
|
||||
# define TRACE(x) dprintf x
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user