Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 356932
b: refs/heads/master
c: b22ff77
h: refs/heads/master
v: v3
  • Loading branch information
Liu Jinsong authored and Konrad Rzeszutek Wilk committed Feb 20, 2013
1 parent b66c46c commit 3d4f511
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ef92e7caf9901884f19fdeb4d7a24333b33c5f37
refs/heads/master: b22ff77b82598ff131d215627533e09e4a472220
39 changes: 37 additions & 2 deletions trunk/drivers/xen/xen-stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -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
7 changes: 7 additions & 0 deletions trunk/include/xen/acpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@
int xen_stub_memory_device_init(void);
void xen_stub_memory_device_exit(void);

#define ACPI_PROCESSOR_CLASS "processor"
#define ACPI_PROCESSOR_DEVICE_HID "ACPI0007"
#define ACPI_PROCESSOR_DEVICE_NAME "Processor"

int xen_stub_processor_init(void);
void xen_stub_processor_exit(void);

int xen_acpi_notify_hypervisor_state(u8 sleep_state,
u32 pm1a_cnt, u32 pm1b_cnd);

Expand Down

0 comments on commit 3d4f511

Please sign in to comment.