From nobody Sat Oct 25 09:03:08 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1520309919435612.8452017716573; Mon, 5 Mar 2018 20:18:39 -0800 (PST) Received: from localhost ([::1]:52857 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1et43i-0007kV-H8 for importer@patchew.org; Mon, 05 Mar 2018 23:18:38 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49360) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1et3nu-0001TB-IU for qemu-devel@nongnu.org; Mon, 05 Mar 2018 23:02:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1et3nt-0004Sl-0F for qemu-devel@nongnu.org; Mon, 05 Mar 2018 23:02:18 -0500 Received: from ozlabs.org ([2401:3900:2:1::2]:51997) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1et3ns-0004Os-K6; Mon, 05 Mar 2018 23:02:16 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 3zwNQ3727Rz9shQ; Tue, 6 Mar 2018 15:02:02 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1520308923; bh=YAYQEiGnDins75RQ39NBGHr6Idapm0zQtOsLRkcyC90=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RHbFC3afmZTrY41FwA0i5QFLF0sQIP3NI8w/uY7MBzQJnjivmK4OcOc5NPXpfLAdO 52t/3ruDub6AHgnGiN0mgCdV1AItvTxOhUKQ294SQ6DGftsJKnOvkvYdXw6D7xe6kV ufDAHR/rsN4ZyyYmQYp6urKFarKcSkBiHL9NBL34= From: David Gibson To: peter.maydell@linaro.org, groug@kaod.org Date: Tue, 6 Mar 2018 15:01:36 +1100 Message-Id: <20180306040154.3669-13-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180306040154.3669-1-david@gibson.dropbear.id.au> References: <20180306040154.3669-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 12/30] heathrow: convert to trace-events X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: surajjs@au1.ibm.com, Mark Cave-Ayland , qemu-devel@nongnu.org, agraf@suse.de, qemu-ppc@nongnu.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Mark Cave-Ayland Signed-off-by: Mark Cave-Ayland Signed-off-by: David Gibson --- hw/intc/heathrow_pic.c | 32 +++++++++++--------------------- hw/intc/trace-events | 5 +++++ 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/hw/intc/heathrow_pic.c b/hw/intc/heathrow_pic.c index 7bf44e0d86..5fd2b33a12 100644 --- a/hw/intc/heathrow_pic.c +++ b/hw/intc/heathrow_pic.c @@ -26,16 +26,7 @@ #include "hw/hw.h" #include "hw/ppc/mac.h" #include "hw/intc/heathrow_pic.h" - -/* debug PIC */ -//#define DEBUG_PIC - -#ifdef DEBUG_PIC -#define PIC_DPRINTF(fmt, ...) \ - do { printf("PIC: " fmt , ## __VA_ARGS__); } while (0) -#else -#define PIC_DPRINTF(fmt, ...) -#endif +#include "trace.h" =20 static inline int heathrow_check_irq(HeathrowPICState *pic) { @@ -61,7 +52,7 @@ static void heathrow_write(void *opaque, hwaddr addr, unsigned int n; =20 n =3D ((addr & 0xfff) - 0x10) >> 4; - PIC_DPRINTF("writel: " TARGET_FMT_plx " %u: %08x\n", addr, n, value); + trace_heathrow_write(addr, n, value); if (n >=3D 2) return; pic =3D &s->pics[n]; @@ -109,7 +100,7 @@ static uint64_t heathrow_read(void *opaque, hwaddr addr, break; } } - PIC_DPRINTF("readl: " TARGET_FMT_plx " %u: %08x\n", addr, n, value); + trace_heathrow_read(addr, n, value); return value; } =20 @@ -124,24 +115,23 @@ static void heathrow_set_irq(void *opaque, int num, i= nt level) HeathrowState *s =3D opaque; HeathrowPICState *pic; unsigned int irq_bit; + int last_level; =20 -#if defined(DEBUG) - { - static int last_level[64]; - if (last_level[num] !=3D level) { - PIC_DPRINTF("set_irq: num=3D0x%02x level=3D%d\n", num, level); - last_level[num] =3D level; - } - } -#endif pic =3D &s->pics[1 - (num >> 5)]; irq_bit =3D 1 << (num & 0x1f); + last_level =3D (pic->levels & irq_bit) ? 1 : 0; + if (level) { pic->events |=3D irq_bit & ~pic->level_triggered; pic->levels |=3D irq_bit; } else { pic->levels &=3D ~irq_bit; } + + if (last_level !=3D level) { + trace_heathrow_set_irq(num, level); + } + heathrow_update_irq(s); } =20 diff --git a/hw/intc/trace-events b/hw/intc/trace-events index 4092d2825e..55e8c2570c 100644 --- a/hw/intc/trace-events +++ b/hw/intc/trace-events @@ -186,3 +186,8 @@ nvic_complete_irq(int irq, bool secure) "NVIC complete = IRQ %d (secure %d)" nvic_set_irq_level(int irq, int level) "NVIC external irq %d level set to = %d" nvic_sysreg_read(uint64_t addr, uint32_t value, unsigned size) "NVIC sysre= g read addr 0x%" PRIx64 " data 0x%" PRIx32 " size %u" nvic_sysreg_write(uint64_t addr, uint32_t value, unsigned size) "NVIC sysr= eg write addr 0x%" PRIx64 " data 0x%" PRIx32 " size %u" + +# hw/intc/heathrow_pic.c +heathrow_write(uint64_t addr, unsigned int n, uint64_t value) "0x%"PRIx64"= %u: 0x%"PRIx64 +heathrow_read(uint64_t addr, unsigned int n, uint64_t value) "0x%"PRIx64" = %u: 0x%"PRIx64 +heathrow_set_irq(int num, int level) "set_irq: num=3D0x%02x level=3D%d" --=20 2.14.3