Google
  Web www.spinics.net

Re: libpciaccess question

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


On Wed, 2008-07-02 at 10:57 -0600, Sebastian Kuzminsky wrote:
> Hi there, sorry to mail you directly but I couldnt find the proper
> mailing list for asking about libpciaccess.

xorg@xxxxxxxxxxxxxxxxxxxxx is probably the best place.  I've cc'd the
list since this is probably a generally interesting question.

> I'm trying to use libpciaccess to write a userspace utility to work with
> some PCI cards, and I need to peek & poke some IO BARs.  I'm on Ubuntu
> 7.10, which has libpciaccess 0.8.0.
> 
> I can map in memory BARs fine, but the mmap() in
> pci_device_linux_sysfs_map_region() fails with EINVAL when I try to map
> IO BARs.  Is this is a limitation of the sysfs regionX files corresponding
> to IO BARs, that they're not mmappable?

I'm reasonably sure they're not mmapable.  Doing so would essentially
require that the kernel set up a fake map, trap all read or write access
to it, and disassemble the faulting instruction to deduce the i/o cycle
size and address and translate that to an i/o instruction.  (That's my
understanding anyway.)  The PCI config space is not mmap'able for much
the same reason.

The config space is supported through the normal read/write syscalls
though, and the same could reasonably be done for the IO BARs I suspect,
but right now there's no code for that in pciaccess.  Which seems like
failing.

> Does libpciaccess provide some other interface for accessing IO BARs,
> or should i just iopl and inb/outb by hand?

Doing it by hand is certainly the short-term answer, but it would be
pleasant to extend libpciaccess to cover this case.

- ajax

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
xorg mailing list
xorg@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/xorg

[X Forum]     [Devices]     [XFree86]     [XFree86 Newbie]     [Site Home]     [IETF Annouce]     [Security]     [Fontconfig]     [Bugtraq]     [Rubini]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Video for Linux]     [Linux RAID]     [Linux Resources]

Powered by Linux