/* Get the number of ticks (in CONFIG_SYS_HZ resolution)  */
unsigned long long get_ticks(void)
/* Get the number of ticks (in CONFIG_SYS_HZ resolution)  */
unsigned long long get_ticks(void)
{
	const unsigned long now = read_timer();
	if (now >= timer.last_update)
		timer.ticks += now - timer.last_update;
	else
		timer.ticks += TIMER_MAX_VAL - timer.last_update + now;
	timer.last_update = now;
	return clk_to_systicks(timer.ticks);
}