From patchwork Mon Sep 30 07:34:48 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: 831531 Delivered-To: patch@linaro.org Received: by 2002:a5d:66c8:0:b0:367:895a:4699 with SMTP id k8csp1834349wrw; Mon, 30 Sep 2024 01:09:05 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXSvZ0s/fDI5oJPzYCI0e6aSDL0WiY1EFSWouorSqy4T/tZ3BP2LCXThZSO2MBnTnG9+4advw==@linaro.org X-Google-Smtp-Source: AGHT+IFI9y0MShwoLPmFHq/UAlD9D1ZOhOf2r30NnO2Q214k0ZqsqpDhk/warvn+cB+KbnxXRxqN X-Received: by 2002:a05:6214:328e:b0:6cb:2ad6:78ef with SMTP id 6a1803df08f44-6cb3b5c6732mr162583166d6.4.1727683744912; Mon, 30 Sep 2024 01:09:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727683744; cv=none; d=google.com; s=arc-20240605; b=AaihZ7dHLZ7mFkAO6yR7UZ1oKNTXJxw6cFe347MkIbBuQjtpGGEt+SxU4nFOpyUpJB 28j6uTRa//hV5DNmhCe9WxQ5KIvB7Pb32ktNJNn0N1bV+8BwUffuo1eNsfAGZ/Cv00+B OddWLq/hV+w1yT8clncfnz9pE34cU0iriz3ynCqA4fWsFRiSE5UBp+DcPbuQrn6/mBzV a6Btj9PkJA61pC7H1q1eVRGZ+6tQeBwbiSg4EdgtUd39GTcHViIK5aMq3db11rgWKNnu OZkeuvy1HFsS2toA3dm9T/fqf/Px9dwio4EKKdUANq0T8ejIGLJp4Flx/E32QL77o9dL 5ZHA== 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=olm5MEqTuo7Wlc02c6b6qRoX+TEZG1pRsM1M0qwZSUk=; fh=Wy2Q3sNWPDKxNwELUcZZKTFep4jJmSUk04d3iQNw3B8=; b=lQhdEi7twUSEwxIztqrobWz5Zhk3zaFrQV/mxgqQ95WexdOZ4Ijqk9Rf24yjks+Ic2 9Sd6YPhZ/cCDRLH6rCV0vvnWj969dK3TXLrn6e6QAB5nF2F/Cmi2/Yzyy1E0RUj6ViMI fw7qZy8UO5i8hsxGFs9lHPqzWgvgu0QVl5UXLZXCp5TwESTm2ZSco7rqxDaTykmIv18S TjXoHvNvNB73d55G58IvE93FSC00BAcOFEcLZ9koAaqaapO8ObDRSg6n3SRtMmMXD9V4 7NKOtXwu1e6HTOjmgIvziv24RjFK5dFox8LmQOFA0CKLs7WiTMUZgIJC8mnlTX6Z5mWW b/Dg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zqYpeUnr; 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 6a1803df08f44-6cb3b6d26cesi78776796d6.611.2024.09.30.01.09.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Sep 2024 01:09:04 -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=zqYpeUnr; 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 1svBSE-000852-Og; Mon, 30 Sep 2024 04:08:26 -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 1svBS7-0007jd-Qy for qemu-devel@nongnu.org; Mon, 30 Sep 2024 04:08:22 -0400 Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1svBS6-0004gM-3p for qemu-devel@nongnu.org; Mon, 30 Sep 2024 04:08:19 -0400 Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-539983beb19so260803e87.3 for ; Mon, 30 Sep 2024 01:08:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727683696; x=1728288496; 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=olm5MEqTuo7Wlc02c6b6qRoX+TEZG1pRsM1M0qwZSUk=; b=zqYpeUnr5WZA45prmYu8Gq1tJDrjSlC5TvyqDbwUsFFYlrq4fDUwdTtmg+1DYtILMf 9Ql0337t9wlEqMnUALEeIKRpg4UUySrFkTIW9DiXqAG0e7N1fDdh85PaGLBCVFm4oW1/ 64yhC179Lxti3xaxkj+tKf6s8pJ9F4tRShTPuH9NKzaLAXYatEy8qtJ1WBPLF9fiStEW bX9E0ccFGLmJZLAHyJpqh4DM7mfedJOCwFKHviBHESiGtkdX2cA+6sbh1ZkguugJuP7Q tQNcbunvwrzJ2mL3CJRoePe8XoYJ5qeG25ZSYR7x39139YzksZpDmLHYnYr/dtZ5OsAW 9uTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727683696; x=1728288496; 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=olm5MEqTuo7Wlc02c6b6qRoX+TEZG1pRsM1M0qwZSUk=; b=s6e5oV/mHVEbXYdZBnrjg5mvv+VStNyuvQq2AsvdD+8jhLn+4SacmB6Kqm5wNXd8mc 3887/QRzD+zDPy07pRaaK1SczqIwRs+o12PDf8+3mdifhuEi2aZz1r1f2/6zSTQR4ggG F8RaVJcl7Bs4Fgy+Y69nxCN47ALj5YTM4NiIcgt9v58cWFuUMkgDZd2h7BNSW0/burvg cO9Vi6NqHAfHa7sboPqfPXlhkEUmtlWoZgdOcOA2VC/HdiATNOFvR97uJsZWu69nBKmQ n/FDBVelehWuHzqP7rvf0H7L8ie94dtZ4+gAzOdAVePBzSqfXBw/uBcBg0bin1XKO3u+ P51A== X-Gm-Message-State: AOJu0Yxnzes+YMx1m+SzTqHjHzXADtHInBGYuEW/x5ofjyvWp34rw6qs o3fsX3Q+zz9h1YCELbKqfWmuHz802/4ZA+kdDBjSECSa6Vr5nGlfhyEfFOHAgr+/mUIBubMqIsF CRZw= X-Received: by 2002:a5d:690f:0:b0:37c:d4ba:1127 with SMTP id ffacd0b85a97d-37cd5a8791dmr6298056f8f.16.1727681786225; Mon, 30 Sep 2024 00:36:26 -0700 (PDT) Received: from localhost.localdomain (186.red-88-28-13.dynamicip.rima-tde.net. [88.28.13.186]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37cd56e6665sm8343859f8f.54.2024.09.30.00.36.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 30 Sep 2024 00:36:25 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Mahmoud Mandour , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-D?= =?utf-8?q?aud=C3=A9?= , Thomas Huth , =?utf-8?q?Alex_Benn=C3=A9e?= , Alexandre Iooss , Jason Wang , Aleksandar Rikalo , Anton Johansson , Peter Maydell , Huacai Chen , "Michael S. Tsirkin" , Sven Schnelle , Jiaxun Yang , qemu-arm@nongnu.org, Aurelien Jarno , Pierrick Bouvier , Max Filippov , Paul Burton Subject: [PATCH 11/13] hw/pci/pci_device: Add PCI_DMA_DEFINE_LDST_END() macro Date: Mon, 30 Sep 2024 09:34:48 +0200 Message-ID: <20240930073450.33195-12-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240930073450.33195-1-philmd@linaro.org> References: <20240930073450.33195-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::136; envelope-from=philmd@linaro.org; helo=mail-lf1-x136.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, 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 Define both endianness variants with a single macro. Useful to add yet other endian specific definitions in the next commit. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/pci/pci_device.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/include/hw/pci/pci_device.h b/include/hw/pci/pci_device.h index 91df40f989..ff619241a4 100644 --- a/include/hw/pci/pci_device.h +++ b/include/hw/pci/pci_device.h @@ -298,13 +298,14 @@ static inline MemTxResult pci_dma_write(PCIDevice *dev, dma_addr_t addr, return st##_s##_dma(pci_get_address_space(dev), addr, val, attrs); \ } +#define PCI_DMA_DEFINE_LDST_END(_l, _s, _bits) \ + PCI_DMA_DEFINE_LDST(_l##_le, _s##_le, _bits) \ + PCI_DMA_DEFINE_LDST(_l##_be, _s##_be, _bits) + PCI_DMA_DEFINE_LDST(ub, b, 8); -PCI_DMA_DEFINE_LDST(uw_le, w_le, 16) -PCI_DMA_DEFINE_LDST(l_le, l_le, 32); -PCI_DMA_DEFINE_LDST(q_le, q_le, 64); -PCI_DMA_DEFINE_LDST(uw_be, w_be, 16) -PCI_DMA_DEFINE_LDST(l_be, l_be, 32); -PCI_DMA_DEFINE_LDST(q_be, q_be, 64); +PCI_DMA_DEFINE_LDST_END(uw, w, 16) +PCI_DMA_DEFINE_LDST_END(l, l, 32) +PCI_DMA_DEFINE_LDST_END(q, q, 64) #undef PCI_DMA_DEFINE_LDST