Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Dec 1997 00:05:18 +1030
From:      Mike Smith <mike@smith.net.au>
To:        John-Mark Gurney <gurney_j@resnet.uoregon.edu>
Cc:        FreeBSD Hackers <freebsd-hackers@freebsd.org>
Subject:   Re: converting drivers to dynamic memory... 
Message-ID:  <199712181335.AAA00353@word.smith.net.au>
In-Reply-To: Your message of "Thu, 18 Dec 1997 03:50:32 -0800." <19971218035032.46460@hydrogen.nike.efn.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
> well...  one of the things that will need to be done in preperation
> for moving to a dynamic system which will be required by the bus/device
> code, we will need to eliminate ALL static datat that depends upon
> Ndevice to size itself.

This is traditionally the softc array (or pointer array), and not much 
else.

> There are two ways that we can fix this problem.  The first (and
> technically the best) is to be extend many of the calling functions
> to pass around a void * pointer that will point to that devices
> resources.  Though this is technically best, it will require that
> most major parts of the kernel be significantly changes.
>
> The second solution is to continue to use the major/minor code scheme,
> but use a binary tree or a B-tree to obtain the private data.  This
> can cause a performance impact if we use if for things like the sio,
> but this can be fixed by changing the interrupt interface.
>
> I think that we should go with the second solution as it will be

I do not.  And you have missed the most obvious (and most widely 
discussed) solution, which various people are already working on.

Understand that when DEVFS hits us properly (and all that's holding it 
up now are buggy consumers), dev_t will cease to be what it currently 
is.  The dev_t argument is present everywhere that you want to 
reference your device softc.

So, when you create your DEVFS node, one of the objects you pass in 
will be stored in the device token that's passed back on all your 
devices references.  In the normal case, this will be a pointer to your 
softc, which you can retrieve in the normal fashion.

There will be no major/minor numbers soon.

mike
"Real hackers run -current with DEVFS and SLICE on their laptops"




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