From nobody Tue Nov 18 04:25:29 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.43 as permitted sender) client-ip=209.85.128.43; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f43.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.43 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1607890900; cv=none; d=zohomail.com; s=zohoarc; b=eD/NL23M/FWuxoHKIR/npTaQXfs1EmgtSKKIPBGEj+E2ebEv7JcFl2y/gansKbvVL2AolmSlfYgUALb1XAqDTHq4vMlVzZNqDqWPcwdjGZX3YZ2FqgwOW82/390bjO4MAfH/x5zV9rTd+0cKC5xJTr27k7k0czMfIBgP3sfLcLw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607890900; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=elw3dkJb0pO4uN20lOWqB+T8hVaJgjod16PJg5LRYBw=; b=h9y8pq9TBfI508xW8jBvGXxJJHeXigKFCx3JpEUOQz9gwriuaHC7s7ispbN/hbrmesZvRYO4x7M11aKcqZEpEc4UJzzjG0uzkWCGcryoUlGNCG+47FXlnrQUe1GWspFEdsqz1ja7VnsIpJzOjE+6CYyrDeg5k7vL395HwDK7qnY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.43 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by mx.zohomail.com with SMTPS id 1607890900418211.07258510820157; Sun, 13 Dec 2020 12:21:40 -0800 (PST) Received: by mail-wm1-f43.google.com with SMTP id k10so11958038wmi.3 for ; Sun, 13 Dec 2020 12:21:39 -0800 (PST) Return-Path: Return-Path: Received: from localhost.localdomain (101.red-88-21-206.staticip.rima-tde.net. [88.21.206.101]) by smtp.gmail.com with ESMTPSA id j7sm26852271wmb.40.2020.12.13.12.21.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Dec 2020 12:21:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=elw3dkJb0pO4uN20lOWqB+T8hVaJgjod16PJg5LRYBw=; b=OakRocpid6FZj3s/PHYLg8MdRlpbGGdPHt0I1Hb3XrhOxXp3/vJv5KwyCgWALrU1gD cy5QiYNzKe4CL63vdsi0D1njoMUzsX59RGAdylbSTMxcaagw3mMevgxeLXuzYfRBFfey 0FiwS7SCZsQxFLdbxVsGsavlw0q/uUP5pSakgEzriGTJ+oyDfEM/5vaeqZSWkRhZ+t2I 6T6kvP20RAGbVNzgqNGKz8SnndsmKOKQI61NyIC7M7aQoqa9B6XIQoTlMV342ZF6GR7k plpVy02/WeD/36qp+tsHL80j8nR85pYGGf71Zx8TtAQGRIJWV5Sn3Hgcu2yw1InrB4zD hyEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=elw3dkJb0pO4uN20lOWqB+T8hVaJgjod16PJg5LRYBw=; b=Qo7ePTFxXDMA1VulS98ublvpcGy4B9/TBG1TqhHjJobefKH8wax2BqyvI7dzbs8k/x lIVYB78TKN1feRcfkBJR8Efl3vgBo80fpcxsOMaHpApcmMpvFNAWFug67C6fgXfcShSs EGNgVup3lGkpoMfyngIxujh/yLC/ps0G/qFUUtBSncUVIWLBzWDYiFEhA1yk9YCukGFD X4Lgy5KStm6/vPg/Dzzp8IzLFAjnMwUbQu1S87niKiLwhlcCLes51iXilmt+MVSjEzij 3UN8WsjszqM+A1M+YFaPz5cr2Pm4NEO+eD4R7FQPnR63m9Xe+MZntp8xZ8j31xU18dJD hBLw== X-Gm-Message-State: AOAM531oEQsiR8hFsQZCZvnw2ik3ul/QexJtLzLUOeL286S1GJu/MwCc U4hUexpih6Yk9Xl8XsDSQQw= X-Google-Smtp-Source: ABdhPJxYfakzKjYyS+h5ikBDwAbUZrCSc5kwJtqdOV5z+575/HCCL+TNCGZORrpxlu3KFPynTy49wg== X-Received: by 2002:a1c:8016:: with SMTP id b22mr24363664wmd.135.1607890898684; Sun, 13 Dec 2020 12:21:38 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Aurelien Jarno , Aleksandar Rikalo , kvm@vger.kernel.org, Jiaxun Yang , Huacai Chen , Paul Burton , Richard Henderson Subject: [PULL 22/26] target/mips: Move mips_cpu_add_definition() from helper.c to cpu.c Date: Sun, 13 Dec 2020 21:19:42 +0100 Message-Id: <20201213201946.236123-23-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201213201946.236123-1-f4bug@amsat.org> References: <20201213201946.236123-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20201206233949.3783184-10-f4bug@amsat.org> --- target/mips/cpu.c | 33 +++++++++++++++++++++++++++++++++ target/mips/helper.c | 33 --------------------------------- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/target/mips/cpu.c b/target/mips/cpu.c index 3024c51a211..c29fef29d00 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -30,6 +30,7 @@ #include "exec/exec-all.h" #include "hw/qdev-properties.h" #include "hw/qdev-clock.h" +#include "qapi/qapi-commands-machine-target.h" =20 static void mips_cpu_set_pc(CPUState *cs, vaddr value) { @@ -299,6 +300,38 @@ static void mips_cpu_register_types(void) =20 type_init(mips_cpu_register_types) =20 +static void mips_cpu_add_definition(gpointer data, gpointer user_data) +{ + ObjectClass *oc =3D data; + CpuDefinitionInfoList **cpu_list =3D user_data; + CpuDefinitionInfoList *entry; + CpuDefinitionInfo *info; + const char *typename; + + typename =3D object_class_get_name(oc); + info =3D g_malloc0(sizeof(*info)); + info->name =3D g_strndup(typename, + strlen(typename) - strlen("-" TYPE_MIPS_CPU)); + info->q_typename =3D g_strdup(typename); + + entry =3D g_malloc0(sizeof(*entry)); + entry->value =3D info; + entry->next =3D *cpu_list; + *cpu_list =3D entry; +} + +CpuDefinitionInfoList *qmp_query_cpu_definitions(Error **errp) +{ + CpuDefinitionInfoList *cpu_list =3D NULL; + GSList *list; + + list =3D object_class_get_list(TYPE_MIPS_CPU, false); + g_slist_foreach(list, mips_cpu_add_definition, &cpu_list); + g_slist_free(list); + + return cpu_list; +} + /* Could be used by generic CPU object */ MIPSCPU *mips_cpu_create_with_clock(const char *cpu_type, Clock *cpu_refcl= k) { diff --git a/target/mips/helper.c b/target/mips/helper.c index 0c657865793..87296fbad69 100644 --- a/target/mips/helper.c +++ b/target/mips/helper.c @@ -24,7 +24,6 @@ #include "exec/cpu_ldst.h" #include "exec/log.h" #include "hw/mips/cpudevs.h" -#include "qapi/qapi-commands-machine-target.h" =20 enum { TLBRET_XI =3D -6, @@ -1500,35 +1499,3 @@ void QEMU_NORETURN do_raise_exception_err(CPUMIPSSta= te *env, =20 cpu_loop_exit_restore(cs, pc); } - -static void mips_cpu_add_definition(gpointer data, gpointer user_data) -{ - ObjectClass *oc =3D data; - CpuDefinitionInfoList **cpu_list =3D user_data; - CpuDefinitionInfoList *entry; - CpuDefinitionInfo *info; - const char *typename; - - typename =3D object_class_get_name(oc); - info =3D g_malloc0(sizeof(*info)); - info->name =3D g_strndup(typename, - strlen(typename) - strlen("-" TYPE_MIPS_CPU)); - info->q_typename =3D g_strdup(typename); - - entry =3D g_malloc0(sizeof(*entry)); - entry->value =3D info; - entry->next =3D *cpu_list; - *cpu_list =3D entry; -} - -CpuDefinitionInfoList *qmp_query_cpu_definitions(Error **errp) -{ - CpuDefinitionInfoList *cpu_list =3D NULL; - GSList *list; - - list =3D object_class_get_list(TYPE_MIPS_CPU, false); - g_slist_foreach(list, mips_cpu_add_definition, &cpu_list); - g_slist_free(list); - - return cpu_list; -} --=20 2.26.2