From owner-freebsd-drivers@FreeBSD.ORG Fri Jan 4 03:00:27 2013 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 52DC89FA for ; Fri, 4 Jan 2013 03:00:27 +0000 (UTC) (envelope-from rj@cyclaero.com) Received: from mo6-p00-ob.rzone.de (mo6-p00-ob.rzone.de [IPv6:2a01:238:20a:202:5300::1]) by mx1.freebsd.org (Postfix) with ESMTP id E51EC61A for ; Fri, 4 Jan 2013 03:00:26 +0000 (UTC) X-RZG-AUTH: :O2kGeEG7b/pS1E6gSHOyjPKyNsg/5l1He+DgCy9/8FSej6CwUysqfN3Dd+qW8pqf5aP/Kw== X-RZG-CLASS-ID: mo00 Received: from rolf.projectworld.net (b150f7b8.virtua.com.br [177.80.247.184]) by smtp.strato.de (jored mo36) (RZmta 31.11 DYNA|AUTH) with (AES128-SHA encrypted) ESMTPA id x07710p042YYTG ; Fri, 4 Jan 2013 04:00:21 +0100 (CET) Subject: Re: How to map device addresses into user space Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: "Dr. Rolf Jansen" In-Reply-To: Date: Fri, 4 Jan 2013 01:00:17 -0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: To: freebsd-drivers@freebsd.org X-Mailer: Apple Mail (2.1283) X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jan 2013 03:00:27 -0000 Am 03.01.2013 um 17:17 schrieb Mehmet Erol Sanliturk: > On Thu, Jan 3, 2013 at 8:45 AM, Dr. Rolf Jansen = wrote: >=20 >> ... >>=20 >> I need to map the Base Address Registers into user space memory, in = order to pass the BAR's to the National Instruments Drivers Development = Kit (NI-DDK). The DDK is a complex set of C++ classes running in user = space, that read/write directly from/into the BAR's. >>=20 >> The FreeBSD bus_space_* functions are useless in this respect, = because the DDK isn't designed that way, I need the BAR addresses mapped = into user space. >>=20 >> ... >=20 > There is the following book: >=20 > FreeBSD Device Drivers >=20 > Product Details >=20 > Paperback: 352 pages > Publisher: No Starch Press; Original edition (May 7, 2012) > Language: English > ISBN-10: 1593272049 > ISBN-13: 978-1593272043 Mehmet, Many thanks for your response. I know this book. It suggests accessing the PCI registers using Newbus = (Chapter 7). Newbus hides away direct reading/writing to the BAR's, and = therefore, Newbus is useless in the given respect. Again, I need the exact PCI Base Address Registers directly mapped into = user space, so that I can do in my user space measurement controller = something like the following: user_space_BAR[0 + funcOffset] &=3D 0x03; Best regards Rolf