From patchwork Fri Apr 25 15:28:33 2025 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: 884385 Delivered-To: patch@linaro.org Received: by 2002:a5d:474d:0:b0:38f:210b:807b with SMTP id o13csp4027001wrs; Fri, 25 Apr 2025 08:34:08 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVH4m63fr3Wof70427QmNjKXBtNM9wLmmQTk1TMpIdgGupHiyJ6MIJZS+uVa3g4a8yC30OOjg==@linaro.org X-Google-Smtp-Source: AGHT+IG413Ea2T85WFkALkdItGDQzrWi2wfRlso433xjv/HUYz9U4/A0VK6TONR25VUjkV30ZYdz X-Received: by 2002:ac8:7fd3:0:b0:477:1edc:baaa with SMTP id d75a77b69052e-4801c3bb9c9mr44099281cf.6.1745595248331; Fri, 25 Apr 2025 08:34:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1745595248; cv=none; d=google.com; s=arc-20240605; b=bQpEdDTCc5h1P+qElJrwQAIak5/38+iyIbxjrThkH/V2xoNPRIXflBudXp5BoKDG2V m6K0EIeY2JVsrju/i8oNT0Uc7FVbQpfYzsNF0QlXbOFkesJTJEMGmBMkEWrZtTk2ye+5 qaE/nTw4W8oa24zA7GJlBiUZqZa+QbrKizIRlqJT8N54wuAUUiwY32Xw57DKsJNJcEfj PYIiBHT8GjnR7HpKI4pBV4ARud4ciOWsiECxxbT9/3ZPtJ3bXjFXz6sMglDJxCTkMay6 MskwHMUWArLQ/dNfyTGtVvyCFLA1pj9FO5+OFVOor/9lKc15GjJ5TcyqlGjazKgcTyIA q+KA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=teMG3JygoBDrbKMTX3hz7+h4Vn64sYsEGgE4H+sueD8=; fh=qtn8prgQtzf5IzCNvLChUZDElvNECP6ej9YfjQeBz3I=; b=Sid6ExsrBNds6qymBYy2yYNP61MKQj6Wyymyq1Rr4Fvxr4JVpro6ZJ+I6poJ021MOk YdN0zr30pEXklCt/eI9vdYFW4PA7TXm7Lcu4K38AmJ+5118EksPKtasvLbxu9iT7mJTy js7QKZsu5d+nH9/lRbhS1wOyq1DmcDS6rw5U93WSUkq5bXZ1PJW/Lr+5Pj7FEFfCcVlu X4oorvsg/izVLLZK8hmWpHc9+Dq1fpX+T/F+q3Jcl2IjUkphmc7BA9EixWU0IgCxo61h ZFFO4YBLe2/k9Ehjgeej7h+oX5K2yQwdOFUAHlAyP6W6CRxmSzGj8efLyOod8P47jDJC fewQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uH5Aw6Rc; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-47ea1986dc2si43931121cf.233.2025.04.25.08.34.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Apr 2025 08:34:08 -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=uH5Aw6Rc; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u8L2z-00029r-Ls; Fri, 25 Apr 2025 11:33:02 -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 1u8L2o-0001Fp-CJ for qemu-devel@nongnu.org; Fri, 25 Apr 2025 11:32:50 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u8L2m-0004CL-Bd for qemu-devel@nongnu.org; Fri, 25 Apr 2025 11:32:49 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-39129fc51f8so1928040f8f.0 for ; Fri, 25 Apr 2025 08:32:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1745595166; x=1746199966; 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=teMG3JygoBDrbKMTX3hz7+h4Vn64sYsEGgE4H+sueD8=; b=uH5Aw6RcZ//9egpKj9mTt5MF6XoWpF9SFkvt6DAZYlIltG67UDkrvrb8a75sbgdZDF o4qhBje/XeIjE8wJO83tasTgrbYVppzXU9S1tSASLma1thDfnJ5qrxE/Ti4NsucTyfDe EKvPX2SoXvfwSJkYjrLc2OYuqDlwZ6pF6q0Q+WolXd2++bNS00gGM8SFLskglnAKNcD2 SXhC85gzyFR44ZUaDHT23WYMezl7WN/O6GZ/4c396vM8i0NRgMIrOJztIe8Cvq1DCh8W c9ysZkiPbCKsFemSo7HKdb5XbnvoFeYFF3Y/8RmKc4JtWWp2HNCCdy3vk095IbETthxY nbhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745595166; x=1746199966; 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=teMG3JygoBDrbKMTX3hz7+h4Vn64sYsEGgE4H+sueD8=; b=cTIPHNCU5nz7pd8A1DxQgXAF1DpjE8m8SQEOaan3lZfwoSd5WqTgU8zBnK3Dz+9qy7 NQ5U40hH0J+xRrtK1ttf66Nn4xRQKZzl3DD7c39FtfAAmQYzInyhXx01IzZnsWqUlbVK ImlslJ5BKskVxXbEuNMy55O3AM6VSbhaMTj/k2jOrZ0xBbx4JT74XO7vxls6n1BRj7Dh bqWHZCJ2YJhhjHjImyspPFJO5H1VdjhQ/tZ0XDKTxeDOlDAn3ArF/1TBWRuisazFEhsm s9lCqmhK6w711C6m/0HscR6hcrMHtAzD5I5R3TR5SywO4lnEawiAWLJJ/Ckhu2/UP4ii NCtg== X-Gm-Message-State: AOJu0YzT7ORnxEuiubts9LGWqPk9qUN0mc8Kxkll6e//cOVEVPkP2ij3 KrCohFtq9QuP/5kN61jzim9IF4PjMQ1Ibpll0LbBPQmQNuiZWh2su99rtZRLLa1Up8pRFzjSxwe 5 X-Gm-Gg: ASbGncst2AdoCHQyvhhE/x7aSR/AyNVEy95a47afLl4YHNpVhBe7EDbKZBBNgsEfoFV Ubf9m8+0/1voGx2uk6FFNHZApcN3AHk73ZstZBu9eH/Nkq/T7TrhLaW4+thsvpp8erL5ek/90Se D8+FLjCkhiRlYnKokUHB0eV6Lb0Cm7U3Jl/hltcjhd2ziqrvuCLXvD7lLsPU6+nf3DKknMIsaW6 jXsA9VOK5UjheqNDV3xGzyNHkbnElfvp2kg3q6Rqhrf+9PVRo07AhizU7IzSgIu5CM6L/Ly1JTQ Rg1tPh6wVw5sLzHgudfXCqnEU0Hw5hgenDbdncShoO/vsDaxBytaExRSoJq0tu+8a8ZGnlC8IDx AzwltDu1FNjycHdg= X-Received: by 2002:a05:6000:40ca:b0:39c:1257:ccae with SMTP id ffacd0b85a97d-3a074fa76bcmr2068527f8f.57.1745595166423; Fri, 25 Apr 2025 08:32:46 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-440a53108f2sm28032085e9.19.2025.04.25.08.32.45 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 25 Apr 2025 08:32:46 -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?= , Richard Henderson Subject: [PULL 49/58] hw/microblaze: Evaluate TARGET_BIG_ENDIAN at compile time Date: Fri, 25 Apr 2025 17:28:33 +0200 Message-ID: <20250425152843.69638-50-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250425152843.69638-1-philmd@linaro.org> References: <20250425152843.69638-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=philmd@linaro.org; helo=mail-wr1-x42e.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 Rather than evaluating TARGET_BIG_ENDIAN at preprocessing time via #ifdef'ry, do it in C at compile time Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20250417131004.47205-8-philmd@linaro.org> --- hw/microblaze/petalogix_ml605_mmu.c | 12 ++++++------ hw/microblaze/xlnx-zynqmp-pmu.c | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/hw/microblaze/petalogix_ml605_mmu.c b/hw/microblaze/petalogix_ml605_mmu.c index c887c7a99ed..bea6b689fd1 100644 --- a/hw/microblaze/petalogix_ml605_mmu.c +++ b/hw/microblaze/petalogix_ml605_mmu.c @@ -218,12 +218,12 @@ petalogix_ml605_init(MachineState *machine) static void petalogix_ml605_machine_init(MachineClass *mc) { -#if TARGET_BIG_ENDIAN - mc->desc = "PetaLogix linux refdesign for xilinx ml605 (big endian)"; - mc->deprecation_reason = "big endian support is not tested"; -#else - mc->desc = "PetaLogix linux refdesign for xilinx ml605 (little endian)"; -#endif + if (TARGET_BIG_ENDIAN) { + mc->desc = "PetaLogix linux refdesign for xilinx ml605 (big endian)"; + mc->deprecation_reason = "big endian support is not tested"; + } else { + mc->desc = "PetaLogix linux refdesign for xilinx ml605 (little endian)"; + } mc->init = petalogix_ml605_init; } diff --git a/hw/microblaze/xlnx-zynqmp-pmu.c b/hw/microblaze/xlnx-zynqmp-pmu.c index ea1430f4081..ed40b5f2e05 100644 --- a/hw/microblaze/xlnx-zynqmp-pmu.c +++ b/hw/microblaze/xlnx-zynqmp-pmu.c @@ -181,12 +181,12 @@ static void xlnx_zynqmp_pmu_init(MachineState *machine) static void xlnx_zynqmp_pmu_machine_init(MachineClass *mc) { -#if TARGET_BIG_ENDIAN - mc->desc = "Xilinx ZynqMP PMU machine (big endian)"; - mc->deprecation_reason = "big endian support is not tested"; -#else - mc->desc = "Xilinx ZynqMP PMU machine (little endian)"; -#endif + if (TARGET_BIG_ENDIAN) { + mc->desc = "Xilinx ZynqMP PMU machine (big endian)"; + mc->deprecation_reason = "big endian support is not tested"; + } else { + mc->desc = "Xilinx ZynqMP PMU machine (little endian)"; + } mc->init = xlnx_zynqmp_pmu_init; }