From patchwork Mon Sep 30 22:12:01 2024 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: 831585 Delivered-To: patch@linaro.org Received: by 2002:a5d:43d2:0:b0:367:895a:4699 with SMTP id v18csp13120wrr; Mon, 30 Sep 2024 15:12:31 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU7BWHxWAntEB3lplTkGiM4nHoJqdYias0dyya19qKic8sQ+gcaXEvKQq/V18SDa2Q66I9ohA==@linaro.org X-Google-Smtp-Source: AGHT+IFfQA1Dtd65QK6LSLqf4XmTDOa/RSRp4ovCdW0m4bcYrQpCezbF9G+oZ1PWC2KPvh8IViTg X-Received: by 2002:a05:620a:17a1:b0:7a9:be1b:7a41 with SMTP id af79cd13be357-7ae5b801758mr218692385a.4.1727734350723; Mon, 30 Sep 2024 15:12:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727734350; cv=none; d=google.com; s=arc-20240605; b=CcqeE2vqJx3haziagbHpG6I8+S75FPfW20kzEeedHXmkaF+l4tlE+zw+giY0axhlkF 8IvgyDBqtFkZCQ1d3kedUT3pbR/OxOepTWSSY0LYPcdCwafDa1vp8vywlb9gY+LWLBzE NYLWVQnuxD8Zi+h5u9XSrXVL5sZTc4iRdXQwP6iDO+Fz4uWB6hmq6+jXZFmU+Mk6nDo3 yWaj3BTepZkDtRm9CZ9VvxOa1mcXeQ87ZQMqLE6iXunGSxqSblNCWX81bZ/iomBo4TSY B2xvnscGVWYWUIWaelDftXOGcD0DB+/5maeYxSNfNZc1xWx/iGIG43Qd/I86nQORTmW2 4xOA== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=LRXyg4ZMLe6rL1P5aLv2+vxkqHAdzQV7DbZ6DSez1v4=; fh=ANAgQAkGs37PxNAxU2bccxa/SpERQafpMiE9doUlQR0=; b=Zb8NWw0dSH43dbnIfxajWNQkLllSuqrA3poCQwCfeDDYDm9B9AGM9pVWX4+ElvoV07 uUlYtJ0bi0nFNDsFfTx+HKBTU7m/Q53ZwhrXMWpt3JnD5D2uHs2iNYQpTTqIPSpKMGak Lpva6TR2vm9B4sCI1kD5p53XQCRFIjq0ut8rT8Wzh1ahL/EdzlN8iiMdRTammYQILSi/ MeExxZpXWKuCk5UIQsWEKrPMV57Q6YzshScWngNyd+zz9igfV1yjr+4JJr2C2bmy/AlO CzGz/w4Kc4w+lJmLkx2BI8LvlvC2ndYr7zEOogvaNBzqRMngsrVlu/HjCQyzfXbGA2CX CBiw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qYRx65+3; 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 af79cd13be357-7ae37871314si623488885a.609.2024.09.30.15.12.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Sep 2024 15:12:30 -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=qYRx65+3; 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 1svOcp-0002xM-OJ; Mon, 30 Sep 2024 18:12:15 -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 1svOcn-0002u6-C4 for qemu-devel@nongnu.org; Mon, 30 Sep 2024 18:12:13 -0400 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1svOcl-0002c0-Ld for qemu-devel@nongnu.org; Mon, 30 Sep 2024 18:12:13 -0400 Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-5c5cf26b95aso5611916a12.3 for ; Mon, 30 Sep 2024 15:12:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727734330; x=1728339130; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=LRXyg4ZMLe6rL1P5aLv2+vxkqHAdzQV7DbZ6DSez1v4=; b=qYRx65+3vGtfRSLb85H70gg4rNMrSsNFzts7HuM8yx1kdTqfo3dytGZT8h+wsN5ML2 1VeYiQX+gaboj42F3I+HZcFu9u34wZmq3m4Iy/l6P9IoCb+/PCWnynb896X66fpQaRlL 7lHJVrdaXpzBa2UhOhkRkunYDgvLabKVjyGSxLloFGVgSgz+QQq4Aw1nj9SSWgjVdOuR +7HMOIR/y5t0BXK35nEiFZCs0Ar8VlnIjUrcC82rnGWVhJBdDDXM2Gx0lqYKojNaYzJT NimohG9atsc2Y31tFuTZVe5Mh4yRLbeJAjtyx3zSXrZB36MAa7kdV6HUFtjbrnGyaZ/K Gbtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727734330; x=1728339130; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=LRXyg4ZMLe6rL1P5aLv2+vxkqHAdzQV7DbZ6DSez1v4=; b=O81YxwEi/vcFREHCVoEEW/r5e/BnkGzoq8jTpdiWL89jwHYSxAiZGysWuVzOPl71p0 MlZROwHZLvEARDxUFSOk7fYFLSV28BtNJUGniWCgnggcsryAQgP/jhNNZiA9WyFE4JgR C8YDafk3xOaupNFt0vV5O1XH4mtgNdzOLSRicDmXWJpu+oraaLBJuKNy6lkEQJFkP+WO yMCqUNeRDG8lxcZoLDANU+HR3WKkwyH72w/u7DPzZgq3gu7tV/2/yJ9NDODJJyll/rXJ XhWqZ4Isn5A1T7bCcWSYvO7jf2us34SZRFYFDjXA9SiuhMk9zoTnDoPxnWy2nZ/y7dwg pu6w== X-Gm-Message-State: AOJu0YxGsFLgP9fa/FHzHzIuOjfYAzcFsWBhJ2DDwDL5OSydyAvZH1Jz 3sc+IRM8zMNtHUKRL5OfP63J0dNJOL+BFQICbQWabVsACMZqn9zAwCb/OaPGAPaHfkc1UgLE6CM oFLM= X-Received: by 2002:a05:6402:3508:b0:5c8:9f81:446c with SMTP id 4fb4d7f45d1cf-5c89f8144bbmr1469099a12.3.1727734329731; Mon, 30 Sep 2024 15:12:09 -0700 (PDT) Received: from localhost.localdomain (46.170.88.92.rev.sfr.net. [92.88.170.46]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c882495335sm5056696a12.95.2024.09.30.15.12.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 30 Sep 2024 15:12:09 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Alistair Francis , Peter Maydell , Thomas Huth , Hao Wu , Laurent Vivier , Joel Stanley , qemu-arm@nongnu.org, Andrew Jeffery , Steven Lee , Tyrone Ting , "Edgar E. Iglesias" , Igor Mitsyanko , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jamin Lin , Troy Lee , Anton Johansson Subject: [PATCH 0/3] hw/arm: Replace tswap32() by stl_endian_p() Date: Tue, 1 Oct 2024 00:12:01 +0200 Message-ID: <20240930221205.59101-1-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::531; envelope-from=philmd@linaro.org; helo=mail-ed1-x531.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 - Expose arm_cpu_code_is_big_endian() - pass ARMCPU argument to arm_write_bootloader() so we can call arm_cpu_code_is_big_endian() on it, - Replace target specific tswap32() by target agnostic stl_endian_p() Tested on little & big endian hosts. Philippe Mathieu-Daudé (3): target/arm: Expose arm_cpu_code_is_big_endian() prototype in 'cpu.h' hw/arm: Have arm_write_bootloader() take a ARMCPU argument hw/arm: Replace tswap32() calls by target agnostic stl_endian_p() include/hw/arm/boot.h | 9 ++++++--- target/arm/cpu.h | 7 +++++++ hw/arm/aspeed.c | 3 +-- hw/arm/boot.c | 17 ++++++++++------- hw/arm/exynos4210.c | 7 +++---- hw/arm/npcm7xx.c | 6 ++++-- hw/arm/raspi.c | 4 ++-- hw/arm/xilinx_zynq.c | 5 +++-- linux-user/aarch64/cpu_loop.c | 4 ++-- linux-user/arm/cpu_loop.c | 4 ++-- target/arm/cpu.c | 6 ++---- 11 files changed, 42 insertions(+), 30 deletions(-)