ia64/xen-unstable

view tools/misc/cpuperf/cpuperf_xeno.h @ 3963:cfee4c4a8ed6

bitkeeper revision 1.1242 (4225f56fwo6ym-RMTBheAeYhl10ATQ)

forward ported James Bulpin's performance counters tool

Signed-off-by: michael.fetterman@cl.cam.ac.uk
author rneugeba@wyvis.research.intel-research.net
date Wed Mar 02 17:18:39 2005 +0000 (2005-03-02)
parents
children 6e899a3840b2 2f20c2fce2c5 8799d14bef77 a9873d384da4
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 <xc.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 $