From patchwork Fri Oct 13 14:01:08 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: 733218 Delivered-To: patch@linaro.org Received: by 2002:a5d:54d1:0:b0:31d:da82:a3b4 with SMTP id x17csp1485322wrv; Fri, 13 Oct 2023 07:06:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEs828ieo6IS9PZbZCfZlP/9s/JBGb2XJSSgJsO8obdlAqviV5IgJ0kxUlkhGc23QF3t5Dy X-Received: by 2002:a05:622a:1653:b0:418:1179:9195 with SMTP id y19-20020a05622a165300b0041811799195mr28007684qtj.66.1697205984507; Fri, 13 Oct 2023 07:06:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697205984; cv=none; d=google.com; s=arc-20160816; b=otVuwg65/u19etxVOochPp4HZkQYP8RNiChJbRkOGscmgltIAju6dByPK8gbMA7CSM qNVKdpw0sBNuY8rl0Vp13/qAW/JJZ+Xb0PnZGUpC9x5cCVAR3lR8MKT4Se1ShcPWy2Lp sOw/EJRMAwPYbrc6EN1KHFduxxCPkkiw2M997mnbv9oks8YX2DIJ4TU+96geDCFJFNi4 d3UkuVT7R1ZzXFuace5PMNNbWU7SaSkBgUBVK/Ap7A5ND8LtpH1psRzW40D6+oniK2gO kzLlH54N89Uu5fQcaL3Rgo4JSE9Yu/noqpRhEICx/XRkrPe4oZxBD4c0Vq75Lo7SGvK5 Yd1w== 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=07DFvbHkZiBMbxAaSmNu0dQsKVUwAhLuuLPTQQVTtt0=; fh=yvC9ZPM7MgJn7Xb0eJwxiCf2t+VfzDAYAfYYKFMFkpQ=; b=CWLUpm+j5FE3USSsfYkTB2KrxrdyokJU46J9674Llj9jhEAca6mr9gjnZor03P1kjA 6zIf4YvnLuyp1ojnoeJjbuoGOlMB90znMvbzX9wX3OlzxgZl/rvZcD+MkOeDMA7in6lq VXWRHW7W2nxn7jRrRin6PZMBr9ZrhUiIUqAeTpYk4DKKZa7LVpJo4AyCFYxFWZD+t7xb o4znwOBX/7O13zcNvQVCJ8FATfl4+5LLGsiCAHApeYvQoIsQajXC4XIb4EY41SmN4ilu YL4gHucpL05SyaGIESl3nZuISVeH7t946FCOrwG5P8qtWMZ6iit7RJBNx9YLOjvjQmia H6yQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OCkIlB5R; 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 n19-20020a05622a11d300b00419c0d9d4c6si1287857qtk.135.2023.10.13.07.06.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Oct 2023 07:06:24 -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=OCkIlB5R; 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 1qrImR-0004KH-7s; Fri, 13 Oct 2023 10:04:43 -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 1qrIkm-0007xG-Te for qemu-devel@nongnu.org; Fri, 13 Oct 2023 10:03:04 -0400 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qrIkd-0002PK-SI for qemu-devel@nongnu.org; Fri, 13 Oct 2023 10:02:59 -0400 Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-9ba081173a3so355248866b.1 for ; Fri, 13 Oct 2023 07:02:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697205768; x=1697810568; 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=07DFvbHkZiBMbxAaSmNu0dQsKVUwAhLuuLPTQQVTtt0=; b=OCkIlB5RGSCHe071andYqFdVb9ogjsaDXvF/7LQxPRSnO9we7hUVvhVx3/3nsrMNcC QPKO69OZKPA50TM+G766N7tTOQRyudfsQpafFVUWyjqSZDt6PcAY8bxw11FMO8Nk/Prw +0L+VI0HTdL6emtoNPh3WEgAYuV6+wqfgA3VLvyEK4r2ogHDhHXpAtMXwiRSI8jO0QpT +miGQbCfzxA4f6OfsSqMPKelqAhQU9mQc9tI7V8+cS60ehl2/fuFqx2cpZaC4eSrrPW7 bKhvGMdkI4kkMtfPAvDAoE2Wpuc08AnUYyWcY3CpvinrGlzrlTE1M2xS9NVjKQPQc9Ws 4LYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697205768; x=1697810568; 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=07DFvbHkZiBMbxAaSmNu0dQsKVUwAhLuuLPTQQVTtt0=; b=rSxkv/hL0ZdpSHj2AryPTezq6PjCTAuE8BaRTFoRpdh4I+eSqozicQ8ka4DOoSD/tQ Su7XOs4oFQuVyBSioQS2IfEWgFBVqOjWlnXxwzjZru69B3iKJieBVslOGVgY2Fke7yxq mQUYsherUx22GqiHqeKiL2/PNuX+aAVmHu+sVe3yNZ8Wlcvb/sDVvaqTb8AXuCa/wTGZ 11FCHtQv60Nz4PMy5WZUwVVEOAGxg8y6GWURdaGCmAS7DJE5MT9+l6lkhfoSKwnk8BMg IMivzEOu2ABUWBVXK3fIKPcNd9o8Yq62xfTlpcQnx27BThfF64CuGSdtgplZu3/vt9q7 bjzw== X-Gm-Message-State: AOJu0Ywhu6bWrtcks4oz+HbQuwcBmSURTudqmzDiG8aWter5MoJgmsfc HQZb0HTOKQjEVtMZHAMUUKn2bEldSv8/72Kswz4= X-Received: by 2002:a17:906:8a47:b0:9b8:9b30:aff with SMTP id gx7-20020a1709068a4700b009b89b300affmr22902546ejc.1.1697205767691; Fri, 13 Oct 2023 07:02:47 -0700 (PDT) Received: from m1x-phil.lan ([176.172.118.168]) by smtp.gmail.com with ESMTPSA id h17-20020a1709063c1100b009b94a8150d8sm12508110ejg.199.2023.10.13.07.02.43 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 13 Oct 2023 07:02:47 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Xiaojuan Yang , "Michael S. Tsirkin" , qemu-ppc@nongnu.org, Aleksandar Rikalo , David Hildenbrand , qemu-s390x@nongnu.org, "Edgar E. Iglesias" , Jiaxun Yang , Song Gao , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , Stafford Horne , Alistair Francis , Yanan Wang , Max Filippov , Artyom Tarasenko , Marcel Apfelbaum , =?utf-8?q?C=C3=A9dric_Le_Goa?= =?utf-8?q?ter?= , Laurent Vivier , Aurelien Jarno , qemu-riscv@nongnu.org, Palmer Dabbelt , Yoshinori Sato , Bastian Koppelmann , Bin Meng , Daniel Henrique Barboza , Mark Cave-Ayland , Weiwei Li , Daniel Henrique Barboza , Nicholas Piggin , qemu-arm@nongnu.org, Liu Zhiwei , Marek Vasut , Laurent Vivier , Peter Maydell , Brian Cain , Thomas Huth , Chris Wulff , Sergio Lopez , Richard Henderson , Ilya Leoshkevich , Michael Rolnik Subject: [PATCH v2 09/16] target/nios2: Declare QOM definitions in 'cpu-qom.h' Date: Fri, 13 Oct 2023 16:01:08 +0200 Message-ID: <20231013140116.255-10-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231013140116.255-1-philmd@linaro.org> References: <20231013140116.255-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=philmd@linaro.org; helo=mail-ej1-x635.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=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 "target/foo/cpu.h" contains the target specific declarations. A heterogeneous setup need to access target agnostic declarations (at least the QOM ones, to instantiate the objects). Our convention is to add such target agnostic QOM declarations in the "target/foo/cpu-qom.h" header. Extract QOM definitions from "cpu.h" to "cpu-qom.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/nios2/cpu-qom.h | 19 +++++++++++++++++++ target/nios2/cpu.h | 7 +------ 2 files changed, 20 insertions(+), 6 deletions(-) create mode 100644 target/nios2/cpu-qom.h diff --git a/target/nios2/cpu-qom.h b/target/nios2/cpu-qom.h new file mode 100644 index 0000000000..931bc69b10 --- /dev/null +++ b/target/nios2/cpu-qom.h @@ -0,0 +1,19 @@ +/* + * QEMU Nios II CPU QOM header (target agnostic) + * + * Copyright (c) 2012 Chris Wulff + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef QEMU_NIOS2_CPU_QOM_H +#define QEMU_NIOS2_CPU_QOM_H + +#include "hw/core/cpu.h" +#include "qom/object.h" + +#define TYPE_NIOS2_CPU "nios2-cpu" + +OBJECT_DECLARE_CPU_TYPE(Nios2CPU, Nios2CPUClass, NIOS2_CPU) + +#endif diff --git a/target/nios2/cpu.h b/target/nios2/cpu.h index ede1ba2140..2d79b5b298 100644 --- a/target/nios2/cpu.h +++ b/target/nios2/cpu.h @@ -21,20 +21,15 @@ #ifndef NIOS2_CPU_H #define NIOS2_CPU_H +#include "cpu-qom.h" #include "exec/cpu-defs.h" -#include "hw/core/cpu.h" #include "hw/registerfields.h" -#include "qom/object.h" typedef struct CPUArchState CPUNios2State; #if !defined(CONFIG_USER_ONLY) #include "mmu.h" #endif -#define TYPE_NIOS2_CPU "nios2-cpu" - -OBJECT_DECLARE_CPU_TYPE(Nios2CPU, Nios2CPUClass, NIOS2_CPU) - /** * Nios2CPUClass: * @parent_phases: The parent class' reset phase handlers.