diff --git a/headers/private/kernel/arch/x86/arch_cpu.h b/headers/private/kernel/arch/x86/arch_cpu.h index 204c901814..17a3d41ece 100644 --- a/headers/private/kernel/arch/x86/arch_cpu.h +++ b/headers/private/kernel/arch/x86/arch_cpu.h @@ -401,7 +401,7 @@ void x86_page_fault_exception_double_fault(struct iframe* frame); #ifndef __x86_64__ -void i386_set_tss_and_kstack(addr_t kstack); +void x86_set_tss_and_kstack(addr_t kstack); void x86_fnsave(void* fpuState); void x86_frstor(const void* fpuState); void x86_noop_swap(void* oldFpuState, const void* newFpuState); diff --git a/headers/private/kernel/arch/x86/arch_thread.h b/headers/private/kernel/arch/x86/arch_thread.h index 7efd8b11e8..4a08809911 100644 --- a/headers/private/kernel/arch/x86/arch_thread.h +++ b/headers/private/kernel/arch/x86/arch_thread.h @@ -17,9 +17,9 @@ extern "C" { #endif -struct iframe* i386_get_user_iframe(void); -struct iframe* i386_get_current_iframe(void); -struct iframe* i386_get_thread_user_iframe(Thread* thread); +struct iframe* x86_get_user_iframe(void); +struct iframe* x86_get_current_iframe(void); +struct iframe* x86_get_thread_user_iframe(Thread* thread); uint32 x86_next_page_directory(Thread* from, Thread* to); diff --git a/headers/private/kernel/arch/x86/smp_priv.h b/headers/private/kernel/arch/x86/smp_priv.h index f5e6f4564e..17b035123c 100644 --- a/headers/private/kernel/arch/x86/smp_priv.h +++ b/headers/private/kernel/arch/x86/smp_priv.h @@ -7,7 +7,6 @@ #include -int i386_smp_interrupt(int vector); void arch_smp_ack_interrupt(void); status_t arch_smp_set_apic_timer(bigtime_t relativeTimeout); status_t arch_smp_clear_apic_timer(void); diff --git a/src/system/kernel/arch/x86/32/interrupts.S b/src/system/kernel/arch/x86/32/interrupts.S index aa4dfe16ac..014fa33c4d 100644 --- a/src/system/kernel/arch/x86/32/interrupts.S +++ b/src/system/kernel/arch/x86/32/interrupts.S @@ -884,7 +884,7 @@ FUNCTION(x86_vm86_enter): pushl THREAD_kernel_stack_top(%edi) movl %esp, THREAD_kernel_stack_top(%edi) pushl %esp - call i386_set_tss_and_kstack + call x86_set_tss_and_kstack // go to vm86 mode cli @@ -916,7 +916,7 @@ FUNCTION(x86_vm86_return): movl %dr3, %edi movl %eax, THREAD_kernel_stack_top(%edi) pushl %eax - call i386_set_tss_and_kstack + call x86_set_tss_and_kstack addl $4, %esp // restore registers diff --git a/src/system/kernel/arch/x86/arch_cpu.cpp b/src/system/kernel/arch/x86/arch_cpu.cpp index 2edd3c392d..2c61241a47 100644 --- a/src/system/kernel/arch/x86/arch_cpu.cpp +++ b/src/system/kernel/arch/x86/arch_cpu.cpp @@ -974,7 +974,7 @@ arch_cpu_init_post_modules(kernel_args* args) #ifndef __x86_64__ void -i386_set_tss_and_kstack(addr_t kstack) +x86_set_tss_and_kstack(addr_t kstack) { get_cpu_struct()->arch.tss.sp0 = kstack; } diff --git a/src/system/kernel/arch/x86/arch_debug.cpp b/src/system/kernel/arch/x86/arch_debug.cpp index e8b90927d7..beedfa3b0d 100644 --- a/src/system/kernel/arch/x86/arch_debug.cpp +++ b/src/system/kernel/arch/x86/arch_debug.cpp @@ -503,7 +503,7 @@ static struct iframe* get_current_iframe(Thread* thread) { if (thread == thread_get_current_thread()) - return i386_get_current_iframe(); + return x86_get_current_iframe(); addr_t ebp = thread->arch_info.current_stack.esp[2]; // NOTE: This doesn't work, if the thread is running (on another CPU). diff --git a/src/system/kernel/arch/x86/arch_smp.cpp b/src/system/kernel/arch/x86/arch_smp.cpp index 0720ae0bc6..a63051be29 100644 --- a/src/system/kernel/arch/x86/arch_smp.cpp +++ b/src/system/kernel/arch/x86/arch_smp.cpp @@ -39,7 +39,7 @@ static uint32 sAPICVersions[B_MAX_CPU_COUNT]; static int32 -i386_ici_interrupt(void *data) +x86_ici_interrupt(void *data) { // genuine inter-cpu interrupt int cpu = smp_get_current_cpu(); @@ -49,7 +49,7 @@ i386_ici_interrupt(void *data) static int32 -i386_spurious_interrupt(void *data) +x86_spurious_interrupt(void *data) { // spurious interrupt TRACE(("spurious interrupt on cpu %ld\n", smp_get_current_cpu())); @@ -62,7 +62,7 @@ i386_spurious_interrupt(void *data) static int32 -i386_smp_error_interrupt(void *data) +x86_smp_error_interrupt(void *data) { // smp error interrupt TRACE(("smp error interrupt on cpu %ld\n", smp_get_current_cpu())); @@ -91,9 +91,9 @@ arch_smp_init(kernel_args *args) if (args->num_cpus > 1) { // I/O interrupts start at ARCH_INTERRUPT_BASE, so all interrupts are shifted reserve_io_interrupt_vectors(3, 0xfd - ARCH_INTERRUPT_BASE); - install_io_interrupt_handler(0xfd - ARCH_INTERRUPT_BASE, &i386_ici_interrupt, NULL, B_NO_LOCK_VECTOR); - install_io_interrupt_handler(0xfe - ARCH_INTERRUPT_BASE, &i386_smp_error_interrupt, NULL, B_NO_LOCK_VECTOR); - install_io_interrupt_handler(0xff - ARCH_INTERRUPT_BASE, &i386_spurious_interrupt, NULL, B_NO_LOCK_VECTOR); + install_io_interrupt_handler(0xfd - ARCH_INTERRUPT_BASE, &x86_ici_interrupt, NULL, B_NO_LOCK_VECTOR); + install_io_interrupt_handler(0xfe - ARCH_INTERRUPT_BASE, &x86_smp_error_interrupt, NULL, B_NO_LOCK_VECTOR); + install_io_interrupt_handler(0xff - ARCH_INTERRUPT_BASE, &x86_spurious_interrupt, NULL, B_NO_LOCK_VECTOR); } return B_OK; diff --git a/src/system/kernel/arch/x86/arch_thread.cpp b/src/system/kernel/arch/x86/arch_thread.cpp index ce482bac49..da8e47d739 100644 --- a/src/system/kernel/arch/x86/arch_thread.cpp +++ b/src/system/kernel/arch/x86/arch_thread.cpp @@ -67,7 +67,6 @@ class RestartSyscall : public AbstractTraceEntry { // from arch_interrupts.S -extern "C" void i386_stack_init(struct farcall *interrupt_stack_offset); extern "C" void x86_return_to_userland(iframe* frame); // from arch_cpu.c @@ -160,7 +159,7 @@ initial_return_to_userland(Thread* thread, iframe* frame) // disable interrupts and set up CPU specifics for this thread disable_interrupts(); - i386_set_tss_and_kstack(thread->kernel_stack_top); + x86_set_tss_and_kstack(thread->kernel_stack_top); x86_set_tls_context(thread); x86_set_syscall_stack(thread->kernel_stack_top); @@ -177,7 +176,7 @@ initial_return_to_userland(Thread* thread, iframe* frame) the thread is a kernel thread). */ struct iframe * -i386_get_user_iframe(void) +x86_get_user_iframe(void) { struct iframe* frame = get_current_iframe(); @@ -191,11 +190,11 @@ i386_get_user_iframe(void) } -/*! \brief Like i386_get_user_iframe(), just for the given thread. +/*! \brief Like x86_get_user_iframe(), just for the given thread. The thread must not be running and the threads spinlock must be held. */ struct iframe * -i386_get_thread_user_iframe(Thread *thread) +x86_get_thread_user_iframe(Thread *thread) { if (thread->state == B_THREAD_RUNNING) return NULL; @@ -217,7 +216,7 @@ i386_get_thread_user_iframe(Thread *thread) struct iframe * -i386_get_current_iframe(void) +x86_get_current_iframe(void) { return get_current_iframe(); } @@ -367,7 +366,7 @@ arch_thread_init_tls(Thread *thread) void arch_thread_context_switch(Thread *from, Thread *to) { - i386_set_tss_and_kstack(to->kernel_stack_top); + x86_set_tss_and_kstack(to->kernel_stack_top); x86_set_syscall_stack(to->kernel_stack_top); // set TLS GDT entry to the current thread - since this action is diff --git a/src/system/kernel/arch/x86/arch_user_debugger.cpp b/src/system/kernel/arch/x86/arch_user_debugger.cpp index 42aaf6f073..99e2b83218 100644 --- a/src/system/kernel/arch/x86/arch_user_debugger.cpp +++ b/src/system/kernel/arch/x86/arch_user_debugger.cpp @@ -516,7 +516,7 @@ debugger_single_step(int argc, char** argv) // TODO: Since we need an iframe, this doesn't work when KDL wasn't entered // via an exception. - struct iframe* frame = i386_get_current_iframe(); + struct iframe* frame = x86_get_current_iframe(); if (frame == NULL) { kprintf("Failed to get the current iframe!\n"); return 0; @@ -568,7 +568,7 @@ arch_destroy_thread_debug_info(struct arch_thread_debug_info *info) void arch_update_thread_single_step() { - if (struct iframe* frame = i386_get_user_iframe()) { + if (struct iframe* frame = x86_get_user_iframe()) { Thread* thread = thread_get_current_thread(); // set/clear TF in EFLAGS depending on whether single stepping is @@ -584,7 +584,7 @@ arch_update_thread_single_step() void arch_set_debug_cpu_state(const debug_cpu_state *cpuState) { - if (struct iframe *frame = i386_get_user_iframe()) { + if (struct iframe *frame = x86_get_user_iframe()) { // For the floating point state to be correct the calling function must // not use these registers (not even indirectly). if (gHasSSE) { @@ -629,7 +629,7 @@ arch_set_debug_cpu_state(const debug_cpu_state *cpuState) void arch_get_debug_cpu_state(debug_cpu_state *cpuState) { - if (struct iframe *frame = i386_get_user_iframe()) { + if (struct iframe *frame = x86_get_user_iframe()) { // For the floating point state to be correct the calling function must // not use these registers (not even indirectly). if (gHasSSE) { @@ -852,7 +852,7 @@ x86_handle_debug_exception(struct iframe *frame) asm("movl %%dr7, %0" : "=r"(dr7)); } - TRACE(("i386_handle_debug_exception(): DR6: %lx, DR7: %lx\n", dr6, dr7)); + TRACE(("x86_handle_debug_exception(): DR6: %lx, DR7: %lx\n", dr6, dr7)); // check, which exception condition applies if (dr6 & X86_DR6_BREAKPOINT_MASK) { @@ -885,7 +885,7 @@ x86_handle_debug_exception(struct iframe *frame) // Occurs only, if GD in DR7 is set (which we don't do) and someone // tries to write to the debug registers. if (IFRAME_IS_USER(frame)) { - dprintf("i386_handle_debug_exception(): ignoring spurious general " + dprintf("x86_handle_debug_exception(): ignoring spurious general " "detect exception\n"); enable_interrupts(); @@ -908,7 +908,7 @@ x86_handle_debug_exception(struct iframe *frame) // kernel entry or whether this is genuine kernel single-stepping. bool inKernel = true; if (thread->team != team_get_kernel_team() - && i386_get_user_iframe() == NULL) { + && x86_get_user_iframe() == NULL) { // TODO: This is not yet fully correct, since a newly created // thread that hasn't entered userland yet also has this // property. @@ -948,7 +948,7 @@ x86_handle_debug_exception(struct iframe *frame) // task switch // Occurs only, if T in EFLAGS is set (which we don't do). if (IFRAME_IS_USER(frame)) { - dprintf("i386_handle_debug_exception(): ignoring spurious task switch " + dprintf("x86_handle_debug_exception(): ignoring spurious task switch " "exception\n"); enable_interrupts(); @@ -956,7 +956,7 @@ x86_handle_debug_exception(struct iframe *frame) panic("spurious task switch exception in kernel mode"); } else { if (IFRAME_IS_USER(frame)) { - TRACE(("i386_handle_debug_exception(): ignoring spurious debug " + TRACE(("x86_handle_debug_exception(): ignoring spurious debug " "exception (no condition recognized)\n")); enable_interrupts(); @@ -974,7 +974,7 @@ x86_handle_debug_exception(struct iframe *frame) void x86_handle_breakpoint_exception(struct iframe *frame) { - TRACE(("i386_handle_breakpoint_exception()\n")); + TRACE(("x86_handle_breakpoint_exception()\n")); // reset eip to the int3 instruction frame->eip--; diff --git a/src/system/kernel/arch/x86/vm86.cpp b/src/system/kernel/arch/x86/vm86.cpp index ebfce515af..948b701019 100644 --- a/src/system/kernel/arch/x86/vm86.cpp +++ b/src/system/kernel/arch/x86/vm86.cpp @@ -512,7 +512,7 @@ emulate(struct vm86_state *state) static bool vm86_fault_callback(addr_t address, addr_t faultAddress, bool isWrite) { - struct iframe *frame = i386_get_user_iframe(); + struct iframe *frame = x86_get_user_iframe(); TRACE("Unhandled fault at %#" B_PRIxADDR " touching %#" B_PRIxADDR "while %s\n", faultAddress, address, isWrite ? "writing" : "reading"); diff --git a/src/system/kernel/vm/vm.cpp b/src/system/kernel/vm/vm.cpp index 21518a2d4d..b4f00fbbe3 100644 --- a/src/system/kernel/vm/vm.cpp +++ b/src/system/kernel/vm/vm.cpp @@ -4088,7 +4088,7 @@ vm_page_fault(addr_t address, addr_t faultAddress, bool isWrite, bool isUser, #endif } frame; # ifdef __INTEL__ - struct iframe* iframe = i386_get_user_iframe(); + struct iframe* iframe = x86_get_user_iframe(); if (iframe == NULL) panic("iframe is NULL!");