Date: Thu, 31 Mar 2016 13:39:25 -0700 From: John Baldwin <jhb@freebsd.org> To: freebsd-current@freebsd.org Cc: Jim Harris <jim.harris@gmail.com>, Luigi Rizzo <rizzo@iet.unipi.it> Subject: Re: accessing a PCIe register from userspace through kmem or other ways ? Message-ID: <2550091.UENsv0ilXD@ralph.baldwin.cx> In-Reply-To: <CAJP=Hc_A2-i8twW4AhnA50ryf3%2BHLOparQ9xcCnCCVLv0%2B9PSw@mail.gmail.com> References: <CA%2BhQ2%2BiU4odjhaNicFA4QjvSZR2OZOOy%2BFu4LTqsibdoK4M8zg@mail.gmail.com> <CAJP=Hc_A2-i8twW4AhnA50ryf3%2BHLOparQ9xcCnCCVLv0%2B9PSw@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday, March 30, 2016 11:20:51 AM Jim Harris wrote: > On Wed, Mar 30, 2016 at 10:47 AM, Luigi Rizzo <rizzo@iet.unipi.it> wrote: > > > Hi, > > I'd like to test the rate at which I can access device registers > > on a PCIe card, and was wondering whether I need to patch a device > > driver, or perhaps I can use /dev/kmem once I figure out where > > the registers are mapped ? > > > > You do not need to patch a device driver. Have you looked at > libpciaccess? This should give you everything you need. You can also look at what pciconf uses. (It has a read_config() method that uses an ioctl on an fd of /dev/pci). -- John Baldwin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2550091.UENsv0ilXD>