aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen
diff options
context:
space:
mode:
authorJiang Liu <jiang.liu@linux.intel.com>2014-02-19 01:02:17 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-02-20 18:27:47 -0500
commit772c53990fc29a34aec539abc6b2a1edbab8b2b5 (patch)
tree5c7fba628d7b7139cb5af5856df2ba45910a0af6 /drivers/xen
parent8b296d9412a087c1e2191d3e7448c76d9498714f (diff)
ACPI / PAD / xen: use acpi_evaluate_ost() to replace open-coded version
Use public function acpi_evaluate_ost() to replace open-coded version of evaluating ACPI _OST method. Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/xen')
-rw-r--r--drivers/xen/xen-acpi-pad.c26
1 files changed, 7 insertions, 19 deletions
diff --git a/drivers/xen/xen-acpi-pad.c b/drivers/xen/xen-acpi-pad.c
index 40c4bc06b5fa..f83b754505f8 100644
--- a/drivers/xen/xen-acpi-pad.c
+++ b/drivers/xen/xen-acpi-pad.c
@@ -77,27 +77,14 @@ static int acpi_pad_pur(acpi_handle handle)
77 return num; 77 return num;
78} 78}
79 79
80/* Notify firmware how many CPUs are idle */
81static void acpi_pad_ost(acpi_handle handle, int stat,
82 uint32_t idle_nums)
83{
84 union acpi_object params[3] = {
85 {.type = ACPI_TYPE_INTEGER,},
86 {.type = ACPI_TYPE_INTEGER,},
87 {.type = ACPI_TYPE_BUFFER,},
88 };
89 struct acpi_object_list arg_list = {3, params};
90
91 params[0].integer.value = ACPI_PROCESSOR_AGGREGATOR_NOTIFY;
92 params[1].integer.value = stat;
93 params[2].buffer.length = 4;
94 params[2].buffer.pointer = (void *)&idle_nums;
95 acpi_evaluate_object(handle, "_OST", &arg_list, NULL);
96}
97
98static void acpi_pad_handle_notify(acpi_handle handle) 80static void acpi_pad_handle_notify(acpi_handle handle)
99{ 81{
100 int idle_nums; 82 int idle_nums;
83 struct acpi_buffer param = {
84 .length = 4,
85 .pointer = (void *)&idle_nums,
86 };
87
101 88
102 mutex_lock(&xen_cpu_lock); 89 mutex_lock(&xen_cpu_lock);
103 idle_nums = acpi_pad_pur(handle); 90 idle_nums = acpi_pad_pur(handle);
@@ -109,7 +96,8 @@ static void acpi_pad_handle_notify(acpi_handle handle)
109 idle_nums = xen_acpi_pad_idle_cpus(idle_nums) 96 idle_nums = xen_acpi_pad_idle_cpus(idle_nums)
110 ?: xen_acpi_pad_idle_cpus_num(); 97 ?: xen_acpi_pad_idle_cpus_num();
111 if (idle_nums >= 0) 98 if (idle_nums >= 0)
112 acpi_pad_ost(handle, 0, idle_nums); 99 acpi_evaluate_ost(handle, ACPI_PROCESSOR_AGGREGATOR_NOTIFY,
100 0, &param);
113 mutex_unlock(&xen_cpu_lock); 101 mutex_unlock(&xen_cpu_lock);
114} 102}
115 103