Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


HVM enhancements
[palacios.git] / palacios / src / interfaces / vmm_pwrstat.c
1 /* 
2  * This file is part of the Palacios Virtual Machine Monitor developed
3  * by the V3VEE Project with funding from the United States National 
4  * Science Foundation and the Department of Energy.  
5  *
6  * The V3VEE Project is a joint project between Northwestern University
7  * and the University of New Mexico.  You can find out more at 
8  * http://www.v3vee.org
9  *
10  * Copyright (c) 2013, The V3VEE Project <http://www.v3vee.org> 
11  * All rights reserved.
12  *
13  * Author: Kyle C. Hale <kh@u.northwestern.edu>
14  * 
15  * This is free software.  You are permitted to use,
16  * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
17  */
18
19 #include <palacios/vmm.h>
20 #include <palacios/vmm_debug.h>
21 #include <palacios/vmm_types.h>
22 #include <palacios/vm_guest.h>
23 #include <palacios/vmm_lowlevel.h>
24
25 #include <interfaces/vmm_pwrstat.h>
26
27 struct v3_pwrstat_iface * palacios_pwrstat = 0;
28
29
30 void v3_pwrstat_init (void) 
31 {
32     if (palacios_pwrstat && palacios_pwrstat->init) {
33         palacios_pwrstat->init();
34     }
35 }
36
37
38 void v3_pwrstat_deinit (void) 
39 {
40     if (palacios_pwrstat && palacios_pwrstat->deinit) {
41         palacios_pwrstat->deinit();
42     }
43 }
44
45
46 uint64_t v3_pwrstat_get_value (v3_pwrstat_ctr_t ctr)
47 {
48     if (palacios_pwrstat && palacios_pwrstat->get_value) {
49         return palacios_pwrstat->get_value(ctr);
50     }
51
52     return -1;
53 }
54
55
56 int v3_pwrstat_ctr_valid(v3_pwrstat_ctr_t ctr)
57 {
58     if (palacios_pwrstat && palacios_pwrstat->ctr_valid) {
59         return palacios_pwrstat->ctr_valid(ctr);
60     }
61
62     return -1;
63 }
64
65
66 void V3_Init_Pwrstat (struct v3_pwrstat_iface * pwrstat_iface) 
67 {
68     palacios_pwrstat = pwrstat_iface;
69 }
70
71