From owner-freebsd-acpi@FreeBSD.ORG Fri Apr 11 05:11:54 2008 Return-Path: Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C11C106566C for ; Fri, 11 Apr 2008 05:11:54 +0000 (UTC) (envelope-from glorgster@gmail.com) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.232]) by mx1.freebsd.org (Postfix) with ESMTP id C2AC58FC15 for ; Fri, 11 Apr 2008 05:11:53 +0000 (UTC) (envelope-from glorgster@gmail.com) Received: by wx-out-0506.google.com with SMTP id i29so365584wxd.7 for ; Thu, 10 Apr 2008 22:11:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; bh=E2bzraC5FuvUpIl99yIxOsDVywIhgatPK5xz8b9/uws=; b=v4RR0GEAMHmfhq81KWI+CgVUy1yszY8oj1dZ1szjCit/e8DSrbJnKyF7Vo5Nm1Wu5S3iN5CEWggM4Ad5NCSp9hNFdXDBq7CNlD8NxUJS4ckX8myypER0i7X7kfEToOrCB0O5ctS2AxQt3wqZIYUKP/xVKOp7jG06SmoKL2vQM4E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=WAzFxpzsx7pt/rSWns1Z76xGfoNI4YrTtg/0baHj/1nY/miv/LlfjDIIrovBwW+KS75bSw/QQVFuGfzJERSWVZKm+rr/URER7mxYtH/kXvWF3uziMLHZ8zFfcMgvmj56+s3KXsSHnR+isonK51jkuBdBCpufcCsnQEhKG/RYHro= Received: by 10.141.145.11 with SMTP id x11mr1246011rvn.215.1207890711786; Thu, 10 Apr 2008 22:11:51 -0700 (PDT) Received: by 10.141.43.7 with HTTP; Thu, 10 Apr 2008 22:11:51 -0700 (PDT) Message-ID: Date: Fri, 11 Apr 2008 16:11:51 +1100 From: "Alexey Tarasov" To: freebsd-acpi@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Question about resource allocation X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2008 05:11:54 -0000 Hi, I'm trying to update spic and acpi_sony drivers, looking to Linux sony_laptop driver. Now I'm at allocating IO ports resource stage. spic driver on FreeBSD uses bus_alloc_resources() with default for bus values (0, ~0) for this purpose ---- if (!(sc->port_res = bus_alloc_resource(sc->dev, SYS_RES_IOPORT, &sc->port_rid, 0, ~0, 5, RF_ACTIVE))) { device_printf(sc->dev,"Couldn't map I/O\n"); return (ENXIO); } ---- sony_laptop enumerates resources of device using acpi_walk_resources() function and then calls request_region() for all found IO regions. First non fail result will be used later in working with SPIC. So question: is it better to use approach from sony_laptop. If yes, then how to walk resources (I've not found analog of acpi_walk_resource function in FreeBSD) If there is link to any related documentation, it'll be great help. Thanks. --- Best regards, Alexey