diff options
author | Liu Jinsong <jinsong.liu@intel.com> | 2013-01-24 15:12:30 +0100 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2013-02-20 04:02:27 +0100 |
commit | b22ff77b82598ff131d215627533e09e4a472220 (patch) | |
tree | 239af45631e67c97a5d4c08c9041a1d3028f41df /drivers/xen | |
parent | xen/acpi: ACPI memory hotplug (diff) | |
download | linux-b22ff77b82598ff131d215627533e09e4a472220.tar.xz linux-b22ff77b82598ff131d215627533e09e4a472220.zip |
xen/stub: driver for CPU hotplug
Add Xen stub driver for CPU hotplug, early occupy to block native,
will be replaced later by real Xen processor driver module.
Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers/xen')
-rw-r--r-- | drivers/xen/xen-stub.c | 39 |
1 files changed, 37 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 @@ #include <acpi/acpi_drivers.h> #include <xen/acpi.h> +#ifdef CONFIG_ACPI + /*-------------------------------------------- stub driver for Xen memory hotplug --------------------------------------------*/ -#ifdef CONFIG_ACPI - static const struct acpi_device_id memory_device_ids[] = { {ACPI_MEMORY_DEVICE_HID, 0}, {"", 0}, @@ -63,4 +63,39 @@ void xen_stub_memory_device_exit(void) } EXPORT_SYMBOL_GPL(xen_stub_memory_device_exit); + +/*-------------------------------------------- + stub driver for Xen cpu hotplug +--------------------------------------------*/ + +static const struct acpi_device_id processor_device_ids[] = { + {ACPI_PROCESSOR_OBJECT_HID, 0}, + {ACPI_PROCESSOR_DEVICE_HID, 0}, + {"", 0}, +}; + +static struct acpi_driver xen_stub_processor_driver = { + /* same name as native processor driver to block native loaded */ + .name = "processor", + .class = ACPI_PROCESSOR_CLASS, + .ids = processor_device_ids, +}; + +int xen_stub_processor_init(void) +{ + if (!xen_initial_domain()) + return -ENODEV; + + /* just reserve space for Xen, block native driver loaded */ + return acpi_bus_register_driver(&xen_stub_processor_driver); +} +EXPORT_SYMBOL_GPL(xen_stub_processor_init); +subsys_initcall(xen_stub_processor_init); + +void xen_stub_processor_exit(void) +{ + acpi_bus_unregister_driver(&xen_stub_processor_driver); +} +EXPORT_SYMBOL_GPL(xen_stub_processor_exit); + #endif |