From 1741cb8ed375739faba0b07d996f3ee73f4e9431 Mon Sep 17 00:00:00 2001 From: jsg Date: Mon, 22 Aug 2022 09:33:40 +0000 Subject: [PATCH] remove locore.s bzero and use libkern bzero on i386 libkern bzero doesn't have the 486 path but is otherwise the same ok mlarkin@ deraadt@ --- sys/arch/i386/i386/locore.s | 69 +------------------------------ sys/lib/libkern/arch/i386/bzero.S | 4 +- 2 files changed, 2 insertions(+), 71 deletions(-) diff --git a/sys/arch/i386/i386/locore.s b/sys/arch/i386/i386/locore.s index 98ec7f4683e..d5ea4b89db0 100644 --- a/sys/arch/i386/i386/locore.s +++ b/sys/arch/i386/i386/locore.s @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.s,v 1.196 2022/08/22 08:53:55 jsg Exp $ */ +/* $OpenBSD: locore.s,v 1.197 2022/08/22 09:33:40 jsg Exp $ */ /* $NetBSD: locore.s,v 1.145 1996/05/03 19:41:19 christos Exp $ */ /*- @@ -1518,73 +1518,6 @@ _C_LABEL(doreti_iret): #include #include -/* - * 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 a/sys/lib/libkern/arch/i386/bzero.S b/sys/lib/libkern/arch/i386/bzero.S index 82b64b4d663..b1a7cec656d 100644 --- a/sys/lib/libkern/arch/i386/bzero.S +++ b/sys/lib/libkern/arch/i386/bzero.S @@ -1,4 +1,4 @@ -/* $OpenBSD: bzero.S,v 1.5 2014/11/29 18:51:23 tedu Exp $ */ +/* $OpenBSD: bzero.S,v 1.6 2022/08/22 09:33:40 jsg Exp $ */ /* * Written by J.T. Conklin . @@ -7,7 +7,6 @@ #include -#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 -- 2.20.1