~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/io-64-nonatomic-lo-hi.h

Version: ~ [ linux-5.11-rc3 ] ~ [ linux-5.10.7 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.89 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.167 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.215 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.251 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.251 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef _LINUX_IO_64_NONATOMIC_LO_HI_H_
  3 #define _LINUX_IO_64_NONATOMIC_LO_HI_H_
  4 
  5 #include <linux/io.h>
  6 #include <asm-generic/int-ll64.h>
  7 
  8 static inline __u64 lo_hi_readq(const volatile void __iomem *addr)
  9 {
 10         const volatile u32 __iomem *p = addr;
 11         u32 low, high;
 12 
 13         low = readl(p);
 14         high = readl(p + 1);
 15 
 16         return low + ((u64)high << 32);
 17 }
 18 
 19 static inline void lo_hi_writeq(__u64 val, volatile void __iomem *addr)
 20 {
 21         writel(val, addr);
 22         writel(val >> 32, addr + 4);
 23 }
 24 
 25 static inline __u64 lo_hi_readq_relaxed(const volatile void __iomem *addr)
 26 {
 27         const volatile u32 __iomem *p = addr;
 28         u32 low, high;
 29 
 30         low = readl_relaxed(p);
 31         high = readl_relaxed(p + 1);
 32 
 33         return low + ((u64)high << 32);
 34 }
 35 
 36 static inline void lo_hi_writeq_relaxed(__u64 val, volatile void __iomem *addr)
 37 {
 38         writel_relaxed(val, addr);
 39         writel_relaxed(val >> 32, addr + 4);
 40 }
 41 
 42 #ifndef readq
 43 #define readq lo_hi_readq
 44 #endif
 45 
 46 #ifndef writeq
 47 #define writeq lo_hi_writeq
 48 #endif
 49 
 50 #ifndef readq_relaxed
 51 #define readq_relaxed lo_hi_readq_relaxed
 52 #endif
 53 
 54 #ifndef writeq_relaxed
 55 #define writeq_relaxed lo_hi_writeq_relaxed
 56 #endif
 57 
 58 #ifndef ioread64_lo_hi
 59 #define ioread64_lo_hi ioread64_lo_hi
 60 static inline u64 ioread64_lo_hi(void __iomem *addr)
 61 {
 62         u32 low, high;
 63 
 64         low = ioread32(addr);
 65         high = ioread32(addr + sizeof(u32));
 66 
 67         return low + ((u64)high << 32);
 68 }
 69 #endif
 70 
 71 #ifndef iowrite64_lo_hi
 72 #define iowrite64_lo_hi iowrite64_lo_hi
 73 static inline void iowrite64_lo_hi(u64 val, void __iomem *addr)
 74 {
 75         iowrite32(val, addr);
 76         iowrite32(val >> 32, addr + sizeof(u32));
 77 }
 78 #endif
 79 
 80 #ifndef ioread64be_lo_hi
 81 #define ioread64be_lo_hi ioread64be_lo_hi
 82 static inline u64 ioread64be_lo_hi(void __iomem *addr)
 83 {
 84         u32 low, high;
 85 
 86         low = ioread32be(addr + sizeof(u32));
 87         high = ioread32be(addr);
 88 
 89         return low + ((u64)high << 32);
 90 }
 91 #endif
 92 
 93 #ifndef iowrite64be_lo_hi
 94 #define iowrite64be_lo_hi iowrite64be_lo_hi
 95 static inline void iowrite64be_lo_hi(u64 val, void __iomem *addr)
 96 {
 97         iowrite32be(val, addr + sizeof(u32));
 98         iowrite32be(val >> 32, addr);
 99 }
100 #endif
101 
102 #ifndef ioread64
103 #define ioread64_is_nonatomic
104 #define ioread64 ioread64_lo_hi
105 #endif
106 
107 #ifndef iowrite64
108 #define iowrite64_is_nonatomic
109 #define iowrite64 iowrite64_lo_hi
110 #endif
111 
112 #ifndef ioread64be
113 #define ioread64be_is_nonatomic
114 #define ioread64be ioread64be_lo_hi
115 #endif
116 
117 #ifndef iowrite64be
118 #define iowrite64be_is_nonatomic
119 #define iowrite64be iowrite64be_lo_hi
120 #endif
121 
122 #endif  /* _LINUX_IO_64_NONATOMIC_LO_HI_H_ */
123 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp