diff options
author | Liu Jinsong <jinsong.liu@intel.com> | 2013-01-24 09:12:30 -0500 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2013-02-19 22:02:27 -0500 |
commit | b22ff77b82598ff131d215627533e09e4a472220 (patch) | |
tree | 239af45631e67c97a5d4c08c9041a1d3028f41df /drivers/xen/xen-stub.c | |
parent | ef92e7caf9901884f19fdeb4d7a24333b33c5f37 (diff) |
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/xen-stub.c')
-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 @@ | |||
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 |