/* Grabs the current RTC seconds counter and adjusts it to the Unix Epoch.  */
static void aica_rtc_gettimeofday(struct timespec *ts)
/* Grabs the current RTC seconds counter and adjusts it to the Unix Epoch.  */
static void aica_rtc_gettimeofday(struct timespec *ts)
{
	unsigned long val1, val2;
	do {
		val1 = ((ctrl_inl(AICA_RTC_SECS_H) & 0xffff) << 16) |
			(ctrl_inl(AICA_RTC_SECS_L) & 0xffff);
		val2 = ((ctrl_inl(AICA_RTC_SECS_H) & 0xffff) << 16) |
			(ctrl_inl(AICA_RTC_SECS_L) & 0xffff);
	} while (val1 != val2);
	ts->tv_sec = val1 - TWENTY_YEARS;
	ts->tv_nsec = 0;
}