linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* undefined reference to pci_io_base
@ 2006-08-29 17:34 Geoff Levand
  2006-08-29 20:28 ` Linas Vepstas
  2006-08-29 22:42 ` Paul Mackerras
  0 siblings, 2 replies; 8+ messages in thread
From: Geoff Levand @ 2006-08-29 17:34 UTC (permalink / raw)
  To: linuxppc-dev

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().

Anyway, it seems asm-powerpc/io.h has two sets of io macros,
one set for iSeries, and one generic set for everything else.
The problem arises because the generic macros just use the eeh
macros in eeh.h, which in turn, directly use pci_io_base. 

I can think of three solutions to this that work for me, but
I'm not sure which, if any, would be the most proper.  One
would be to just have this in io.h:

  #if defined(CONFI_PCI)
  extern unsigned long pci_io_base;
  #else
  #define pci_io_base 0
  #endif

Another would be to have this in some file that is always built
in, like setup-common.c:

  #if !defined(CONFI_PCI)
  unsigned long pci_io_base;
  EXPORT_SYMBOL(pci_io_base);
  #endif

A third would be to have another set of io macros in io.h that
are used when CONFIG_PCI=n.

Comments welcome.

-Geoff

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-08-30 15:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-29 17:34 undefined reference to pci_io_base Geoff Levand
2006-08-29 20:28 ` Linas Vepstas
2006-08-29 22:38   ` Benjamin Herrenschmidt
2006-08-29 22:42 ` Paul Mackerras
2006-08-29 23:20   ` Linas Vepstas
2006-08-29 23:57     ` Geoff Levand
2006-08-30  0:13       ` Paul Mackerras
2006-08-30 15:05         ` Geoff Levand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).