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

Re: Help with some low level access



On Tue, 4 Feb 2003, Ross Vumbaca wrote:
> 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:)

Alternatively, define your own inb() and friends, based on the definitions in
<asm/io.h>.

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: