From owner-freebsd-hackers Thu Dec 18 06:32:03 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id GAA22045 for hackers-outgoing; Thu, 18 Dec 1997 06:32:03 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from cheops.anu.edu.au (avalon@cheops.anu.edu.au [150.203.76.24]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id GAA22000 for ; Thu, 18 Dec 1997 06:31:57 -0800 (PST) (envelope-from avalon@coombs.anu.edu.au) Message-Id: <199712181431.GAA22000@hub.freebsd.org> Received: by cheops.anu.edu.au (1.37.109.16/16.2) id AA247585503; Fri, 19 Dec 1997 01:31:43 +1100 From: Darren Reed Subject: Re: converting drivers to dynamic memory... To: gurney_j@resnet.uoregon.edu Date: Fri, 19 Dec 1997 01:31:43 +1100 (EDT) Cc: freebsd-hackers@FreeBSD.ORG In-Reply-To: <19971218053840.15389@hydrogen.nike.efn.org> from "John-Mark Gurney" at Dec 18, 97 05:38:40 am X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk In some mail from John-Mark Gurney, sie said: > > > Hmmm. So how exactly does the B-tree solve the problem ? You're > > allocating > > the dynamic data and storing it on the B-Tree and then have to look > > it up by > > searching the B-tree ? Aren't there better ways of allocating data > > and then > > looking up where it is (what about asking the driver itself) ? > > correct.. this is EXACTLY what the code does.. the problem is that > right now the data is stored in a static table, because of this, you > can't just say, hey, I need another instance of you to attach to this > card... we could even go with a small array of pointers that gets > realloced/resized each time a driver gets attached... (which might be > better, I happen to have just finished testing the btree code, so that > influenced my choice.. :) ).. Now I've got more clues so I can understand where you're going with all of this :) Well, FWIW, Solaris2 does the "extra pointer" thing in its DDI :) However, if you are using multiple instances, you do need to keep track of which is which (guess you could use B-Trees for this :) yourself. Their function call interface consists of over 120 functions which support using the extra pointer (they call their void * type dev_info_t). Hmmm, on second thoughts maybe instead of option 1 and option 2, option 2 should be phase 1 and option 1 should be phase 2 ? :-) Darren