From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 11 11:48:27 2007 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2F9D316A405 for ; Wed, 11 Apr 2007 11:48:27 +0000 (UTC) (envelope-from alan@fromorbit.com) Received: from thing1.auspcmarket.com.au (mail.fromorbit.com [203.31.169.65]) by mx1.freebsd.org (Postfix) with ESMTP id E143913C457 for ; Wed, 11 Apr 2007 11:48:26 +0000 (UTC) (envelope-from alan@fromorbit.com) Received: from [192.168.1.197] (c220-239-255-86.rivrw3.nsw.optusnet.com.au [220.239.255.86]) by thing1.auspcmarket.com.au (Postfix) with ESMTP id 15B4C5DD4; Wed, 11 Apr 2007 21:25:19 +1000 (EST) Message-ID: <461CC586.5060507@fromorbit.com> Date: Wed, 11 Apr 2007 21:24:54 +1000 From: Alan Garfield User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 To: takawata@jp.freebsd.org References: <200704110951.l3B9p4hT024402@sana.init-main.com> In-Reply-To: <200704110951.l3B9p4hT024402@sana.init-main.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: hackers@freebsd.org Subject: Re: Resources and ACPI 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: Wed, 11 Apr 2007 11:48:27 -0000 takawata@jp.freebsd.org wrote: >> If the resources are allocated how do I access/see them? > > sc->sc_rid1 = 0; > sc->sc_res1 = bus_alloc_resource_any(self, SYS_RES_IOPORT, &sc->sc_rid, RF_ACTIVE); > sc->sc_rid2 = 0; > sc->sc_res2 = bus_alloc_resource_any(self, SYS_RES_IOPORT, &sc->sc_rid, RF_ACTIVE); > value_af = bus_space_read_8(rman_get_bustag(sc->sc_res2), rman_get_bushandle(sc->sc_res2), 1); Thanks for this, but how does on tell which resources have been allocated to which other than manually specifying them with bus_alloc_resource()? This is the bit that's confusing me, it seem like magic happens but I need to know which resource is which. Many thanks in advance! Alan.