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

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