Skip to contentSkip to conversation

insmod: unresolved symbol XIo_In32/XIo_Out32

DISCUSSION Juliana Su 3 participants 6 messages Jul 11, 2008 – Jul 13, 2008

lore
Share & tools
lore

Juliana Su

author
#0 lore raw

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

#1 lore raw
Quoted 7 lines · Juliana Su

Hi,

Is anybody familiar with the following error?

insmod: unresolved symbol XIo_In32
insmod: unresolved symbol XIo_Out32

Quoted 9 lines

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.

author
#2 lore raw

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

Quoted 23 lines · Grant Likely
Quoted 9 lines · Juliana Su

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.

#3 lore raw
Quoted 8 lines · Juliana Su

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.

author
#4 lore raw

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

Quoted 15 lines · Grant Likely
Quoted 4 lines · Juliana Su

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.

#5 lore raw

Hi,

Quoted 8 lines · Juliana Su

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

Quoted 7 lines
#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