public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Special handling of sysfs device resource files?
@ 2006-04-11 21:25 Ian Romanick
  2006-04-11 23:59 ` Ian Romanick
  2006-04-12  4:45 ` Paul Mackerras
  0 siblings, 2 replies; 6+ messages in thread
From: Ian Romanick @ 2006-04-11 21:25 UTC (permalink / raw)
  To: lkml

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm in the process of modifying X to be civilized in it's handling of
PCI devices on Linux.  As part of that, I've modified it to map the
/sys/bus/pci/device/*/resource[0-6] files instead of mucking about with
/dev/mem.

This seems to mostly work, but I am having one problem.  I map the
region by opening the file with O_RDWR, then mmap with
(PROT_READ|PROT_WRITE) and MAP_SHARED.  In all cases, the open and mmap
succeed.  However, for I/O BARs, the resulting pointer from mmap is
invalid.  Any access to it results in a segfault and GDB says it's "out
of range".

The base address of the BAR is page aligned, so its not a problem with
the alignment of mmap vs. the alignment of the BAR.  What else could it
be?  I'm pretty stumped.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (GNU/Linux)

iD8DBQFEPB7KX1gOwKyEAw8RAhG/AJ4x+Vjl8V9SNeyMhYe2txeAeKALKACePCwL
6s0kj4YhDY3/thVh6mvO5X4=
=g9eu
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-04-12 17:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-11 21:25 Special handling of sysfs device resource files? Ian Romanick
2006-04-11 23:59 ` Ian Romanick
2006-04-12 17:14   ` Jesse Barnes
2006-04-12 17:20   ` Jesse Barnes
2006-04-12  4:45 ` Paul Mackerras
2006-04-12 15:06   ` Ian Romanick

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox