MAYAP KAMGA Christine larissa
2013-Jan-03 09:30 UTC
Fwd: [Beginners question]- Compilation error while trying user program from dom0
Sorry, in my case, my user application is running on the domO.
-------- Original Message --------
Subject: [Xen-users] [Beginners question]- Compilation error while
trying user program from domU
Date: Thu, 03 Jan 2013 10:12:12 +0100
From: MAYAP KAMGA Christine larissa <christine.mayapkamga@enseeiht.fr>
To: <xen-users@lists.xen.org>
Hello
I'm having almost the same problem as below.
In my case, i want to use "cpufreq.h" and percpu.h libraries to get
current processor frequency.
**This is my sample program**
#include <acpi/cpufreq/cpufreq.h>
#include <asm/percpu.h>
static unsigned int get_my_cur_freq(int cpuid)
{
struct cpufreq_policy *policy;
policy = per_cpu(cpufreq_cpu_policy, cpuid);
if (!policy)
return 0;
else
return policy->cur;
}
I linked the necesary librairy, but while executing my makefile, i
having the followinf error:
XenRoot/xen/include/acpi/cpufreq/processor_perf.h:61: error: expected
declaration specifiers or ‘...’ before ‘cpufreq_statistic_data’
XenRoot/xen/include/acpi/cpufreq/processor_perf.h:61: warning: data
definition has no type or storage class
XenRoot/xen/include/acpi/cpufreq/processor_perf.h:61: warning: type
defaults to ‘int’ in declaration of ‘DECLARE_PER_CPU’
In file included from readCurrentCpuCounters.c:6:
XenRoot/xen/include/acpi/cpufreq/cpufreq.h:23: warning: data definition
has no type or storage class
XenRoot/xen/include/acpi/cpufreq/cpufreq.h:23: warning: type defaults
to ‘int’ in declaration of ‘DECLARE_PER_CPU’
XenRoot/xen/include/acpi/cpufreq/cpufreq.h:23: warning: parameter names
(without types) in function declaration
XenRoot/xen/include/acpi/cpufreq/cpufreq.h:25: error: expected ‘=’,
‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘cpufreq_verbose’
XenRoot/xen/include/acpi/cpufreq/cpufreq.h:62: error: expected
declaration specifiers or ‘...’ before ‘cpufreq_cpu_policy’
XenRoot/xen/include/acpi/cpufreq/cpufreq.h:62: warning: data definition
has no type or storage class
XenRoot/xen/include/acpi/cpufreq/cpufreq.h:62: warning: type defaults
to ‘int’ in declaration of ‘DECLARE_PER_CPU’
XenRoot/xen/include/acpi/cpufreq/cpufreq.h:62: error: conflicting types
for ‘DECLARE_PER_CPU’
XenRoot/xen/include/acpi/cpufreq/processor_perf.h:61: note: previous
declaration of ‘DECLARE_PER_CPU’ was here
XenRoot/xen/include/acpi/cpufreq/cpufreq.h: In function
‘cpufreq_register_driver’:
XenRoot/xen/include/acpi/cpufreq/cpufreq.h:164: error: ‘EINVAL’
undeclared (first use in this function)
XenRoot/xen/include/acpi/cpufreq/cpufreq.h:164: error: (Each undeclared
identifier is reported only once
XenRoot/xen/include/acpi/cpufreq/cpufreq.h:164: error: for each
function it appears in.)
XenRoot/xen/include/acpi/cpufreq/cpufreq.h:167: error: ‘EBUSY’
undeclared (first use in this function)
XenRoot/xen/include/acpi/cpufreq/cpufreq.h: In function
‘cpufreq_unregister_driver’:
XenRoot/xen/include/acpi/cpufreq/cpufreq.h:177: error: ‘EINVAL’
undeclared (first use in this function)
readCurrentCpuCounters.c: In function ‘get_cur_freq_on_cpu’:
readCurrentCpuCounters.c:26: error: ‘per_cpu__cpufreq_cpu_policy’
undeclared (first use in this function)
readCurrentCpuCounters.c:26: warning: type defaults to ‘int’ in
declaration of ‘type name’
readCurrentCpuCounters.c:26: error: invalid type argument of ‘unary *’
(have ‘int’)
make: *** [readCurrentCpuCounters.o] Erreur 1
Please, what can i do to solve this issue.
PS: i'm using Xen in his 4.1.2 version.
Thanks in advance
On Wed, 2 Jan 2013 22:02:05 -0800 (PST), Lakshman Jayaraju
wrote:> Hi all,
>
> My aim is to invoke hypercalls from programs inside guest domains. So
> in
> this regard I wrote a sample program as below that invokes a
> function(xc_domain_getinfo) declared in xenctrl.h.
>
> *Sample Program:*
> #include<stdio.h>
> #include<xenctrl.h>
> int main()
> {
> printf("Attempt to invoke hypercall!!!\n");
> int handle,rc;
> xc_dominfo_t *info;
> handle = xc_interface_open();
> printf(Äcquired handle :%d\n",handle);
> rc = xc_domain_getinfo(handle,3,1,info);
> printf(" The returned value is :%d\n",rc);
> return 0;
> }
>
> I linked xenctrl library from dom0, but I am getting compilation
> error
> saying *xenctrl.h: No such file or directory*. Then as per the error
> message
> I tried copying(by downloading source) required header files as and
> when it
> says missing header files name on consecutive compilation. But I
> ended up
> with path conflicts and couldn't succeed in compiling.
>
> *My doubts:*
> * Do I need to copy header files manually into guest domain? - I
> tried
> copying header files required as per compilation error msgs but I
> ended up
> with conflicts.
> * Any pointers to detailed guide to invoke hypercalls from guest
> domains??
>
>
> Thanks,
> Lakshman
>
>
>
>
> --
> View this message in context:
>
>
http://xen.1045712.n5.nabble.com/Beginners-question-Compilation-error-while-trying-user-program-from-domU-tp5713299.html
> Sent from the Xen - User mailing list archive at Nabble.com.
>
> _______________________________________________
> Xen-users mailing list
> Xen-users@lists.xen.org
> http://lists.xen.org/xen-users
_______________________________________________
Xen-users mailing list
Xen-users@lists.xen.org
http://lists.xen.org/xen-users
_______________________________________________
Xen-users mailing list
Xen-users@lists.xen.org
http://lists.xen.org/xen-users