Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Jun 1999 06:48:49 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        bde@zeta.org.au, julian@whistle.com
Cc:        current@FreeBSD.ORG, nick.hibma@jrc.it, phk@critter.freebsd.dk, roger@cs.strath.ac.uk
Subject:   Re: cdevsw_add
Message-ID:  <199906042048.GAA25745@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>> The isa drivers provide many bad examples.  Most of them attached the
>> devsw in a disgusting SYSINIT even if the device is disabled.  I moved
>> the devsw attach to the device attach function in some drivers that
>> I worked on.  This was necessary to support pcvt and syscons sharing a
>> devsw entry.
>
>Firstly, the SYSINIT code was a stopgap. It will evolve with time..  The

Like most stogaps, it was there too long (3.5 years).  It is mostly gone
now.

>...
>I therefore put it to the group that the right place to do devsw[]
>manipulation is neither in xxx-probe, or xxxx_attach, but in xxx_init(),
>which is only called once, and IS called at teh right time.
>It should also be noted that teh devsw[] extraction code should be run
>from the init() code when it is run with the 'shutdown' argument. (but
>only when the driver arees to allow itself to be unlinked).

You're forgetting that devsw[] is another stopgap.  The kernel should
probably use something like devfs, where dev_t's only exist for devices
that actually exist.  xxx_init() is far too early to decide which hardware
devices exist.

Bruce


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199906042048.GAA25745>