From patchwork Fri Oct 13 12:56:29 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: 733200 Delivered-To: patch@linaro.org Received: by 2002:a5d:54d1:0:b0:31d:da82:a3b4 with SMTP id x17csp1448531wrv; Fri, 13 Oct 2023 05:57:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHaQxk9iE3smMvoJ670TNFl8VrZW422PxbRsgaAJaI3hN+PsBbZfUqR4gnJStvrski7o3fJ X-Received: by 2002:a67:e004:0:b0:457:cb7b:c878 with SMTP id c4-20020a67e004000000b00457cb7bc878mr532639vsl.29.1697201862075; Fri, 13 Oct 2023 05:57:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697201862; cv=none; d=google.com; s=arc-20160816; b=sSb7FeeILGoZ/2bAcbGAktIY1DKQGKWeZX/yeCy0eSFIKBUJE4kvWJld7IG4IQOzzz XSXkQWi/LYKcXdJe/1cyEPEnIVClwZIER3gQEWg6cv5+wPwvLHIFj9jQizBQJjxWUDSa YoZPPXHkqiXmKILI5+WxFfrcA5TtDYRRBlcgO5JFgMq5o4LZ0o4Pzz9S7ThXfuzxpxmz WC67VU5lfHc7JARR2KtQKFXhMNCCbW6HseqsH6qfkN9q8iMa0B1t3o+NucQh9Xpc6dHv 8bSO3w461nRdOlwW3EEvmZ2zF6cjQ2kyAPHiHgg4WO7iUE5C3wu1ETL92fPO6J8I5RnU dzGw== 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=8yYXPRc/xEWiPRWLkGZcxqQvValoM9UBry2nkc5FvzM=; fh=VA6j7lkwZBpc1StxpFljCA0aH/klDdhOAPrIIfLw9Rk=; b=FzJfzQNuOAb6wPW4+/+YQ4wdTwBfCIZCjL5vAqkNIZ+rAUn83sgsAhAKGGx3dGPmCU dsmIPMVT6exX8niz90CC4gXPCFRov2rGWFOkQZj3m8BJOS/U7x07zzkNA529BBAka8b7 cr5YqEZXXX8cSaj2Bc87PGY2S80jBis27Pyi46DbkNlwHt0fCLvtHuDKL2xDC0vJPT77 p0cVNLDQoRHL/Kp1tLzVIss6xgNfI/vJcR9dqMGuziElcUrr/H2lapG69Uvl75GvyA07 9l4E/rptV0BMmXkVb2TqvDPEdSLpybF6Hqeai5BABEhb5rjfe26Q8n0x79bCi/u679U9 8Qtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SJiBlll7; 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 b12-20020ac87fcc000000b0041820a6d5f2si1119246qtk.714.2023.10.13.05.57.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Oct 2023 05:57:42 -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=SJiBlll7; 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 1qrHjB-0004Nr-D7; Fri, 13 Oct 2023 08:57:17 -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 1qrHj9-0004Mh-7p for qemu-devel@nongnu.org; Fri, 13 Oct 2023 08:57:15 -0400 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qrHj7-0002ee-CZ for qemu-devel@nongnu.org; Fri, 13 Oct 2023 08:57:14 -0400 Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-53df747cfe5so3852066a12.2 for ; Fri, 13 Oct 2023 05:57:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697201831; x=1697806631; 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=8yYXPRc/xEWiPRWLkGZcxqQvValoM9UBry2nkc5FvzM=; b=SJiBlll7cxNYFVHVlldeMQRzkpD6odpAXKkzpfGBYqfIn9lln1O0b9a31e6ZVEl/RI jC6CFh/j0YlCHqwts7kTVcoCvQwzkyGSQ3BPL3kn/8LgoLGIkpjsN/KZ+kG72s2R3W0s BW1K5JCRUe2FyUhZUn/W8qwb9kPBN/tRx7gsba61FZc+cFfKv9Zh5pw1NQkGoCbTZKCE cxK9ef2GU7epKs23aWxb0zny6zUNn0aKs50ATfBB/dtaoRO2oBOunYy0O8WvSxvlYwiu KWIDkeKjNN+WAgwLWuPPoe192sgiLweJj/vwNqf8F16BBlBOgjUzCTZxXJ8mdGWNZEoD bW8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697201831; x=1697806631; 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=8yYXPRc/xEWiPRWLkGZcxqQvValoM9UBry2nkc5FvzM=; b=O/7JdOz0SOHjbluD/nP68UIfnz4PS8+I7Px5Jh7GIDDYxVb/iY18tnLoYOieOSV27/ sq/o0RL8iyw0+lzziiTg9OR2LWEPqBYfB74Y2Y/B9fJKjaO+r5VzX+R2GeR1W3aBpGO8 Zjim56iT+v3lBdR9FYjgPguNotDlr3kCt4XXt2Q7y/pM/bcAA940a2Q1UVVect9fqE+f xVBxbtfkOcfkSkRaWr4V04CPNn2uNlgsI/OZnmlkeYjHn5yE2l8gUXKcEvqYIGDHorC0 hqnJ6f4gXtGZUtLY6XQreb5zqSWclFckP/tdAI6xE6qrsbTCbPWV8YGQaDPHFlbLO1nA 2g2A== X-Gm-Message-State: AOJu0YxFGYtKO9XRJCc6vMxktf5xxrjAOsHnotiDZGiHOi+rR3KDJLmF kUWuvXDdVM8xup3vUyPBonGuV+khVWo77g46xHc= X-Received: by 2002:a17:907:7711:b0:9ae:82b4:e309 with SMTP id kw17-20020a170907771100b009ae82b4e309mr24106310ejc.0.1697201831561; Fri, 13 Oct 2023 05:57:11 -0700 (PDT) Received: from m1x-phil.lan ([176.172.118.168]) by smtp.gmail.com with ESMTPSA id f5-20020a170906560500b009b8dbdd5203sm12337668ejq.107.2023.10.13.05.57.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 13 Oct 2023 05:57:11 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: David Gibson , qemu-ppc@nongnu.org, Nicholas Piggin , Harsh Prateek Bora , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Daniel Henrique Barboza , =?utf-8?q?Philippe_Mathieu?= =?utf-8?q?-Daud=C3=A9?= Subject: [PATCH 6/7] target/ppc: Move powerpc_mmu_t definition to 'cpu.h' Date: Fri, 13 Oct 2023 14:56:29 +0200 Message-ID: <20231013125630.95116-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231013125630.95116-1-philmd@linaro.org> References: <20231013125630.95116-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52d; envelope-from=philmd@linaro.org; helo=mail-ed1-x52d.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 The powerpc_mmu_t definition is only used by target/ppc/, no need to expose it. Restrict it by moving it to "target/ppc/cpu.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Cédric Le Goater --- target/ppc/cpu-qom.h | 43 ------------------------------------------- target/ppc/cpu.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 43 deletions(-) diff --git a/target/ppc/cpu-qom.h b/target/ppc/cpu-qom.h index b2e42c2996..5bdca472be 100644 --- a/target/ppc/cpu-qom.h +++ b/target/ppc/cpu-qom.h @@ -36,49 +36,6 @@ OBJECT_DECLARE_CPU_TYPE(PowerPCCPU, PowerPCCPUClass, POWERPC_CPU) #define TYPE_HOST_POWERPC_CPU POWERPC_CPU_TYPE_NAME("host") -/*****************************************************************************/ -/* MMU model */ -typedef enum powerpc_mmu_t powerpc_mmu_t; -enum powerpc_mmu_t { - POWERPC_MMU_UNKNOWN = 0x00000000, - /* Standard 32 bits PowerPC MMU */ - POWERPC_MMU_32B = 0x00000001, - /* PowerPC 6xx MMU with software TLB */ - POWERPC_MMU_SOFT_6xx = 0x00000002, - /* - * PowerPC 74xx MMU with software TLB (this has been - * disabled, see git history for more information. - * keywords: tlbld tlbli TLBMISS PTEHI PTELO) - */ - POWERPC_MMU_SOFT_74xx = 0x00000003, - /* PowerPC 4xx MMU with software TLB */ - POWERPC_MMU_SOFT_4xx = 0x00000004, - /* PowerPC MMU in real mode only */ - POWERPC_MMU_REAL = 0x00000006, - /* Freescale MPC8xx MMU model */ - POWERPC_MMU_MPC8xx = 0x00000007, - /* BookE MMU model */ - POWERPC_MMU_BOOKE = 0x00000008, - /* BookE 2.06 MMU model */ - POWERPC_MMU_BOOKE206 = 0x00000009, -#define POWERPC_MMU_64 0x00010000 - /* 64 bits PowerPC MMU */ - POWERPC_MMU_64B = POWERPC_MMU_64 | 0x00000001, - /* Architecture 2.03 and later (has LPCR) */ - POWERPC_MMU_2_03 = POWERPC_MMU_64 | 0x00000002, - /* Architecture 2.06 variant */ - POWERPC_MMU_2_06 = POWERPC_MMU_64 | 0x00000003, - /* Architecture 2.07 variant */ - POWERPC_MMU_2_07 = POWERPC_MMU_64 | 0x00000004, - /* Architecture 3.00 variant */ - POWERPC_MMU_3_00 = POWERPC_MMU_64 | 0x00000005, -}; - -static inline bool mmu_is_64bit(powerpc_mmu_t mmu_model) -{ - return mmu_model & POWERPC_MMU_64; -} - /*****************************************************************************/ /* Input pins model */ typedef enum powerpc_input_t powerpc_input_t; diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index d8cf4c03bf..c2cd069095 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -217,6 +217,48 @@ typedef enum powerpc_excp_t { POWERPC_EXCP_POWER10, } powerpc_excp_t; +/*****************************************************************************/ +/* MMU model */ +typedef enum powerpc_mmu_t { + POWERPC_MMU_UNKNOWN = 0x00000000, + /* Standard 32 bits PowerPC MMU */ + POWERPC_MMU_32B = 0x00000001, + /* PowerPC 6xx MMU with software TLB */ + POWERPC_MMU_SOFT_6xx = 0x00000002, + /* + * PowerPC 74xx MMU with software TLB (this has been + * disabled, see git history for more information. + * keywords: tlbld tlbli TLBMISS PTEHI PTELO) + */ + POWERPC_MMU_SOFT_74xx = 0x00000003, + /* PowerPC 4xx MMU with software TLB */ + POWERPC_MMU_SOFT_4xx = 0x00000004, + /* PowerPC MMU in real mode only */ + POWERPC_MMU_REAL = 0x00000006, + /* Freescale MPC8xx MMU model */ + POWERPC_MMU_MPC8xx = 0x00000007, + /* BookE MMU model */ + POWERPC_MMU_BOOKE = 0x00000008, + /* BookE 2.06 MMU model */ + POWERPC_MMU_BOOKE206 = 0x00000009, +#define POWERPC_MMU_64 0x00010000 + /* 64 bits PowerPC MMU */ + POWERPC_MMU_64B = POWERPC_MMU_64 | 0x00000001, + /* Architecture 2.03 and later (has LPCR) */ + POWERPC_MMU_2_03 = POWERPC_MMU_64 | 0x00000002, + /* Architecture 2.06 variant */ + POWERPC_MMU_2_06 = POWERPC_MMU_64 | 0x00000003, + /* Architecture 2.07 variant */ + POWERPC_MMU_2_07 = POWERPC_MMU_64 | 0x00000004, + /* Architecture 3.00 variant */ + POWERPC_MMU_3_00 = POWERPC_MMU_64 | 0x00000005, +} powerpc_mmu_t; + +static inline bool mmu_is_64bit(powerpc_mmu_t mmu_model) +{ + return mmu_model & POWERPC_MMU_64; +} + #define PPC_INPUT(env) ((env)->bus_model) /*****************************************************************************/