aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen/xen-stub.c
diff options
context:
space:
mode:
authorLiu Jinsong <jinsong.liu@intel.com>2013-01-24 09:12:30 -0500
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2013-02-19 22:02:27 -0500
commitb22ff77b82598ff131d215627533e09e4a472220 (patch)
tree239af45631e67c97a5d4c08c9041a1d3028f41df /drivers/xen/xen-stub.c
parentef92e7caf9901884f19fdeb4d7a24333b33c5f37 (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.c39
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
37static const struct acpi_device_id memory_device_ids[] = { 37static 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}
64EXPORT_SYMBOL_GPL(xen_stub_memory_device_exit); 64EXPORT_SYMBOL_GPL(xen_stub_memory_device_exit);
65 65
66
67/*--------------------------------------------
68 stub driver for Xen cpu hotplug
69--------------------------------------------*/
70
71static const struct acpi_device_id processor_device_ids[] = {
72 {ACPI_PROCESSOR_OBJECT_HID, 0},
73 {ACPI_PROCESSOR_DEVICE_HID, 0},
74 {"", 0},
75};
76
77static 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
84int 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}
92EXPORT_SYMBOL_GPL(xen_stub_processor_init);
93subsys_initcall(xen_stub_processor_init);
94
95void xen_stub_processor_exit(void)
96{
97 acpi_bus_unregister_driver(&xen_stub_processor_driver);
98}
99EXPORT_SYMBOL_GPL(xen_stub_processor_exit);
100
66#endif 101#endif