1 #ifndef __IFACE_PSTATE_CTRL_H__
2 #define __IFACE_PSTATE_CTRL_H__
5 * This file is part of the Palacios Virtual Machine Monitor developed
6 * by the V3VEE Project with funding from the United States National
7 * Science Foundation and the Department of Energy.
9 * The V3VEE Project is a joint project between Northwestern University
10 * and the University of New Mexico. You can find out more at
11 * http://www.v3vee.org
13 * Copyright (c) 2014, the V3VEE Project <http://www.v3vee.org>
14 * all rights reserved.
16 * Author: Kyle C. Hale <kh@u.northwestern.edu>
17 * Shiva Rao <shiva.rao.717@gmail.com>
18 * Peter Dinda <pdinda@northwestern.edu>
20 * This is free software. you are permitted to use,
21 * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
26 #include <interfaces/vmm_pstate_ctrl.h>
28 // These functions are available for use within the module
29 // They affect the current core
31 void palacios_pstate_ctrl_get_chars(struct v3_cpu_pstate_chars *c);
33 void palacios_pstate_ctrl_acquire(uint32_t type);
34 void palacios_pstate_ctrl_release(void);
37 uint64_t palacios_pstate_ctrl_get_pstate(void);
38 void palacios_pstate_ctrl_set_pstate(uint64_t p);
40 uint64_t palacios_pstate_ctrl_get_freq(void);
41 void palacios_pstate_ctrl_set_freq(uint64_t f_khz);
44 // This structure is how the user space commands us
45 struct v3_dvfs_ctrl_request {
46 enum {V3_DVFS_ACQUIRE, // Take control over a pcore from host
47 V3_DVFS_RELEASE, // Release control of a pcore to host
48 V3_DVFS_SETFREQ, // Set frequency of acquired pcore
49 V3_DVFS_SETPSTATE} cmd; // Set pstate of acquired pcore
50 enum {V3_DVFS_EXTERNAL,
51 V3_DVFS_DIRECT } acq_type; // External for setting freq using Linux
52 // Direct for setting pstate directly using module
53 uint32_t pcore; // Which core we mean
54 uint64_t freq_khz; // for setfreq
55 uint64_t pstate; // for setpstate