From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: In which library can I find these functions ? Date: Wed, 30 Jan 2013 16:30:05 -0500 Message-ID: <20130130213003.GB1885@konrad-lan.dumpdata.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: =?iso-8859-1?Q?S=E9bastien_Fr=E9mal?= Cc: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Tue, Jan 29, 2013 at 04:59:39PM +0100, S=E9bastien Fr=E9mal wrote: > Hi, > = > I'm trying to build a module to implement a shared memory mechanism betwe= en > the dom0 and domU's. > = > To do so, I'm investigating the grant table mechanisms. I have wrote that > code (which is supposed to be the dom0-side of a module creating and > sharing 1 page) : > = > #undef __KERNEL__ > #define __KERNEL__ > = > #undef MODULE > #define MODULE > = > #include > #include > #include > #include > #include > #include > = > unsigned long myPage; > = > static int __init hello_init(void){ > // int domB =3D atoi(argv[1]); > printk(KERN_INFO "Test sur le partage de m=E9moire dans Xen \n"); > = > if((myPage =3D get_zeroed_page(GFP_KERNEL))=3D=3D0) > printk(KERN_INFO "Zeroed page\n"); > = > grant_ref_t gref; > gref =3D 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); > = > 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 > functions but I can't find those. Can you please help me ? I searched in > project like Xen VMSocket to look after their way of dealing the problem, > but the Makefile doesn't point out directories containing the included > headers or libraries having implemented functions (I don't understand how > it's suppose to compile). cscope is quite good at finding these things. You just need xen/grant_table.h and xen/xen.h > = > I thank you for your help. > = > Best regards, > = > Fremal S. > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel