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

Re: [Xen-devel] In which library can I find these functions ?



Thank you, it works !! I didn't knew this functionnality.

I attach the working code for example in case of somebody have the same issue.

#undef __KERNEL__
#define __KERNEL__

#undef MODULE
#define MODULE

#include <xen/page.h>
#include <xen/grant_table.h>
#include <linux/gfp.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>

MODULE_LICENSE("GPL");

unsigned long myPage;

static int __init hello_init(void){
//      int domB = atoi(argv[1]);
        printk(KERN_INFO "Test sur le partage de mémoire dans Xen \n");

        if((myPage = get_zeroed_page(GFP_KERNEL))==0)
                printk(KERN_INFO "Zeroed page\n");

        grant_ref_t gref;
        gref = gnttab_grant_foreign_access(1, virt_to_mfn(myPage), 0);

        if(gref < 0){
                printk(KERN_INFO "Grant failed\n");
                free_page(myPage);
        }
        return 0;
}

static void __exit hello_exit(void){
        free_page(myPage);
        printk(KERN_INFO "Cleaning module.\n");
}

module_init(hello_init);
module_exit(hello_exit);


UMONS

Ir Doctorant S. Frémal
Université de Mons
Service d'Informatique
Rue de Houdain,  n°9
7000 Mons
+32(0)65/37.40.51

www.umons.ac.be



2013/1/31 Olaf Hering <olaf@xxxxxxxxx>
On Tue, Jan 29, Sébastien Frémal wrote:

> The code is compiling, but when I try to launch the insert the module, I get
> error messages :
>
> [95265.790842] shmxen: Unknown symbol gnttab_grant_foreign_access (err 0)
> [95265.790855] shmxen: Unknown symbol xen_features (err 0)
> [95265.790865] shmxen: Unknown symbol get_phys_to_machine (err 0)
>                                             
> I'm searching for libraries to link with the module so it can use these

drivers/xen/grant-table.c:EXPORT_SYMBOL_GPL(gnttab_grant_foreign_access);
drivers/xen/features.c:EXPORT_SYMBOL_GPL(xen_features);
arch/x86/xen/p2m.c:EXPORT_SYMBOL_GPL(get_phys_to_machine);

The posted code is not marked as GPL, so the module linking code will
not consider the required functions.

Olaf

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.