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

Re: Help with some low level access



Hi,

Geert Uytterhoeven wrote:

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.

O.k the inb and outb is fine now, but I get this weird (link) problem:

/sio.c:46: undefined reference to `local symbols in discarded section .fixup' /sio.c:46: undefined reference to `local symbols in discarded section .fixup' /sio.c:46: undefined reference to `local symbols in discarded section .fixup' /sio.c:46: undefined reference to `local symbols in discarded section .fixup' /sio.c:47: undefined reference to `local symbols in discarded section .fixup' /tmp/ccq1O4nL.o:/sio.c:48: more undefined references to `local symbols in discarded section .fixup' follow

(Similar story with my program:)

/tmp/ccdI9nhl.o: In function `main':
/dma_test.c:7: undefined reference to `local symbols in discarded section .fixup'
/tmp/ccdI9nhl.o: In function `main':
/usr/include/asm/io.h:125: undefined reference to `local symbols in discarded section .fixup' /usr/include/asm/io.h:125: undefined reference to `local symbols in discarded section .fixup'

So glibc should define ioperm(), and inb() and friends.

Agreed, from reading the docs ioperm(), inb() etc are supposed to be in glibc's sys/io.h, but that file does not even exist on ppc.

Regards,

Ross..



Reply to: