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