File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change 38
38
#include "dm.h"
39
39
#include "acpi.h"
40
40
41
- static uint8_t get_vcpu_px_cnt (struct vmctx * ctx , int vcpu_id )
41
+ static inline int get_vcpu_pm_info (struct vmctx * ctx , int vcpu_id ,
42
+ uint64_t pm_type , uint64_t * pm_info )
42
43
{
43
- uint64_t pm_ioctl_buf = 0 ;
44
- enum pm_cmd_type cmd_type = PMCMD_GET_PX_CNT ;
45
-
46
- pm_ioctl_buf = ((ctx -> vmid << PMCMD_VMID_SHIFT ) & PMCMD_VMID_MASK )
44
+ * pm_info = ((ctx -> vmid << PMCMD_VMID_SHIFT ) & PMCMD_VMID_MASK )
47
45
| ((vcpu_id << PMCMD_VCPUID_SHIFT ) & PMCMD_VCPUID_MASK )
48
- | cmd_type ;
46
+ | (pm_type & PMCMD_TYPE_MASK );
47
+
48
+ return vm_get_cpu_state (ctx , pm_info );
49
+ }
50
+
51
+ static inline uint8_t get_vcpu_px_cnt (struct vmctx * ctx , int vcpu_id )
52
+ {
53
+ uint64_t px_cnt ;
49
54
50
- if (vm_get_cpu_state (ctx , & pm_ioctl_buf )) {
55
+ if (get_vcpu_pm_info (ctx , vcpu_id , PMCMD_GET_PX_CNT , & px_cnt )) {
51
56
return 0 ;
52
57
}
53
58
54
- return (uint8_t )pm_ioctl_buf ;
59
+ return (uint8_t )px_cnt ;
55
60
}
56
61
57
62
static int get_vcpu_px_data (struct vmctx * ctx , int vcpu_id ,
You can’t perform that action at this time.
0 commit comments