ia64/xen-unstable

annotate tools/misc/cpuperf/cpuperf_xeno.h @ 6403:6e899a3840b2

Rename libxc => libxenctrl and xc.h => xen/xenctrl.h
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Wed Aug 24 23:07:29 2005 +0000 (2005-08-24)
parents cfee4c4a8ed6
children 2f20c2fce2c5 e24fd7012ffb 4abd299ef2f6 3428d58a85e1 b54144915ae6 0610add7c3fe b4b3f6be5226
rev   line source
rneugeba@3963 1 /*
rneugeba@3963 2 * Interface to Xen MSR hypercalls.
rneugeba@3963 3 *
rneugeba@3963 4 * $Id: cpuperf_xeno.h,v 1.1 2003/10/13 16:49:44 jrb44 Exp $
rneugeba@3963 5 *
rneugeba@3963 6 * $Log: cpuperf_xeno.h,v $
rneugeba@3963 7 * Revision 1.1 2003/10/13 16:49:44 jrb44
rneugeba@3963 8 * Initial revision
rneugeba@3963 9 *
rneugeba@3963 10 */
rneugeba@3963 11
cl349@6403 12 #include <xenctrl.h>
rneugeba@3963 13
rneugeba@3963 14 static int xc_handle;
rneugeba@3963 15
rneugeba@3963 16 void xen_init()
rneugeba@3963 17 {
rneugeba@3963 18 if ( (xc_handle = xc_interface_open()) == -1 )
rneugeba@3963 19 {
rneugeba@3963 20 fprintf(stderr, "Error opening xc interface: %d (%s)\n",
rneugeba@3963 21 errno, strerror(errno));
rneugeba@3963 22 exit(-1);
rneugeba@3963 23 }
rneugeba@3963 24
rneugeba@3963 25 }
rneugeba@3963 26
rneugeba@3963 27 void dom0_wrmsr( int cpu_mask, int msr, unsigned int low, unsigned int high )
rneugeba@3963 28 {
rneugeba@3963 29 xc_msr_write (xc_handle, cpu_mask, msr, low, high);
rneugeba@3963 30 }
rneugeba@3963 31
rneugeba@3963 32 unsigned long long dom0_rdmsr( int cpu_mask, int msr )
rneugeba@3963 33 {
rneugeba@3963 34 return xc_msr_read(xc_handle, cpu_mask, msr);
rneugeba@3963 35 }
rneugeba@3963 36
rneugeba@3963 37 // End of $RCSfile: cpuperf_xeno.h,v $
rneugeba@3963 38