From patchwork Thu Aug 24 09:23:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: gaosong X-Patchwork-Id: 716504 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp1234559wrp; Thu, 24 Aug 2023 02:25:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEJQ+syoxGaEUGUN2o/9HShV6KHystlDwE+S96FjpO2r+nmj+oVeqzqgZvPiXsClfKp/Irr X-Received: by 2002:a05:622a:447:b0:3f5:16af:17db with SMTP id o7-20020a05622a044700b003f516af17dbmr19779263qtx.0.1692869122696; Thu, 24 Aug 2023 02:25:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692869122; cv=none; d=google.com; s=arc-20160816; b=C4JbdpqAhTjLYOG0Sl7mlxs18d1ulTAzAWm9hWCSkYSJBUpfrxjPmYiQS9RlAMb93A 4CbzZufBbEQ9p/C/+YLVm+1tLI0apWqoXIKtq4ZVgzjk7e/sTjWv+a/eYSoCKgxDdxhr dB3xjErUfqraQz7TWAuffkIrewlk7bDvoee79jlHkn0cAO5/u9wY0h6lXmS5moQW0Y+2 YY/ukadyn4LsU/tvenXuCQKDs/uUSitxOoykr0/arELIT9cS1aQrpU+HVG3tFErpz4fc Il995rxCx4sCd+dFQzjq6AKBHA5QdXYSSzUxQ6/CvlxV1DKl1ij5o5T32oYF2DFw0CRE F6Jg== 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; bh=yvJahIhp77M/HY7dMzFletHWlUmkbXj930hizO0bonI=; fh=64Br0Hu6lV8heewipdJI9p0HjLAy9hStM6+wPm6jfNs=; b=paskziv1ZFfAbR4WX7AHH20B8mmBWvwEo/ExFaAVi8adINcrXcV54Cyf5684x87vxa nEY3aGgBi1u/ZfPAgbjCw2PAx9ETJkyTvC9oHXE20X9dAJIvhnN0uU7FFxgbd0x40xSf fE3GuN5uIAhQmHN7OhtHN6wMc19rFiEpQvdpxxdxRTZyAnmgedQAUBdABx2dUmWDPI8S CgAC5gtuZF5EsTE/vSJUEBgjJXYvLpZb7gIul5ib9LdUe1E2lDTxX1gPpu2EXM6CrXoo /LF/So6fokAJP5AO3Rt2oJ5Nnd0PQ+dmVaZm4fI5EoIsfCobTKP2gIqVqQcy7Qo7Rmy9 m7sw== ARC-Authentication-Results: i=1; mx.google.com; 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" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f15-20020ac87f0f000000b0040b4cb9b6f9si8445521qtk.102.2023.08.24.02.25.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Aug 2023 02:25:22 -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; 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" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qZ6Zw-0003pw-0I; Thu, 24 Aug 2023 05:24:36 -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 1qZ6Zr-0003Z6-Ri for qemu-devel@nongnu.org; Thu, 24 Aug 2023 05:24:31 -0400 Received: from mail.loongson.cn ([114.242.206.163]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qZ6Zl-0003ME-KR for qemu-devel@nongnu.org; Thu, 24 Aug 2023 05:24:31 -0400 Received: from loongson.cn (unknown [10.2.5.185]) by gateway (Coremail) with SMTP id _____8AxTeu+IedkNnkbAA--.50812S3; Thu, 24 Aug 2023 17:24:14 +0800 (CST) Received: from localhost.localdomain (unknown [10.2.5.185]) by localhost.localdomain (Coremail) with SMTP id AQAAf8DxJ826IedkJjhiAA--.40637S6; Thu, 24 Aug 2023 17:24:14 +0800 (CST) From: Song Gao To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, richard.henderson@linaro.org, =?utf-8?q?Philippe_Ma?= =?utf-8?q?thieu-Daud=C3=A9?= Subject: [PULL 04/31] target/loongarch: Introduce abstract TYPE_LOONGARCH64_CPU Date: Thu, 24 Aug 2023 17:23:42 +0800 Message-Id: <20230824092409.1492470-5-gaosong@loongson.cn> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230824092409.1492470-1-gaosong@loongson.cn> References: <20230824092409.1492470-1-gaosong@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8DxJ826IedkJjhiAA--.40637S6 X-CM-SenderInfo: 5jdr20tqj6z05rqj20fqof0/ X-Coremail-Antispam: 1Uk129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7 ZEXasCq-sGcSsGvfJ3UbIjqfuFe4nvWSU5nxnvy29KBjDU0xBIdaVrnUUvcSsGvfC2Kfnx nUUI43ZEXa7xR_UUUUUUUUU== Received-SPF: pass client-ip=114.242.206.163; envelope-from=gaosong@loongson.cn; helo=mail.loongson.cn X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, 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 From: Philippe Mathieu-Daudé In preparation of introducing TYPE_LOONGARCH32_CPU, introduce an abstract TYPE_LOONGARCH64_CPU. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20230821125959.28666-5-philmd@linaro.org> Signed-off-by: Song Gao --- target/loongarch/cpu.c | 12 +++++++++--- target/loongarch/cpu.h | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index a1ebc20330..34d6c5a31d 100644 --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -734,9 +734,9 @@ static void loongarch_cpu_class_init(ObjectClass *c, void *data) #endif } -#define DEFINE_LOONGARCH_CPU_TYPE(model, initfn) \ +#define DEFINE_LOONGARCH_CPU_TYPE(size, model, initfn) \ { \ - .parent = TYPE_LOONGARCH_CPU, \ + .parent = TYPE_LOONGARCH##size##_CPU, \ .instance_init = initfn, \ .name = LOONGARCH_CPU_TYPE_NAME(model), \ } @@ -752,7 +752,13 @@ static const TypeInfo loongarch_cpu_type_infos[] = { .class_size = sizeof(LoongArchCPUClass), .class_init = loongarch_cpu_class_init, }, - DEFINE_LOONGARCH_CPU_TYPE("la464", loongarch_la464_initfn), + { + .name = TYPE_LOONGARCH64_CPU, + .parent = TYPE_LOONGARCH_CPU, + + .abstract = true, + }, + DEFINE_LOONGARCH_CPU_TYPE(64, "la464", loongarch_la464_initfn), }; DEFINE_TYPES(loongarch_cpu_type_infos) diff --git a/target/loongarch/cpu.h b/target/loongarch/cpu.h index fa371ca8ba..c50b3a5ef3 100644 --- a/target/loongarch/cpu.h +++ b/target/loongarch/cpu.h @@ -377,6 +377,7 @@ struct ArchCPU { }; #define TYPE_LOONGARCH_CPU "loongarch-cpu" +#define TYPE_LOONGARCH64_CPU "loongarch64-cpu" OBJECT_DECLARE_CPU_TYPE(LoongArchCPU, LoongArchCPUClass, LOONGARCH_CPU)