* 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
* Re: undefined reference to pci_io_base
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
1 sibling, 1 reply; 8+ messages in thread
From: Linas Vepstas @ 2006-08-29 20:28 UTC (permalink / raw)
To: Geoff Levand; +Cc: linuxppc-dev
On Tue, Aug 29, 2006 at 10:34:54AM -0700, Geoff Levand wrote:
> 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
This makes the most sense to me; it compiles to something nice.
> 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
This compiles to something ugly and pointless ...
> A third would be to have another set of io macros in io.h that
> are used when CONFIG_PCI=n.
I'm not sure that yet-another set of macros improves readabily.
Those macros are already fairly byzantine in thier inter-connections.
--linas
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: undefined reference to pci_io_base
2006-08-29 17:34 undefined reference to pci_io_base Geoff Levand
2006-08-29 20:28 ` Linas Vepstas
@ 2006-08-29 22:42 ` Paul Mackerras
2006-08-29 23:20 ` Linas Vepstas
1 sibling, 1 reply; 8+ messages in thread
From: Paul Mackerras @ 2006-08-29 22:42 UTC (permalink / raw)
To: Geoff Levand; +Cc: linuxppc-dev
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.
Paul.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: undefined reference to pci_io_base
2006-08-29 22:42 ` Paul Mackerras
@ 2006-08-29 23:20 ` Linas Vepstas
2006-08-29 23:57 ` Geoff Levand
0 siblings, 1 reply; 8+ messages in thread
From: Linas Vepstas @ 2006-08-29 23:20 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
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 ??
--linas
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: undefined reference to pci_io_base
2006-08-29 23:20 ` Linas Vepstas
@ 2006-08-29 23:57 ` Geoff Levand
2006-08-30 0:13 ` Paul Mackerras
0 siblings, 1 reply; 8+ messages in thread
From: Geoff Levand @ 2006-08-29 23:57 UTC (permalink / raw)
To: Linas Vepstas; +Cc: linuxppc-dev, Paul Mackerras
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: undefined reference to pci_io_base
2006-08-29 23:57 ` Geoff Levand
@ 2006-08-30 0:13 ` Paul Mackerras
2006-08-30 15:05 ` Geoff Levand
0 siblings, 1 reply; 8+ messages in thread
From: Paul Mackerras @ 2006-08-30 0:13 UTC (permalink / raw)
To: Geoff Levand; +Cc: linuxppc-dev
Geoff Levand writes:
> 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?
It's occasionally useful with PCI && !ISA. It's pretty useless with
!PCI && !ISA.
> Paul, can I send you that fix, or should I send it to
> someone else?
Send it to Andrew Morton.
Paul.
^ 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).