From: Alan Cox Date: Thu, 19 Oct 2017 21:59:41 +0000 (+0100) Subject: ibmpc: PC implementation of the fast page copy and clear X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=42a38e9d6ac220dd4c18d26aacc1f59b0e158cda;p=FUZIX.git ibmpc: PC implementation of the fast page copy and clear --- diff --git a/Kernel/platform-ibmpc/ibmpc.S b/Kernel/platform-ibmpc/ibmpc.S index 56aa9532..8c1c09a2 100644 --- a/Kernel/platform-ibmpc/ibmpc.S +++ b/Kernel/platform-ibmpc/ibmpc.S @@ -31,6 +31,8 @@ istack_top: .global biosdata_read .global equipment_word + .global do_copy_page + .global do_zero_page init_early: /* Dig useful information out of the BIOS */ @@ -418,6 +420,47 @@ biosdata_read: popw %bp ret +do_copy_page: + pushw %bp + movw %sp,%bp + pushw %es + pushw %ds + pushw %si + pushw %di + movw 4(%bp),%ax + movw %ax,%es + movw 6(%bp),%ax + movw %ax,%ds + xorw %si,%si + movw %si,%di + movw $0x0800,%cx /* Change me if not using 4K pages */ + rep movsw + popw %di + popw %si + popw %ds + popw %es + popw %bp + ret + +do_zero_page: + pushw %bp + movw %sp,%bp + pushw %es + pushw %di + movw 4(%bp),%ax + movw %ax,%es + movw 6(%bp),%ax + movw %ax,%ds + xorw %ax,%ax + xorw %ax,%si + movw %ax,%di + movw $0x0800,%cx /* Change me if not using 4K pages */ + rep stosw + popw %si + popw %es + popw %bp + ret + kernel_ds: .word 0