Skip to content

Commit dc13aa1

Browse files
committed
NetBSD src for "kernel", checkout.sh rev 3d7207df3ee831968994bfb61e516b7e26aaed05
1 parent 7def1f3 commit dc13aa1

File tree

3,081 files changed

+200614
-124267
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,081 files changed

+200614
-124267
lines changed

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $NetBSD: Makefile,v 1.316 2015/07/23 08:03:25 mrg Exp $
1+
# $NetBSD: Makefile,v 1.317 2016/01/14 02:51:25 christos Exp $
22

33
#
44
# This is the top-level makefile for building NetBSD. For an outline of
@@ -163,7 +163,7 @@ afterinstall: .PHONY .MAKE
163163
${MAKEDIRTARGET} share/man makedb
164164
.endif
165165
.if (${MKUNPRIVED} != "no" && ${MKINFO} != "no")
166-
${MAKEDIRTARGET} gnu/usr.bin/texinfo/install-info infodir-meta
166+
${MAKEDIRTARGET} external/gpl2/texinfo/bin/install-info infodir-meta
167167
.endif
168168
.if !defined(NOPOSTINSTALL)
169169
${MAKEDIRTARGET} . postinstall-check

build.sh

+23-16
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#! /usr/bin/env sh
2-
# $NetBSD: build.sh,v 1.308 2015/06/27 06:00:28 matt Exp $
2+
# $NetBSD: build.sh,v 1.309 2016/04/29 16:08:09 christos Exp $
33
#
44
# Copyright (c) 2001-2011 The NetBSD Foundation, Inc.
55
# All rights reserved.
@@ -1593,21 +1593,28 @@ rebuildmake()
15931593
fi
15941594

15951595
# Build bootstrap ${toolprefix}make if needed.
1596-
if ${do_rebuildmake}; then
1597-
statusmsg "Bootstrapping ${toolprefix}make"
1598-
${runcmd} cd "${tmpdir}"
1599-
${runcmd} env CC="${HOST_CC-cc}" CPPFLAGS="${HOST_CPPFLAGS}" \
1600-
CFLAGS="${HOST_CFLAGS--O}" LDFLAGS="${HOST_LDFLAGS}" \
1601-
${HOST_SH} "${TOP}/tools/make/configure" ||
1602-
( cp ${tmpdir}/config.log ${tmpdir}-config.log
1603-
bomb "Configure of ${toolprefix}make failed, see ${tmpdir}-config.log for details" )
1604-
${runcmd} ${HOST_SH} buildmake.sh ||
1605-
bomb "Build of ${toolprefix}make failed"
1606-
make="${tmpdir}/${toolprefix}make"
1607-
${runcmd} cd "${TOP}"
1608-
${runcmd} rm -f usr.bin/make/*.o usr.bin/make/lst.lib/*.o
1609-
done_rebuildmake=true
1596+
if ! ${do_rebuildmake}; then
1597+
return
16101598
fi
1599+
1600+
statusmsg "Bootstrapping ${toolprefix}make"
1601+
${runcmd} cd "${tmpdir}"
1602+
${runcmd} env \
1603+
\
1604+
CC="${HOST_CC-cc}" \
1605+
CPPFLAGS="${HOST_CPPFLAGS} -D_PATH_DEFSYSPATH="'\"'${NETBSDSRCDIR}/share/mk'\"' \
1606+
CFLAGS="${HOST_CFLAGS--O}" \
1607+
LDFLAGS="${HOST_LDFLAGS}" \
1608+
\
1609+
${HOST_SH} "${TOP}/tools/make/configure" ||
1610+
( cp ${tmpdir}/config.log ${tmpdir}-config.log
1611+
bomb "Configure of ${toolprefix}make failed, see ${tmpdir}-config.log for details" )
1612+
${runcmd} ${HOST_SH} buildmake.sh ||
1613+
bomb "Build of ${toolprefix}make failed"
1614+
make="${tmpdir}/${toolprefix}make"
1615+
${runcmd} cd "${TOP}"
1616+
${runcmd} rm -f usr.bin/make/*.o usr.bin/make/lst.lib/*.o
1617+
done_rebuildmake=true
16111618
}
16121619

16131620
# validatemakeparams --
@@ -1869,7 +1876,7 @@ createmakewrapper()
18691876
eval cat <<EOF ${makewrapout}
18701877
#! ${HOST_SH}
18711878
# Set proper variables to allow easy "make" building of a NetBSD subtree.
1872-
# Generated from: \$NetBSD: build.sh,v 1.308 2015/06/27 06:00:28 matt Exp $
1879+
# Generated from: \$NetBSD: build.sh,v 1.309 2016/04/29 16:08:09 christos Exp $
18731880
# with these arguments: ${_args}
18741881
#
18751882

common/include/prop/prop_dictionary.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: prop_dictionary.h,v 1.14 2011/09/30 22:08:18 jym Exp $ */
1+
/* $NetBSD: prop_dictionary.h,v 1.15 2016/01/22 23:03:46 dholland Exp $ */
22

33
/*-
44
* Copyright (c) 2006, 2009 The NetBSD Foundation, Inc.
@@ -33,6 +33,7 @@
3333
#define _PROPLIB_PROP_DICTIONARY_H_
3434

3535
#include <prop/prop_object.h>
36+
#include <prop/prop_array.h>
3637

3738
typedef struct _prop_dictionary *prop_dictionary_t;
3839
typedef struct _prop_dictionary_keysym *prop_dictionary_keysym_t;

common/lib/libc/arch/arm/atomic/atomic_nand_16.S

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: atomic_nand_16.S,v 1.2 2014/03/04 16:15:28 matt Exp $ */
1+
/* $NetBSD: atomic_nand_16.S,v 1.3 2015/12/11 12:41:10 skrll Exp $ */
22

33
/*-
44
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -36,8 +36,8 @@
3636
ENTRY_NP(_atomic_nand_16)
3737
mov ip, r0
3838
1: ldrexh r0, [ip] /* load old value (to be returned) */
39-
mvns r3, r0 /* complement source */
40-
ands r3, r3, r1 /* calculate new value */
39+
ands r3, r0, r1 /* calculate new value step 1 */
40+
mvns r3, r3 /* ... complement for new value */
4141
strexh r2, r3, [ip] /* try to store */
4242
cmp r2, #0 /* succeed? */
4343
bne 1b /* no, try again */
@@ -57,8 +57,8 @@ STRONG_ALIAS(_atomic_nand_ushort,_atomic_nand_16)
5757
ENTRY_NP(_atomic_nand_16_nv)
5858
mov ip, r0 /* need r0 for return value */
5959
1: ldrexh r0, [ip] /* load old value */
60-
mvns r0, r0 /* complement source */
61-
ands r0, r0, r1 /* calculate new value (return value) */
60+
ands r0, r0, r1 /* calculate new value step 1 */
61+
mvns r0, r0 /* ... complement for new value */
6262
strexh r2, r0, [ip] /* try to store */
6363
cmp r2, #0 /* succeed? */
6464
bne 1b /* no, try again? */

common/lib/libc/arch/arm/atomic/atomic_nand_32.S

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: atomic_nand_32.S,v 1.2 2014/03/04 16:15:28 matt Exp $ */
1+
/* $NetBSD: atomic_nand_32.S,v 1.3 2015/12/11 12:41:10 skrll Exp $ */
22

33
/*-
44
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -36,8 +36,8 @@
3636
ENTRY_NP(_atomic_nand_32)
3737
mov ip, r0
3838
1: ldrex r0, [ip] /* load old value (to be returned) */
39-
mvns r3, r0 /* complement source */
40-
ands r3, r3, r1 /* calculate new value */
39+
ands r3, r0, r1 /* calculate new value step 1 */
40+
mvns r3, r3 /* ... complement for new value */
4141
strex r2, r3, [ip] /* try to store */
4242
cmp r2, #0 /* succeed? */
4343
bne 1b /* no, try again */
@@ -59,8 +59,8 @@ STRONG_ALIAS(_atomic_nand_ulong,_atomic_nand_32)
5959
ENTRY_NP(_atomic_nand_32_nv)
6060
mov ip, r0 /* need r0 for return value */
6161
1: ldrex r0, [ip] /* load old value */
62-
mvns r0, r0 /* complement source */
63-
ands r0, r0, r1 /* calculate new value (return value) */
62+
ands r0, r0, r1 /* calculate new value step 1 */
63+
mvns r0, r0 /* ... complement for new value */
6464
strex r2, r0, [ip] /* try to store */
6565
cmp r2, #0 /* succeed? */
6666
bne 1b /* no, try again? */

common/lib/libc/arch/arm/atomic/atomic_nand_64.S

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: atomic_nand_64.S,v 1.3 2014/03/04 16:15:28 matt Exp $ */
1+
/* $NetBSD: atomic_nand_64.S,v 1.4 2015/12/11 12:41:10 skrll Exp $ */
22
/*-
33
* Copyright (c) 2013 The NetBSD Foundation, Inc.
44
* All rights reserved.
@@ -40,10 +40,10 @@ ENTRY_NP(_atomic_nand_64_nv)
4040
#endif
4141
mov ip, r0 /* need r0 for return value */
4242
1: ldrexd r0, r1, [ip] /* load old value */
43-
mvns r0, r0 /* complement old value */
44-
mvns r1, r1 /* complement old value */
45-
ands r0, r0, r2 /* calculate new value */
46-
ands r1, r1, r3 /* calculate new value */
43+
ands r0, r0, r2 /* calculate new value step 1 */
44+
ands r1, r1, r3 /* calculate new value step 2 */
45+
mvns r0, r0 /* ... complement for new value */
46+
mvns r1, r1 /* ... complement for new value */
4747
strexd r4, r0, r1, [ip] /* try to store */
4848
cmp r4, #0 /* succeed? */
4949
bne 1b /* no, try again? */

common/lib/libc/arch/arm/atomic/atomic_nand_8.S

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: atomic_nand_8.S,v 1.2 2014/03/04 16:15:28 matt Exp $ */
1+
/* $NetBSD: atomic_nand_8.S,v 1.3 2015/12/11 12:41:10 skrll Exp $ */
22

33
/*-
44
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -36,8 +36,8 @@
3636
ENTRY_NP(_atomic_nand_8)
3737
mov ip, r0
3838
1: ldrexb r0, [ip] /* load old value (to be returned) */
39-
mvns r3, r0 /* complement source */
40-
ands r3, r3, r1 /* calculate new value */
39+
ands r3, r0, r1 /* calculate new value step 1 */
40+
mvns r3, r3 /* ... complement for new value */
4141
strexb r2, r3, [ip] /* try to store */
4242
cmp r2, #0 /* succeed? */
4343
bne 1b /* no, try again */
@@ -57,8 +57,8 @@ STRONG_ALIAS(_atomic_nand_uchar,_atomic_nand_8)
5757
ENTRY_NP(_atomic_nand_8_nv)
5858
mov ip, r0 /* need r0 for return value */
5959
1: ldrexb r0, [ip] /* load old value */
60-
mvns r0, r0 /* complement source */
61-
ands r0, r0, r1 /* calculate new value (return value) */
60+
ands r0, r0, r1 /* calculate new value step 1*/
61+
mvns r0, r0 /* ... complement for new value */
6262
strexb r2, r0, [ip] /* try to store */
6363
cmp r2, #0 /* succeed? */
6464
bne 1b /* no, try again? */

common/lib/libc/arch/arm/atomic/sync_fetch_and_nand_8.S

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: sync_fetch_and_nand_8.S,v 1.4 2015/05/17 22:08:24 justin Exp $ */
1+
/* $NetBSD: sync_fetch_and_nand_8.S,v 1.5 2015/12/11 12:41:10 skrll Exp $ */
22

33
/*-
44
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -41,10 +41,10 @@ ENTRY_NP(__sync_fetch_and_nand_8)
4141
mov r2, r1
4242
#endif
4343
1: ldrexd r0, r1, [ip] /* load old value */
44-
mvns r4, r0 /* complement old value */
45-
mvns r5, r0 /* complement old value */
46-
ands r4, r4, r2 /* calculate new value */
47-
ands r5, r5, r3 /* calculate new value */
44+
ands r4, r0, r2 /* calculate new value step 1 */
45+
ands r5, r1, r3 /* calculate new value step 1 */
46+
mvns r4, r4 /* complement new value */
47+
mvns r5, r5 /* complement new value */
4848
strexd r6, r4, r5, [ip] /* try to store */
4949
cmp r6, #0 /* succeed? */
5050
bne 1b /* no, try again */

common/lib/libc/arch/sparc/atomic/Makefile.inc

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# $NetBSD: Makefile.inc,v 1.19 2015/10/18 02:28:07 nakayama Exp $
1+
# $NetBSD: Makefile.inc,v 1.21 2016/02/27 19:19:33 joerg Exp $
22

33
.include <bsd.own.mk>
44

55
# This is called with MACHINE=sparc64 && MACHINE_ARCH=sparc when building
66
# 32 bit kernels for ultrasparc hardware
7-
.if ${MACHINE} == "sparc64"
7+
.if ${MACHINE} == "sparc64" && ${HAVE_LLVM:Uno} == "no"
88

99
SPARC64DIR= ${.PARSEDIR}/../../sparc64/atomic
1010
.PATH.c: ${SPARC64DIR}
@@ -43,7 +43,8 @@ SRCS+= atomic_nand_16_cas.c atomic_nand_8_cas.c \
4343
atomic_swap_16_cas.c atomic_swap_8_cas.c \
4444
atomic_c11_compare_exchange_cas_32.c \
4545
atomic_c11_compare_exchange_cas_16.c \
46-
atomic_c11_compare_exchange_cas_8.c
46+
atomic_c11_compare_exchange_cas_8.c \
47+
atomic_load.c atomic_store.c
4748
. endif
4849

4950
. if (${LIB} == "kern" || ${LIB} == "rump")

common/lib/libc/atomic/atomic_add_32_nv_cas.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: atomic_add_32_nv_cas.c,v 1.6 2014/02/22 17:08:30 martin Exp $ */
1+
/* $NetBSD: atomic_add_32_nv_cas.c,v 1.7 2016/02/27 19:20:01 joerg Exp $ */
22

33
/*-
44
* Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -49,6 +49,7 @@ atomic_add_32_nv(volatile uint32_t *addr, int32_t val)
4949
#undef atomic_add_32_nv
5050
atomic_op_alias(atomic_add_32_nv,_atomic_add_32_nv)
5151
crt_alias(__sync_add_and_fetch_4,_atomic_add_32_nv)
52+
crt_alias(__atomic_add_fetch_4,_atomic_add_32_nv)
5253

5354
#undef atomic_add_int_nv
5455
atomic_op_alias(atomic_add_int_nv,_atomic_add_32_nv)

common/lib/libc/gmon/mcount.c

+28-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: mcount.c,v 1.10 2012/03/20 16:21:41 matt Exp $ */
1+
/* $NetBSD: mcount.c,v 1.13 2016/02/28 02:56:39 christos Exp $ */
22

33
/*
44
* Copyright (c) 2003, 2004 Wasabi Systems, Inc.
@@ -76,12 +76,13 @@
7676
#if 0
7777
static char sccsid[] = "@(#)mcount.c 8.1 (Berkeley) 6/4/93";
7878
#else
79-
__RCSID("$NetBSD: mcount.c,v 1.10 2012/03/20 16:21:41 matt Exp $");
79+
__RCSID("$NetBSD: mcount.c,v 1.13 2016/02/28 02:56:39 christos Exp $");
8080
#endif
8181
#endif
8282

8383
#include <sys/param.h>
8484
#include <sys/gmon.h>
85+
#include <sys/lock.h>
8586

8687
#ifndef _KERNEL
8788
#include "reentrant.h"
@@ -93,6 +94,10 @@ extern struct gmonparam _gmondummy;
9394
struct gmonparam *_m_gmon_alloc(void);
9495
#endif
9596

97+
#if defined(_KERNEL) && !defined(_RUMPKERNEL) && defined(MULTIPROCESSOR)
98+
__cpu_simple_lock_t __mcount_lock;
99+
#endif
100+
96101
#ifndef __LINT__
97102
_MCOUNT_DECL(u_long, u_long)
98103
#ifdef _KERNEL
@@ -140,12 +145,17 @@ _MCOUNT_DECL(u_long frompc, u_long selfpc)
140145

141146
#if defined(_REENTRANT) && !defined(_KERNEL)
142147
if (__isthreaded) {
148+
/* prevent re-entry via thr_getspecific */
149+
if (_gmonparam.state != GMON_PROF_ON)
150+
return;
151+
_gmonparam.state = GMON_PROF_BUSY;
143152
p = thr_getspecific(_gmonkey);
144153
if (p == NULL) {
145154
/* Prevent recursive calls while allocating */
146155
thr_setspecific(_gmonkey, &_gmondummy);
147156
p = _m_gmon_alloc();
148157
}
158+
_gmonparam.state = GMON_PROF_ON;
149159
} else
150160
#endif
151161
p = &_gmonparam;
@@ -155,8 +165,12 @@ _MCOUNT_DECL(u_long frompc, u_long selfpc)
155165
*/
156166
if (p->state != GMON_PROF_ON)
157167
return;
158-
#ifdef _KERNEL
168+
#if defined(_KERNEL) && !defined(_RUMPKERNEL)
159169
MCOUNT_ENTER;
170+
#ifdef MULTIPROCESSOR
171+
__cpu_simple_lock(&__mcount_lock);
172+
__insn_barrier();
173+
#endif
160174
#endif
161175
p->state = GMON_PROF_BUSY;
162176
/*
@@ -246,17 +260,25 @@ _MCOUNT_DECL(u_long frompc, u_long selfpc)
246260
*frompcindex = (u_short)toindex;
247261
goto done;
248262
}
249-
250263
}
251264
done:
252265
p->state = GMON_PROF_ON;
253-
#ifdef _KERNEL
266+
#if defined(_KERNEL) && !defined(_RUMPKERNEL)
267+
#ifdef MULTIPROCESSOR
268+
__insn_barrier();
269+
__cpu_simple_unlock(&__mcount_lock);
270+
#endif
254271
MCOUNT_EXIT;
255272
#endif
256273
return;
274+
257275
overflow:
258276
p->state = GMON_PROF_ERROR;
259-
#ifdef _KERNEL
277+
#if defined(_KERNEL) && !defined(_RUMPKERNEL)
278+
#ifdef MULTIPROCESSOR
279+
__insn_barrier();
280+
__cpu_simple_unlock(&__mcount_lock);
281+
#endif
260282
MCOUNT_EXIT;
261283
#endif
262284
return;

common/lib/libc/stdlib/_strtol.h

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: _strtol.h,v 1.7 2013/05/17 12:55:56 joerg Exp $ */
1+
/* $NetBSD: _strtol.h,v 1.10 2015/11/13 16:02:07 christos Exp $ */
22

33
/*-
44
* Copyright (c) 1990, 1993
@@ -105,8 +105,14 @@ INT_FUNCNAME(_int_, _FUNCNAME, _l)(const char *nptr, char **endptr,
105105
c = s[1];
106106
s += 2;
107107
base = 16;
108-
}
109-
if (base == 0)
108+
#if 0
109+
} else if ((base == 0 || base == 2) &&
110+
c == '0' && (*s == 'b' || *s == 'B')) {
111+
c = s[1];
112+
s += 2;
113+
base = 2;
114+
#endif
115+
} else if (base == 0)
110116
base = (c == '0' ? 8 : 10);
111117

112118
/*

common/lib/libc/stdlib/_strtoul.h

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: _strtoul.h,v 1.7 2013/05/17 12:55:56 joerg Exp $ */
1+
/* $NetBSD: _strtoul.h,v 1.9 2015/11/13 16:02:07 christos Exp $ */
22

33
/*-
44
* Copyright (c) 1990, 1993
@@ -102,8 +102,14 @@ INT_FUNCNAME(_int_, _FUNCNAME, _l)(const char *nptr, char **endptr,
102102
c = s[1];
103103
s += 2;
104104
base = 16;
105-
}
106-
if (base == 0)
105+
#if 0
106+
} else if ((base == 0 || base == 2) &&
107+
c == '0' && (*s == 'b' || *s == 'B')) {
108+
c = s[1];
109+
s += 2;
110+
base = 2;
111+
#endif
112+
} else if (base == 0)
107113
base = (c == '0' ? 8 : 10);
108114

109115
/*

0 commit comments

Comments
 (0)