vga_copy.S 589 B

1234567891011121314151617181920212223
  1. /* VGA framebuffer row copy: rep movsl optimized for P5 USWC write-combining.
  2. *
  3. * void vga_fb_copy_row(void *dst, void *src, unsigned int dwords);
  4. *
  5. * On Pentium (P5), rep movsl to UC memory (PCI framebuffer) uses the
  6. * 64-byte USWC write-combining buffer. Writes are batched and flushed
  7. * as burst transfers to VRAM, avoiding per-dword PCI bus stalls.
  8. */
  9. .code32
  10. .text
  11. .globl vga_fb_copy_row
  12. vga_fb_copy_row:
  13. pushl %esi
  14. pushl %edi
  15. movl 12(%esp), %edi /* dst */
  16. movl 16(%esp), %esi /* src */
  17. movl 20(%esp), %ecx /* dword count */
  18. cld
  19. rep movsl
  20. popl %edi
  21. popl %esi
  22. ret