Received: from eggs.gnu.org ([2001:4830:134:3::10]:46234) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W2n1J-0001gA-S5 for qemu-devel@nongnu.org; Mon, 13 Jan 2014 14:18:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W2n1E-0003Bh-A4 for qemu-devel@nongnu.org; Mon, 13 Jan 2014 14:17:57 -0500 Received: from mail-qa0-x22b.google.com ([2607:f8b0:400d:c00::22b]:51564) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W2n1E-0003Bc-5g for qemu-devel@nongnu.org; Mon, 13 Jan 2014 14:17:52 -0500 Received: by mail-qa0-f43.google.com with SMTP id o15so1074999qap.2 for ; Mon, 13 Jan 2014 11:17:51 -0800 (PST) Date: Mon, 13 Jan 2014 14:17:28 -0500 From: "Gabriel L. Somlo" Message-ID: <20140113191728.GK1276@ERROL.INI.CMU.EDU> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140113175306.GI1276@ERROL.INI.CMU.EDU> Subject: [Qemu-devel] [PATCH] ACPI: AppleSMC _STA method should return 32bit value List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: mst@redhat.com Signed-off-by: Gabriel Somlo --- This applies incrementally on top of "Add DSDT node for AppleSMC" v.3 (accepted Dec. 25, 2013), and obsoletes v.4 of same with cleaner code in acpi-build.c. Thanks, Gabriel hw/i386/acpi-dsdt-isa.dsl | 4 ++-- hw/i386/acpi-build.c | 11 +++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/hw/i386/acpi-dsdt-isa.dsl b/hw/i386/acpi-dsdt-isa.dsl index 46942c1..3a6e100 100644 --- a/hw/i386/acpi-dsdt-isa.dsl +++ b/hw/i386/acpi-dsdt-isa.dsl @@ -19,8 +19,8 @@ Scope(\_SB.PCI0.ISA) { Device (SMC) { Name(_HID, EisaId("APP0001")) /* _STA will be patched to 0x0B if AppleSMC is present */ - ACPI_EXTRACT_NAME_WORD_CONST DSDT_APPLESMC_STA - Name(_STA, 0xFF00) + ACPI_EXTRACT_NAME_DWORD_CONST DSDT_APPLESMC_STA + Name(_STA, 0xFFFFFF00) Name(_CRS, ResourceTemplate () { IO (Decode16, 0x0300, 0x0300, 0x01, 0x20) IRQNoFlags() { 6 } diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 30bfcd2..9e5733e 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); + *(uint32_t *)(info->dsdt_code + *applesmc_sta) = + cpu_to_le32(applesmc_find() ? 0x0b : 0x00); } static -- 1.8.1.4