Subject: Re: Call for review: The New Block/Character Device Switch
To: MAEKAWA Masahide <>
From: Matt Thomas <>
List: tech-kern
Date: 06/28/2001 07:43:07
At 10:55 PM 6/28/2001 +0900, MAEKAWA Masahide wrote:
>Matt Thomas <> wrote:
> >>- What do you think that many macros for each devices are defined in
> >>sys/conf.h
> >>   or machine/conf.h? In addition, in order to use that macros compels 
> us to
> >>   define many new functions same as nullop/enodev and kludge aliases.
> >
> >Shouldn't be needed; but they do make prototypes easier.
>Yes. But we should consider which is useful or not, I think.
> >>The bdevsw/cdevsw tables are dealed with in the abstract to support
> >>to attach/detach the bdevsw/cdevsw data dynamically. Each drivers should
> >>use devsw_get(9) and devsw_lookup(9) to get the device interface instead of
> >>accessing them directly.
> >
> >decsw_get I like.  Not sure about devsw_lookup.  It seems hackish.
>In some ports we must generate dev_t from the devsw name at
>the boot time, right?
>(yes, after applied my patch, still remain hard-coding of majors...)
> >>In order to support this feature, add the new grammer 'device-switch'
> >>to 'files'. In my current implementation, all 'device-switch' is in
> >>the new file 'devsw.<arch>' under sys/arch/<arch>/conf.
> >
> >Sigh.  Another file.
>Now devsw.<arch> is included from files.<arch>.
>Should 'device-switch'es be just in files.<arch>?
>Even so, I can change very easily. ok. No problems.

Actually, I don't mind the extra file.  For instance, this
helps the split up of the arm ports.  We can keep the common
devices in arch/arm/conf/devsw.arm and only have the port
specific devices in arch/<port>/conf/devsw.<port>.  This makes
having shared arm base/etc sets simpler (if they can all use
the same MAKEDEV)

> >And are placed in ioconf.c?  or someplace else?
>I'm not sure...
> >If you have multi device-switch for the same name, will the latter
> >take priority?
>Sorry, I don't think of an example sooner...
>Could you show me an example?

Given the example above, imagine a device-switch in decsw.arm but
then a 2nd device-switch that is in devsw.cats for the same name
but a different chr number.  The 2nd one should take precedence.

Do the major {wd = 16} go away?  Do the blk/chr arrays get filled
regardless of the presence of the device?  (think dynamic loading)

Matt Thomas               Internet:
3am Software Foundry      WWW URL:
Cupertino, CA             Disclaimer: I avow all knowledge of this message