ide_iops.h 791 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /* Generic I/O and MEMIO string operations. */
  3. #define __ide_insw insw
  4. #define __ide_insl insl
  5. #define __ide_outsw outsw
  6. #define __ide_outsl outsl
  7. static __inline__ void __ide_mm_insw(void __iomem *port, void *addr, u32 count)
  8. {
  9. while (count--) {
  10. *(u16 *)addr = readw(port);
  11. addr += 2;
  12. }
  13. }
  14. static __inline__ void __ide_mm_insl(void __iomem *port, void *addr, u32 count)
  15. {
  16. while (count--) {
  17. *(u32 *)addr = readl(port);
  18. addr += 4;
  19. }
  20. }
  21. static __inline__ void __ide_mm_outsw(void __iomem *port, void *addr, u32 count)
  22. {
  23. while (count--) {
  24. writew(*(u16 *)addr, port);
  25. addr += 2;
  26. }
  27. }
  28. static __inline__ void __ide_mm_outsl(void __iomem * port, void *addr, u32 count)
  29. {
  30. while (count--) {
  31. writel(*(u32 *)addr, port);
  32. addr += 4;
  33. }
  34. }