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