Skip to content

Commit baf5335

Browse files
committed
NetBSD src for "kernel", checkout.sh rev d6befe53cfce665e722657acf8c16ded5cadf9b5
1 parent c430bf3 commit baf5335

File tree

1,345 files changed

+60166
-47857
lines changed

Some content is hidden

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

1,345 files changed

+60166
-47857
lines changed

bin/cat/cat.c

+10-17
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: cat.c,v 1.55 2015/07/25 16:17:01 sevan Exp $ */
1+
/* $NetBSD: cat.c,v 1.57 2016/06/16 00:52:37 sevan Exp $ */
22

33
/*
44
* Copyright (c) 1989, 1993
@@ -44,7 +44,7 @@ __COPYRIGHT(
4444
#if 0
4545
static char sccsid[] = "@(#)cat.c 8.2 (Berkeley) 4/27/95";
4646
#else
47-
__RCSID("$NetBSD: cat.c,v 1.55 2015/07/25 16:17:01 sevan Exp $");
47+
__RCSID("$NetBSD: cat.c,v 1.57 2016/06/16 00:52:37 sevan Exp $");
4848
#endif
4949
#endif /* not lint */
5050

@@ -113,6 +113,7 @@ main(int argc, char *argv[])
113113
vflag = 1;
114114
break;
115115
default:
116+
case '?':
116117
(void)fprintf(stderr,
117118
"Usage: %s [-beflnstuv] [-B bsize] [-] "
118119
"[file ...]\n", getprogname());
@@ -174,18 +175,16 @@ cook_buf(FILE *fp)
174175
line = gobble = 0;
175176
for (prev = '\n'; (ch = getc(fp)) != EOF; prev = ch) {
176177
if (prev == '\n') {
177-
if (ch == '\n') {
178-
if (sflag) {
179-
if (!gobble && nflag && !bflag)
180-
(void)fprintf(stdout,
181-
"%6d\t\n", ++line);
182-
else if (!gobble && putchar(ch) == EOF)
183-
break;
178+
if (sflag) {
179+
if (ch == '\n') {
180+
if (gobble)
181+
continue;
184182
gobble = 1;
185-
continue;
183+
} else
184+
gobble = 0;
186185
}
187186
if (nflag) {
188-
if (!bflag) {
187+
if (!bflag || ch != '\n') {
189188
(void)fprintf(stdout,
190189
"%6d\t", ++line);
191190
if (ferror(stdout))
@@ -197,13 +196,7 @@ cook_buf(FILE *fp)
197196
break;
198197
}
199198
}
200-
} else if (nflag) {
201-
(void)fprintf(stdout, "%6d\t", ++line);
202-
if (ferror(stdout))
203-
break;
204199
}
205-
}
206-
gobble = 0;
207200
if (ch == '\n') {
208201
if (eflag)
209202
if (putchar('$') == EOF)

build.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#! /usr/bin/env sh
2-
# $NetBSD: build.sh,v 1.309 2016/04/29 16:08:09 christos Exp $
2+
# $NetBSD: build.sh,v 1.310 2016/06/03 00:00:01 kre Exp $
33
#
44
# Copyright (c) 2001-2011 The NetBSD Foundation, Inc.
55
# All rights reserved.
@@ -506,7 +506,7 @@ initdefaults()
506506
# XXX Except that doesn't work on Solaris. Or many Linuces.
507507
#
508508
unset PWD
509-
TOP=$(/bin/pwd -P 2>/dev/null || /bin/pwd 2>/dev/null)
509+
TOP=$( (exec pwd -P 2>/dev/null) || (exec pwd 2>/dev/null) )
510510

511511
# The user can set HOST_SH in the environment, or we try to
512512
# guess an appropriate value. Then we set several other
@@ -1876,7 +1876,7 @@ createmakewrapper()
18761876
eval cat <<EOF ${makewrapout}
18771877
#! ${HOST_SH}
18781878
# Set proper variables to allow easy "make" building of a NetBSD subtree.
1879-
# Generated from: \$NetBSD: build.sh,v 1.309 2016/04/29 16:08:09 christos Exp $
1879+
# Generated from: \$NetBSD: build.sh,v 1.310 2016/06/03 00:00:01 kre Exp $
18801880
# with these arguments: ${_args}
18811881
#
18821882

common/include/prop/prop_array.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: prop_array.h,v 1.13 2011/09/30 22:08:18 jym Exp $ */
1+
/* $NetBSD: prop_array.h,v 1.14 2016/05/31 09:29:25 pgoyette Exp $ */
22

33
/*-
44
* Copyright (c) 2006, 2009 The NetBSD Foundation, Inc.
@@ -144,11 +144,13 @@ bool prop_array_add_uint32(prop_array_t, uint32_t);
144144
bool prop_array_add_int64(prop_array_t, int64_t);
145145
bool prop_array_add_uint64(prop_array_t, uint64_t);
146146

147+
bool prop_array_add_cstring(prop_array_t, const char *);
147148
bool prop_array_get_cstring(prop_array_t, unsigned int,
148149
char **);
149150
bool prop_array_set_cstring(prop_array_t, unsigned int,
150151
const char *);
151152

153+
bool prop_array_add_cstring_nocopy(prop_array_t, const char *);
152154
bool prop_array_get_cstring_nocopy(prop_array_t,
153155
unsigned int,
154156
const char **);

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
# $NetBSD: Makefile.inc,v 1.21 2016/02/27 19:19:33 joerg Exp $
1+
# $NetBSD: Makefile.inc,v 1.22 2016/05/29 05:10:34 nakayama 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" && ${HAVE_LLVM:Uno} == "no"
7+
.if ${MACHINE} == "sparc64" && \
8+
(${HAVE_LLVM:Uno} == "no" || (defined(LIB) && ${LIB} == "kern"))
89

910
SPARC64DIR= ${.PARSEDIR}/../../sparc64/atomic
1011
.PATH.c: ${SPARC64DIR}

common/lib/libprop/Makefile.inc

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
# $NetBSD: Makefile.inc,v 1.9 2012/07/27 09:10:59 pooka Exp $
1+
# $NetBSD: Makefile.inc,v 1.10 2016/06/28 05:18:11 pgoyette Exp $
22

33
.PATH: ${.PARSEDIR}
44

55
SRCS+= prop_array.c prop_array_util.c prop_bool.c prop_data.c \
66
prop_dictionary.c prop_dictionary_util.c prop_ingest.c \
77
prop_kern.c prop_number.c prop_object.c prop_stack.c prop_string.c
8-
9-
.ifdef (PROPLIB_WANT_RB)
10-
SRCS+= prop_rb.c
11-
.endif

common/lib/libprop/prop_array_util.3

+13-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.\" $NetBSD: prop_array_util.3,v 1.7 2011/10/17 09:24:54 wiz Exp $
1+
.\" $NetBSD: prop_array_util.3,v 1.9 2016/05/31 09:31:13 wiz Exp $
22
.\"
33
.\" Copyright (c) 2006 The NetBSD Foundation, Inc.
44
.\" All rights reserved.
@@ -27,7 +27,7 @@
2727
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2828
.\" POSSIBILITY OF SUCH DAMAGE.
2929
.\"
30-
.Dd March 12, 2011
30+
.Dd May 31, 2016
3131
.Dt PROP_ARRAY_UTIL 3
3232
.Os
3333
.Sh NAME
@@ -58,8 +58,10 @@
5858
.Nm prop_array_add_uint32 ,
5959
.Nm prop_array_add_int64 ,
6060
.Nm prop_array_add_uint64 ,
61+
.Nm prop_array_add_cstring ,
6162
.Nm prop_array_get_cstring ,
6263
.Nm prop_array_set_cstring ,
64+
.Nm prop_array_add_cstring_nocopy ,
6365
.Nm prop_array_get_cstring_nocopy ,
6466
.Nm prop_array_set_cstring_nocopy ,
6567
.Nm prop_array_add_and_rel
@@ -153,13 +155,17 @@
153155
.Fn prop_array_add_uint64 "prop_array_t dict" "uint64_t val"
154156
.\"
155157
.Ft bool
158+
.Fn prop_array_add_cstring "prop_array_t dict" "const char *cp"
159+
.Ft bool
156160
.Fn prop_array_get_cstring "prop_array_t dict" "unsigned int indx" \
157161
"char **strp"
158162
.Ft bool
159163
.Fn prop_array_set_cstring "prop_array_t dict" "unsigned int indx" \
160164
"const char *str"
161165
.\"
162166
.Ft bool
167+
.Fn prop_array_add_cstring_nocopy "prop_array_t dict" "const char *cp"
168+
.Ft bool
163169
.Fn prop_array_get_cstring_nocopy "prop_array_t dict" \
164170
"unsigned int indx" "const char **strp"
165171
.Ft bool
@@ -181,14 +187,17 @@ value type.
181187
The setters handle object creation and release for the caller.
182188
.Pp
183189
The
190+
.Fn prop_array_add_cstring
191+
and
184192
.Fn prop_array_get_cstring
185-
function returns dynamically allocated memory.
193+
functions returns dynamically allocated memory.
186194
See
187195
.Xr prop_string 3
188196
for more information.
189197
.Pp
190198
The
191-
.Fn prop_array_get_cstring_nocopy
199+
.Fn prop_array_add_cstring_nocopy ,
200+
.Fn prop_array_get_cstring_nocopy ,
192201
and
193202
.Fn prop_array_set_cstring_nocopy
194203
functions do not copy the string that is set or returned.

common/lib/libprop/prop_array_util.c

+16-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: prop_array_util.c,v 1.4 2012/07/27 09:10:59 pooka Exp $ */
1+
/* $NetBSD: prop_array_util.c,v 1.5 2016/05/31 09:29:25 pgoyette Exp $ */
22

33
/*-
44
* Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -201,6 +201,21 @@ TEMPLATE(64)
201201
#undef TEMPLATE
202202

203203
#define TEMPLATE(variant, qualifier) \
204+
bool \
205+
prop_array_add_cstring ## variant (prop_array_t array, \
206+
const char *cp) \
207+
{ \
208+
prop_string_t str; \
209+
bool rv; \
210+
\
211+
str = prop_string_create_cstring ## variant (cp); \
212+
if (str == NULL) \
213+
return false; \
214+
rv = prop_array_add(array, str); \
215+
prop_object_release(str); \
216+
return rv; \
217+
} \
218+
\
204219
bool \
205220
prop_array_get_cstring ## variant (prop_array_t array, \
206221
unsigned int indx, \

common/lib/libprop/prop_dictionary.c

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: prop_dictionary.c,v 1.39 2013/10/18 18:26:20 martin Exp $ */
1+
/* $NetBSD: prop_dictionary.c,v 1.41 2016/06/28 05:21:15 pgoyette Exp $ */
22

33
/*-
44
* Copyright (c) 2006, 2007 The NetBSD Foundation, Inc.
@@ -33,7 +33,8 @@
3333
#include <prop/prop_array.h>
3434
#include <prop/prop_dictionary.h>
3535
#include <prop/prop_string.h>
36-
#include "prop_rb_impl.h"
36+
37+
#include <sys/rbtree.h>
3738

3839
#if !defined(_KERNEL) && !defined(_STANDALONE)
3940
#include <errno.h>
@@ -210,7 +211,7 @@ _prop_dict_init(void)
210211
{
211212

212213
_PROP_MUTEX_INIT(_prop_dict_keysym_tree_mutex);
213-
_prop_rb_tree_init(&_prop_dict_keysym_tree,
214+
rb_tree_init(&_prop_dict_keysym_tree,
214215
&_prop_dict_keysym_rb_tree_ops);
215216
return 0;
216217
}
@@ -235,7 +236,7 @@ _prop_dict_keysym_free(prop_stack_t stack, prop_object_t *obj)
235236
{
236237
prop_dictionary_keysym_t pdk = *obj;
237238

238-
_prop_rb_tree_remove_node(&_prop_dict_keysym_tree, pdk);
239+
rb_tree_remove_node(&_prop_dict_keysym_tree, pdk);
239240
_prop_dict_keysym_put(pdk);
240241

241242
return _PROP_OBJECT_FREE_DONE;
@@ -292,7 +293,7 @@ _prop_dict_keysym_alloc(const char *key)
292293
* we just retain it and return it.
293294
*/
294295
_PROP_MUTEX_LOCK(_prop_dict_keysym_tree_mutex);
295-
opdk = _prop_rb_tree_find(&_prop_dict_keysym_tree, key);
296+
opdk = rb_tree_find_node(&_prop_dict_keysym_tree, key);
296297
if (opdk != NULL) {
297298
prop_object_retain(opdk);
298299
_PROP_MUTEX_UNLOCK(_prop_dict_keysym_tree_mutex);
@@ -328,14 +329,14 @@ _prop_dict_keysym_alloc(const char *key)
328329
* we have to check again if it is in the tree.
329330
*/
330331
_PROP_MUTEX_LOCK(_prop_dict_keysym_tree_mutex);
331-
opdk = _prop_rb_tree_find(&_prop_dict_keysym_tree, key);
332+
opdk = rb_tree_find_node(&_prop_dict_keysym_tree, key);
332333
if (opdk != NULL) {
333334
prop_object_retain(opdk);
334335
_PROP_MUTEX_UNLOCK(_prop_dict_keysym_tree_mutex);
335336
_prop_dict_keysym_put(pdk);
336337
return (opdk);
337338
}
338-
rpdk = _prop_rb_tree_insert_node(&_prop_dict_keysym_tree, pdk);
339+
rpdk = rb_tree_insert_node(&_prop_dict_keysym_tree, pdk);
339340
_PROP_ASSERT(rpdk == pdk);
340341
_PROP_MUTEX_UNLOCK(_prop_dict_keysym_tree_mutex);
341342
return (rpdk);

common/lib/libprop/prop_number.c

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: prop_number.c,v 1.27 2014/09/05 05:19:24 matt Exp $ */
1+
/* $NetBSD: prop_number.c,v 1.30 2016/06/28 06:47:35 pgoyette Exp $ */
22

33
/*-
44
* Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -29,9 +29,9 @@
2929
* POSSIBILITY OF SUCH DAMAGE.
3030
*/
3131

32+
#include <sys/rbtree.h>
3233
#include <prop/prop_number.h>
3334
#include "prop_object_impl.h"
34-
#include "prop_rb_impl.h"
3535

3636
#if defined(_KERNEL)
3737
#include <sys/systm.h>
@@ -157,7 +157,7 @@ _prop_number_free(prop_stack_t stack, prop_object_t *obj)
157157
{
158158
prop_number_t pn = *obj;
159159

160-
_prop_rb_tree_remove_node(&_prop_number_tree, pn);
160+
rb_tree_remove_node(&_prop_number_tree, pn);
161161

162162
_PROP_POOL_PUT(_prop_number_pool, pn);
163163

@@ -171,7 +171,7 @@ _prop_number_init(void)
171171
{
172172

173173
_PROP_MUTEX_INIT(_prop_number_tree_mutex);
174-
_prop_rb_tree_init(&_prop_number_tree, &_prop_number_rb_tree_ops);
174+
rb_tree_init(&_prop_number_tree, &_prop_number_rb_tree_ops);
175175
return 0;
176176
}
177177

@@ -283,7 +283,7 @@ _prop_number_alloc(const struct _prop_number_value *pnv)
283283
* we just retain it and return it.
284284
*/
285285
_PROP_MUTEX_LOCK(_prop_number_tree_mutex);
286-
opn = _prop_rb_tree_find(&_prop_number_tree, pnv);
286+
opn = rb_tree_find_node(&_prop_number_tree, pnv);
287287
if (opn != NULL) {
288288
prop_object_retain(opn);
289289
_PROP_MUTEX_UNLOCK(_prop_number_tree_mutex);
@@ -308,14 +308,14 @@ _prop_number_alloc(const struct _prop_number_value *pnv)
308308
* we have to check again if it is in the tree.
309309
*/
310310
_PROP_MUTEX_LOCK(_prop_number_tree_mutex);
311-
opn = _prop_rb_tree_find(&_prop_number_tree, pnv);
311+
opn = rb_tree_find_node(&_prop_number_tree, pnv);
312312
if (opn != NULL) {
313313
prop_object_retain(opn);
314314
_PROP_MUTEX_UNLOCK(_prop_number_tree_mutex);
315315
_PROP_POOL_PUT(_prop_number_pool, pn);
316316
return (opn);
317317
}
318-
rpn = _prop_rb_tree_insert_node(&_prop_number_tree, pn);
318+
rpn = rb_tree_insert_node(&_prop_number_tree, pn);
319319
_PROP_ASSERT(rpn == pn);
320320
_PROP_MUTEX_UNLOCK(_prop_number_tree_mutex);
321321
return (rpn);

0 commit comments

Comments
 (0)