1
2
3
4
5
6
7
8
9
10
11
12
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/export.h>
16#include <linux/types.h>
17#include <linux/acpi.h>
18#include <xen/acpi.h>
19
20#ifdef CONFIG_ACPI
21
22
23
24
25
26static const struct acpi_device_id memory_device_ids[] = {
27 {ACPI_MEMORY_DEVICE_HID, 0},
28 {"", 0},
29};
30
31static struct acpi_driver xen_stub_memory_device_driver = {
32
33 .name = "acpi_memhotplug",
34 .class = ACPI_MEMORY_DEVICE_CLASS,
35 .ids = memory_device_ids,
36};
37
38int xen_stub_memory_device_init(void)
39{
40 if (!xen_initial_domain())
41 return -ENODEV;
42
43
44 return acpi_bus_register_driver(&xen_stub_memory_device_driver);
45}
46EXPORT_SYMBOL_GPL(xen_stub_memory_device_init);
47subsys_initcall(xen_stub_memory_device_init);
48
49void xen_stub_memory_device_exit(void)
50{
51 acpi_bus_unregister_driver(&xen_stub_memory_device_driver);
52}
53EXPORT_SYMBOL_GPL(xen_stub_memory_device_exit);
54
55
56
57
58
59
60static const struct acpi_device_id processor_device_ids[] = {
61 {ACPI_PROCESSOR_OBJECT_HID, 0},
62 {ACPI_PROCESSOR_DEVICE_HID, 0},
63 {"", 0},
64};
65
66static struct acpi_driver xen_stub_processor_driver = {
67
68 .name = "processor",
69 .class = ACPI_PROCESSOR_CLASS,
70 .ids = processor_device_ids,
71};
72
73int xen_stub_processor_init(void)
74{
75 if (!xen_initial_domain())
76 return -ENODEV;
77
78
79 return acpi_bus_register_driver(&xen_stub_processor_driver);
80}
81EXPORT_SYMBOL_GPL(xen_stub_processor_init);
82subsys_initcall(xen_stub_processor_init);
83
84void xen_stub_processor_exit(void)
85{
86 acpi_bus_unregister_driver(&xen_stub_processor_driver);
87}
88EXPORT_SYMBOL_GPL(xen_stub_processor_exit);
89
90#endif
91