From nobody Thu Dec 18 19:38:37 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1571751835; cv=none; d=zoho.com; s=zohoarc; b=Gt7AVJehMaC9DyZYi3urH2XfbzWjrhNlwcjVDLbk1CA8Cp1IYPMhw6J8atIr5cYq4/ZbTgSZptGjuqqtm0wzwqOjrK4bMsNlNt0MH+HJyicqVUWIjYVAmn+8M0CyeZ3vsNDjdTkNiG+Wyfi/hEAdKG114NdOGxi5u6JTl1ozMj4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571751835; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Fwd2iBNusbM/OQvc1QbvND2II8QsKKZ6PUURuQhaBB0=; b=Cx+IlCTiOPO354mokVy3VDbo7MDwkIsUG/k7BixMj3zv/5jITGfUVTHfXRt8PdvXLPOPO5AMbbnK/oE6DJ6eFnWRbLnDS2BLFwUK2Hlomgh6QEaT8AcZmOwTGvc27ThGe56UVXQzEIWIE4VqYJuF1MBkYYasyE/P+baIBQW1rdg= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1571751835013446.0402782797289; Tue, 22 Oct 2019 06:43:55 -0700 (PDT) Received: from localhost ([::1]:57570 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMuRz-0007vo-8G for importer@patchew.org; Tue, 22 Oct 2019 09:43:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36706) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMuGd-0002Tu-8c for qemu-devel@nongnu.org; Tue, 22 Oct 2019 09:32:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMuGb-0001FE-Ul for qemu-devel@nongnu.org; Tue, 22 Oct 2019 09:32:07 -0400 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:35168) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iMuGb-0001F1-OV for qemu-devel@nongnu.org; Tue, 22 Oct 2019 09:32:05 -0400 Received: by mail-wm1-x341.google.com with SMTP id v9so266503wml.0 for ; Tue, 22 Oct 2019 06:32:05 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id r2sm20263856wma.1.2019.10.22.06.32.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Oct 2019 06:32:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=Fwd2iBNusbM/OQvc1QbvND2II8QsKKZ6PUURuQhaBB0=; b=XHjSRSNbhRJY+4m6I3uwOrSX8IB4HQ+2R9Jwy5wfDz0Bk/vkpAAsW+RqC1KoFspqRC vt/PEbSbenMjJcKttgn/DYhdsMhIP4Gw2KYZxnCRaNgc8B8vaAY9Bbx/lZJ0cCPz48Mh gLLTuo7EIxwpVFkVu/6XhuflpMPjdx3EaYdlMvrDiBM4PleiXQMt17z99gnCZ5LdGTea 2wR8kARrS8zA3vwwbYd/cToTGZDEiNPiWuIOP9lLX+Fldq9dIWoT5GDmI/Fm1hwkBjVy AY9EuEXsqlWxOA1MEPWxQUsd5W4IL/KQIy+tr7UQbukk8x4CG058l/DBbe8vm7Z0VP2z j0SQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Fwd2iBNusbM/OQvc1QbvND2II8QsKKZ6PUURuQhaBB0=; b=dw2CSy2VLfDwwn+eSjGByMd3ZVx8BixjH5dYpfetCSEDen8Z4SW4/8i7lbZMqXWNSH 9k7RyXXWxyGBSHoIPaxOzGkDG3YJM3UtB4gxmcFckI6PRAIztfhCE3WeFPdhElmPvm9B 5EPNhuM6x4KmrAwRQFeom5+HQ+0Pz2/luh1LXQBmZ3vPv3Yl8lL9crfScL8Rc3RL6a8n owI6icJqqhgdF5GRNKXfPeaf40eX7pQbrUOridd7zSCtIegh3bhsfLQFhBtAUunLAhLx kUXL09AEdqb0Yjj5AwBpIlbwdNUzdQ+X/a9PcKIgwkw90JnubpYFS4IjVLppMWEomian eOjg== X-Gm-Message-State: APjAAAXzMlQlNYVZm5NgXNQmN7bwKMaIYxJFwFgNftV0WSQWiNutzDV4 LVKvn8JRELJXJ0cTmQX+zTGtbGv4Jso= X-Google-Smtp-Source: APXvYqxbXJBy8Wjay+8PGErsvjRy4TJe+lrg8zf4fhvP5Iu6/X8bT88nKdtsnep65UZ40mAxLkNYPg== X-Received: by 2002:a1c:7d95:: with SMTP id y143mr3197804wmc.143.1571751124203; Tue, 22 Oct 2019 06:32:04 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 10/41] hw/m68k/mcf5208.c: Switch to transaction-based ptimer API Date: Tue, 22 Oct 2019 14:31:03 +0100 Message-Id: <20191022133134.14487-11-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191022133134.14487-1-peter.maydell@linaro.org> References: <20191022133134.14487-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::341 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Switch the mcf5208 code away from bottom-half based ptimers to the new transaction-based ptimer API. This just requires adding begin/commit calls around the various places that modify the ptimer state, and using the new ptimer_init() function to create the timer. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Thomas Huth Message-id: 20191017132905.5604-9-peter.maydell@linaro.org --- hw/m68k/mcf5208.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hw/m68k/mcf5208.c b/hw/m68k/mcf5208.c index 34d34eba17c..158c5e4be75 100644 --- a/hw/m68k/mcf5208.c +++ b/hw/m68k/mcf5208.c @@ -9,7 +9,6 @@ #include "qemu/osdep.h" #include "qemu/units.h" #include "qemu/error-report.h" -#include "qemu/main-loop.h" #include "qapi/error.h" #include "qemu-common.h" #include "cpu.h" @@ -79,6 +78,7 @@ static void m5208_timer_write(void *opaque, hwaddr offset, return; } =20 + ptimer_transaction_begin(s->timer); if (s->pcsr & PCSR_EN) ptimer_stop(s->timer); =20 @@ -94,8 +94,10 @@ static void m5208_timer_write(void *opaque, hwaddr offse= t, =20 if (s->pcsr & PCSR_EN) ptimer_run(s->timer, 0); + ptimer_transaction_commit(s->timer); break; case 2: + ptimer_transaction_begin(s->timer); s->pmr =3D value; s->pcsr &=3D ~PCSR_PIF; if ((s->pcsr & PCSR_RLD) =3D=3D 0) { @@ -104,6 +106,7 @@ static void m5208_timer_write(void *opaque, hwaddr offs= et, } else { ptimer_set_limit(s->timer, value, s->pcsr & PCSR_OVW); } + ptimer_transaction_commit(s->timer); break; case 4: break; @@ -182,7 +185,6 @@ static void mcf5208_sys_init(MemoryRegion *address_spac= e, qemu_irq *pic) { MemoryRegion *iomem =3D g_new(MemoryRegion, 1); m5208_timer_state *s; - QEMUBH *bh; int i; =20 /* SDRAMC. */ @@ -191,8 +193,7 @@ static void mcf5208_sys_init(MemoryRegion *address_spac= e, qemu_irq *pic) /* Timers. */ for (i =3D 0; i < 2; i++) { s =3D g_new0(m5208_timer_state, 1); - bh =3D qemu_bh_new(m5208_timer_trigger, s); - s->timer =3D ptimer_init_with_bh(bh, PTIMER_POLICY_DEFAULT); + s->timer =3D ptimer_init(m5208_timer_trigger, s, PTIMER_POLICY_DEF= AULT); memory_region_init_io(&s->iomem, NULL, &m5208_timer_ops, s, "m5208-timer", 0x00004000); memory_region_add_subregion(address_space, 0xfc080000 + 0x4000 * i, --=20 2.20.1