[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v1 11/12] Arm: GICv3: Define macros to read/write 64 bit
- To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Ayan Kumar Halder <ayankuma@xxxxxxx>
- Date: Fri, 21 Oct 2022 16:31:27 +0100
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Ai9EcEkOkTt5okEc7oZTbCy/K+W9d1rnSC3OXLOLx8M=; b=dr6VRYFrR0Tk1FzqPTVSjT4iCGgOfKAb8P9XPFTMfhzlARBWRWsco+phSjOug/d+/CcPl/fsDqS8i9VsqZoAsBv1DZUg+Kgb6ODajHECZx7tzWfkTA1RBA+ZNXDy+c6KUP+nfXnGzjxTP81zQAmy4a0ShaO1stGgY96y9eWuFXaIqylZ0WlCKRwgyMj9HGNQHecUxyLNcmPc2/qRTctrC2GWzuFxDyOLNbWTzonXKBbJPD01E/PdgSu71meYKYmYxG49F4wH45tdzTABRg3nXQ1lbSxdg7gBmjYerE1YXP3CgkebZv0BniPYIy6f6nGBtQmF8I7HWnYZ73PwU2oJXQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YGRLw49Iz2wznc96DnBagju+OSoTmzDGiZUhF6Js7xPNxrTcibG+X1ACXY2ji+5Q55kETUjVImDIhrvtUpKfJLGkXXWNLrgSoEhINMk4dSvA/FmaiooP/X8yCYKlo5c5bgkI/dh7JbrWBl96eUaxMepabOJYGZDqi4m6xiBVsgfADg5cgi7Y70/tI1pLWk4CQl9jbjQuW5s3rD6+HcQi22KN4QN07UwT3nW3bF9vdRC8XxvmyR48KCKWk5cv87+8s6TdQjb21eZLC/dcalsnNPFxeFnON21wzY0awl8MJkqQpWvIdx5XvHMqV+DHaQNTsn7ZkjRHqjLXfM+T3r9M3g==
- Cc: <sstabellini@xxxxxxxxxx>, <stefanos@xxxxxxxxxx>, <julien@xxxxxxx>, <Volodymyr_Babchuk@xxxxxxxx>, <bertrand.marquis@xxxxxxx>, Ayan Kumar Halder <ayankuma@xxxxxxx>
- Delivery-date: Fri, 21 Oct 2022 15:32:43 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
Defined readq_relaxed()/writeq_relaxed() to read and write 64 bit regs.
This in turn calls readl_relaxed()/writel_relaxed() twice for the lower
and upper 32 bits.
Signed-off-by: Ayan Kumar Halder <ayankuma@xxxxxxx>
---
xen/arch/arm/include/asm/arm32/io.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/xen/arch/arm/include/asm/arm32/io.h
b/xen/arch/arm/include/asm/arm32/io.h
index 73a879e9fb..6a5f563fbc 100644
--- a/xen/arch/arm/include/asm/arm32/io.h
+++ b/xen/arch/arm/include/asm/arm32/io.h
@@ -80,10 +80,14 @@ static inline u32 __raw_readl(const volatile void __iomem
*addr)
__raw_readw(c)); __r; })
#define readl_relaxed(c) ({ u32 __r = le32_to_cpu((__force __le32) \
__raw_readl(c)); __r; })
+#define readq_relaxed(c) ({ u64 __r = (le64_to_cpu(readl_relaxed(c+4)) << 32)
| \
+ readl_relaxed(c); __r; })
#define writeb_relaxed(v,c) __raw_writeb(v,c)
#define writew_relaxed(v,c) __raw_writew((__force u16) cpu_to_le16(v),c)
#define writel_relaxed(v,c) __raw_writel((__force u32) cpu_to_le32(v),c)
+#define writeq_relaxed(v,c) writel_relaxed(((uint64_t)v&0xffffffff), c); \
+ writel_relaxed((((uint64_t)v)>>32), (c+4));
#define readb(c) ({ u8 __v = readb_relaxed(c); __iormb(); __v;
})
#define readw(c) ({ u16 __v = readw_relaxed(c); __iormb(); __v;
})
--
2.17.1
|