From patchwork Fri Jan 5 15:42:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 760201 Delivered-To: patch@linaro.org Received: by 2002:a5d:678d:0:b0:336:6142:bf13 with SMTP id v13csp107644wru; Fri, 5 Jan 2024 07:53:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IH63WgwLf6TMHU6gchgfAR68dGpA++TGVwAXt8YqexBs8qzsjP162uHviX8WZSQ5Q/uysK8 X-Received: by 2002:a05:622a:1105:b0:428:3d8d:38a8 with SMTP id e5-20020a05622a110500b004283d8d38a8mr2440493qty.69.1704470018380; Fri, 05 Jan 2024 07:53:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704470018; cv=none; d=google.com; s=arc-20160816; b=RFToWJsM4N4RLhMSGcICAFPhblE/opkuuGGgka8sBE61ymEwxVgvwQTY2FaNqJiJ6D 3PSyOX03hKtpMeaAdNJPKmV+6bZ5rG/GLxe2FuWZbIPWvnroYUykfACZ7LeGrkASnpP8 CRU5iM4LFppAdP9RptULNvSc868vcIqbd5/rOH1qNvfbdOiFlJX7HsMU8lQnRL8cMcSJ /o6SgRv5oB7vzYC/t1/aEiNVuLWMIr5uWlRF0hnqhanDPOGzPOC7QhYxqh7Oqwk9ve7Z UxDXLE2/ePhxMQBg/DHtmQ3pV5OtiV+bBbjxsCmjKXtqD8G40PfEAXfSF1eZ+kh7L+E6 8XdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=T2dHbEy97kiYKLMLDn2+e8bN6W1pBXRM0uBjrESXiSY=; fh=tROm31tyoJcOlKLqF+Vl530andyBxyZ444yuWCVrtms=; b=r7EIHAxmQSsw5mbpmKKCLPyJRWx/pmo/Fzu1dshcEdMBmlYILraaPYpIJwUbPRNoYD gfizMKj9EIaZaojWXcGyWE9nBuDvGPMLycLM9yJfxrt/UkwHuB876d7rMZp+nGkpszwW q8YDieywvGj65F70bKE7Ujcho0OsW8O0uadhkB3tEgzi8x7MYrG7mXZYsYM5qvNRZ6Mp NHGCi2i7EUHxEIT3hhT5T8621MLFpid3E3JUYk6F8xGDu0jlYhsDjpoPQPLx6hzj2pd4 5ilXQaj5ZT4/Y7iUOLBbssR8SGVvgS38MbEoK/3/M44xKSg0ixr134v6iV1qPOUUwoPv 5sDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZBOGvIPL; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id h6-20020ac85846000000b004297deac925si195284qth.654.2024.01.05.07.53.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Jan 2024 07:53:38 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZBOGvIPL; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rLmMn-0005Ca-NV; Fri, 05 Jan 2024 10:44:13 -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 1rLmMj-0004vc-Vm for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:44:11 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rLmMg-0003Dj-UV for qemu-devel@nongnu.org; Fri, 05 Jan 2024 10:44:09 -0500 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-40d41555f9dso16541075e9.2 for ; Fri, 05 Jan 2024 07:44:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704469444; x=1705074244; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=T2dHbEy97kiYKLMLDn2+e8bN6W1pBXRM0uBjrESXiSY=; b=ZBOGvIPLJTGuTvxZxFQsst4Jj8nIUCkX9RExawr2nM3HtE3xZ54Y1YeQGhRQeHMkTt tgk/zCqcNTK29KZEEOo0VRvQdFC/x8bhdxPiMB3Z1MFrW+UmV3B7FZhYUbn5Ru0Dbz82 dQDXwU7LfDVDdAgD33tZDhmUrrUJTVjA8tgHPQmenjGJ4jeomIi6+NX4Y2OQVks5OjCS LWfLbAkhtElDHngHLq3+HHiNtY805W1LCfGzuCOrO4vNHKvlhQVRwEb5oYdDdWaSzBpT kX0zd5qcjw6SD+/sVNoWURxBTQTqcU8z6Vr+q9n53AOG2Fy5KZhZbAwYhaog2pp5GJrd iB4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704469444; x=1705074244; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=T2dHbEy97kiYKLMLDn2+e8bN6W1pBXRM0uBjrESXiSY=; b=J0JoCWcnKJkqOlFRoguZUGjwj/2Nz7ssk6YMAISm+QIr8nXu32wn8PeylanmhTuC9r Qi2cu/A4VD+Ua62340EhKiXRInzP1wUQ+cY2FiVsrB/J2m6WOWt899zHNKbxTa3aXOtC WmwESIpVCrQexcCrBIYwpzv5FPUFB5f8VFJviMgSvupGXhpwNspZfxLHZszxv0Y516Dq Ic+PJrHWvNtO55h+7FujvIi3tBlwEny+pI0/cCEYG1dO/Lzx5kAoyEltb40HQ5nSylRT /1DFksTIq3fiIb63OKsCVk+wNdiRwFVtxi3WLoOdkBMxUaq6pAE21dQ9mcOlk2bD9V9a nhVQ== X-Gm-Message-State: AOJu0Ywwc4SiQ2Nbk1kV9zNj3rTKZXGs1G/0Voa6KinryXr2Ck8dchU2 dRpR9Gbij61VzOgRL7S2qUM27uJJpxAgalZz4Lo81OaDIo0= X-Received: by 2002:a05:600c:8515:b0:40d:5a9f:2b59 with SMTP id gw21-20020a05600c851500b0040d5a9f2b59mr1265328wmb.41.1704469444712; Fri, 05 Jan 2024 07:44:04 -0800 (PST) Received: from m1x-phil.lan (juv34-h02-176-184-26-1.dsl.sta.abo.bbox.fr. [176.184.26.1]) by smtp.gmail.com with ESMTPSA id f13-20020a05600c4e8d00b0040d887fda00sm1904820wmq.26.2024.01.05.07.44.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 05 Jan 2024 07:44:04 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Gavin Shan , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , "Edgar E. Iglesias" Subject: [PULL 10/71] target/cris: Use generic cpu_list() Date: Fri, 5 Jan 2024 16:42:03 +0100 Message-ID: <20240105154307.21385-11-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240105154307.21385-1-philmd@linaro.org> References: <20240105154307.21385-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.google.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_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Gavin Shan Before it's applied: [gshan@gshan q]$ ./build/qemu-system-cris -cpu ? Available CPUs: crisv8 crisv9 crisv10 crisv11 crisv17 crisv32 After it's applied: [gshan@gshan q]$ ./build/qemu-system-cris -cpu ? Available CPUs: crisv10 crisv11 crisv17 crisv32 crisv8 crisv9 Signed-off-by: Gavin Shan Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20231114235628.534334-11-gshan@redhat.com> Signed-off-by: Philippe Mathieu-Daudé --- target/cris/cpu.h | 3 --- target/cris/cpu.c | 38 -------------------------------------- 2 files changed, 41 deletions(-) diff --git a/target/cris/cpu.h b/target/cris/cpu.h index 1be7f90319..d830dcac5b 100644 --- a/target/cris/cpu.h +++ b/target/cris/cpu.h @@ -287,7 +287,4 @@ static inline void cpu_get_tb_cpu_state(CPUCRISState *env, vaddr *pc, | X_FLAG | PFIX_FLAG)); } -#define cpu_list cris_cpu_list -void cris_cpu_list(void); - #endif diff --git a/target/cris/cpu.c b/target/cris/cpu.c index a5083a0077..9ba08e8b0c 100644 --- a/target/cris/cpu.c +++ b/target/cris/cpu.c @@ -99,44 +99,6 @@ static ObjectClass *cris_cpu_class_by_name(const char *cpu_model) return oc; } -/* Sort alphabetically by VR. */ -static gint cris_cpu_list_compare(gconstpointer a, gconstpointer b) -{ - CRISCPUClass *ccc_a = CRIS_CPU_CLASS(a); - CRISCPUClass *ccc_b = CRIS_CPU_CLASS(b); - - /* */ - if (ccc_a->vr > ccc_b->vr) { - return 1; - } else if (ccc_a->vr < ccc_b->vr) { - return -1; - } else { - return 0; - } -} - -static void cris_cpu_list_entry(gpointer data, gpointer user_data) -{ - ObjectClass *oc = data; - const char *typename = object_class_get_name(oc); - char *name; - - name = g_strndup(typename, strlen(typename) - strlen(CRIS_CPU_TYPE_SUFFIX)); - qemu_printf(" %s\n", name); - g_free(name); -} - -void cris_cpu_list(void) -{ - GSList *list; - - list = object_class_get_list(TYPE_CRIS_CPU, false); - list = g_slist_sort(list, cris_cpu_list_compare); - qemu_printf("Available CPUs:\n"); - g_slist_foreach(list, cris_cpu_list_entry, NULL); - g_slist_free(list); -} - static void cris_cpu_realizefn(DeviceState *dev, Error **errp) { CPUState *cs = CPU(dev);