tech-misc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Regarding PCIe peek/poke in NetBSD



On Tue, Jan 04, 2011 at 10:47:30AM +0530, Gnanasekar Loganathan wrote:
> Hi Manuel,
> 
> The requirement was, one of my customer want to do read/write on any
> address/offset from any PCIe devices present in the system. He don't
> want to use the corresponding device drivers, need separate
> application that can map the PCIe device region of any devices by bus
> no, device no and function. The application meant for testing purpose
> only.
> 
> Using the 'pcictl' utility i can able to do read/write operations on
> PCIe configuration space, but not able to do in io/mem/prefetchable
> space.  Able to map the region by 'bus_space_map', if the region was
> not already mapped by the driver. bus_space_map fails if it was
> already mapped.
> 
> Is there any way  to map the region which was already mapped by the driver?

Well, this is not so easy.
For I/O space, I guess they can be acceeded using the i386_iopl(2) call
(assuming you're on x86 hardware). For memory-mapped space, maybe
they can be acceeded using /dev/mem, but I never tried this.

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--


Home | Main Index | Thread Index | Old Index