/* * arch/i386/lib/memcpy_io.S * * The most general form of memory copy to/from I/O space, used for * devices which can handle arbitrary transactions with appropriate * handling of byte enables. The goal is to produce the minimum * number of naturally aligned transactions on the bus. */ #include .globl memcpy_toio .type memcpy_toio, @function memcpy_toio: pushl %edi pushl %esi #ifdef CONFIG_REGPARM movl %eax, %edi movl %edx, %esi #else movl 12(%esp), %eax movl 16(%esp), %edx movl 20(%esp), %ecx #endif jecxz 1f testl $1, %edi jz 2f movsb decl %ecx 2: cmpl $2, %ecx jb 3f testl $2, %edi jz 4f movsw decl %ecx decl %ecx 4: movl %ecx, %edx shrl $2, %ecx jz 5f rep ; movsl 5: movl %edx, %ecx testb $2, %cl jz 3f movsw 3: testb $1, %cl jz 1f movsb 1: pop %esi pop %edi ret .size memcpy_toio, .-memcpy_toio .globl memcpy_toio .type memcpy_fromio, @function memcpy_fromio: pushl %edi pushl %esi #ifdef CONFIG_REGPARM movl %eax, %edi movl %edx, %esi #else movl 12(%esp), %eax movl 16(%esp), %edx movl 20(%esp), %ecx #endif jecxz 1f testl $1, %esi jz 2f movsb decl %ecx 2: cmpl $2, %ecx jb 3f testl $2, %esi jz 4f movsw decl %ecx decl %ecx 4: movl %ecx, %edx shrl $2, %ecx jz 5f rep ; movsl 5: movl %edx, %ecx testb $2, %cl jz 3f movsw 3: testb $1, %cl jz 1f movsb 1: pop %esi pop %edi ret .size memcpy_fromio, .-memcpy_fromio