ia64/xen-unstable

view tools/misc/cpuperf/cpuperf_xeno.h @ 6435:b4b3f6be5226

merge?
author cl349@firebug.cl.cam.ac.uk
date Thu Aug 25 17:27:49 2005 +0000 (2005-08-25)
parents 0610add7c3fe 6e899a3840b2
children 8799d14bef77 9312a3e8a6f8
line source
1 /*
2 * Interface to Xen MSR hypercalls.
3 *
4 * $Id: cpuperf_xeno.h,v 1.1 2003/10/13 16:49:44 jrb44 Exp $
5 *
6 * $Log: cpuperf_xeno.h,v $
7 * Revision 1.1 2003/10/13 16:49:44 jrb44
8 * Initial revision
9 *
10 */
12 #include <xenctrl.h>
14 static int xc_handle;
16 void xen_init()
17 {
18 if ( (xc_handle = xc_interface_open()) == -1 )
19 {
20 fprintf(stderr, "Error opening xc interface: %d (%s)\n",
21 errno, strerror(errno));
22 exit(-1);
23 }
25 }
27 void dom0_wrmsr( int cpu_mask, int msr, unsigned int low, unsigned int high )
28 {
29 xc_msr_write (xc_handle, cpu_mask, msr, low, high);
30 }
32 unsigned long long dom0_rdmsr( int cpu_mask, int msr )
33 {
34 return xc_msr_read(xc_handle, cpu_mask, msr);
35 }
37 // End of $RCSfile: cpuperf_xeno.h,v $