FreeBSD/sys/arm/xscale/ixp425/ixp425_timer.c
/*
 * DELAY:
 *
 *	Delay for at least N microseconds.
 */
Delay for at least N microseconds.
Delay for at least N microseconds .
void
DELAY(int n)
{
	u_int32_t first, last;
	int usecs;
	if (n == 0)
		return;
	if (n >= (0x80000000U / COUNTS_PER_USEC))
		usecs = (0x80000000U / COUNTS_PER_USEC) - 1;
	else
		usecs = n * COUNTS_PER_USEC;
	first = GET_TS_VALUE();
	while (usecs > 0) {
		last = GET_TS_VALUE();
		usecs -= (int)(last - first);
		first = last;
	}
}
void DELAY ( int n ) { u_int32_t first , last ; int usecs ; if ( n == 0 ) return ; if ( n >= ( 0x80000000U / COUNTS_PER_USEC ) ) usecs = ( 0x80000000U / COUNTS_PER_USEC ) - 1 ; else usecs = n * COUNTS_PER_USEC ; first = GET_TS_VALUE ( ) ; while ( usecs > 0 ) { last = GET_TS_VALUE ( ) ; usecs -= ( int ) ( last - first ) ; first = last ; } }
DELAY:
      Delay for at least N microseconds.
DELAY : Delay for at least N microseconds .
/*
	 * Clamp the timeout at a maximum value (about 32 seconds with
	 * a 66MHz clock). *Nobody* should be delay()ing for anywhere
	 * near that length of time and if they are, they should be hung
	 * out to dry.
	 */ /* Note: Timestamp timer counts *up*, unlike the other timers */