/* timer without interrupts This function is derived from PowerPC code (read timebase as long long). On ARM it just returns the timer value.  */
unsigned long long get_ticks(void)
/* timer without interrupts This function is derived from PowerPC code (read timebase as long long). On ARM it just returns the timer value.  */
unsigned long long get_ticks(void)
{
	ulong now = read_timer();
	if (lastdec >= now) {
		timestamp += lastdec - now;
	} else {
		timestamp += lastdec + timer_load_val - now;
	}
	lastdec = now;
	return timestamp;
}