io-64-nonatomic-lo-hi.h 610 B

1234567891011121314151617181920212223242526272829303132
  1. #ifndef _LINUX_IO_64_NONATOMIC_LO_HI_H_
  2. #define _LINUX_IO_64_NONATOMIC_LO_HI_H_
  3. #include <linux/io.h>
  4. #include <asm-generic/int-ll64.h>
  5. static inline __u64 lo_hi_readq(const volatile void __iomem *addr)
  6. {
  7. const volatile u32 __iomem *p = addr;
  8. u32 low, high;
  9. low = readl(p);
  10. high = readl(p + 1);
  11. return low + ((u64)high << 32);
  12. }
  13. static inline void lo_hi_writeq(__u64 val, volatile void __iomem *addr)
  14. {
  15. writel(val, addr);
  16. writel(val >> 32, addr + 4);
  17. }
  18. #ifndef readq
  19. #define readq lo_hi_readq
  20. #endif
  21. #ifndef writeq
  22. #define writeq lo_hi_writeq
  23. #endif
  24. #endif /* _LINUX_IO_64_NONATOMIC_LO_HI_H_ */