linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* insmod: unresolved symbol XIo_In32/XIo_Out32
@ 2008-07-11 14:26 Juliana Su
  2008-07-11 18:31 ` Grant Likely
  0 siblings, 1 reply; 6+ messages in thread
From: Juliana Su @ 2008-07-11 14:26 UTC (permalink / raw)
  To: linuxppc-embedded

Hi,

Is anybody familiar with the following error?

insmod: unresolved symbol XIo_In32
insmod: unresolved symbol XIo_Out32

I am trying to write a device driver for a Custom IP and get it to run 
on a Xilinx ML310's Linux OS. I am using Xilinx EDK 10.1 and MontaVista 
Linux version 2.4.20_mvl31-ml300. I ran into this error when trying to 
load my module into the kernel. When I try to load the module using 
insmod on the ".o" file, the module refuses to load and gives me the 
unresolved symbol error message. I actually stumbled upon an older 
posting from June 2006 on this mailing list that described a similar 
problem, but those suggestions did not help me. Maybe two years later, 
there are more ideas/suggestions/solutions to this problem?

Thanks!


-Juliana

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

* Re: insmod: unresolved symbol XIo_In32/XIo_Out32
  2008-07-11 14:26 insmod: unresolved symbol XIo_In32/XIo_Out32 Juliana Su
@ 2008-07-11 18:31 ` Grant Likely
  2008-07-11 19:11   ` Juliana Su
  0 siblings, 1 reply; 6+ messages in thread
From: Grant Likely @ 2008-07-11 18:31 UTC (permalink / raw)
  To: Juliana Su; +Cc: linuxppc-embedded

On Fri, Jul 11, 2008 at 10:26:27AM -0400, Juliana Su wrote:
> Hi,
>
> Is anybody familiar with the following error?
>
> insmod: unresolved symbol XIo_In32
> insmod: unresolved symbol XIo_Out32
>
> I am trying to write a device driver for a Custom IP and get it to run  
> on a Xilinx ML310's Linux OS. I am using Xilinx EDK 10.1 and MontaVista  
> Linux version 2.4.20_mvl31-ml300. I ran into this error when trying to  
> load my module into the kernel. When I try to load the module using  
> insmod on the ".o" file, the module refuses to load and gives me the  
> unresolved symbol error message. I actually stumbled upon an older  
> posting from June 2006 on this mailing list that described a similar  
> problem, but those suggestions did not help me. Maybe two years later,  
> there are more ideas/suggestions/solutions to this problem?

I can't help much with the 2.4 montavista kernel, but I can say that the
error means that the XIo_* helper routines are either not compiled into
the kernel or are not exported with EXPORT_SYMBOL().  The XIo_* routines
are hooks used by Xilinx cross platform device drivers to make the
actual accesses to hardware.  If they are not implemented, then you need
to create them yourself.

g.

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

* Re: insmod: unresolved symbol XIo_In32/XIo_Out32
  2008-07-11 18:31 ` Grant Likely
@ 2008-07-11 19:11   ` Juliana Su
  2008-07-11 21:05     ` Grant Likely
  0 siblings, 1 reply; 6+ messages in thread
From: Juliana Su @ 2008-07-11 19:11 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-embedded

Hi,

Thanks for your reply! I am new to creating loadable kernel modules, so 
I hope you do not mind some more questions... How can I get the XIo_* 
helper routines to compile into the kernel or export them with 
EXPORT_SYMBOL( )? In my c file (my driver file from which I create the 
object file), I made sure to include xio.h, which is where XIo_In32 and 
XIo_Out32 are defined (see below section from xio.h).


/************************** Function Prototypes 
******************************/

/* The following functions allow the software to be transportable across
 * processors which may use memory mapped I/O or I/O which is mapped into a
 * seperate address space such as X86.  The functions are better suited for
 * debugging and are therefore the default implementation. Macros can 
instead
 * be used if USE_IO_MACROS is defined.
 */
#ifndef USE_IO_MACROS

/* Functions */
u8 XIo_In8(XIo_Address InAddress);
u16 XIo_In16(XIo_Address InAddress);
u32 XIo_In32(XIo_Address InAddress);

void XIo_Out8(XIo_Address OutAddress, u8 Value);
void XIo_Out16(XIo_Address OutAddress, u16 Value);
void XIo_Out32(XIo_Address OutAddress, u32 Value);

#else

/* The following macros allow optimized I/O operations for memory mapped I/O
 * Note that the SYNCHRONIZE_IO may be moved by the compiler during
 * optimization.
 */

#define XIo_In8(InputPtr)  (*(volatile u8  *)(InputPtr)); SYNCHRONIZE_IO;
#define XIo_In16(InputPtr) (*(volatile u16 *)(InputPtr)); SYNCHRONIZE_IO;
#define XIo_In32(InputPtr) (*(volatile u32 *)(InputPtr)); SYNCHRONIZE_IO;

#define XIo_Out8(OutputPtr, Value)  \
    { (*(volatile u8  *)(OutputPtr) = Value); SYNCHRONIZE_IO; }
#define XIo_Out16(OutputPtr, Value) \
    { (*(volatile u16 *)(OutputPtr) = Value); SYNCHRONIZE_IO; }
#define XIo_Out32(OutputPtr, Value) \
    { (*(volatile u32 *)(OutputPtr) = Value); SYNCHRONIZE_IO; }

#endif


I thought that, by including xio.h, XIo_In32 and XIo_Out32 would be 
taken care of, but that is probably a novice assumption of mine...


-Juliana


Grant Likely wrote:
> On Fri, Jul 11, 2008 at 10:26:27AM -0400, Juliana Su wrote:
>   
>> Hi,
>>
>> Is anybody familiar with the following error?
>>
>> insmod: unresolved symbol XIo_In32
>> insmod: unresolved symbol XIo_Out32
>>
>> I am trying to write a device driver for a Custom IP and get it to run  
>> on a Xilinx ML310's Linux OS. I am using Xilinx EDK 10.1 and MontaVista  
>> Linux version 2.4.20_mvl31-ml300. I ran into this error when trying to  
>> load my module into the kernel. When I try to load the module using  
>> insmod on the ".o" file, the module refuses to load and gives me the  
>> unresolved symbol error message. I actually stumbled upon an older  
>> posting from June 2006 on this mailing list that described a similar  
>> problem, but those suggestions did not help me. Maybe two years later,  
>> there are more ideas/suggestions/solutions to this problem?
>>     
>
> I can't help much with the 2.4 montavista kernel, but I can say that the
> error means that the XIo_* helper routines are either not compiled into
> the kernel or are not exported with EXPORT_SYMBOL().  The XIo_* routines
> are hooks used by Xilinx cross platform device drivers to make the
> actual accesses to hardware.  If they are not implemented, then you need
> to create them yourself.
>
> g.
>
>
>   

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

* Re: insmod: unresolved symbol XIo_In32/XIo_Out32
  2008-07-11 19:11   ` Juliana Su
@ 2008-07-11 21:05     ` Grant Likely
  2008-07-12 19:22       ` Juliana Su
  0 siblings, 1 reply; 6+ messages in thread
From: Grant Likely @ 2008-07-11 21:05 UTC (permalink / raw)
  To: Juliana Su; +Cc: linuxppc-embedded

On Fri, Jul 11, 2008 at 03:11:06PM -0400, Juliana Su wrote:
> Hi,
>
> Thanks for your reply! I am new to creating loadable kernel modules, so  
> I hope you do not mind some more questions... How can I get the XIo_*  
> helper routines to compile into the kernel or export them with  
> EXPORT_SYMBOL( )? In my c file (my driver file from which I create the  
> object file), I made sure to include xio.h, which is where XIo_In32 and  
> XIo_Out32 are defined (see below section from xio.h).

Add an EXPORT_SYMBOL() line to the location where the io accessors are
implemented.  However, you'd probably be better just to replace xio.h
implementation with macros that just map them to the in_be32() and
out_be32() macros.

g.

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

* Re: insmod: unresolved symbol XIo_In32/XIo_Out32
  2008-07-11 21:05     ` Grant Likely
@ 2008-07-12 19:22       ` Juliana Su
  2008-07-13  7:30         ` Joachim Foerster
  0 siblings, 1 reply; 6+ messages in thread
From: Juliana Su @ 2008-07-12 19:22 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-embedded

Hi again,

Ok, so I tried mapping to in_be32( ) and out_be32( ) by changing:

#define XIo_In32(InputPtr) (*(volatile u32 *)(InputPtr)); SYNCHRONIZE_IO; 
to
#define XIo_In32(InputPtr) in_be32(InputPtr)

and

#define XIo_Out32(OutputPtr, Value) \
   { (*(volatile u32 *)(OutputPtr) = Value); SYNCHRONIZE_IO; }
to
#define XIo_Out32(OutputPtr, Value) out_be32(OutputPtr, Value)

I made sure to include asm-ppc/io.h, too. However, I still get the same 
unresolved symbol error message... Did I do the mapping correctly? 
Thanks again for your help!


-Juliana


Grant Likely wrote:
> On Fri, Jul 11, 2008 at 03:11:06PM -0400, Juliana Su wrote:
>   
>> Hi,
>>
>> Thanks for your reply! I am new to creating loadable kernel modules, so  
>> I hope you do not mind some more questions... How can I get the XIo_*  
>> helper routines to compile into the kernel or export them with  
>> EXPORT_SYMBOL( )? In my c file (my driver file from which I create the  
>> object file), I made sure to include xio.h, which is where XIo_In32 and  
>> XIo_Out32 are defined (see below section from xio.h).
>>     
>
> Add an EXPORT_SYMBOL() line to the location where the io accessors are
> implemented.  However, you'd probably be better just to replace xio.h
> implementation with macros that just map them to the in_be32() and
> out_be32() macros.
>
> g.
>
>   

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

* Re: insmod: unresolved symbol XIo_In32/XIo_Out32
  2008-07-12 19:22       ` Juliana Su
@ 2008-07-13  7:30         ` Joachim Foerster
  0 siblings, 0 replies; 6+ messages in thread
From: Joachim Foerster @ 2008-07-13  7:30 UTC (permalink / raw)
  To: Juliana Su; +Cc: linuxppc-embedded

Hi,

On Sat, 2008-07-12 at 15:22 -0400, Juliana Su wrote:
> Ok, so I tried mapping to in_be32( ) and out_be32( ) by changing:
> 
> #define XIo_In32(InputPtr) (*(volatile u32 *)(InputPtr)); SYNCHRONIZE_IO; 
> to
> #define XIo_In32(InputPtr) in_be32(InputPtr)
> 
> and
> 
> #define XIo_Out32(OutputPtr, Value) \
>    { (*(volatile u32 *)(OutputPtr) = Value); SYNCHRONIZE_IO; }
> to
> #define XIo_Out32(OutputPtr, Value) out_be32(OutputPtr, Value)
> 
> I made sure to include asm-ppc/io.h, too. However, I still get the same 
> unresolved symbol error message... Did I do the mapping correctly? 

Hmmm, as Grant already said, you need to replace the _implementation_
(the actual function) by macros. You replaced a #define with another
#define - and a #define is not a symbol (for the compiler, only for
cpp). So - without knowing anything about your MontaVista Linux sources
- I think that the #defines you replaced are _not_ used, instead there
have to be some function _definition_ (in xio.h) you need to replace.

As an example: Xilinx also has a xio.h in their git tree. There one
would have to replace lines 167..173 in
http://git.xilinx.com/cgi-bin/gitweb.cgi?p=linux-2.6-xlnx.git;a=blob;f=drivers/xilinx_common/xio.h;h=7b22a677bbf7769d8698d37397f2174a2cd7e2b2;hb=HEAD

 Joachim

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

end of thread, other threads:[~2008-07-13  7:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-11 14:26 insmod: unresolved symbol XIo_In32/XIo_Out32 Juliana Su
2008-07-11 18:31 ` Grant Likely
2008-07-11 19:11   ` Juliana Su
2008-07-11 21:05     ` Grant Likely
2008-07-12 19:22       ` Juliana Su
2008-07-13  7:30         ` Joachim Foerster

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