From patchwork Wed Oct 18 21:50:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 735110 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp1226579wro; Wed, 18 Oct 2023 15:00:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG7lUeu8saR/8i2CcyIU5dU1qmytFEhxcBRcvYdiT1KMB6GZb59vttg8DbG9Dme1FIrfvbv X-Received: by 2002:ac8:5cce:0:b0:412:c2a:eaef with SMTP id s14-20020ac85cce000000b004120c2aeaefmr554667qta.11.1697666426264; Wed, 18 Oct 2023 15:00:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697666426; cv=none; d=google.com; s=arc-20160816; b=ZAjIvWZ2+IeE7JFOuXU2giZPV1QCNp+oECtuGZ5BAbD2OtcYHSck/flTzg7ZVmAayo VnZXurJkciyjLWG5Pfym5gamfDbUrTFwD7YxZvZvvi3OvSCSCAvndBmCQmf1oralR1Tx hf/jTe8A+qwa5rv1jOA6H//A2b+V9irFpl/EdwiDrHC4guZXro7o3AxLvWvC4H8t+AwD m3CbNAI+e6AKPqCRyw9BrFlFQq1Y1sQGGgn5TpOXN3Jah5IDt/y3R2k23DHN6SIx2Y7z kUhNukPPeU0jnGn3niYhBtC9O54jk6cfQil4BZ9Vra6k0PN7AtGmk6Qsng1FvLvPXYbC 7cCA== 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=LHeZQ0Lg4r7zm7nc2BLDD9ln4Dja/Hc81cMiyiTh6zw=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=IO+88R+QOmB2DUEHXAH7rQ1gupUIaM9F3r+fVzpefk4sOmc/RQs4w1eURu424C5QXh RHxk19chJREG3HR48Z56nXuvur9pwAuihbzryCsM01OfXoPo9k5T/dbL/PUsq2tVWPTR 2V0b6/SEdmeFWv5Z0zmpbPLzwkj/H1CDiPtjhpY4O0ePFgX+sGcjCwUUEnpYM/gOTrep nPOaZuxYVKC/kjMpVgya7mVUiERpM0fsRzB/2MUSthkU/mExTI7aOOzf4VDLZog0qJgc BmVF4sQz2CdzMQValPBdmHk16/JWzoN+OqelDIRGpMAKCFHC/in18FQemOOlqp4DheFP 4Ujg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AhUp6N7k; 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 a4-20020ac85b84000000b0041808244656si594066qta.313.2023.10.18.15.00.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Oct 2023 15:00:26 -0700 (PDT) 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=AhUp6N7k; 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 1qtESa-0001a9-UG; Wed, 18 Oct 2023 17:52:13 -0400 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 1qtESF-000172-VA for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:52 -0400 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtESE-0004Ox-AI for qemu-devel@nongnu.org; Wed, 18 Oct 2023 17:51:51 -0400 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-6b497c8575aso5392605b3a.1 for ; Wed, 18 Oct 2023 14:51:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697665908; x=1698270708; 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=LHeZQ0Lg4r7zm7nc2BLDD9ln4Dja/Hc81cMiyiTh6zw=; b=AhUp6N7kuWu2/psqdAuyMZUv40+lHb/uAkK8tVvF6wqkIaQnaXVrb9JzrC+lUFHtIk INiUrquQM64Szykrl8Exj8Gf3N6WfddGgv3lizC0om/yXtOAFz+ENJcQOWM3AouNOXP8 vsDkVG93DZLq40m5KuiFmpxPigznWT0hndPJi5xrpAjCZmztViyNKCwPJjNoeyAOct8/ agSYvyeySjWFY+2xChzAqDLP5peIMv3iFlCIofQmF0zX/hyv2jDS6xbFFnAckEtjbxyN 5IC0CJKJHU0UCOpRXyJD7wfyNAQc6/hlIBIIjPBHm6quUuImJc109GeHGsG0aB7lzH1p b4og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697665908; x=1698270708; 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=LHeZQ0Lg4r7zm7nc2BLDD9ln4Dja/Hc81cMiyiTh6zw=; b=J4r0W8bYg1p/KP2L7l1SewdgcxmMzxbGtx8+AlkyuK+DMCNLGgoppxy6FJ5KlmRCqI zY6NMAYj/S/ZQhyNs4ML8AIXsW5J4PZ8VrvVtjTq5uA8ZALs/JIeHQavqo7JZkxUvpqp 1v/XdGYP7CZAEmqRdVM+lYBguZTCwmlJ+v0AaJaZYsqUDmXQRzLc68B4/2Q7TU0DqN2G 6l4ZbgoGbQ5JVButuXtqvGHYVjZ/qOR8BzKzaiFPo6OgAm6psVbkopZFbTcsZM0yaQ/e Yj0S+YqUW1/5FHYqzyeGGRDW9Pg4jSm4bOWmCF7oFFtHpfP3k44sWnyn97g2h7D+AD38 TpJQ== X-Gm-Message-State: AOJu0YzyLs7++w25+3fSCLCeI+vplC9e1S6BGPCWhiMBEw1BUvjAAjW1 F56GU441mR/BHpDIHsac+T9cG4/IUgPTFtJ5AKw= X-Received: by 2002:a05:6a21:7741:b0:133:d17d:193a with SMTP id bc1-20020a056a21774100b00133d17d193amr382198pzc.59.1697665908207; Wed, 18 Oct 2023 14:51:48 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id w17-20020a63f511000000b005b61a024ec7sm2176380pgh.74.2023.10.18.14.51.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:51:47 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH 14/61] target/hppa: Implement cpu_list Date: Wed, 18 Oct 2023 14:50:48 -0700 Message-Id: <20231018215135.1561375-15-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018215135.1561375-1-richard.henderson@linaro.org> References: <20231018215135.1561375-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42d; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42d.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 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Richard Henderson --- target/hppa/cpu.h | 5 +++++ target/hppa/cpu.c | 24 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index 22690e351d..30010858a9 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -365,4 +365,9 @@ int hppa_artype_for_page(CPUHPPAState *env, target_ulong vaddr); #endif G_NORETURN void hppa_dynamic_excp(CPUHPPAState *env, int excp, uintptr_t ra); +#define CPU_RESOLVING_TYPE TYPE_HPPA_CPU + +#define cpu_list hppa_cpu_list +void hppa_cpu_list(void); + #endif /* HPPA_CPU_H */ diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 41abdb04d0..1975aa9621 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -162,6 +162,30 @@ static ObjectClass *hppa_cpu_class_by_name(const char *cpu_model) return object_class_by_name(TYPE_HPPA_CPU); } +static void hppa_cpu_list_entry(gpointer data, gpointer user_data) +{ + ObjectClass *oc = data; + CPUClass *cc = CPU_CLASS(oc); + const char *tname = object_class_get_name(oc); + g_autofree char *name = g_strndup(tname, strchr(tname, '-') - tname); + + if (cc->deprecation_note) { + qemu_printf(" %s (deprecated)\n", name); + } else { + qemu_printf(" %s\n", name); + } +} + +void hppa_cpu_list(void) +{ + GSList *list; + + list = object_class_get_list_sorted(TYPE_HPPA_CPU, false); + qemu_printf("Available CPUs:\n"); + g_slist_foreach(list, hppa_cpu_list_entry, NULL); + g_slist_free(list); +} + #ifndef CONFIG_USER_ONLY #include "hw/core/sysemu-cpu-ops.h"