From patchwork Thu Feb 23 12:45:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 142622 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 BE35DB6ED0 for ; Fri, 24 Feb 2012 00:42:26 +1100 (EST) Received: from localhost ([::1]:56629 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0Y48-00046r-8r for incoming@patchwork.ozlabs.org; Thu, 23 Feb 2012 07:46:32 -0500 Received: from eggs.gnu.org ([140.186.70.92]:60276) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0Y3I-0001gk-GD for qemu-devel@nongnu.org; Thu, 23 Feb 2012 07:45:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S0Y3A-0000sD-Hb for qemu-devel@nongnu.org; Thu, 23 Feb 2012 07:45:40 -0500 Received: from mx1.redhat.com ([209.132.183.28]:31391) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0Y3A-0000rx-8u for qemu-devel@nongnu.org; Thu, 23 Feb 2012 07:45:32 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q1NCjVvD020892 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 23 Feb 2012 07:45:31 -0500 Received: from rincewind.home.kraxel.org (ovpn-116-35.ams2.redhat.com [10.36.116.35]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q1NCjShu014343; Thu, 23 Feb 2012 07:45:29 -0500 Received: by rincewind.home.kraxel.org (Postfix, from userid 500) id AED5841F1D; Thu, 23 Feb 2012 13:45:27 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Thu, 23 Feb 2012 13:45:17 +0100 Message-Id: <1330001126-20564-4-git-send-email-kraxel@redhat.com> In-Reply-To: <1330001126-20564-1-git-send-email-kraxel@redhat.com> References: <1330001126-20564-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 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 v6 03/12] acpi: don't pass overflow_time to acpi_pm1_evt_get_sts 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 Pretty pointless, can easily be reached via ACPIREGS now. Signed-off-by: Gerd Hoffmann --- hw/acpi.c | 6 +++--- hw/acpi.h | 2 +- hw/acpi_piix4.c | 4 ++-- hw/vt82c686.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/hw/acpi.c b/hw/acpi.c index 1922e53..1129335 100644 --- a/hw/acpi.c +++ b/hw/acpi.c @@ -249,10 +249,10 @@ int acpi_table_add(const char *t) } /* ACPI PM1a EVT */ -uint16_t acpi_pm1_evt_get_sts(ACPIREGS *ar, int64_t overflow_time) +uint16_t acpi_pm1_evt_get_sts(ACPIREGS *ar) { int64_t d = acpi_pm_tmr_get_clock(); - if (d >= overflow_time) { + if (d >= ar->tmr.overflow_time) { ar->pm1.evt.sts |= ACPI_BITMASK_TIMER_STATUS; } return ar->pm1.evt.sts; @@ -260,7 +260,7 @@ uint16_t acpi_pm1_evt_get_sts(ACPIREGS *ar, int64_t overflow_time) void acpi_pm1_evt_write_sts(ACPIREGS *ar, uint16_t val) { - uint16_t pm1_sts = acpi_pm1_evt_get_sts(ar, ar->tmr.overflow_time); + uint16_t pm1_sts = acpi_pm1_evt_get_sts(ar); if (pm1_sts & val & ACPI_BITMASK_TIMER_STATUS) { /* if TMRSTS is reset, then compute the new overflow time */ acpi_pm_tmr_calc_overflow_time(ar); diff --git a/hw/acpi.h b/hw/acpi.h index 530c86a..e1d5e3b 100644 --- a/hw/acpi.h +++ b/hw/acpi.h @@ -131,7 +131,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, int64_t overflow_time); +uint16_t acpi_pm1_evt_get_sts(ACPIREGS *ar); void acpi_pm1_evt_write_sts(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 68d5eab..5b16d20 100644 --- a/hw/acpi_piix4.c +++ b/hw/acpi_piix4.c @@ -80,7 +80,7 @@ static void pm_update_sci(PIIX4PMState *s) { int sci_level, pmsts; - pmsts = acpi_pm1_evt_get_sts(&s->ar, s->ar.tmr.overflow_time); + pmsts = acpi_pm1_evt_get_sts(&s->ar); sci_level = (((pmsts & s->ar.pm1.evt.en) & (ACPI_BITMASK_RT_CLOCK_ENABLE | ACPI_BITMASK_POWER_BUTTON_ENABLE | @@ -138,7 +138,7 @@ static void pm_ioport_read(IORange *ioport, uint64_t addr, unsigned width, switch(addr) { case 0x00: - val = acpi_pm1_evt_get_sts(&s->ar, s->ar.tmr.overflow_time); + val = acpi_pm1_evt_get_sts(&s->ar); break; case 0x02: val = s->ar.pm1.evt.en; diff --git a/hw/vt82c686.c b/hw/vt82c686.c index c659283..1b083de 100644 --- a/hw/vt82c686.c +++ b/hw/vt82c686.c @@ -177,7 +177,7 @@ static void pm_update_sci(VT686PMState *s) { int sci_level, pmsts; - pmsts = acpi_pm1_evt_get_sts(&s->ar, s->ar.tmr.overflow_time); + pmsts = acpi_pm1_evt_get_sts(&s->ar); sci_level = (((pmsts & s->ar.pm1.evt.en) & (ACPI_BITMASK_RT_CLOCK_ENABLE | ACPI_BITMASK_POWER_BUTTON_ENABLE | @@ -226,7 +226,7 @@ static uint32_t pm_ioport_readw(void *opaque, uint32_t addr) addr &= 0x0f; switch (addr) { case 0x00: - val = acpi_pm1_evt_get_sts(&s->ar, s->ar.tmr.overflow_time); + val = acpi_pm1_evt_get_sts(&s->ar); break; case 0x02: val = s->ar.pm1.evt.en;