Replaced common u64.h functions with operators.

Change-Id: I71b7b4879209eeff89ce5748d67102afebf871dc
This commit is contained in:
Gerard
2013-11-21 12:09:58 +01:00
committed by Lionel Sambuc
parent cd36dd7703
commit 78da142dab
37 changed files with 141 additions and 273 deletions

View File

@@ -67,10 +67,10 @@ double getidle(void)
if ((r = sys_getidletsc(&idle2)) != OK)
return -1.0;
idelta = sub64(idle2, idle);
tdelta = sub64(stop, start);
idelta = idle2 - idle;
tdelta = stop - start;
if (cmp64(idelta, tdelta) >= 0)
if (idelta >= tdelta)
return 100.0;
ifp = make_double(idelta);

View File

@@ -191,9 +191,9 @@ void procexit (char *UNUSED(name))
*/
/* Calculate "small" difference. */
spent = sub64(stop, cprof_stk[cprof_stk_top].start_2);
spent = stop - cprof_stk[cprof_stk_top].start_2;
cprof_stk[cprof_stk_top].slot->cycles +=
sub64(spent, cprof_stk[cprof_stk_top].spent_deeper);
spent - cprof_stk[cprof_stk_top].spent_deeper;
/* Clear spent_deeper for call level we're leaving. */
cprof_stk[cprof_stk_top].spent_deeper = ((u64_t)(0));
@@ -216,7 +216,7 @@ void procexit (char *UNUSED(name))
stop = make64(tsc_lo, tsc_hi);
/* Calculate "big" difference. */
spent = sub64(stop, cprof_stk[cprof_stk_top].start_1);
spent = stop - cprof_stk[cprof_stk_top].start_1;
cprof_stk_top--; /* decrease stack */
if (cprof_stk_top >= 0) /* don't update non-existent level -1 */
cprof_stk[cprof_stk_top].spent_deeper += spent;

View File

@@ -61,7 +61,7 @@ int spin_check(spin_t *s)
case STATE_TS:
read_tsc_64(&cur_tsc);
tsc_delta = sub64(cur_tsc, s->s_base_tsc);
tsc_delta = cur_tsc - s->s_base_tsc;
micro_delta = tsc_64_to_micros(tsc_delta);

View File

@@ -63,7 +63,7 @@ micro_delay(u32_t micros)
CALIBRATE;
/* We have to know when to end the delay. */
end = now + mul64u(micros, calib_mhz);
end = now + ((u64_t)micros * calib_mhz);
/* If we have to wait for at least one HZ tick, use the regular
* tickdelay first. Round downwards on purpose, so the average
@@ -75,7 +75,7 @@ micro_delay(u32_t micros)
tickdelay(micros*Hz/MICROHZ);
/* Wait (the rest) of the delay time using busywait. */
while(cmp64(now, end) < 0)
while(now < end)
read_tsc_64(&now);
return OK;
@@ -87,7 +87,7 @@ u32_t tsc_64_to_micros(u64_t tsc)
CALIBRATE;
tmp = div64u64(tsc, calib_mhz);
tmp = tsc / calib_mhz;
if (ex64hi(tmp)) {
printf("tsc_64_to_micros: more than 2^32ms\n");
return ~0UL;