From 977f9ab515e707449e044bf6c3f71b4cd82f449d Mon Sep 17 00:00:00 2001 From: Jeff Roberson Date: Wed, 1 Oct 2003 05:25:27 +0000 Subject: [PATCH] - Add ss2_pagezero() for zeroing pages using the movnti instruction. This instruction is enabled with SSE2 but does not use SSE registers. It is a "non-temporal" move which bypasses the cache and does not dirty lines. --- sys/i386/i386/support.s | 14 ++++++++++++++ sys/i386/include/md_var.h | 1 + 2 files changed, 15 insertions(+) diff --git a/sys/i386/i386/support.s b/sys/i386/i386/support.s index 6af498019e5d..b03f1dc2e828 100644 --- a/sys/i386/i386/support.s +++ b/sys/i386/i386/support.s @@ -350,6 +350,20 @@ intreg_i586_bzero: ret #endif /* I586_CPU && defined(DEV_NPX) */ +ENTRY(sse2_pagezero) + pushl %ebx + movl 8(%esp),%ecx + movl %ecx,%eax + addl $4096,%eax + xor %ebx,%ebx +1: + movnti %ebx,(%ecx) + addl $4,%ecx + cmpl %ecx,%eax + jne 1b + popl %ebx + ret + ENTRY(i686_pagezero) pushl %edi pushl %ebx diff --git a/sys/i386/include/md_var.h b/sys/i386/include/md_var.h index 4fe29d3ad352..526c39017879 100644 --- a/sys/i386/include/md_var.h +++ b/sys/i386/include/md_var.h @@ -93,6 +93,7 @@ void i586_bzero(void *buf, size_t len); int i586_copyin(const void *udaddr, void *kaddr, size_t len); int i586_copyout(const void *kaddr, void *udaddr, size_t len); void i686_pagezero(void *addr); +void sse2_pagezero(void *addr); void init_AMD_Elan_sc520(void); int is_physical_memory(vm_offset_t addr); vm_paddr_t kvtop(void *addr);