From owner-freebsd-hackers@FreeBSD.ORG Mon Nov 21 16:21:22 2005 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 AB99916A41F for ; Mon, 21 Nov 2005 16:21:22 +0000 (GMT) (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 3F27843D45 for ; Mon, 21 Nov 2005 16:21:22 +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.3/8.13.3) with ESMTP id jALGIxcZ042993; Mon, 21 Nov 2005 09:19:00 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Mon, 21 Nov 2005 09:19:10 -0700 (MST) Message-Id: <20051121.091910.105332203.imp@bsdimp.com> To: dmitry@atlantis.dp.ua From: "M. Warner Losh" In-Reply-To: <20051118124856.F199@atlantis.atlantis.dp.ua> References: <20051118124856.F199@atlantis.atlantis.dp.ua> X-Mailer: Mew version 3.3 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]); Mon, 21 Nov 2005 09:19:00 -0700 (MST) Cc: freebsd-hackers@freebsd.org Subject: Re: Physical memory access from kld 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: Mon, 21 Nov 2005 16:21:22 -0000 I think that you'll want to use PCIB_READ_CONFIG. This function takes a pointer to a pci bridge device_t and can be used to read an arbitrary register in pci config space. PCIB_READ_CONFIG(pcib, b, s, f, n, w) b -- bus s -- slot f -- function n -- register to read w -- width to read This will help you access device on bus 0, slot 6, function 0. It will access the actual hardware, not the cached values like you have been doing in 4.x. Hope this helps. Warner