Commit 40a58637 authored by Liu Jinsong's avatar Liu Jinsong Committed by Konrad Rzeszutek Wilk

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: default avatarLiu, Jinsong <jinsong.liu@intel.com>
Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
parent b22ff77b
...@@ -65,24 +65,6 @@ static int xen_hotadd_memory(int pxm, struct acpi_memory_info *info) ...@@ -65,24 +65,6 @@ static int xen_hotadd_memory(int pxm, struct acpi_memory_info *info)
return rc; return rc;
} }
static int xen_acpi_get_pxm(acpi_handle h)
{
unsigned long long pxm;
acpi_status status;
acpi_handle handle;
acpi_handle phandle = h;
do {
handle = phandle;
status = acpi_evaluate_integer(handle, "_PXM", NULL, &pxm);
if (ACPI_SUCCESS(status))
return pxm;
status = acpi_get_parent(handle, &phandle);
} while (ACPI_SUCCESS(status));
return -ENXIO;
}
static int xen_acpi_memory_enable_device(struct acpi_memory_device *mem_device) static int xen_acpi_memory_enable_device(struct acpi_memory_device *mem_device)
{ {
int pxm, result; int pxm, result;
......
...@@ -69,4 +69,22 @@ static inline void xen_acpi_sleep_register(void) ...@@ -69,4 +69,22 @@ static inline void xen_acpi_sleep_register(void)
} }
#endif #endif
static inline int xen_acpi_get_pxm(acpi_handle h)
{
unsigned long long pxm;
acpi_status status;
acpi_handle handle;
acpi_handle phandle = h;
do {
handle = phandle;
status = acpi_evaluate_integer(handle, "_PXM", NULL, &pxm);
if (ACPI_SUCCESS(status))
return pxm;
status = acpi_get_parent(handle, &phandle);
} while (ACPI_SUCCESS(status));
return -ENXIO;
}
#endif /* _XEN_ACPI_H */ #endif /* _XEN_ACPI_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment