2 #include "../port/lib.h"
21 pcc = rpcc(nil) & 0xFFFFFFFF;
24 * pcclast is needed to detect wraparound of
25 * the cycle timer which is only 32-bits.
26 * m->cpuhz is set from the info passed from
28 * This could be in clockinit if can
29 * guarantee no wraparound between then and now.
31 * All the clock stuff needs work.
33 m->cpuhz = hwrpb->cfreq;
36 delta = pcc - m->pcclast;
38 delta += 0x100000000LL;
40 m->fastclock += delta;
42 return MACHP(0)->fastclock;
64 return fastticks2us(cycletimer());
68 * performance measurement ticks. must be low overhead.
69 * doesn't have to count over a second.
87 eot = fastticks(nil) + (m->cpuhz/1000000)*us;
88 while(fastticks(nil) < eot)
95 microdelay(millisecs*1000);
105 /* HZ == 100, timer == 1024Hz. error < 1ms */