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

Re: sys/io.h



On Thu, Dec 28, 2000 at 11:12:21AM +0100, Geert Uytterhoeven wrote:
> On Sun, 24 Dec 2000, Daniel Jacobowitz wrote:
> > On Sat, Dec 23, 2000 at 03:57:40PM +0100, Geert Uytterhoeven wrote:
> > > 
> > > Anyone knows why /usr/include/sys/io.h is in libc6-devel on ia32, but not on
> > > ppc? Both are potato.
> > 
> > Because it's an ia32 (and alpha) specific header file.  There's just no
> > useful definitions for those functions on powerpc, so rather than
> > forging stubs for them, the libc developers chose to make it obvious, I
> > guess.
> 
> OK, so I need the
> 
>     #ifdef __powerpc__
>     #include <asm/io.h>
>     #else
>     #include <sys/io.h>
>     #endif
> 
> construct in my parallel LCD program, which bangs the parallel port directly.
> I need #ifdef's anyway, since I must mmap() ISA I/O space explicitly on PPC.

Yep.  Of course, it's even worse than that depending on how portable
you're trying to be.  Note that the ISA IO space is mapped differently
on different PPCs, and on powermacs of course is not available (I would
imagine...)

And it may or may not be reliably in those locations.  I believe
something more complex happens, but I'm not the one to ask.


Dan

/--------------------------------\  /--------------------------------\
|       Daniel Jacobowitz        |__|        SCS Class of 2002       |
|   Debian GNU/Linux Developer    __    Carnegie Mellon University   |
|         dan@debian.org         |  |       dmj+@andrew.cmu.edu      |
\--------------------------------/  \--------------------------------/



Reply to: