insmod: unresolved symbol XIo_In32/XIo_Out32

6 messages, 3 authors, 2008-07-13 · open the first message on its own page

insmod: unresolved symbol XIo_In32/XIo_Out32

From: Juliana Su <hidden>
Date: 2008-07-11 15:47:04

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

Re: insmod: unresolved symbol XIo_In32/XIo_Out32

From: Grant Likely <hidden>
Date: 2008-07-11 18:31:21

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.

Re: insmod: unresolved symbol XIo_In32/XIo_Out32

From: Juliana Su <hidden>
Date: 2008-07-11 19:11:12

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:
  
quoted
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.


  

Re: insmod: unresolved symbol XIo_In32/XIo_Out32

From: Grant Likely <hidden>
Date: 2008-07-11 21:05:18

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.

Re: insmod: unresolved symbol XIo_In32/XIo_Out32

From: Juliana Su <hidden>
Date: 2008-07-12 19:22:26

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:
  
quoted
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.

  

Re: insmod: unresolved symbol XIo_In32/XIo_Out32

From: Joachim Foerster <hidden>
Date: 2008-07-13 07:30:19

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help