From owner-freebsd-current@FreeBSD.ORG Mon Jul 14 19:34:35 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E19A437B401 for ; Mon, 14 Jul 2003 19:34:35 -0700 (PDT) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id ABC4F43F85 for ; Mon, 14 Jul 2003 19:34:34 -0700 (PDT) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.9/8.12.3) with ESMTP id h6F2YXAO000976; Mon, 14 Jul 2003 20:34:33 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Mon, 14 Jul 2003 20:34:31 -0600 (MDT) Message-Id: <20030714.203431.85413817.imp@bsdimp.com> To: nate@root.org From: "M. Warner Losh" In-Reply-To: <20030714173017.F18544@root.org> References: <20030714173017.F18544@root.org> X-Mailer: Mew version 2.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: current@freebsd.org Subject: Re: newbus questions X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2003 02:34:36 -0000 In message: <20030714173017.F18544@root.org> Nate Lawson writes: : I'm working on ECDT support for ACPI and ran into a couple newbus-related : questions. : : 1. I'm using the identify entry as a way to get called early on in the : boot process. However, this does not happen before $PIR evaluation. How : should I hook in a routine for pre-$PIR execution? You cannot with newbus. discovery of $PIR happens as part of the BIOS scans, of which pci bios is one. why do you need to do this? It seems like a very odd question. : 2. I need to call bus_alloc_resource() to get access to some io ports. : However, calling BUS_READ_IVAR in the identify routine gets a bad pointer : deref. So how do I get a handle to use for allocating the IO ports : (first arg of bus_alloc_resource)? You need a device and a parent device. If you do not have one, then you must get one. : 3. It appears bus_alloc_resource() takes a range of values. If I know the : exact value to use, I request it via "value, value" instead of "0, ~0". : Is this correct? Yes. However, typically the parent bus identifies these resources, and the child device swallows it. The child device typically has no say in the matter. However, the foo_identify routines can set what it thinks are the right addresses. : The framework for this code is in ec_identify() and ec_attach() in : sys/dev/acpica/acpi_ec.c. This really isn't a identify routine. You must hook into other things if you want to get access early. Let's take a step back. What are you trying to do? Warner