unsigned long long val = ecx;
val *= ebx;
- do_div(val, eax);
printk("CPU%u: TSC: %u Hz * %u / %u = %Lu Hz\n",
- smp_processor_id(), ecx, ebx, eax, val);
+ smp_processor_id(), ecx, ebx, eax, val / eax);
}
else if ( ecx | eax | ebx )
{
static inline unsigned long div_sc(unsigned long ticks, unsigned long nsec,
int shift)
{
- uint64_t tmp = ((uint64_t)ticks) << shift;
-
- do_div(tmp, nsec);
- return (unsigned long) tmp;
+ return ((uint64_t)ticks << shift) / nsec;
}
/*
static inline void write_watchdog_counter(const char *descr)
{
- u64 count = (u64)cpu_khz * 1000;
+ uint64_t count = cpu_khz * 1000ULL / nmi_hz;
- do_div(count, nmi_hz);
- if(descr)
+ if ( descr )
Dprintk("setting %s to -%#"PRIx64"\n", descr, count);
wrmsrl(nmi_perfctr_msr, 0 - count);
}
struct vcpu_time_info *info = &this_cpu(vcpu_info)->time;
uint64_t freq;
- freq = 1000000000ULL << 32;
- do_div(freq, info->tsc_to_system_mul);
+ freq = (1000000000ULL << 32) / info->tsc_to_system_mul;
if ( info->tsc_shift < 0 )
freq <<= -info->tsc_shift;
else
set_time_scale(&t->tsc_scale, tmp);
t->stamp.local_tsc = boot_tsc_stamp;
- do_div(tmp, 1000);
- cpu_khz = (unsigned long)tmp;
+ cpu_khz = tmp / 1000;
printk("Detected %lu.%03lu MHz processor.\n",
cpu_khz / 1000, cpu_khz % 1000);