diff options
| -rw-r--r-- | drivers/xen/xen-stub.c | 39 | ||||
| -rw-r--r-- | include/xen/acpi.h | 7 |
2 files changed, 44 insertions, 2 deletions
diff --git a/drivers/xen/xen-stub.c b/drivers/xen/xen-stub.c index 811152f67137..d85e411cbf89 100644 --- a/drivers/xen/xen-stub.c +++ b/drivers/xen/xen-stub.c | |||
| @@ -28,12 +28,12 @@ | |||
| 28 | #include <acpi/acpi_drivers.h> | 28 | #include <acpi/acpi_drivers.h> |
| 29 | #include <xen/acpi.h> | 29 | #include <xen/acpi.h> |
| 30 | 30 | ||
| 31 | #ifdef CONFIG_ACPI | ||
| 32 | |||
| 31 | /*-------------------------------------------- | 33 | /*-------------------------------------------- |
| 32 | stub driver for Xen memory hotplug | 34 | stub driver for Xen memory hotplug |
| 33 | --------------------------------------------*/ | 35 | --------------------------------------------*/ |
| 34 | 36 | ||
| 35 | #ifdef CONFIG_ACPI | ||
| 36 | |||
| 37 | static const struct acpi_device_id memory_device_ids[] = { | 37 | static const struct acpi_device_id memory_device_ids[] = { |
| 38 | {ACPI_MEMORY_DEVICE_HID, 0}, | 38 | {ACPI_MEMORY_DEVICE_HID, 0}, |
| 39 | {"", 0}, | 39 | {"", 0}, |
| @@ -63,4 +63,39 @@ void xen_stub_memory_device_exit(void) | |||
| 63 | } | 63 | } |
| 64 | EXPORT_SYMBOL_GPL(xen_stub_memory_device_exit); | 64 | EXPORT_SYMBOL_GPL(xen_stub_memory_device_exit); |
| 65 | 65 | ||
| 66 | |||
| 67 | /*-------------------------------------------- | ||
| 68 | stub driver for Xen cpu hotplug | ||
| 69 | --------------------------------------------*/ | ||
| 70 | |||
| 71 | static const struct acpi_device_id processor_device_ids[] = { | ||
| 72 | {ACPI_PROCESSOR_OBJECT_HID, 0}, | ||
| 73 | {ACPI_PROCESSOR_DEVICE_HID, 0}, | ||
| 74 | {"", 0}, | ||
| 75 | }; | ||
| 76 | |||
| 77 | static struct acpi_driver xen_stub_processor_driver = { | ||
| 78 | /* same name as native processor driver to block native loaded */ | ||
| 79 | .name = "processor", | ||
| 80 | .class = ACPI_PROCESSOR_CLASS, | ||
| 81 | .ids = processor_device_ids, | ||
| 82 | }; | ||
| 83 | |||
| 84 | int xen_stub_processor_init(void) | ||
| 85 | { | ||
| 86 | if (!xen_initial_domain()) | ||
| 87 | return -ENODEV; | ||
| 88 | |||
| 89 | /* just reserve space for Xen, block native driver loaded */ | ||
| 90 | return acpi_bus_register_driver(&xen_stub_processor_driver); | ||
| 91 | } | ||
| 92 | EXPORT_SYMBOL_GPL(xen_stub_processor_init); | ||
| 93 | subsys_initcall(xen_stub_processor_init); | ||
| 94 | |||
| 95 | void xen_stub_processor_exit(void) | ||
| 96 | { | ||
| 97 | acpi_bus_unregister_driver(&xen_stub_processor_driver); | ||
| 98 | } | ||
| 99 | EXPORT_SYMBOL_GPL(xen_stub_processor_exit); | ||
| 100 | |||
| 66 | #endif | 101 | #endif |
diff --git a/include/xen/acpi.h b/include/xen/acpi.h index ce7e5264b320..2b3103b33725 100644 --- a/include/xen/acpi.h +++ b/include/xen/acpi.h | |||
| @@ -47,6 +47,13 @@ | |||
| 47 | int xen_stub_memory_device_init(void); | 47 | int xen_stub_memory_device_init(void); |
| 48 | void xen_stub_memory_device_exit(void); | 48 | void xen_stub_memory_device_exit(void); |
| 49 | 49 | ||
| 50 | #define ACPI_PROCESSOR_CLASS "processor" | ||
| 51 | #define ACPI_PROCESSOR_DEVICE_HID "ACPI0007" | ||
| 52 | #define ACPI_PROCESSOR_DEVICE_NAME "Processor" | ||
| 53 | |||
| 54 | int xen_stub_processor_init(void); | ||
| 55 | void xen_stub_processor_exit(void); | ||
| 56 | |||
| 50 | int xen_acpi_notify_hypervisor_state(u8 sleep_state, | 57 | int xen_acpi_notify_hypervisor_state(u8 sleep_state, |
| 51 | u32 pm1a_cnt, u32 pm1b_cnd); | 58 | u32 pm1a_cnt, u32 pm1b_cnd); |
| 52 | 59 | ||
