Tue Mar 17 23:42:45 2009 UTC ()
Add local declarations of bcmp() and bzero() because libkern.h no longer
provides those declarations.

It's possible that these can be removed later when we find out whether
these functions are actually needed in the kernel, but meanwhile, this
allows alpha, hp700 and the powerpc ports (who all build these as part
of libkern) to complete their builds.


(he)
diff -r1.2 -r1.3 src/common/lib/libc/string/bcmp.c
diff -r1.6 -r1.7 src/common/lib/libc/string/memset.c

cvs diff -r1.2 -r1.3 src/common/lib/libc/string/bcmp.c (expand / switch to unified diff)

--- src/common/lib/libc/string/bcmp.c 2007/06/04 18:19:26 1.2
+++ src/common/lib/libc/string/bcmp.c 2009/03/17 23:42:45 1.3
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: bcmp.c,v 1.2 2007/06/04 18:19:26 christos Exp $ */ 1/* $NetBSD: bcmp.c,v 1.3 2009/03/17 23:42:45 he Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1987, 1993 4 * Copyright (c) 1987, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -24,38 +24,40 @@ @@ -24,38 +24,40 @@
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE. 29 * SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33#if defined(LIBC_SCCS) && !defined(lint) 33#if defined(LIBC_SCCS) && !defined(lint)
34#if 0 34#if 0
35static char sccsid[] = "@(#)bcmp.c 8.1 (Berkeley) 6/4/93"; 35static char sccsid[] = "@(#)bcmp.c 8.1 (Berkeley) 6/4/93";
36#else 36#else
37__RCSID("$NetBSD: bcmp.c,v 1.2 2007/06/04 18:19:26 christos Exp $"); 37__RCSID("$NetBSD: bcmp.c,v 1.3 2009/03/17 23:42:45 he Exp $");
38#endif 38#endif
39#endif /* LIBC_SCCS and not lint */ 39#endif /* LIBC_SCCS and not lint */
40 40
41 41
42#if !defined(_KERNEL) && !defined(_STANDALONE) 42#if !defined(_KERNEL) && !defined(_STANDALONE)
43#include <assert.h> 43#include <assert.h>
44#include <string.h> 44#include <string.h>
45#else 45#else
46#include <lib/libkern/libkern.h> 46#include <lib/libkern/libkern.h>
47#endif 47#endif
48 48
 49int bcmp(const void *, const void *, size_t);
 50
49/* 51/*
50 * bcmp -- vax cmpc3 instruction 52 * bcmp -- vax cmpc3 instruction
51 */ 53 */
52int 54int
53bcmp(const void *b1, const void *b2, size_t length) 55bcmp(const void *b1, const void *b2, size_t length)
54{ 56{
55 const char *p1 = b1, *p2 = b2; 57 const char *p1 = b1, *p2 = b2;
56 58
57 _DIAGASSERT(b1 != 0); 59 _DIAGASSERT(b1 != 0);
58 _DIAGASSERT(b2 != 0); 60 _DIAGASSERT(b2 != 0);
59 61
60 if (length == 0) 62 if (length == 0)
61 return(0); 63 return(0);

cvs diff -r1.6 -r1.7 src/common/lib/libc/string/memset.c (expand / switch to unified diff)

--- src/common/lib/libc/string/memset.c 2008/03/29 14:03:22 1.6
+++ src/common/lib/libc/string/memset.c 2009/03/17 23:42:45 1.7
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: memset.c,v 1.6 2008/03/29 14:03:22 he Exp $ */ 1/* $NetBSD: memset.c,v 1.7 2009/03/17 23:42:45 he Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1990, 1993 4 * Copyright (c) 1990, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to Berkeley by 7 * This code is derived from software contributed to Berkeley by
8 * Mike Hibler and Chris Torek. 8 * Mike Hibler and Chris Torek.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -27,27 +27,27 @@ @@ -27,27 +27,27 @@
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE. 32 * SUCH DAMAGE.
33 */ 33 */
34 34
35#include <sys/cdefs.h> 35#include <sys/cdefs.h>
36#if defined(LIBC_SCCS) && !defined(lint) 36#if defined(LIBC_SCCS) && !defined(lint)
37#if 0 37#if 0
38static char sccsid[] = "@(#)memset.c 8.1 (Berkeley) 6/4/93"; 38static char sccsid[] = "@(#)memset.c 8.1 (Berkeley) 6/4/93";
39#else 39#else
40__RCSID("$NetBSD: memset.c,v 1.6 2008/03/29 14:03:22 he Exp $"); 40__RCSID("$NetBSD: memset.c,v 1.7 2009/03/17 23:42:45 he Exp $");
41#endif 41#endif
42#endif /* LIBC_SCCS and not lint */ 42#endif /* LIBC_SCCS and not lint */
43 43
44#include <sys/types.h> 44#include <sys/types.h>
45 45
46#if !defined(_KERNEL) && !defined(_STANDALONE) 46#if !defined(_KERNEL) && !defined(_STANDALONE)
47#include <assert.h> 47#include <assert.h>
48#include <limits.h> 48#include <limits.h>
49#include <string.h> 49#include <string.h>
50#else 50#else
51#include <lib/libkern/libkern.h> 51#include <lib/libkern/libkern.h>
52#include <machine/limits.h> 52#include <machine/limits.h>
53#endif  53#endif
@@ -56,26 +56,28 @@ __RCSID("$NetBSD: memset.c,v 1.6 2008/03 @@ -56,26 +56,28 @@ __RCSID("$NetBSD: memset.c,v 1.6 2008/03
56#define wmask (wsize - 1) 56#define wmask (wsize - 1)
57 57
58#ifdef _FORTIFY_SOURCE 58#ifdef _FORTIFY_SOURCE
59#undef bzero 59#undef bzero
60#undef memset 60#undef memset
61#endif 61#endif
62 62
63#ifndef __OPTIMIZE_SIZE__ 63#ifndef __OPTIMIZE_SIZE__
64#ifdef BZERO 64#ifdef BZERO
65#define RETURN return 65#define RETURN return
66#define VAL 0 66#define VAL 0
67#define WIDEVAL 0 67#define WIDEVAL 0
68 68
 69void bzero(void *, size_t);
 70
69void 71void
70bzero(void *dst0, size_t length) 72bzero(void *dst0, size_t length)
71#else 73#else
72#define RETURN return (dst0) 74#define RETURN return (dst0)
73#define VAL c0 75#define VAL c0
74#define WIDEVAL c 76#define WIDEVAL c
75 77
76void * 78void *
77memset(void *dst0, int c0, size_t length) 79memset(void *dst0, int c0, size_t length)
78#endif 80#endif
79{ 81{
80 size_t t; 82 size_t t;
81#ifndef BZERO 83#ifndef BZERO