Re: Help with some low level access
On Tue, 4 Feb 2003, Ross Vumbaca wrote:
> Geert Uytterhoeven wrote:
> > ISA I/O space is the low part of PCI I/O space.
> > ISA memory space is something different (not available on Macs).
>
> I should mention I am not using a Mac, it is an "AmigaOne/MAI Teron"
> board, which is basically an ATX board with a VIA Southbridge (hence the
> ISA peripherals), and a PPC Specific Northbridge which provides PC like
> functions (AGP, PCI...).
OK. That's almost a LongTrail with different North and South bridges ;-)
> >>The above code (not using ioperm) works if I put it into the kernel, e.g
> >>in the dma.c driver, but I wanted to use it from user space when I need
> >>it (which is why I have ioperm), not to put it in the kernel. There does
> >>not seem to be any sys/io.h with the PowerPC libc, and no inb or ioperm
> >>functions for user space programs (???), the above program won't build
> >>on PowerPC.
>
> > Does my sio.c still build?
>
> I tried to built it (after changing CHRP_ISA_IO_BASE), but for some
> reason there is no "inb" or "outb" functions, i.e
>
> sio.c: In function `sio_write':
> sio.c:80: warning: implicit declaration of function `outb'
> sio.c: In function `sio_read':
> sio.c:87: warning: implicit declaration of function `inb'
>
> and of course it fails to link. I compile with "gcc -g -Wall -O2", am I
> doing something badly wrong here?
Add #define __KERNEL__ before including <asm/io.h>. When I wrote sio.c, the
#ifdef __KERNEL__ wasn't in <asm/io.h> yet.
So glibc should define ioperm(), and inb() and friends.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Reply to: