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

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