From owner-freebsd-drivers@FreeBSD.ORG Thu Jan 3 16:45:37 2013 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A84E16C2 for ; Thu, 3 Jan 2013 16:45:37 +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 48B9430C for ; Thu, 3 Jan 2013 16:45:36 +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 (josoe mo8) (RZmta 31.11 DYNA|AUTH) with (AES128-SHA encrypted) ESMTPA id f010a9p03FjMbI for ; Thu, 3 Jan 2013 17:45:33 +0100 (CET) From: "Dr. Rolf Jansen" Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: How to map device addresses into user space Date: Thu, 3 Jan 2013 14:45:29 -0200 Message-Id: To: freebsd-drivers@freebsd.org Mime-Version: 1.0 (Apple Message framework v1283) 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: Thu, 03 Jan 2013 16:45:37 -0000 I am building a loadable kernel module for FreeBSD 9.1-RELEASE x86_64 = for a PCI Data Acquisition board from National Instruments. 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. 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. Having the measurement done by the kernel module is not an option = either, because it is math intensive, and kernel modules are build = without SSE and with soft float. I got tiny kernel modules/extensions only providing the mapped addresses = of the PCI BAR's running together with the Measurement Routines using = the NI-DDK on Darwin (Mac OS X) and Linux. So, how can I map device addresses into user space on FreeBSD? Best regards Rolf