Subversion Repositories shark

Compare Revisions

Regard whitespace Rev 651 → Rev 652

/shark/trunk/oslib/kl/advtimer.c
486,13 → 486,17
{
unsigned long long dtsc;
unsigned long temp;
struct timespec temp_time;
SYS_FLAGS f;
 
if (use_tsc) {
f = ll_fsave();
 
__asm__("cpuid"::"a" (0), "b" (0), "c" (0), "d" (0));
ll_read_timespec(&temp_time); // Set new start TimeSpec
TIMESPEC_ASSIGN(&init_time,&temp_time);
rdtscll(init_tsc); // Set new start TSC
ll_read_timespec(&init_time); // Set new start TimeSpec
__asm__("cpuid"::"a" (0), "b" (0), "c" (0), "d" (0));
mul32div32to32(clk_per_msec,new_f,old_f,temp);
clk_per_msec = temp;
/shark/trunk/oslib/ll/i386/advtimer.h
85,6 → 85,13
: "D" (ptr_init_tsc) , "b" (clk_opt_1), "c" (clk_opt_2)
: "edx" );
 
if (init_time.tv_sec != 0 || init_time.tv_nsec != 0) {
__asm__("divl %%ecx\n\t"
"addl %%ebx,%%eax\n\t"
:"=a" (tspec->tv_sec), "=d" (tspec->tv_nsec)
:"a" (init_time.tv_nsec+tspec->tv_nsec), "b" (tspec->tv_sec+init_time.tv_sec), "c" (1000000000), "d" (0));
};
}
 
//Low level time read function: Optimized for CPU < 2 GHz
111,6 → 118,13
: "D" (ptr_init_tsc) , "b" (clk_opt_1), "c" (clk_opt_3)
: "edx" );
if (init_time.tv_sec != 0 || init_time.tv_nsec != 0) {
__asm__("divl %%ecx\n\t"
"addl %%ebx,%%eax\n\t"
:"=a" (tspec->tv_sec), "=d" (tspec->tv_nsec)
:"a" (init_time.tv_nsec+tspec->tv_nsec), "b" (tspec->tv_sec+init_time.tv_sec), "c" (1000000000), "d" (0));
};
}
 
//Low level time read function: Optimized for CPU < 4 GHz
137,6 → 151,13
: "D" (ptr_init_tsc) , "b" (clk_opt_1), "c" (clk_opt_4)
: "edx" );
if (init_time.tv_sec != 0 || init_time.tv_nsec != 0) {
__asm__("divl %%ecx\n\t"
"addl %%ebx,%%eax\n\t"
:"=a" (tspec->tv_sec), "=d" (tspec->tv_nsec)
:"a" (init_time.tv_nsec+tspec->tv_nsec), "b" (tspec->tv_sec+init_time.tv_sec), "c" (1000000000), "d" (0));
};
}
 
//Low level time read function
170,7 → 191,7
__asm__("divl %%ecx\n\t"
"addl %%ebx,%%eax\n\t"
:"=a" (tspec->tv_sec), "=d" (tspec->tv_nsec)
:"a" (init_time.tv_nsec+tspec->tv_nsec), "b" (tspec->tv_sec+init_time.tv_sec), "c" (0x3B9ACA00), "d" (0));
:"a" (init_time.tv_nsec+tspec->tv_nsec), "b" (tspec->tv_sec+init_time.tv_sec), "c" (1000000000), "d" (0));
};
}