Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

powerpc/io: Use generic raw accessors

The raw accessors are identical to the generic versions, use the generic
versions.

Suggested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20241218105523.416573-16-mpe@ellerman.id.au

authored by

Michael Ellerman and committed by
Madhavan Srinivasan
0305292f c051451b

+9 -59
+9 -59
arch/powerpc/include/asm/io.h
··· 276 276 277 277 #define _IO_PORT(port) ((volatile void __iomem *)(_IO_BASE + (port))) 278 278 279 - /* 280 - * Non ordered and non-swapping "raw" accessors 281 - */ 282 - 283 - static inline unsigned char __raw_readb(const volatile void __iomem *addr) 284 - { 285 - return *(volatile unsigned char __force *)addr; 286 - } 287 - #define __raw_readb __raw_readb 288 - 289 - static inline unsigned short __raw_readw(const volatile void __iomem *addr) 290 - { 291 - return *(volatile unsigned short __force *)addr; 292 - } 293 - #define __raw_readw __raw_readw 294 - 295 - static inline unsigned int __raw_readl(const volatile void __iomem *addr) 296 - { 297 - return *(volatile unsigned int __force *)addr; 298 - } 299 - #define __raw_readl __raw_readl 300 - 301 - static inline void __raw_writeb(unsigned char v, volatile void __iomem *addr) 302 - { 303 - *(volatile unsigned char __force *)addr = v; 304 - } 305 - #define __raw_writeb __raw_writeb 306 - 307 - static inline void __raw_writew(unsigned short v, volatile void __iomem *addr) 308 - { 309 - *(volatile unsigned short __force *)addr = v; 310 - } 311 - #define __raw_writew __raw_writew 312 - 313 - static inline void __raw_writel(unsigned int v, volatile void __iomem *addr) 314 - { 315 - *(volatile unsigned int __force *)addr = v; 316 - } 317 - #define __raw_writel __raw_writel 318 - 319 279 #ifdef __powerpc64__ 320 - static inline unsigned long __raw_readq(const volatile void __iomem *addr) 321 - { 322 - return *(volatile unsigned long __force *)addr; 323 - } 324 - #define __raw_readq __raw_readq 325 - 326 - static inline void __raw_writeq(unsigned long v, volatile void __iomem *addr) 327 - { 328 - *(volatile unsigned long __force *)addr = v; 329 - } 330 - #define __raw_writeq __raw_writeq 331 - 332 - static inline void __raw_writeq_be(unsigned long v, volatile void __iomem *addr) 333 - { 334 - __raw_writeq((__force unsigned long)cpu_to_be64(v), addr); 335 - } 336 - #define __raw_writeq_be __raw_writeq_be 337 - 338 280 /* 339 - * Real mode versions of the above. Those instructions are only supposed 281 + * Real mode versions of raw accessors. Those instructions are only supposed 340 282 * to be used in hypervisor real mode as per the architecture spec. 341 283 */ 342 284 static inline void __raw_rm_writeb(u8 val, volatile void __iomem *paddr) ··· 1021 1079 #define clrsetbits_8(addr, clear, set) clrsetbits(8, addr, clear, set) 1022 1080 1023 1081 #include <asm-generic/io.h> 1082 + 1083 + #ifdef __powerpc64__ 1084 + static inline void __raw_writeq_be(unsigned long v, volatile void __iomem *addr) 1085 + { 1086 + __raw_writeq((__force unsigned long)cpu_to_be64(v), addr); 1087 + } 1088 + #define __raw_writeq_be __raw_writeq_be 1089 + #endif // __powerpc64__ 1024 1090 1025 1091 #endif /* __KERNEL__ */ 1026 1092