aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiu Jinsong <jinsong.liu@intel.com>2013-01-25 02:42:31 -0500
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2013-02-19 22:02:28 -0500
commit40a58637a4fa10a2faea71f0f30ff0b3d74c6e00 (patch)
treee7fe9fcfb7f0bdca91152b8cef0fc08d6e224024
parentb22ff77b82598ff131d215627533e09e4a472220 (diff)
xen/acpi: Move xen_acpi_get_pxm to Xen's acpi.h
So that it could be reused by Xen CPU hotplug logic. Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
-rw-r--r--drivers/xen/xen-acpi-memhotplug.c18
-rw-r--r--include/xen/acpi.h18
2 files changed, 18 insertions, 18 deletions
diff --git a/drivers/xen/xen-acpi-memhotplug.c b/drivers/xen/xen-acpi-memhotplug.c
index 2c3759ac10f0..678680cb213c 100644
--- a/drivers/xen/xen-acpi-memhotplug.c
+++ b/drivers/xen/xen-acpi-memhotplug.c
@@ -65,24 +65,6 @@ static int xen_hotadd_memory(int pxm, struct acpi_memory_info *info)
65 return rc; 65 return rc;
66} 66}
67 67
68static int xen_acpi_get_pxm(acpi_handle h)
69{
70 unsigned long long pxm;
71 acpi_status status;
72 acpi_handle handle;
73 acpi_handle phandle = h;
74
75 do {
76 handle = phandle;
77 status = acpi_evaluate_integer(handle, "_PXM", NULL, &pxm);
78 if (ACPI_SUCCESS(status))
79 return pxm;
80 status = acpi_get_parent(handle, &phandle);
81 } while (ACPI_SUCCESS(status));
82
83 return -ENXIO;
84}
85
86static int xen_acpi_memory_enable_device(struct acpi_memory_device *mem_device) 68static int xen_acpi_memory_enable_device(struct acpi_memory_device *mem_device)
87{ 69{
88 int pxm, result; 70 int pxm, result;
diff --git a/include/xen/acpi.h b/include/xen/acpi.h
index 2b3103b33725..dc69c91605b8 100644
--- a/include/xen/acpi.h
+++ b/include/xen/acpi.h
@@ -69,4 +69,22 @@ static inline void xen_acpi_sleep_register(void)
69} 69}
70#endif 70#endif
71 71
72static inline int xen_acpi_get_pxm(acpi_handle h)
73{
74 unsigned long long pxm;
75 acpi_status status;
76 acpi_handle handle;
77 acpi_handle phandle = h;
78
79 do {
80 handle = phandle;
81 status = acpi_evaluate_integer(handle, "_PXM", NULL, &pxm);
82 if (ACPI_SUCCESS(status))
83 return pxm;
84 status = acpi_get_parent(handle, &phandle);
85 } while (ACPI_SUCCESS(status));
86
87 return -ENXIO;
88}
89
72#endif /* _XEN_ACPI_H */ 90#endif /* _XEN_ACPI_H */