From: Matthew Dillon Date: Mon, 23 Oct 2006 15:42:50 +0000 (+0000) Subject: Get rid of the indirect function pointer for bzero(). We haven't used it X-Git-Tag: v2.0.1~4217 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/afaa1d56145a9087b56db467d889f7c1e0185beb Get rid of the indirect function pointer for bzero(). We haven't used it to install a more 'optimized' version of bzero in a long time, and it isn't compatible with libc. --- diff --git a/sys/dev/video/fb/fbreg.h b/sys/dev/video/fb/fbreg.h index d9b5f72f2b..44e472db53 100644 --- a/sys/dev/video/fb/fbreg.h +++ b/sys/dev/video/fb/fbreg.h @@ -24,7 +24,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/fb/fbreg.h,v 1.6 1999/12/29 04:35:36 peter Exp $ - * $DragonFly: src/sys/dev/video/fb/fbreg.h,v 1.8 2006/09/10 01:26:37 dillon Exp $ + * $DragonFly: src/sys/dev/video/fb/fbreg.h,v 1.9 2006/10/23 15:42:49 dillon Exp $ */ #ifndef _DEV_FB_FBREG_H_ @@ -39,11 +39,10 @@ #define bcopy_io(s, d, c) generic_bcopy((void *)(s), (void *)(d), (c)) #define bcopy_toio(s, d, c) generic_bcopy((void *)(s), (void *)(d), (c)) #define bcopy_fromio(s, d, c) generic_bcopy((void *)(s), (void *)(d), (c)) -#define bzero_io(d, c) generic_bzero((void *)(d), (c)) +#define bzero_io(d, c) bzero((void *)(d), (c)) #define fill_io(p, d, c) fill((p), (void *)(d), (c)) #define fillw_io(p, d, c) fillw((p), (void *)(d), (c)) void generic_bcopy(const void *s, void *d, size_t c); -void generic_bzero(void *d, size_t c); #else /* !__i386__ */ #define bcopy_io(s, d, c) memcpy_io((d), (s), (c)) #define bcopy_toio(s, d, c) memcpy_toio((d), (void *)(s), (c)) diff --git a/sys/platform/pc32/i386/bzero.s b/sys/platform/pc32/i386/bzero.s index fb85051ac4..1dd1bb6a92 100644 --- a/sys/platform/pc32/i386/bzero.s +++ b/sys/platform/pc32/i386/bzero.s @@ -31,7 +31,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/platform/pc32/i386/bzero.s,v 1.4 2006/10/22 18:42:11 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/i386/bzero.s,v 1.5 2006/10/23 15:42:45 dillon Exp $ */ /* * void bzero(void *buf, u_int len) (arguments passed on stack) @@ -49,7 +49,7 @@ .text /* - * GCC-4.x may call memset directly, we can't use an indirect pointer. + * NOTE: GCC-4.x may call memset directly, we can't use an indirect pointer. */ ENTRY(memset) pushl %edi @@ -64,7 +64,11 @@ ENTRY(memset) orl %edx,%eax jmp 2f -ENTRY(generic_bzero) +/* + * Ignore inefficiencies due to alignment. Most callers will supply + * reasonably aligned pointers. + */ +ENTRY(bzero) pushl %edi subl %eax,%eax movl 4+4(%esp),%edi diff --git a/sys/platform/pc32/i386/support.s b/sys/platform/pc32/i386/support.s index 505049ab73..cb459e58fc 100644 --- a/sys/platform/pc32/i386/support.s +++ b/sys/platform/pc32/i386/support.s @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/i386/support.s,v 1.67.2.5 2001/08/15 01:23:50 peter Exp $ - * $DragonFly: src/sys/platform/pc32/i386/support.s,v 1.14 2006/10/22 18:42:11 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/i386/support.s,v 1.15 2006/10/23 15:42:45 dillon Exp $ */ #include "use_npx.h" @@ -55,10 +55,6 @@ memcpy_vector: bcopy_vector: .long asm_generic_bcopy - .globl bzero -bzero: - .long generic_bzero - .globl ovbcopy_vector ovbcopy_vector: .long asm_generic_bcopy diff --git a/sys/platform/pc32/include/md_var.h b/sys/platform/pc32/include/md_var.h index 59078f5181..0bded5a253 100644 --- a/sys/platform/pc32/include/md_var.h +++ b/sys/platform/pc32/include/md_var.h @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/include/md_var.h,v 1.35.2.4 2003/01/22 20:14:53 jhb Exp $ - * $DragonFly: src/sys/platform/pc32/include/md_var.h,v 1.18 2006/05/20 02:42:06 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/include/md_var.h,v 1.19 2006/10/23 15:42:46 dillon Exp $ */ #ifndef _MACHINE_MD_VAR_H_ @@ -45,6 +45,7 @@ extern vm_paddr_t Maxmem; extern u_int atdevbase; /* offset in virtual memory of ISA io mem */ extern void **bcopy_vector; extern void **memcpy_vector; +extern void **ovbcopy_vector; extern int busdma_swi_pending; extern int (*copyin_vector) (const void *udaddr, void *kaddr, size_t len); @@ -61,7 +62,6 @@ extern char cpu_vendor[]; extern u_int cyrix_did; extern char kstack[]; extern int nfs_diskless_valid; -extern void **ovbcopy_vector; extern char sigcode[]; extern int szsigcode; diff --git a/sys/platform/pc32/isa/npx.c b/sys/platform/pc32/isa/npx.c index d46ac96edb..c55bac0db6 100644 --- a/sys/platform/pc32/isa/npx.c +++ b/sys/platform/pc32/isa/npx.c @@ -33,7 +33,7 @@ * * from: @(#)npx.c 7.2 (Berkeley) 5/12/91 * $FreeBSD: src/sys/i386/isa/npx.c,v 1.80.2.3 2001/10/20 19:04:38 tegge Exp $ - * $DragonFly: src/sys/platform/pc32/isa/npx.c,v 1.33 2006/09/19 11:47:35 corecode Exp $ + * $DragonFly: src/sys/platform/pc32/isa/npx.c,v 1.34 2006/10/23 15:42:48 dillon Exp $ */ #include "opt_cpu.h" @@ -499,7 +499,7 @@ npx_attach(device_t dev) ovbcopy_vector = i586_bcopy; } if (!(flags & NPX_DISABLE_I586_OPTIMIZED_BZERO)) - bzero = i586_bzero; + bzero_vector = i586_bzero; if (!(flags & NPX_DISABLE_I586_OPTIMIZED_COPYIO)) { copyin_vector = i586_copyin; copyout_vector = i586_copyout; diff --git a/sys/sys/systm.h b/sys/sys/systm.h index 80c6a9c0c6..6f98926f3b 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -37,7 +37,7 @@ * * @(#)systm.h 8.7 (Berkeley) 3/29/95 * $FreeBSD: src/sys/sys/systm.h,v 1.111.2.18 2002/12/17 18:04:02 sam Exp $ - * $DragonFly: src/sys/sys/systm.h,v 1.43 2006/10/20 17:02:13 dillon Exp $ + * $DragonFly: src/sys/sys/systm.h,v 1.44 2006/10/23 15:42:50 dillon Exp $ */ #ifndef _SYS_SYSTM_H_ @@ -164,13 +164,7 @@ u_quad_t strtouq (const char *, char **, int); */ void bcopy (volatile const void *from, volatile void *to, size_t len); void ovbcopy (const void *from, void *to, size_t len); - -#ifdef __i386__ -extern void (*bzero) (volatile void *buf, size_t len); -#else -void bzero (void *buf, size_t len); -#endif - +void bzero (volatile void *buf, size_t len); void *memcpy (void *to, const void *from, size_t len); int copystr (const void *kfaddr, void *kdaddr, size_t len,