Subject: Re: CVS commit: src/sys/dev/ata
To: Cherry G. Mathew <cherry@zyx.in>
From: Brett Lymn <blymn@baesystems.com.au>
List: tech-kern
Date: 04/06/2006 22:34:15
On Thu, Apr 06, 2006 at 01:03:39PM +0530, Cherry G. Mathew wrote:
> 
> Do we use varargs within the kernel already ? Wouldn't it pull in
> compiler dependancies ( as you mention ) into the kernel ? 
> 

printf? ;)

> AFAIU, the current hook subsystems ( shutdown, power etc. ) take a
> fixed number of args. Couldn't you implement them as such with
> EVENTHANDLER for a start and then move to varargs if required ?
> 

Yes, the current ones do take a fixed number of args and in most
instances you can get away with a single arg.  The only time this is a
problem is with the exec hook (I think it's that one) that wants two
args.  Originally I was thinking the args could be bundled up into a
single structure but actually using varargs means you don't have to
hack around a single arg limitation which can be nice.

> Since EVENTHANDLER_INVOKE(name, ...) is a varargs macro, I assume it
> isn't affected by the gcc problem you mention ?
> 

No, from what I understand that _is_ the problem... gcc2 cannot handle
varargs in macros, yamt pointed that out in the thread I started on
tech-kern.

-- 
Brett Lymn