From owner-freebsd-arch Wed May 23 22:47:11 2001 Delivered-To: freebsd-arch@freebsd.org Received: from mass.dis.org (adsl-64-166-71-242.dsl.sntc01.pacbell.net [64.166.71.242]) by hub.freebsd.org (Postfix) with ESMTP id E170F37B43C for ; Wed, 23 May 2001 22:47:07 -0700 (PDT) (envelope-from msmith@mass.dis.org) Received: from mass.dis.org (localhost [127.0.0.1]) by mass.dis.org (8.11.3/8.11.3) with ESMTP id f4NKHp400923; Wed, 23 May 2001 13:17:52 -0700 (PDT) (envelope-from msmith@mass.dis.org) Message-Id: <200105232017.f4NKHp400923@mass.dis.org> X-Mailer: exmh version 2.1.1 10/15/1999 To: Brian Somers Cc: freebsd-arch@FreeBSD.ORG Subject: Re: RFC: unit_list routines In-reply-to: Your message of "Wed, 23 May 2001 18:02:09 BST." <200105231702.f4NH29F07183@hak.lan.Awfulhak.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 23 May 2001 13:17:51 -0700 From: Mike Smith Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > > >I didn't do it that way because the ``usual'' way units are allocated > > >is sequentially. Using bits when there are large numbers of units > > >gets awkward. I figured what was required was something small and > > >simple that would cover the requirements of most/all drivers that > > >need to track their units so that it's easy to find an unused one, > > >and it's easy to allocate/deallocate things. > > > > How does newbus allocate/manage unit numbers ? > > I don't think it does. The only way to find out what's in use > (AFAIK) is by looking at every specinfo in dev_hash.... Er, what exactly are you smoking? Newbus manages unit numbers using the devclass: struct devclass { TAILQ_ENTRY(devclass) link; driver_list_t drivers; /* bus devclasses store drivers for bus */ char *name; device_t *devices; /* array of devices indexed by unit */ int maxunit; /* size of devices array */ }; -- ... every activity meets with opposition, everyone who acts has his rivals and unfortunately opponents also. But not because people want to be opponents, rather because the tasks and relationships force people to take different points of view. [Dr. Fritz Todt] V I C T O R Y N O T V E N G E A N C E To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message