Subject: Re: [linuxsh-dev] Dreamcast RTC
To: Marcus Comstedt <>
From: Philipp Rumpf <>
List: port-sh3
Date: 12/01/2000 20:32:23
On Fri, Dec 01, 2000 at 04:17:14PM +0100, Marcus Comstedt wrote:
>   Philipp> might want to use the standard trick of doing
>   Philipp> 	do {
>   Philipp> 		val1 = (ctrl_inl(high word)<<16) + (ctrl_inl(low word)&0xffff);
>   Philipp> 		val2 = (ctrl_inl(high word)<<16) + (ctrl_inl(low word)&0xffff);
>   Philipp> 	} while(val1 != val2);
> The code I use check that the value is the same four times in a row.
> That is what the SEGA libraries do, so maybe it's necessary.

>   Philipp> so arch/sh/kernel/time.c: get_rtc_time would look like this;
> What is said here only concerns the Dreamcast.  It should not be
> applied to other machines using the SH cpu.  The Dreamcast RTC is part

Obviously :).  I think we still need to find a good solution for that problem,
preferrably one that doesn't live in arch/.

If you (i.e. all the people working on DC) plan on merging your work soon,
I'd propose moving the RTC code into a separate file and referencing it
through the machvec for generic builds (of course it's questionable how
much sense generic builds make for superh).