From nobody Mon Feb 9 09:16:20 2026 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; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559928903; cv=none; d=zoho.com; s=zohoarc; b=Xokncm+9p+kCy/vNWte7alc9Bjv4pR++uGMFcQrT2D5Q4dB9lLfoLWr/7VOOy0hOHuQfCx16e1TsbkZzJF6JF8V80AznuyoZ+f9BCHxK1AVTmQCaSY250dku7lb1oAE0RwEMHl081GTl/BxN87XUAlo+gJ03gf+4ajBtbOR+TcU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559928903; h=Content-Type:Content-Transfer-Encoding:Cc: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:ARC-Authentication-Results; bh=uXA0BgE04bwbxtxAOVCqf33B5HxeQcYrGda8MKaYYe8=; b=NoJukI4fzGtSTXEbzgvdOfTbiCZZ9MHh4MSPhfuzoYwDpAMv9KrGBs7ulEI35omJvzhCpJ2bNxMpR5Y0dzOCPEeO7o1Pi3PHMXN1hximJQf7mUyZ6MLZ8TgjW5ewjiqqOocGoclcoQc9UTN89R5nGOmM/W0Phu8q8CWtAFklSx0= ARC-Authentication-Results: i=1; mx.zoho.com; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1559928903735891.4492691279165; Fri, 7 Jun 2019 10:35:03 -0700 (PDT) Received: from localhost ([::1]:49836 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZIlU-0007Fd-Br for importer@patchew.org; Fri, 07 Jun 2019 13:34:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53686) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZH00-0003i0-43 for qemu-devel@nongnu.org; Fri, 07 Jun 2019 11:41:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hZGwT-0000xp-C6 for qemu-devel@nongnu.org; Fri, 07 Jun 2019 11:38:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47526) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hZGwS-0000qQ-Vg for qemu-devel@nongnu.org; Fri, 07 Jun 2019 11:38:09 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6FB83308427E; Fri, 7 Jun 2019 15:37:56 +0000 (UTC) Received: from x1w.redhat.com (unknown [10.40.205.135]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AF3E7383F; Fri, 7 Jun 2019 15:37:53 +0000 (UTC) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Yoshinori Sato , qemu-devel@nongnu.org, Igor Mammedov , Richard Henderson Date: Fri, 7 Jun 2019 17:37:01 +0200 Message-Id: <20190607153725.18055-6-philmd@redhat.com> In-Reply-To: <20190607153725.18055-1-philmd@redhat.com> References: <20190607153725.18055-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Fri, 07 Jun 2019 15:38:00 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v18 05/29] !fixup target/rx: CPU definition 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: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" New qom-cpu style requested by Igor. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/rx/cpu.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/target/rx/cpu.c b/target/rx/cpu.c index 3c43467534..c370f65faa 100644 --- a/target/rx/cpu.c +++ b/target/rx/cpu.c @@ -80,7 +80,7 @@ static void rx_cpu_list_entry(gpointer data, gpointer use= r_data) void rx_cpu_list(void) { GSList *list; - list =3D object_class_get_list_sorted(TYPE_RXCPU, false); + list =3D object_class_get_list_sorted(TYPE_RX_CPU, false); g_slist_foreach(list, rx_cpu_list_entry, NULL); g_slist_free(list); } @@ -88,15 +88,26 @@ void rx_cpu_list(void) static ObjectClass *rx_cpu_class_by_name(const char *cpu_model) { ObjectClass *oc; - char *typename =3D NULL; + char *typename; =20 - typename =3D g_strdup_printf(RX_CPU_TYPE_NAME("")); + oc =3D object_class_by_name(cpu_model); + if (oc !=3D NULL && object_class_dynamic_cast(oc, TYPE_RX_CPU) !=3D NU= LL && + !object_class_is_abstract(oc)) { + return oc; + } + + typename =3D g_strdup_printf(RX_CPU_TYPE_NAME("%s"), cpu_model); oc =3D object_class_by_name(typename); if (oc !=3D NULL && object_class_is_abstract(oc)) { oc =3D NULL; } - g_free(typename); + + if (!oc) { + /* default to rx62n */ + oc =3D object_class_by_name(RX_CPU_TYPE_NAME("rx62n")); + } + return oc; } =20 --=20 2.20.1