Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 03 Jan 2013 19:18:26 -0800
From:      Alfred Perlstein <bright@mu.org>
To:        "Dr. Rolf Jansen" <rj@cyclaero.com>
Cc:        freebsd-drivers@freebsd.org
Subject:   Re: How to map device addresses into user space
Message-ID:  <50E64A02.8060109@mu.org>
In-Reply-To: <A3C44BB7-0849-4E2C-B812-D1EC4AB49926@cyclaero.com>
References:  <DFC983B8-91B2-4ED8-89B0-FC4BD4AB2576@cyclaero.com> <CAOgwaMv8rzHPyCLV2OJ-2h9T2SiRHdvdCD=Dp%2Bs8guaCmybe1Q@mail.gmail.com> <A3C44BB7-0849-4E2C-B812-D1EC4AB49926@cyclaero.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 1/3/13 7:00 PM, Dr. Rolf Jansen wrote:
> Am 03.01.2013 um 17:17 schrieb Mehmet Erol Sanliturk:
>
>> On Thu, Jan 3, 2013 at 8:45 AM, Dr. Rolf Jansen <rj@cyclaero.com> wrote:
>>
>>> ...
>>>
>>> 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.
>>>
>>> ...
>> There is the following book:
>>
>> FreeBSD Device Drivers
>>
>> Product Details
>>
>>      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] &= 0x03;

Can't you mmap /dev/mem?

Sorry for being naive, I have not done this before.

-Alfred




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?50E64A02.8060109>