diff options
author | Liu Jinsong <jinsong.liu@intel.com> | 2013-01-25 08:42:31 +0100 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2013-02-20 04:02:28 +0100 |
commit | 40a58637a4fa10a2faea71f0f30ff0b3d74c6e00 (patch) | |
tree | e7fe9fcfb7f0bdca91152b8cef0fc08d6e224024 /include/xen/acpi.h | |
parent | xen/stub: driver for CPU hotplug (diff) | |
download | linux-40a58637a4fa10a2faea71f0f30ff0b3d74c6e00.tar.xz linux-40a58637a4fa10a2faea71f0f30ff0b3d74c6e00.zip |
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>
Diffstat (limited to 'include/xen/acpi.h')
-rw-r--r-- | include/xen/acpi.h | 18 |
1 files changed, 18 insertions, 0 deletions
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) } #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 */ |