Re: /proc/pci design idea

Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be)
Tue, 16 Sep 1997 17:32:06 +0200 (CEST)


On Tue, 16 Sep 1997, Martin Mares wrote:
> > > > Well, doing this via /proc is much slower. And how do you want to separate
> > > > byte, word and longword accesses?
> > > There are things /proc was not meant to do; I/O is one of them -- I/O
> > > is much better handled by traditional /dev device nodes.
> > If you want a device, I have submitted the code to do that a few
> > months ago. Yes you can write. Dejanews?
>
> But a device doesn't seem to solve the byte/word/longword problems as well.
> In fact, you can restrict the device to allow read() with length of 1, 2 or 4
> only, but then it won't be usable as a general device (i.e., cat /dev/pci
> won't work).

Is it really that bad to have longword reads in PCI configuration space for
byte/word registers?

For writes it's different. But writes can be restricted to 1, 2 or 4 bytes
without much problems. Software that wants to write to /dev/pci has to know how
to deal with PCI config space anyway.

BTW, won't `cat /dev/pci' loop if read() returned 4 (i.e. reads are limited to
longwords)?

Greetings,

Geert

--
Geert Uytterhoeven                     Geert.Uytterhoeven@cs.kuleuven.ac.be
Wavelets, Linux/{m68k~Amiga,PPC~CHRP}  http://www.cs.kuleuven.ac.be/~geert/
Department of Computer Science -- Katholieke Universiteit Leuven -- Belgium