Subject: Re: TODR changes for mac68k
To: Robert Swindells <rjs@fdy2.demon.co.uk>
From: Garrett D'Amore <garrett_damore@tadpole.com>
List: port-mac68k
Date: 09/19/2006 20:39:06
Robert Swindells wrote:
> Garrett D'Amore wrote:
>   
>> The patch was for mac68k not macppc.  I am sorry.  I guess I've gotten
>> confused by the 30 or 40 odd ports I've hacked on lately... :-)
>>     
>
>   
>>> Attached find an MI todr patch for macppc.  It isn't tested.  Note that
>>> the rtc_offset handling is now part of the MI code, so the MD driver
>>> doesn't have to worry about it.
>>>       
>
> [snip]
>
> Seems to work.
>   

Excellent.  Thank you.  I'll commit this now.

>   
>> @@ -181,7 +185,13 @@ enablertclock(void)
>>  void
>>  cpu_initclocks(void)
>>  {
>> +	static struct todr_chip_handle todr = {
>> +		.todr_settime = mac68k_settime,
>> +		.todr_gettime = mac68k_gettime,
>> +	};
>> +	
>>  	enablertclock();
>> +	todr_attach(&todr);
>>  }
>>  
>>  void
>>     
>
> Does this form of structure initialization conform to the style guidelines ?
>
> There is plenty of it in the Linux kernel, but I don't remember seeing
> other examples in NetBSD.
>
> Robert Swindells
>   

Yes.  We have just now started converting to it (Christos has converted
a bunch of code using it).  It requires a compiler that support C99
initialization, and it is immune against certain classes of errors
(besides being obviously more readable), so it is preferred.

-- 
Garrett D'Amore, Principal Software Engineer
Tadpole Computer / Computing Technologies Division,
General Dynamics C4 Systems
http://www.tadpolecomputer.com/
Phone: 951 325-2134  Fax: 951 325-2191