diff options
author | Gabriel L. Somlo <gsomlo@gmail.com> | 2014-01-13 15:27:13 -0500 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2014-01-26 13:06:48 +0200 |
commit | 8977557ae418f9b9ff5c35ee39161a33f2368e6a (patch) | |
tree | 7708ac8549c90848454e298d8d942a650e174251 /hw/i386/acpi-build.c | |
parent | 15bce1b7c55c69f47e13c9eb2a4b80f41da26581 (diff) |
ACPI: Fix AppleSMC _STA size
Minimize the storage used for AppleSMC's _STA (8bit), relying on ASL
to implicitly convert it to the officially specified 32bit value.
Signed-off-by: Gabriel Somlo <somlo@cmu.edu>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/i386/acpi-build.c')
-rw-r--r-- | hw/i386/acpi-build.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 30bfcd2b4a..1d62866ec4 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -81,7 +81,7 @@ typedef struct AcpiMiscInfo { static void acpi_get_dsdt(AcpiMiscInfo *info) { - unsigned short applesmc_sta_val, *applesmc_sta_off; + uint16_t *applesmc_sta; Object *piix = piix4_pm_find(); Object *lpc = ich9_lpc_find(); assert(!!piix != !!lpc); @@ -89,18 +89,17 @@ static void acpi_get_dsdt(AcpiMiscInfo *info) if (piix) { info->dsdt_code = AcpiDsdtAmlCode; info->dsdt_size = sizeof AcpiDsdtAmlCode; - applesmc_sta_off = piix_dsdt_applesmc_sta; + applesmc_sta = piix_dsdt_applesmc_sta; } if (lpc) { info->dsdt_code = Q35AcpiDsdtAmlCode; info->dsdt_size = sizeof Q35AcpiDsdtAmlCode; - applesmc_sta_off = q35_dsdt_applesmc_sta; + applesmc_sta = q35_dsdt_applesmc_sta; } /* Patch in appropriate value for AppleSMC _STA */ - applesmc_sta_val = applesmc_find() ? 0x0b : 0x00; - *(uint16_t *)(info->dsdt_code + *applesmc_sta_off) = - cpu_to_le16(applesmc_sta_val); + *(uint8_t *)(info->dsdt_code + *applesmc_sta) = + applesmc_find() ? 0x0b : 0x00; } static |