- remove bcmp(9), bcopy(9), and bzero(9) from libkern since <sys/systm.h> has

macro which replace them with mem*() functions in #ifdef _KERNEL as noted
  in man pages
- move declarations of bcopy(3) and bzero(3) into <lib/libsa/stand.h>
  since they are still in libsa for some MD standalone sources
  (I guess all bcmp(3) in standalone sources have been replaced with memcmp(3)
   but they should be replaced with memcmp() anyway)
This commit is contained in:
tsutsui 2009-03-18 12:25:06 +00:00
parent 479c390e0e
commit d0b9e6c924
10 changed files with 33 additions and 32 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: bcmp.c,v 1.3 2009/03/17 23:42:45 he Exp $ */
/* $NetBSD: bcmp.c,v 1.4 2009/03/18 12:25:06 tsutsui Exp $ */
/*
* Copyright (c) 1987, 1993
@ -34,19 +34,21 @@
#if 0
static char sccsid[] = "@(#)bcmp.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: bcmp.c,v 1.3 2009/03/17 23:42:45 he Exp $");
__RCSID("$NetBSD: bcmp.c,v 1.4 2009/03/18 12:25:06 tsutsui Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#if !defined(_KERNEL) && !defined(_STANDALONE)
#if defined(_KERNEL)
#include <lib/libkern/libkern.h>
#else
#if defined(_STANDALONE)
#include <lib/libsa/stand.h>
#else
#include <assert.h>
#include <string.h>
#else
#include <lib/libkern/libkern.h>
#endif
int bcmp(const void *, const void *, size_t);
#endif
/*
* bcmp -- vax cmpc3 instruction

View File

@ -1,4 +1,4 @@
/* $NetBSD: bcopy.c,v 1.8 2008/03/26 06:19:36 apb Exp $ */
/* $NetBSD: bcopy.c,v 1.9 2009/03/18 12:25:06 tsutsui Exp $ */
/*-
* Copyright (c) 1990, 1993
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)bcopy.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: bcopy.c,v 1.8 2008/03/26 06:19:36 apb Exp $");
__RCSID("$NetBSD: bcopy.c,v 1.9 2009/03/18 12:25:06 tsutsui Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@ -46,6 +46,9 @@ __RCSID("$NetBSD: bcopy.c,v 1.8 2008/03/26 06:19:36 apb Exp $");
#include <string.h>
#else
#include <lib/libkern/libkern.h>
#if !defined(MEMCOPY) && defined(_STANDALONE)
#include <lib/libsa/stand.h>
#endif
#endif
#ifdef _FORTIFY_SOURCE

View File

@ -1,4 +1,4 @@
/* $NetBSD: memset.c,v 1.7 2009/03/17 23:42:45 he Exp $ */
/* $NetBSD: memset.c,v 1.8 2009/03/18 12:25:06 tsutsui Exp $ */
/*-
* Copyright (c) 1990, 1993
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)memset.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: memset.c,v 1.7 2009/03/17 23:42:45 he Exp $");
__RCSID("$NetBSD: memset.c,v 1.8 2009/03/18 12:25:06 tsutsui Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@ -49,6 +49,9 @@ __RCSID("$NetBSD: memset.c,v 1.7 2009/03/17 23:42:45 he Exp $");
#include <string.h>
#else
#include <lib/libkern/libkern.h>
#if defined(BZERO) && defined(_STANDALONE)
#include <lib/libsa/stand.h>
#endif
#include <machine/limits.h>
#endif
@ -66,8 +69,6 @@ __RCSID("$NetBSD: memset.c,v 1.7 2009/03/17 23:42:45 he Exp $");
#define VAL 0
#define WIDEVAL 0
void bzero(void *, size_t);
void
bzero(void *dst0, size_t length)
#else

View File

@ -1,9 +1,9 @@
# $NetBSD: Makefile.inc,v 1.25 2005/12/11 12:24:42 christos Exp $
# $NetBSD: Makefile.inc,v 1.26 2009/03/18 12:25:06 tsutsui Exp $
SRCS+= __main.c __assert.c _mcount.S \
imax.c imin.c lmax.c lmin.c max.c min.c ulmax.c ulmin.c \
byte_swap_2.S byte_swap_4.S bswap64.c \
bcmp.c bcopy.S bzero.S ffs.S \
ffs.S \
memchr.c memcmp.c memcpy.S memmove.S memset.c \
softfloat.c \
strcat.c strcmp.c strcpy.c strlen.c strcasecmp.c \

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile.inc,v 1.7 2006/02/04 23:33:37 uwe Exp $
# $NetBSD: Makefile.inc,v 1.8 2009/03/18 12:25:06 tsutsui Exp $
# $OpenBSD: Makefile.inc,v 1.14 2000/12/29 19:04:41 mickey Exp $
@ -6,7 +6,7 @@ SRCS+= __main.c imax.c imin.c lmax.c lmin.c max.c min.c ulmax.c ulmin.c \
random.c ashrdi3.c divdi3.c strncpy.c strncmp.c strcmp.c memchr.c \
memcmp.c memset.c strlen.c strcpy.c \
strcat.c skpc.c strncasecmp.c strtoul.c \
bcmp.c scanc.c ffs.c strlcpy.c bswap16.c bswap32.c bswap64.c bzero.c
scanc.c ffs.c strlcpy.c bswap16.c bswap32.c bswap64.c
SRCS+= __assert.c
SRCS+= milli.S

View File

@ -1,9 +1,8 @@
# $NetBSD: Makefile.inc,v 1.26 2005/12/11 12:24:42 christos Exp $
# $NetBSD: Makefile.inc,v 1.27 2009/03/18 12:25:07 tsutsui Exp $
SRCS+= __main.c __assert.c \
imax.c imin.c lmax.c lmin.c max.c min.c ulmax.c ulmin.c \
bswap16.S bswap32.S bswap64.S \
bcmp.S bzero.S \
memchr.c memcmp.S memcpy.S memmove.S memset.S \
strcat.S strchr.S strcmp.S strcasecmp.c \
strcpy.S strlen.S strncmp.S strncasecmp.c strncpy.S strrchr.S \

View File

@ -1,9 +1,8 @@
# $NetBSD: Makefile.inc,v 1.25 2008/04/18 05:34:04 garbled Exp $
# $NetBSD: Makefile.inc,v 1.26 2009/03/18 12:25:07 tsutsui Exp $
SRCS+= __main.c __assert.c \
imax.c imin.c lmax.c lmin.c max.c min.c ulmax.c ulmin.c \
bswap16.c bswap32.c bswap64.c \
bcmp.c \
memchr.c memcmp.c \
strcat.c strcmp.c strcpy.c strcasecmp.c \
strncasecmp.c strncmp.c strncpy.c \
@ -16,7 +15,6 @@ SRCS+= ffs.S memset.S strlen.S
# Disable the asm versions on evbppc because they break the Explora
.if ${MACHINE} == "evbppc"
bcopy.o: bcopy.c
memcpy.o: memcpy.c
memcmp.o: memcmp.c
memmove.o: memmove.c

View File

@ -1,9 +1,9 @@
# $NetBSD: Makefile.inc,v 1.2 2002/11/25 00:55:22 fvdl Exp $
# $NetBSD: Makefile.inc,v 1.3 2009/03/18 12:25:07 tsutsui Exp $
SRCS+= __main.c __assert.c \
imax.c imin.c lmax.c lmin.c max.c min.c ulmax.c ulmin.c \
byte_swap_2.S byte_swap_4.S bswap64.c \
bcmp.S bzero.S ffs.S \
ffs.S \
memchr.S memcmp.S memcpy.S memmove.S memset.S \
strcat.S strchr.S strcmp.S strcasecmp.c \
strcpy.S strlen.S strncasecmp.c \

View File

@ -1,4 +1,4 @@
/* $NetBSD: libkern.h,v 1.86 2009/03/14 14:46:10 dsl Exp $ */
/* $NetBSD: libkern.h,v 1.87 2009/03/18 12:25:06 tsutsui Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -253,12 +253,6 @@ struct mtprng_state {
uint32_t mt_sparse[3];
};
#ifdef _STANDALONE
int bcmp(const void *, const void *, size_t);
void bcopy(const void *, void *, size_t);
void bzero(void *, size_t);
#endif
/* Prototypes for which GCC built-ins exist. */
void *memcpy(void *, const void *, size_t);
int memcmp(const void *, const void *, size_t);

View File

@ -1,4 +1,4 @@
/* $NetBSD: stand.h,v 1.66 2009/01/17 14:00:36 tsutsui Exp $ */
/* $NetBSD: stand.h,v 1.67 2009/03/18 12:25:07 tsutsui Exp $ */
/*
* Copyright (c) 1999 Christopher G. Demetriou. All rights reserved.
@ -287,4 +287,8 @@ off_t olseek(int, off_t, int);
extern const char HEXDIGITS[];
extern const char hexdigits[];
/* XXX: These should be removed eventually. */
void bcopy(const void *, void *, size_t);
void bzero(void *, size_t);
#endif /* _LIBSA_STAND_H_ */