From patchwork Wed Feb 15 10:28:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 141291 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 8FE2A1007D5 for ; Wed, 15 Feb 2012 21:28:48 +1100 (EST) Received: from localhost ([::1]:53080 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rxc6K-0006t7-Cu for incoming@patchwork.ozlabs.org; Wed, 15 Feb 2012 05:28:40 -0500 Received: from eggs.gnu.org ([140.186.70.92]:53873) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rxc6D-0006sn-M3 for qemu-devel@nongnu.org; Wed, 15 Feb 2012 05:28:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rxc66-0000ez-4M for qemu-devel@nongnu.org; Wed, 15 Feb 2012 05:28:33 -0500 Received: from mx1.redhat.com ([209.132.183.28]:62694) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rxc65-0000ed-Tv for qemu-devel@nongnu.org; Wed, 15 Feb 2012 05:28:26 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q1FASOSL030897 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 15 Feb 2012 05:28:24 -0500 Received: from rincewind.home.kraxel.org (ovpn-116-41.ams2.redhat.com [10.36.116.41]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q1FASMlU016539; Wed, 15 Feb 2012 05:28:23 -0500 Received: by rincewind.home.kraxel.org (Postfix, from userid 500) id E455C41450; Wed, 15 Feb 2012 11:28:21 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Wed, 15 Feb 2012 11:28:13 +0100 Message-Id: <1329301701-30395-5-git-send-email-kraxel@redhat.com> In-Reply-To: <1329301701-30395-1-git-send-email-kraxel@redhat.com> References: <1329301701-30395-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Gerd Hoffmann Subject: [Qemu-devel] [PATCH v5 04/12] acpi: add acpi_pm1_evt_write_en X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Do APCIREGS->pm1.evt.en updates using the new acpi_pm1_evt_write_en function, so the acpi code will see those updates. Signed-off-by: Gerd Hoffmann --- hw/acpi.c | 5 +++++ hw/acpi.h | 1 + hw/acpi_piix4.c | 2 +- hw/vt82c686.c | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/hw/acpi.c b/hw/acpi.c index 1129335..407949b 100644 --- a/hw/acpi.c +++ b/hw/acpi.c @@ -268,6 +268,11 @@ void acpi_pm1_evt_write_sts(ACPIREGS *ar, uint16_t val) ar->pm1.evt.sts &= ~val; } +void acpi_pm1_evt_write_en(ACPIREGS *ar, uint16_t val) +{ + ar->pm1.evt.en = val; +} + void acpi_pm1_evt_power_down(ACPIREGS *ar) { if (ar->pm1.evt.en & ACPI_BITMASK_POWER_BUTTON_ENABLE) { diff --git a/hw/acpi.h b/hw/acpi.h index e1d5e3b..88f8051 100644 --- a/hw/acpi.h +++ b/hw/acpi.h @@ -133,6 +133,7 @@ static inline int64_t acpi_pm_tmr_get_clock(void) /* PM1a_EVT: piix and ich9 don't implement PM1b. */ uint16_t acpi_pm1_evt_get_sts(ACPIREGS *ar); void acpi_pm1_evt_write_sts(ACPIREGS *ar, uint16_t val); +void acpi_pm1_evt_write_en(ACPIREGS *ar, uint16_t val); void acpi_pm1_evt_power_down(ACPIREGS *ar); void acpi_pm1_evt_reset(ACPIREGS *ar); diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c index b6899f4..9c72e62 100644 --- a/hw/acpi_piix4.c +++ b/hw/acpi_piix4.c @@ -117,7 +117,7 @@ static void pm_ioport_write(IORange *ioport, uint64_t addr, unsigned width, pm_update_sci(s); break; case 0x02: - s->ar.pm1.evt.en = val; + acpi_pm1_evt_write_en(&s->ar, val); pm_update_sci(s); break; case 0x04: diff --git a/hw/vt82c686.c b/hw/vt82c686.c index 10e066b..d8f4e26 100644 --- a/hw/vt82c686.c +++ b/hw/vt82c686.c @@ -206,7 +206,7 @@ static void pm_ioport_writew(void *opaque, uint32_t addr, uint32_t val) pm_update_sci(s); break; case 0x02: - s->ar.pm1.evt.en = val; + acpi_pm1_evt_write_en(&s->ar, val); pm_update_sci(s); break; case 0x04: