From 1fa155830ba6bb658db68ed6de037df9b033ed7f Mon Sep 17 00:00:00 2001 From: Venkatesh Srinivas Date: Fri, 9 Dec 2011 22:32:10 -0800 Subject: [PATCH] kernel -- Remove i686_pagezero. i686_pagezero spent read bandwidth to search for the first non-zero word in a page and zeroed from there. This was silly; the contents of the page didn't matter and reading it was a waste of time. bzero() is used directly. --- sys/platform/pc32/i386/bzero.s | 50 ------------------------------ sys/platform/pc32/i386/pmap.c | 16 ++-------- sys/platform/pc32/include/md_var.h | 1 - 3 files changed, 2 insertions(+), 65 deletions(-) diff --git a/sys/platform/pc32/i386/bzero.s b/sys/platform/pc32/i386/bzero.s index 9f06fe648c..48de8afda5 100644 --- a/sys/platform/pc32/i386/bzero.s +++ b/sys/platform/pc32/i386/bzero.s @@ -87,53 +87,3 @@ ENTRY(bzero) popl %edi ret -ENTRY(i686_pagezero) - pushl %edi - pushl %ebx - - movl 12(%esp), %edi - movl $1024, %ecx - cld - - ALIGN_TEXT -1: - xorl %eax, %eax - repe - scasl - jnz 2f - - popl %ebx - popl %edi - ret - - ALIGN_TEXT - -2: - incl %ecx - subl $4, %edi - - movl %ecx, %edx - cmpl $16, %ecx - - jge 3f - - movl %edi, %ebx - andl $0x3f, %ebx - shrl %ebx - shrl %ebx - movl $16, %ecx - subl %ebx, %ecx - -3: - subl %ecx, %edx - rep - stosl - - movl %edx, %ecx - testl %edx, %edx - jnz 1b - - popl %ebx - popl %edi - ret - diff --git a/sys/platform/pc32/i386/pmap.c b/sys/platform/pc32/i386/pmap.c index 841b068128..24c3c21099 100644 --- a/sys/platform/pc32/i386/pmap.c +++ b/sys/platform/pc32/i386/pmap.c @@ -2691,13 +2691,7 @@ pmap_zero_page(vm_paddr_t phys) *(int *)gd->gd_CMAP3 = PG_V | PG_RW | (phys & PG_FRAME) | PG_A | PG_M; cpu_invlpg(gd->gd_CADDR3); - -#if defined(I686_CPU) - if (cpu_class == CPUCLASS_686) - i686_pagezero(gd->gd_CADDR3); - else -#endif - bzero(gd->gd_CADDR3, PAGE_SIZE); + bzero(gd->gd_CADDR3, PAGE_SIZE); *(int *) gd->gd_CMAP3 = 0; crit_exit(); } @@ -2747,13 +2741,7 @@ pmap_zero_page_area(vm_paddr_t phys, int off, int size) panic("pmap_zero_page: CMAP3 busy"); *(int *) gd->gd_CMAP3 = PG_V | PG_RW | (phys & PG_FRAME) | PG_A | PG_M; cpu_invlpg(gd->gd_CADDR3); - -#if defined(I686_CPU) - if (cpu_class == CPUCLASS_686 && off == 0 && size == PAGE_SIZE) - i686_pagezero(gd->gd_CADDR3); - else -#endif - bzero((char *)gd->gd_CADDR3 + off, size); + bzero((char *)gd->gd_CADDR3 + off, size); *(int *) gd->gd_CMAP3 = 0; crit_exit(); } diff --git a/sys/platform/pc32/include/md_var.h b/sys/platform/pc32/include/md_var.h index ab6fc2faee..1f6addae86 100644 --- a/sys/platform/pc32/include/md_var.h +++ b/sys/platform/pc32/include/md_var.h @@ -123,7 +123,6 @@ void asm_xmm_memcpy(void); void asm_generic_bcopy(void); void asm_mmx_bcopy(void); void asm_xmm_bcopy(void); -void i686_pagezero (void *addr); void init_AMD_Elan_sc520(void); void setidt (int idx, alias_for_inthand_t *func, int typ, int dpl, int selec); -- 2.41.0