On Mon, Aug 22, 2022 at 12:31:45AM +1000, Jonathan Gray wrote:
> libkern bzero doesn't have the 486 path but is otherwise the same
>

ok mlarkin (but didnt test)

> diff --git sys/arch/i386/i386/locore.s sys/arch/i386/i386/locore.s
> index dba6ce75b81..3055a06812c 100644
> --- sys/arch/i386/i386/locore.s
> +++ sys/arch/i386/i386/locore.s
> @@ -1518,73 +1518,6 @@ _C_LABEL(doreti_iret):
>  #include <i386/i386/vector.s>
>  #include <i386/isa/icu.s>
>
> -/*
> - * bzero (void *b, size_t len)
> - *   write len zero bytes to the string b.
> - */
> -
> -ENTRY(bzero)
> -     pushl   %edi
> -     movl    8(%esp),%edi
> -     movl    12(%esp),%edx
> -
> -     xorl    %eax,%eax               /* set fill data to 0 */
> -
> -     /*
> -      * if the string is too short, it's really not worth the overhead
> -      * of aligning to word boundaries, etc.  So we jump to a plain
> -      * unaligned set.
> -      */
> -     cmpl    $16,%edx
> -     jb      7f
> -
> -     movl    %edi,%ecx               /* compute misalignment */
> -     negl    %ecx
> -     andl    $3,%ecx
> -     subl    %ecx,%edx
> -     rep                             /* zero until word aligned */
> -     stosb
> -
> -     cmpl    $CPUCLASS_486,_C_LABEL(cpu_class)
> -     jne     8f
> -
> -     movl    %edx,%ecx
> -     shrl    $6,%ecx
> -     jz      8f
> -     andl    $63,%edx
> -1:   movl    %eax,(%edi)
> -     movl    %eax,4(%edi)
> -     movl    %eax,8(%edi)
> -     movl    %eax,12(%edi)
> -     movl    %eax,16(%edi)
> -     movl    %eax,20(%edi)
> -     movl    %eax,24(%edi)
> -     movl    %eax,28(%edi)
> -     movl    %eax,32(%edi)
> -     movl    %eax,36(%edi)
> -     movl    %eax,40(%edi)
> -     movl    %eax,44(%edi)
> -     movl    %eax,48(%edi)
> -     movl    %eax,52(%edi)
> -     movl    %eax,56(%edi)
> -     movl    %eax,60(%edi)
> -     addl    $64,%edi
> -     decl    %ecx
> -     jnz     1b
> -
> -8:   movl    %edx,%ecx               /* zero by words */
> -     shrl    $2,%ecx
> -     andl    $3,%edx
> -     rep
> -     stosl
> -
> -7:   movl    %edx,%ecx               /* zero remainder bytes */
> -     rep
> -     stosb
> -
> -     popl    %edi
> -     ret
> -
>  #if !defined(SMALL_KERNEL)
>  ENTRY(sse2_pagezero)
>       pushl   %ebx
> diff --git sys/lib/libkern/arch/i386/bzero.S sys/lib/libkern/arch/i386/bzero.S
> index 82b64b4d663..684ff54d20b 100644
> --- sys/lib/libkern/arch/i386/bzero.S
> +++ sys/lib/libkern/arch/i386/bzero.S
> @@ -7,7 +7,6 @@
>
>  #include <machine/asm.h>
>
> -#ifndef _KERNEL
>  ENTRY(bzero)
>       pushl   %edi
>       movl    8(%esp),%edi
> @@ -42,4 +41,3 @@ L1: movl    %edx,%ecx               /* zero remainder by 
> bytes */
>
>       popl    %edi
>       ret
> -#endif
>

Reply via email to