From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 11 18:50:54 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0DD0016A4E1 for ; Tue, 11 Jul 2006 18:50:54 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7D43A43D6E for ; Tue, 11 Jul 2006 18:50:52 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [127.0.0.1] (may be forged)) by harmony.bsdimp.com (8.13.4/8.13.4) with ESMTP id k6BIm2i3045119; Tue, 11 Jul 2006 12:48:02 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Tue, 11 Jul 2006 12:48:11 -0600 (MDT) Message-Id: <20060711.124811.1878034486.imp@bsdimp.com> To: jhb@freebsd.org From: "M. Warner Losh" In-Reply-To: <200607111413.37238.jhb@freebsd.org> References: <200607111115.59844.jhb@freebsd.org> <20060711.103327.-8650905.imp@bsdimp.com> <200607111413.37238.jhb@freebsd.org> X-Mailer: Mew version 4.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Tue, 11 Jul 2006 12:48:02 -0600 (MDT) Cc: freebsd-hackers@freebsd.org, mag@intron.ac, matthias.andree@gmx.de, julian@elischer.org, des@des.no, delphij@delphij.net Subject: Re: kern/99979: Get Ready for Kernel Module in C++ X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jul 2006 18:50:54 -0000 In message: <200607111413.37238.jhb@freebsd.org> John Baldwin writes: : On Tuesday 11 July 2006 12:33, M. Warner Losh wrote: : > In message: <200607111115.59844.jhb@freebsd.org> : > John Baldwin writes: : > : and OS X both of which I've written a PCI driver for) we require device : > : driver writers to go through a lot more hoops to do certain things like : > : allocate resources. At the very least there is much that can be improved : in : > : our driver model. : > : > bus_alloc_resources goes a long ways in this respect. : : Yes, but in OS X I didn't even have to do that. All I had to do was ask it to : map a BAR if I wanted to use it. It already "allocated" all the resources : regardless. Windows was the same way (though a bit weirder, you get a : message that lists all your resources and you have to map them if you want to : use them). What's the difference in asking for a resource to be mapped, and calling a routine that allocates and maps the resource? Also, in FreeBSD, the resources are already allocated by the bus code. It just changes ownership to the child when the request comes in... Warner