Add DSDT node for AppleSMC

AppleSMC (-device isa-applesmc) is required to boot OS X guests.
OS X expects a SMC node to be present in the ACPI DSDT. This patch
adds a SMC node to the DSDT, and dynamically patches the return value
of SMC._STA to either 0x0B if the chip is present, or otherwise to 0x00,
before booting the guest.

Signed-off-by: Gabriel Somlo <somlo@cmu.edu>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
Gabriel L. Somlo 2013-12-22 10:34:56 -05:00 committed by Michael S. Tsirkin
parent 3e16d14fd9
commit 15bce1b7c5
6 changed files with 29 additions and 1 deletions

View file

@ -20,6 +20,13 @@
#define TYPE_ISA_BUS "ISA"
#define ISA_BUS(obj) OBJECT_CHECK(ISABus, (obj), TYPE_ISA_BUS)
#define TYPE_APPLE_SMC "isa-applesmc"
static inline bool applesmc_find(void)
{
return object_resolve_path_type("", TYPE_APPLE_SMC, NULL);
}
typedef struct ISADeviceClass {
DeviceClass parent_class;
} ISADeviceClass;