Implemented lazy FPU state save/restore. In the end mostly ported from NewOS. SMP safe.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17251 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -104,12 +104,10 @@ void i386_enter_uspace(addr_t entry, void *args1, void *args2, addr_t ustack_top
|
||||
void i386_set_tss_and_kstack(addr_t kstack);
|
||||
void i386_switch_stack_and_call(addr_t stack, void (*func)(void *), void *arg);
|
||||
void i386_swap_pgdir(addr_t new_pgdir);
|
||||
void i386_fsave(void *fpu_state);
|
||||
void i386_fnsave(void *fpu_state);
|
||||
void i386_fxsave(void *fpu_state);
|
||||
void i386_frstor(const void *fpu_state);
|
||||
void i386_fxrstor(const void *fpu_state);
|
||||
void i386_fsave_swap(void *old_fpu_state, const void *new_fpu_state);
|
||||
void i386_fxsave_swap(void *old_fpu_state, const void *new_fpu_state);
|
||||
uint32 x86_read_ebp();
|
||||
uint32 x86_read_cr0();
|
||||
void x86_write_cr0(uint32 value);
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
|
||||
#include <smp.h>
|
||||
#include <thread.h>
|
||||
#include <timer.h>
|
||||
#include <boot/kernel_args.h>
|
||||
|
||||
@@ -24,6 +25,9 @@ typedef union cpu_ent {
|
||||
int preempted;
|
||||
timer quantum_timer;
|
||||
|
||||
// tells which thread's fpu state we hold
|
||||
struct thread *fpu_state_thread;
|
||||
|
||||
// keeping track of CPU activity
|
||||
bigtime_t active_time;
|
||||
bigtime_t last_kernel_time;
|
||||
|
||||
@@ -139,6 +139,7 @@ struct thread {
|
||||
int32 state;
|
||||
int32 next_state;
|
||||
union cpu_ent *cpu;
|
||||
union cpu_ent *fpu_cpu; /* this cpu holds our fpu state */
|
||||
|
||||
sigset_t sig_pending;
|
||||
sigset_t sig_block_mask;
|
||||
|
||||
Reference in New Issue
Block a user