About exporting symbols from an external module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello! I am writing a device driver module. I define some functions in the module, for example print_record(). I am doing something in the kvm, so I want to call print_record() in the file of kvm module, for example, I may call print_record() in file /arch/x86/kvm/x86.c to put something into my device driver module.
Now comes the question.
1. Where should I put the codes of my device driver module? It's the first time I write the device driver.
2. After compiling my module, I encounter an error when I compile the kvm module.
     ERROR: "print_record" [arch/x86/kvm/kvm.ko] undefined!
    I use EXPORT_SYMBOL(print_record) in my module file. I use "extern" to declare print_record() and then call print_record()  in file x86.c. 
    To solve this problem, I have tried to copy the Module.symvers from my module folder to /arch/x86/kvm/. But it doesn't work. I have also tried to add KBUILD_EXTRA_SYMBOLS to the Makefile of kvm. It doesn't work either.
    I cat /proc/kallsyms and find that the type of symbol "print_record" is "t" ( local text). What should I do? How to call functions defined in my own module from kvm? Maybe there is something wrong in Makefiles?

Any suggestion is appreciated!
Thanks!
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux