Subject: Re: CVS commit: src/sys/dev/ata
To: Brett Lymn <blymn@baesystems.com.au>
From: Cherry G. Mathew <cherry@zyx.in>
List: tech-kern
Date: 04/06/2006 13:03:39
>>>>> "Brett" == Brett Lymn <blymn@baesystems.com.au> writes:

    Brett> On Wed, Apr 05, 2006 at 11:40:19PM +0200, Manuel Bouyer
    Brett> wrote:
    >>  Well, I have no ideas on this. I just can say that when I
    >> looked at it, I saw it would touch a lot of code and said "I'll
    >> do it later" :)
    >> 

    Brett> There are lots of places that can do with a generic hook
    Brett> infrastructure.  I posted a proposal about doing one on
    Brett> tech-kern on the 31st of Jan. this year.  At the time it
    Brett> was suggested that we look at importing the FreeBSD
    Brett> eventhandler code instead, which with a few modifications
    Brett> would be able to cover what we have now and provide the
    Brett> flexibility that Cherry is looking for.

    Brett> I am coming to a point where I will have some time to look
    Brett> at this but I am wondering do I wait for gcc4 or not?  The
    Brett> reason being is that if I do this now I will need to modify
    Brett> the varargs handling from the FreeBSD code because it uses
    Brett> semantics only supported in gcc3 - the problem is that this
    Brett> leave the vax architecture out in the cold as that is still
    Brett> using a gcc2 compiler. Apparently gcc4 will be supported on
    Brett> the vax.  So, if I wait for the gcc4 import I can get away
    Brett> with fewer modifications... but it means I wait.

I was looking at the FreeBSD man page  EVENTHANDLER(9) 

Do we use varargs within the kernel already ? Wouldn't it pull in
compiler dependancies ( as you mention ) into the kernel ? 

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 ?

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

Thanks,

-- 
~Cherry