From owner-svn-src-all@FreeBSD.ORG Thu Feb 26 00:34:47 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5897F106567C; Thu, 26 Feb 2009 00:34:47 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from agogare.doit.wisc.edu (agogare.doit.wisc.edu [144.92.197.211]) by mx1.freebsd.org (Postfix) with ESMTP id 2205B8FC1E; Thu, 26 Feb 2009 00:34:46 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=ISO-8859-1; format=flowed Received: from avs-daemon.smtpauth2.wiscmail.wisc.edu by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 6.3-7.04 (built Sep 26 2008; 32bit)) id <0KFN0030EDLYGQ00@smtpauth2.wiscmail.wisc.edu>; Wed, 25 Feb 2009 18:34:46 -0600 (CST) Received: from trantor.tachypleus.net (adsl-99-154-1-172.dsl.mdsnwi.sbcglobal.net [99.154.1.172]) by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 6.3-7.04 (built Sep 26 2008; 32bit)) with ESMTPSA id <0KFN00DVFDLQMQ60@smtpauth2.wiscmail.wisc.edu>; Wed, 25 Feb 2009 18:34:40 -0600 (CST) Date: Wed, 25 Feb 2009 18:35:35 -0600 From: Nathan Whitehorn In-reply-to: <1235584641.1273.69.camel@widget.2hip.net> To: Robert Noland Message-id: <49A5E3D7.1080903@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=99.154.1.172 X-Spam-PmxInfo: Server=avs-10, Version=5.5.1.360522, Antispam-Engine: 2.6.1.350677, Antispam-Data: 2009.2.26.2246, SenderIP=99.154.1.172 References: <200902021954.n12JsGT2005768@svn.freebsd.org> <49A57F7B.3040704@freebsd.org> <200902251251.01789.jhb@freebsd.org> <1235584641.1273.69.camel@widget.2hip.net> User-Agent: Thunderbird 2.0.0.19 (X11/20090126) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r188018 - in head: sys/dev/pci usr.sbin/pciconf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Feb 2009 00:34:49 -0000 Robert Noland wrote: > On Wed, 2009-02-25 at 12:51 -0500, John Baldwin wrote: >> On Wednesday 25 February 2009 12:27:23 pm Nathan Whitehorn wrote: >>> John Baldwin wrote: >>>> Author: jhb >>>> Date: Mon Feb 2 19:54:16 2009 >>>> New Revision: 188018 >>>> URL: http://svn.freebsd.org/changeset/base/188018 >>>> >>>> Log: >>>> - Add a new ioctl to /dev/pci to fetch details on an individual BAR of a >>>> device. The details include the current value of the BAR (including all >>>> the flag bits and the current base address), its length, and whether or not >>>> it is enabled. Since this operation is not invasive, non-root users are >>>> allowed to use it (unlike manual config register access which requires >>>> root). The intention is that userland apps (such as Xorg) will use this >>>> interface rather than dangerously frobbing the BARs from userland to >>>> obtain this information. >>>> - Add a new sub-mode to the 'list' mode of pciconf. The -b flag when used >>>> with -l will now list all the active BARs for each device. >>>> >>> Do you happen to have any patches for libpciaccess to use this? >>> >>> Libpciaccess (and so the latest Xorg server) hoses my PowerPC machine >>> when trying to list BARs, but pciconf -b works correctly. There are >>> probably endianness problems in the libpciaccess code, and it would be >>> nice to just replace that mess with this interface. >> No, I don't have any patches. rnoland@ might. This interface was explicitly >> designed to replace mess in libpciaccess. :) > > I still need to work on getting this into libpciaccess. It's > complicated by the fact that we still need to keep the existing code in > place and only use the new ioctl where it exists... > > I'll try and get a patch together soon. I have a patch at http://people.freebsd.org/~nwhitehorn/freebsd_pci.c.patch This is tested on PowerPC and amd64 running -CURRENT, and is in addition to the patch currently applied by ports. It *should* gracefully use the old pathway if the new ioctl isn't available. And now I have working X on PPC! -Nathan