Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 58 → Rev 57

/SPARTAN/trunk/arch/ia32/src/fpu_context.c
29,10 → 29,7
*/
 
#include <fpu_context.h>
#include <arch.h>
#include <cpu.h>
 
 
void fpu_context_save(fpu_context_t *fctx)
{
}
40,8 → 37,6
 
void fpu_context_restore(fpu_context_t *fctx)
{
if(THREAD==CPU->arch.fpu_owner) reset_TS_flag();
else set_TS_flag();
}
 
 
/SPARTAN/trunk/arch/ia32/src/cpu/cpu.c
61,38 → 61,9
"GenuineIntel"
};
 
void set_TS_flag(void)
{
asm
(
"mov %%cr0,%%eax;"
"or $8,%%eax;"
"mov %%eax,%%cr0;"
:
:
:"%eax"
);
}
 
void reset_TS_flag(void)
{
asm
(
"mov %%cr0,%%eax;"
"and $0xffFFffF7,%%eax;"
"mov %%eax,%%cr0;"
:
:
:"%eax"
);
}
 
 
 
void cpu_arch_init(void)
{
CPU->arch.tss = tss_p;
CPU->arch.fpu_owner=NULL;
}
 
 
/SPARTAN/trunk/arch/ia32/include/cpu.h
30,7 → 30,6
#define __ia32_CPU_H__
 
#include <config.h>
#include <proc/thread.h>
#include <typedefs.h>
#include <arch/pm.h>
#include <arch/asm.h>
47,11 → 46,7
int model;
int stepping;
struct tss *tss;
thread_t *fpu_owner;
};
 
 
void set_TS_flag(void);
void reset_TS_flag(void);
 
#endif