From owner-freebsd-arch Thu May 24 3: 1:11 2001 Delivered-To: freebsd-arch@freebsd.org Received: from tele-post-20.mail.demon.net (tele-post-20.mail.demon.net [194.217.242.20]) by hub.freebsd.org (Postfix) with ESMTP id AF57F37B423 for ; Thu, 24 May 2001 03:01:05 -0700 (PDT) (envelope-from dfr@nlsystems.com) Received: from [62.49.251.130] (helo=herring.nlsystems.com) by tele-post-20.mail.demon.net with esmtp (Exim 2.12 #2) id 152rvU-000Bi3-0K; Thu, 24 May 2001 10:01:04 +0000 Received: from herring (herring [10.0.0.2]) by herring.nlsystems.com (8.11.2/8.11.2) with ESMTP id f4O9xm758829; Thu, 24 May 2001 10:59:48 +0100 (BST) (envelope-from dfr@nlsystems.com) Date: Thu, 24 May 2001 10:59:48 +0100 (BST) From: Doug Rabson To: Poul-Henning Kamp Cc: Brian Somers , Garrett Wollman , Subject: Re: RFC: unit_list routines In-Reply-To: <3487.990636871@critter> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 On Wed, 23 May 2001, Poul-Henning Kamp wrote: > In message <200105231552.f4NFqwF05688@hak.lan.Awfulhak.org>, Brian Somers write > s: > > >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 ? The devclass object manages them. A devclass more-or-less represents all devices which share a name. For instance if a new pci bus is discovered, the system finds the devclass for "pci" and asks for the next available unit number. This stuff pre-dates the resource manager which is being discussed which accounts for the duplicated functionality. -- Doug Rabson Mail: dfr@nlsystems.com Phone: +44 20 8348 6160 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message