From nobody Sat Apr 5 01:14:27 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.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=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1739585860; cv=none; d=zohomail.com; s=zohoarc; b=c5qrLjuEgqYXj9Zz4po77ilexmRsrnPzchJnABr4if3Jd6mQCbcgDCLvFHlBcmdoj6S+BaNXNj4VOa28Teh2RYG2qD5ryn/TfGqy0jkHxP0vySqz1Q18a6AvB8K9yjqE2Mi6mxH1UUHq5BccR5UpFiZ5sOYuru9FR3gHW8Hhy7c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1739585860; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=wQafwBUzDgpLby35XfQTEihG+Kbfp3eilEizbHp1M4c=; b=KBklosEN6dX9Ktc9Y/g8vYDU5g2XSo8HDoHcR7OjNUjll3P0G1efvkxHcoR2v9EhXsnv9YxLc1pIMZYHLt+lCb3eg7UjKmuaDDpyS00MmFCFrPZCCrl1pLvQkWUqaxDZ1LAKS5eo3fCS0O0bkDkr8ViskcumyNcGdkBvOP4ANOM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.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) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1739585860410244.44547097688178; Fri, 14 Feb 2025 18:17:40 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tj7jz-0004F1-Iw; Fri, 14 Feb 2025 21:17:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tj7jy-0004Er-6i for qemu-devel@nongnu.org; Fri, 14 Feb 2025 21:17:10 -0500 Received: from home.keithp.com ([63.227.221.253] helo=elaine.keithp.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tj7jw-0006dF-Fk for qemu-devel@nongnu.org; Fri, 14 Feb 2025 21:17:09 -0500 Received: from localhost (localhost [127.0.0.1]) by elaine.keithp.com (Postfix) with ESMTP id 89D1C3F22BE0 for ; Fri, 14 Feb 2025 18:17:04 -0800 (PST) Received: from elaine.keithp.com ([127.0.0.1]) by localhost (elaine.keithp.com [127.0.0.1]) (amavis, port 10024) with LMTP id mhTFRvRwtR3H; Fri, 14 Feb 2025 18:17:03 -0800 (PST) Received: from keithp.com (koto.keithp.com [192.168.11.2]) by elaine.keithp.com (Postfix) with ESMTPSA id 857D33F2294E; Fri, 14 Feb 2025 18:17:02 -0800 (PST) Received: by keithp.com (Postfix, from userid 1000) id 5B5811E6009E; Fri, 14 Feb 2025 18:17:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=keithp.com; s=mail; t=1739585824; bh=w/8IuRHPVdUTbyl/MhQywFst50Ay9Yr9V+RwhgAhxLY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B7XDEs0iIAh+SmUnqqVGDBITNEdxdy8Z+23jybGm/dHySe1MnWPWhzil6R31+gOWl t6SZ+PJpl0fskAnbDPacD7oyXqrhUrsZh/00HhJM2w1m6BrU/FwfGrJbH0gVv+qEHO FtyZEdNOepmp2qGfVdozHdNdn8g/Bt6XS/5mAN2ZMi3/z08EtR0RQVJfcWnvezWF9D r+JvgLviJbx9RBtnbMoFp3gLxI04b8DjmaTm1+FkJ8XQgBI+1vMjnJsQ1TFX4QQvk/ R/MtOk6ZCgRsaS6ncoEDekbUO7duLFl0hNKFuv1Az0ODXDpZ88z8EuZmDRMFLq0of5 q5o2AYIwguo4w== X-Virus-Scanned: Debian amavis at keithp.com DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=keithp.com; s=mail; t=1739585822; bh=w/8IuRHPVdUTbyl/MhQywFst50Ay9Yr9V+RwhgAhxLY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VkFGz2UuBDy3UBL0VkJFsmMgspTF3ZxLf/XVorY5Z+C6vCQhvKJ/6ziDaOUSx97lJ nP1rJwUPnmUeoAgPeFYROP9rhgugztkeqYolNle6k/38ueFj6ZL4r7xbHxzGHQ3WUI ZH6APIUf2ib+/b2GnIhKSokMRmVVePAt/SjfBEUs/1Ym9LETXSUYNQDJIpuE0l7SbP 7Icp6gT65ie4WRs23YCjWG6PR1hNBI3Vc8gyht1WqOXeaHqbgbcc3LTEV7CYaH4CFQ cc8EqYyvRgI42mv7zbZQZecnPb6ZOaUrNmVgewlJ/dMx60naMMxa7osWaTmKIuJidc koP0hxawri2Pw== To: qemu-devel@nongnu.org Cc: Keith Packard Subject: [PATCH 3/5] target/rx: Reset the CPU at qemu reset time Date: Fri, 14 Feb 2025 18:16:52 -0800 Message-ID: <20250215021654.1786679-4-keithp@keithp.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250215021654.1786679-1-keithp@keithp.com> References: <20250215021654.1786679-1-keithp@keithp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=63.227.221.253; envelope-from=keithp@keithp.com; helo=elaine.keithp.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Keith Packard From: Keith Packard via Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (found 2 invalid signatures) X-ZM-MESSAGEID: 1739585863039019000 Content-Type: text/plain; charset="utf-8" This ensure that the CPU gets reset every time QEMU resets. Signed-off-by: Keith Packard --- target/rx/cpu.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/target/rx/cpu.c b/target/rx/cpu.c index 37a6fdd569..04dd34b310 100644 --- a/target/rx/cpu.c +++ b/target/rx/cpu.c @@ -27,6 +27,7 @@ #include "hw/loader.h" #include "fpu/softfloat.h" #include "tcg/debug-assert.h" +#include "system/reset.h" =20 static void rx_cpu_set_pc(CPUState *cs, vaddr value) { @@ -129,6 +130,13 @@ static ObjectClass *rx_cpu_class_by_name(const char *c= pu_model) return oc; } =20 +static void rx_cpu_reset(void *opaque) +{ + RXCPU *cpu =3D opaque; + + cpu_reset(CPU(cpu)); +} + static void rx_cpu_realize(DeviceState *dev, Error **errp) { CPUState *cs =3D CPU(dev); @@ -142,9 +150,10 @@ static void rx_cpu_realize(DeviceState *dev, Error **e= rrp) } =20 qemu_init_vcpu(cs); - cpu_reset(cs); =20 rcc->parent_realize(dev, errp); + + qemu_register_reset(rx_cpu_reset, RX_CPU(cs)); } =20 static void rx_cpu_set_irq(void *opaque, int no, int request) --=20 2.47.2