Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 89 → Rev 90

/SPARTAN/trunk/test/fpu/fpu0/test.c
44,18 → 44,23
static void e(void *data)
{
int i;
while(1) {
while(1)
{
double e,d,le,f;
le=-1;
e=0;
f=1;
for(i=0,d=1;e!=le;d*=f,f+=1,i++) {
for(i=0,d=1;e!=le;d*=f,f+=1,i++)
{
le=e;
e=e+1/d;
if (i>1000000) {
printf("tid%d: e LOOPING\n", THREAD->tid);
if (i>20000000)
{
// printf("tid%d: e LOOPING\n", THREAD->tid);
putchar('!');
i = 0;
}
}
if((int)(100000000*e)==271828182) printf("tid%d: e OK\n", THREAD->tid);
74,5 → 79,7
t = thread_create(e, NULL, TASK, 0);
thread_ready(t);
}
while(1);
 
}
/SPARTAN/trunk/arch/ia32/Makefile.inc
13,7 → 13,7
endif
 
CPPFLAGS=$(DEFS) -nostdinc -I../include
CFLAGS=$(CPPFLAGS) -nostdlib -fno-builtin -fomit-frame-pointer -Wmissing-prototypes -Werror -O3
CFLAGS=$(CPPFLAGS) -nostdlib -fno-builtin -fomit-frame-pointer -Wmissing-prototypes -Werror -O0
LFLAGS=-M -no-check-sections -T ../arch/ia32/_link.ld
 
arch_sources= \
/SPARTAN/trunk/arch/ia32/src/fpu_context.c
51,28 → 51,30
 
void fpu_lazy_context_save(fpu_context_t *fctx)
{
printf("");
asm(
"mov %0,%%eax;"
"fxsave (%%eax);"
:"=m"(fctx)
:
:"eax"
);
printf("");
asm
(
"push %%eax;"
"mov 0x8(%%esp),%%eax;"
"fnsave (%%eax);"
"pop %%eax;"
:"=m"(fctx)
:
:"eax"
);
}
 
void fpu_lazy_context_restore(fpu_context_t *fctx)
{
printf("");
asm(
"mov %0,%%eax;"
"fxrstor (%%eax);"
:"=m"(fctx)
:
:"eax"
);
printf("");
asm
(
"push %%eax;"
"mov 0x8(%%esp),%%eax;"
"frstor (%%eax);"
"pop %%eax;"
:"=m"(fctx)
:
:"eax"
);
}
 
void fpu_init(void)
/SPARTAN/trunk/arch/ia32/src/cpu/cpu.c
131,6 → 131,7
CPU->arch.model = (info.cpuid_eax>>4)&0xf;
CPU->arch.stepping = (info.cpuid_eax>>0)&0xf;
}
set_TS_flag();
}
 
void cpu_print_report(cpu_t* m)
/SPARTAN/trunk/arch/ia32/src/interrupt.c
101,7 → 101,8
reset_TS_flag();
if ((CPU->fpu_owner)!=NULL)
{
// printf("owner %X\n",(int)(&((CPU->fpu_owner)->saved_fpu_context)));
// printf("tid:%d \n", THREAD->tid);
// printf("owner:%d\n", (CPU->fpu_owner)->tid);
fpu_lazy_context_save(&((CPU->fpu_owner)->saved_fpu_context));
 
// printf("owner 2\n");