Subject: Re: undefined reference to pci_io_base

From: Geoff Levand <[email-masked]>
Date: Tue, 29 Aug 2006 16:57:12 -0700

Linas Vepstas wrote:
> On Wed, Aug 30, 2006 at 08:42:56AM +1000, Paul Mackerras wrote:
>> Geoff Levand writes:
>> 
>> > I'm trying to understand the intended design of the inb()
>> > and outb() macros in asm-powerpc/io.h. They are causing
>> > me some grief when I set CONFIG_PCI=n:
>> > 
>> >   drivers/built-in.o: undefined reference to `pci_io_base'
>> > 
>> > This is coming from drivers/char/mem.c, which is always
>> > built in, and is referencing pci_io_base through inb()
>> > and outb().
>> 
>> Hmmm.  inb and outb are designed for accessing PCI I/O space.  I guess
>> we could turn them into BUG() when CONFIG_PCI=n.
> 
> I just looked at drivers/char/mem.c and the code in question
> is surrounded by 
> 
> #if defined(CONFIG_ISA) || !defined(__mc68000__)
> 
> which seems just plain wrong.
> 
> It should probably be changed to 
> 
> #if (defined(CONFIG_ISA) || defined(CONFIG_PCI)) && !defined(__mc68000__)
> 
> This code surrounds fileops to enale fileio on /dev/port
> which maps to inb/outb.  
> 
> Do we want to enable /dev/port for pci space ??

I found the same, but was thinking

#if defined(CONFIG_ISA) && !defined(__mc68000__)

So it is only built when CONFIG_ISA=y.  Is there any
reason to always have it whit PCI?

Paul, can I send you that fix, or should I send it to
someone else?

-Geoff