Renamed remaining i386_* functions to x86_* for consistency.

This commit is contained in:
Alex Smith
2012-07-09 12:14:18 +01:00
parent ee7aba5117
commit 5e9bb17da7
11 changed files with 32 additions and 34 deletions
+1 -1
View File
@@ -401,7 +401,7 @@ void x86_page_fault_exception_double_fault(struct iframe* frame);
#ifndef __x86_64__ #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_fnsave(void* fpuState);
void x86_frstor(const void* fpuState); void x86_frstor(const void* fpuState);
void x86_noop_swap(void* oldFpuState, const void* newFpuState); void x86_noop_swap(void* oldFpuState, const void* newFpuState);
@@ -17,9 +17,9 @@ extern "C" {
#endif #endif
struct iframe* i386_get_user_iframe(void); struct iframe* x86_get_user_iframe(void);
struct iframe* i386_get_current_iframe(void); struct iframe* x86_get_current_iframe(void);
struct iframe* i386_get_thread_user_iframe(Thread* thread); struct iframe* x86_get_thread_user_iframe(Thread* thread);
uint32 x86_next_page_directory(Thread* from, Thread* to); uint32 x86_next_page_directory(Thread* from, Thread* to);
@@ -7,7 +7,6 @@
#include <SupportDefs.h> #include <SupportDefs.h>
int i386_smp_interrupt(int vector);
void arch_smp_ack_interrupt(void); void arch_smp_ack_interrupt(void);
status_t arch_smp_set_apic_timer(bigtime_t relativeTimeout); status_t arch_smp_set_apic_timer(bigtime_t relativeTimeout);
status_t arch_smp_clear_apic_timer(void); status_t arch_smp_clear_apic_timer(void);
+2 -2
View File
@@ -884,7 +884,7 @@ FUNCTION(x86_vm86_enter):
pushl THREAD_kernel_stack_top(%edi) pushl THREAD_kernel_stack_top(%edi)
movl %esp, THREAD_kernel_stack_top(%edi) movl %esp, THREAD_kernel_stack_top(%edi)
pushl %esp pushl %esp
call i386_set_tss_and_kstack call x86_set_tss_and_kstack
// go to vm86 mode // go to vm86 mode
cli cli
@@ -916,7 +916,7 @@ FUNCTION(x86_vm86_return):
movl %dr3, %edi movl %dr3, %edi
movl %eax, THREAD_kernel_stack_top(%edi) movl %eax, THREAD_kernel_stack_top(%edi)
pushl %eax pushl %eax
call i386_set_tss_and_kstack call x86_set_tss_and_kstack
addl $4, %esp addl $4, %esp
// restore registers // restore registers
+1 -1
View File
@@ -974,7 +974,7 @@ arch_cpu_init_post_modules(kernel_args* args)
#ifndef __x86_64__ #ifndef __x86_64__
void void
i386_set_tss_and_kstack(addr_t kstack) x86_set_tss_and_kstack(addr_t kstack)
{ {
get_cpu_struct()->arch.tss.sp0 = kstack; get_cpu_struct()->arch.tss.sp0 = kstack;
} }
+1 -1
View File
@@ -503,7 +503,7 @@ static struct iframe*
get_current_iframe(Thread* thread) get_current_iframe(Thread* thread)
{ {
if (thread == thread_get_current_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]; addr_t ebp = thread->arch_info.current_stack.esp[2];
// NOTE: This doesn't work, if the thread is running (on another CPU). // NOTE: This doesn't work, if the thread is running (on another CPU).
+6 -6
View File
@@ -39,7 +39,7 @@ static uint32 sAPICVersions[B_MAX_CPU_COUNT];
static int32 static int32
i386_ici_interrupt(void *data) x86_ici_interrupt(void *data)
{ {
// genuine inter-cpu interrupt // genuine inter-cpu interrupt
int cpu = smp_get_current_cpu(); int cpu = smp_get_current_cpu();
@@ -49,7 +49,7 @@ i386_ici_interrupt(void *data)
static int32 static int32
i386_spurious_interrupt(void *data) x86_spurious_interrupt(void *data)
{ {
// spurious interrupt // spurious interrupt
TRACE(("spurious interrupt on cpu %ld\n", smp_get_current_cpu())); TRACE(("spurious interrupt on cpu %ld\n", smp_get_current_cpu()));
@@ -62,7 +62,7 @@ i386_spurious_interrupt(void *data)
static int32 static int32
i386_smp_error_interrupt(void *data) x86_smp_error_interrupt(void *data)
{ {
// smp error interrupt // smp error interrupt
TRACE(("smp error interrupt on cpu %ld\n", smp_get_current_cpu())); 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) { if (args->num_cpus > 1) {
// I/O interrupts start at ARCH_INTERRUPT_BASE, so all interrupts are shifted // I/O interrupts start at ARCH_INTERRUPT_BASE, so all interrupts are shifted
reserve_io_interrupt_vectors(3, 0xfd - ARCH_INTERRUPT_BASE); 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(0xfd - ARCH_INTERRUPT_BASE, &x86_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(0xfe - ARCH_INTERRUPT_BASE, &x86_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(0xff - ARCH_INTERRUPT_BASE, &x86_spurious_interrupt, NULL, B_NO_LOCK_VECTOR);
} }
return B_OK; return B_OK;
+6 -7
View File
@@ -67,7 +67,6 @@ class RestartSyscall : public AbstractTraceEntry {
// from arch_interrupts.S // from arch_interrupts.S
extern "C" void i386_stack_init(struct farcall *interrupt_stack_offset);
extern "C" void x86_return_to_userland(iframe* frame); extern "C" void x86_return_to_userland(iframe* frame);
// from arch_cpu.c // 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 and set up CPU specifics for this thread
disable_interrupts(); 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_tls_context(thread);
x86_set_syscall_stack(thread->kernel_stack_top); 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). the thread is a kernel thread).
*/ */
struct iframe * struct iframe *
i386_get_user_iframe(void) x86_get_user_iframe(void)
{ {
struct iframe* frame = get_current_iframe(); 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. The thread must not be running and the threads spinlock must be held.
*/ */
struct iframe * struct iframe *
i386_get_thread_user_iframe(Thread *thread) x86_get_thread_user_iframe(Thread *thread)
{ {
if (thread->state == B_THREAD_RUNNING) if (thread->state == B_THREAD_RUNNING)
return NULL; return NULL;
@@ -217,7 +216,7 @@ i386_get_thread_user_iframe(Thread *thread)
struct iframe * struct iframe *
i386_get_current_iframe(void) x86_get_current_iframe(void)
{ {
return get_current_iframe(); return get_current_iframe();
} }
@@ -367,7 +366,7 @@ arch_thread_init_tls(Thread *thread)
void void
arch_thread_context_switch(Thread *from, Thread *to) 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); x86_set_syscall_stack(to->kernel_stack_top);
// set TLS GDT entry to the current thread - since this action is // set TLS GDT entry to the current thread - since this action is
@@ -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 // TODO: Since we need an iframe, this doesn't work when KDL wasn't entered
// via an exception. // via an exception.
struct iframe* frame = i386_get_current_iframe(); struct iframe* frame = x86_get_current_iframe();
if (frame == NULL) { if (frame == NULL) {
kprintf("Failed to get the current iframe!\n"); kprintf("Failed to get the current iframe!\n");
return 0; return 0;
@@ -568,7 +568,7 @@ arch_destroy_thread_debug_info(struct arch_thread_debug_info *info)
void void
arch_update_thread_single_step() 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(); Thread* thread = thread_get_current_thread();
// set/clear TF in EFLAGS depending on whether single stepping is // set/clear TF in EFLAGS depending on whether single stepping is
@@ -584,7 +584,7 @@ arch_update_thread_single_step()
void void
arch_set_debug_cpu_state(const debug_cpu_state *cpuState) 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 // For the floating point state to be correct the calling function must
// not use these registers (not even indirectly). // not use these registers (not even indirectly).
if (gHasSSE) { if (gHasSSE) {
@@ -629,7 +629,7 @@ arch_set_debug_cpu_state(const debug_cpu_state *cpuState)
void void
arch_get_debug_cpu_state(debug_cpu_state *cpuState) 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 // For the floating point state to be correct the calling function must
// not use these registers (not even indirectly). // not use these registers (not even indirectly).
if (gHasSSE) { if (gHasSSE) {
@@ -852,7 +852,7 @@ x86_handle_debug_exception(struct iframe *frame)
asm("movl %%dr7, %0" : "=r"(dr7)); 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 // check, which exception condition applies
if (dr6 & X86_DR6_BREAKPOINT_MASK) { 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 // Occurs only, if GD in DR7 is set (which we don't do) and someone
// tries to write to the debug registers. // tries to write to the debug registers.
if (IFRAME_IS_USER(frame)) { if (IFRAME_IS_USER(frame)) {
dprintf("i386_handle_debug_exception(): ignoring spurious general " dprintf("x86_handle_debug_exception(): ignoring spurious general "
"detect exception\n"); "detect exception\n");
enable_interrupts(); enable_interrupts();
@@ -908,7 +908,7 @@ x86_handle_debug_exception(struct iframe *frame)
// kernel entry or whether this is genuine kernel single-stepping. // kernel entry or whether this is genuine kernel single-stepping.
bool inKernel = true; bool inKernel = true;
if (thread->team != team_get_kernel_team() 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 // TODO: This is not yet fully correct, since a newly created
// thread that hasn't entered userland yet also has this // thread that hasn't entered userland yet also has this
// property. // property.
@@ -948,7 +948,7 @@ x86_handle_debug_exception(struct iframe *frame)
// task switch // task switch
// Occurs only, if T in EFLAGS is set (which we don't do). // Occurs only, if T in EFLAGS is set (which we don't do).
if (IFRAME_IS_USER(frame)) { 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"); "exception\n");
enable_interrupts(); enable_interrupts();
@@ -956,7 +956,7 @@ x86_handle_debug_exception(struct iframe *frame)
panic("spurious task switch exception in kernel mode"); panic("spurious task switch exception in kernel mode");
} else { } else {
if (IFRAME_IS_USER(frame)) { 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")); "exception (no condition recognized)\n"));
enable_interrupts(); enable_interrupts();
@@ -974,7 +974,7 @@ x86_handle_debug_exception(struct iframe *frame)
void void
x86_handle_breakpoint_exception(struct iframe *frame) 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 // reset eip to the int3 instruction
frame->eip--; frame->eip--;
+1 -1
View File
@@ -512,7 +512,7 @@ emulate(struct vm86_state *state)
static bool static bool
vm86_fault_callback(addr_t address, addr_t faultAddress, bool isWrite) 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 TRACE("Unhandled fault at %#" B_PRIxADDR " touching %#" B_PRIxADDR
"while %s\n", faultAddress, address, isWrite ? "writing" : "reading"); "while %s\n", faultAddress, address, isWrite ? "writing" : "reading");
+1 -1
View File
@@ -4088,7 +4088,7 @@ vm_page_fault(addr_t address, addr_t faultAddress, bool isWrite, bool isUser,
#endif #endif
} frame; } frame;
# ifdef __INTEL__ # ifdef __INTEL__
struct iframe* iframe = i386_get_user_iframe(); struct iframe* iframe = x86_get_user_iframe();
if (iframe == NULL) if (iframe == NULL)
panic("iframe is NULL!"); panic("iframe is NULL!");