From patchwork Mon Aug 21 12:59:55 2023 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: 715371 Delivered-To: patch@linaro.org Received: by 2002:a5d:484e:0:b0:317:ecd7:513f with SMTP id n14csp1820670wrs; Mon, 21 Aug 2023 06:01:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGy1m0vOk6EuT19KffFijVdmKqGn2D7eyqE45VINaUAX5CC+Z0t8ALLe/gM70cvp1yoioY5 X-Received: by 2002:ac8:5903:0:b0:403:a8fa:b4f5 with SMTP id 3-20020ac85903000000b00403a8fab4f5mr8897530qty.4.1692622906917; Mon, 21 Aug 2023 06:01:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692622906; cv=none; d=google.com; s=arc-20160816; b=lWNfM0z7TL5oUZzPD3lVQNVlY5zshCiLIcHRbLB82hL083PxrDlTnPm24J/ugrD8JC MoNAZNH3RCEPLVgAwU9yEPRGaD1/Odp8WF8Wty/O0v212+d4cMmvPsadh2fLbO7QgJRP 1+j+jzsaWfkUZ1EvGOJhQZVvMO17sxWzMib8nRx04kRITJbAW/6aPcZ3XD4LUrf3mNid a6fQvMWOKUqSJBteh6oAkz/3wD45si+keH7SsZpjKLOrn86OQh9oJ5WUuaetMOn1TdrS Hzh4gm9n6OOZxpmXMAL/P3eaNNFm72yKPFL1ilPf5PmMMasdGQ6kcFlP354N3mg6dMtv QcIQ== 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=XkFQ/Hg2hO7EU81YeAwAVpwO++/fptKuH4LuzhRKmho=; fh=6ZlfjzpG5M4zTB3QdUsu1um4KG/wqA9A9dxpvstpjlg=; b=JkFTcYiqcSqNoJ76WIyDPfSYt2b45Youm2XCjKG5MZ2PY+UGthbb+70JuF2fKat1yc rBAj+lh5aRfNy96YHSMjfmFSd9oUg52Wi8XR/m0444ezeXpDRoz6iWW8O87wN0OTHMTP 8KSN+rC5cVF/gCihigE0ZW0MG82aN8Cadm5xrwTwkT3XJ+Y/uuvBzOvvRb/IiA/nQ7wJ h4sRdFixQbbavNVNo+LPpcMbUkhsmspWqCbdlwg/saZ2CnrHCkj+v+HW44RNZHA7HjYN 8jIGz7rbaqnMPmlOxharCxKCYndGt/ikI8unEqK8NwtfaNShPHq91x7DyGB+OdT3N2Re dnFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tgh568op; 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 i14-20020ac85e4e000000b00403f0e0625esi4833225qtx.788.2023.08.21.06.01.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Aug 2023 06:01:46 -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=tgh568op; 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 1qY4XK-00011r-8W; Mon, 21 Aug 2023 09:01:39 -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 1qY4WH-0000Mr-8n for qemu-devel@nongnu.org; Mon, 21 Aug 2023 09:00:50 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qY4WE-0001Cf-HB for qemu-devel@nongnu.org; Mon, 21 Aug 2023 09:00:32 -0400 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-31c3726cc45so1192465f8f.0 for ; Mon, 21 Aug 2023 06:00:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692622828; x=1693227628; 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=XkFQ/Hg2hO7EU81YeAwAVpwO++/fptKuH4LuzhRKmho=; b=tgh568op/VZROyOFlStSZYvij2cw8LzXK5O9jwdOJSOS7g7sXEHVAcEOKBc+Pd8n3w 7vz/NdQEPHMWUBRV+tUnSEjaROy1F1KEbc7M1MOQvL7u234PViJiEQixOwHroMwrhlJ8 IHf6Nox3sW2AdPmj7kALFD8+3YGtmRLZFKlxQH6+71Bhofg45QIiSLoS/CuqWOFGbG2Q qtEb+6wLhFycPTBL01Hkr4tLo0cuV5t9Sj15oXU29czVrWbjrLfCAg0YrOLcjI127PE1 AW8CHpsfNFDfvr/iSoQ8EdHvmSqtyxlAuc82LY3iX6kqDs3FjX4WZlipbTaltshzxQum RH0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692622828; x=1693227628; 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=XkFQ/Hg2hO7EU81YeAwAVpwO++/fptKuH4LuzhRKmho=; b=QUs3b1PjD/bDbWDICbkVdmizO9Xhx9fe7wo5UqKe+MUvpUcz23zyLPK27WwF2YgGw8 LvGnfeMvul8Ss7JaBEnl0mpJjAPsEgMlTWbuXFpHKR2vnNshTv2bgR6dzXqDzKah3c+3 9jUUGLmI87BrPRxoOeruIKZeYRdHB+b4Sr11pgqC3yyuhnDOkON9GDKwUGDQAfycnIgR bbs25vPmhktdIyVeVqwdq+eRYpvbXFDqc+z8ZOWbT2Z6xA9rleWAuFz8LWdWpSKa+dJt Dcg1xJqytUKjg8skYdWP+nD7XAX1/nCBzZwSnJ5FNcrPauNqfNXWIixMml3DwocMxjFF vMLw== X-Gm-Message-State: AOJu0YxHCa4GjfFzUSkhF1fQ7e+F1modKSkS7xDFbz9QCcm86tXobQIU zqsKKrQcP2NnZJInA9swDXdQge2gKzJ5mo10Fsw= X-Received: by 2002:adf:ce8f:0:b0:31a:ddb3:32da with SMTP id r15-20020adfce8f000000b0031addb332damr5520091wrn.22.1692622828027; Mon, 21 Aug 2023 06:00:28 -0700 (PDT) Received: from m1x-phil.lan (static-176-182-122-208.ncc.abo.bbox.fr. [176.182.122.208]) by smtp.gmail.com with ESMTPSA id n16-20020a5d4850000000b003179b3fd837sm12464009wrs.33.2023.08.21.06.00.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 21 Aug 2023 06:00:27 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?A?= =?utf-8?q?lex_Benn=C3=A9e?= , Song Gao , Jiajie Chen , Xiaojuan Yang , Huacai Chen , Richard Henderson Subject: [PATCH v3 4/8] target/loongarch: Introduce abstract TYPE_LOONGARCH64_CPU Date: Mon, 21 Aug 2023 14:59:55 +0200 Message-ID: <20230821125959.28666-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230821125959.28666-1-philmd@linaro.org> References: <20230821125959.28666-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=philmd@linaro.org; helo=mail-wr1-x430.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 In preparation of introducing TYPE_LOONGARCH32_CPU, introduce an abstract TYPE_LOONGARCH64_CPU. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/loongarch/cpu.h | 1 + target/loongarch/cpu.c | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) 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) 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)