CVS commit: src/share/man/man9

2017-04-14 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Sat Apr 15 05:01:59 UTC 2017

Modified Files:
src/share/man/man9: klua_lock.9

Log Message:
Improve wording.
Bump date.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/share/man/man9/klua_lock.9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man9/klua_lock.9
diff -u src/share/man/man9/klua_lock.9:1.2 src/share/man/man9/klua_lock.9:1.3
--- src/share/man/man9/klua_lock.9:1.2	Sat Apr 15 04:08:24 2017
+++ src/share/man/man9/klua_lock.9	Sat Apr 15 05:01:59 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: klua_lock.9,v 1.2 2017/04/15 04:08:24 wiz Exp $
+.\"	$NetBSD: klua_lock.9,v 1.3 2017/04/15 05:01:59 sevan Exp $
 .\"
 .\" Copyright (c) 2015 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd May 14, 2015
+.Dd April 15, 2017
 .Dt KLUA_LOCK 9
 .Os
 .Sh NAME
@@ -63,7 +63,7 @@ driver.
 A
 .Xr driver 9
 can be extended with dynamically managed Lua code with optional functionality
-to be injected from userland with the
+injected from userland with the
 .Xr luactl 8
 utility.
 .Pp
@@ -81,18 +81,18 @@ typedef struct _klua_State {
 The first element
 .Ft L
 of the structure points to a standard Lua state structure.
-The second
+The second element
 .Ft ks_lock
-is used to protect the integrity in cross-thread access to the Lua state.
-The third one
+is used to protect integrity during cross-thread access to the Lua state.
+The third element
 .Ft ks_user
-points whether the structure was created from the kernel space or userland.
+indicates whether the structure was created from the kernel space or user land.
 This parameter is used in the logic of
 .Xr luactl 8 ,
-prohibiting the case of creating a state from kernel and destroying it in
-the userland.
+to prohibit the destruction of state from an opposing side.
+Destroying kernel state from user land for example.
 .Pp
-The kernel Lua API is designed after the userland Lua API.
+The kernel Lua API is designed after the user land Lua API.
 .Ss List of Functions
 .Bl -column "kluaL_newstateX" "luaL_newstateX" "create a Lua state with custom allocatorX"
 .It Sy kernel API Ta Sy userland API Ta Sy Description
@@ -107,7 +107,7 @@ The
 .Fn klua_lock
 and
 .Fn klua_unlock
-functions must be used before and after use of the
+functions must be used before and after the use of the
 .Ft klua_State
 structure.
 The Lua state is not thread safe and this is the standard mechanism to overcome
@@ -120,7 +120,6 @@ utility when accessing
 The
 .Fn klua_close
 function destroys the kernel Lua state.
-It should be used after prior creation.
 .Pp
 The
 .Fn klua_newstate
@@ -135,15 +134,15 @@ defined by the proper Lua release and an
 that Lua passes to the allocator in every call.
 The
 .Ft name
-parameter identifies the kernel Lua state with a text literal and must not
-begin with the
+parameter identifies the kernel Lua state with a text literal.
+It must not begin with the
 .Dq _
 character and must be unique for the
 .Xr lua 9
 device.
 The
 .Ft desc
-parameter optionally describes the Lua state with plain text.
+parameter describes the Lua state in plain text.
 The
 .Ft ipl
 argument is used to define the type of



CVS commit: src/share/man/man9

2017-04-14 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Sat Apr 15 04:44:14 UTC 2017

Modified Files:
src/share/man/man9: klua_mod_register.9

Log Message:
Improve wording.
Bump date.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/share/man/man9/klua_mod_register.9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man9/klua_mod_register.9
diff -u src/share/man/man9/klua_mod_register.9:1.2 src/share/man/man9/klua_mod_register.9:1.3
--- src/share/man/man9/klua_mod_register.9:1.2	Sat Apr 15 04:07:52 2017
+++ src/share/man/man9/klua_mod_register.9	Sat Apr 15 04:44:14 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: klua_mod_register.9,v 1.2 2017/04/15 04:07:52 wiz Exp $
+.\"	$NetBSD: klua_mod_register.9,v 1.3 2017/04/15 04:44:14 sevan Exp $
 .\"
 .\" Copyright (c) 2015 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd May 14, 2015
+.Dd April 15, 2017
 .Dt KLUA_MOD_REGISTER 9
 .Os
 .Sh NAME
@@ -42,8 +42,8 @@
 .Fn klua_mod_unregister "const char *name"
 .Sh DESCRIPTION
 The Lua kernel bindings are designed to provide functionality to Lua scripts
-not available in the language itself, e.g. to access core kernel functionality.
-This mechanism uses the lua_modules functionality.
+normally not available in the language itself, e.g. to access core kernel functionality.
+This is achieved by utilizing the lua_modules functionality.
 .Pp
 The lua_module structure is declared as follows:
 .Bd -literal
@@ -59,43 +59,42 @@ The
 .Ft mod_name
 defines the unique name of a module.
 A C function must use the standard Lua protocol in order to communicate with
-Lua, this is part is maintained with the
+Lua, this part is maintained with the
 .Ft open
 element in the standard Lua way.
 .Ft refcount
-protects the module from unloading it when in use.
-The last parameter
-.Ft mod_next
+protects the module from being unloaded whilst still in use.
+The last parameter,
+.Ft mod_next,
 is used for the standard container
 .Xr LIST 3 .
 .Pp
 The
 .Fn klua_mod_register
-function registers a new function available to the
+function registers a new function which is made available to the
 .Xr lua 9
-device and possible to be used in a Lua code by the
+device and Lua code using the
 .Dv require
-directive.
+directive. 
+The
 .Dv require
-might be used by
+directive can be called from
 .Xr luactl 8
-or by the special meaning of the
-.Dv require
-in the kernel Lua version.
+and the kernel Lua version.
 The
 .Fa name
 parameter is a unique identifier of the kernel Lua module.
 .Fa open
-points to a function used in the C and Lua cooperation,
+points to a function used in the C to Lua binding,
 defined with the appropriate standard Lua API.
 .Pp
-Once registered, a C function must be deregistered with the
+Once registered, a C function can be unregistered with the
 .Fn klua_mod_unregister
 function.
-This function takes as its parameter the unique literal identifier of the
+This function takes as its parameter, the unique literal identifier of the
 extending module.
 .Sh EXAMPLES
-A set of example modules is available in the
+A set of example modules are available in the
 .Pa src/sys/modules/examples
 directory hierarchy.
 .Sh SEE ALSO



CVS commit: src/sys/modules/examples/luareadhappy

2017-04-14 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Apr 15 04:27:30 UTC 2017

Added Files:
src/sys/modules/examples/luareadhappy: Makefile happy.lua
luareadhappy.c

Log Message:
Add new example kernel module in Lua luareadhappy

This example presents a C module with its device (/dev entry) and its
content generator with algorithm defined in Lua state. The Lua state can
be changed dynamically from userland, without interruption of read(2) over
the device.

This is an example how to call Lua code from C.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/modules/examples/luareadhappy/Makefile \
src/sys/modules/examples/luareadhappy/happy.lua \
src/sys/modules/examples/luareadhappy/luareadhappy.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: src/sys/modules/examples/luareadhappy/Makefile
diff -u /dev/null src/sys/modules/examples/luareadhappy/Makefile:1.1
--- /dev/null	Sat Apr 15 04:27:30 2017
+++ src/sys/modules/examples/luareadhappy/Makefile	Sat Apr 15 04:27:30 2017
@@ -0,0 +1,14 @@
+#	$NetBSD: Makefile,v 1.1 2017/04/15 04:27:30 kamil Exp $
+
+#.include "../Makefile.inc"
+
+#S?=	/usr/src/sys
+
+KMOD=	luareadhappy
+SRCS=	luareadhappy.c
+
+CPPFLAGS+=	-I${S}/../external/mit/lua/dist/src \
+		-I${S}/modules/lua \
+		-I${S}/sys
+
+.include 
Index: src/sys/modules/examples/luareadhappy/happy.lua
diff -u /dev/null src/sys/modules/examples/luareadhappy/happy.lua:1.1
--- /dev/null	Sat Apr 15 04:27:30 2017
+++ src/sys/modules/examples/luareadhappy/happy.lua	Sat Apr 15 04:27:30 2017
@@ -0,0 +1,77 @@
+--	$NetBSD: happy.lua,v 1.1 2017/04/15 04:27:30 kamil Exp $
+--
+-- Copyright (c) 2015 The NetBSD Foundation, Inc.
+-- All rights reserved.
+--
+-- Redistribution and use in source and binary forms, with or without
+-- modification, are permitted provided that the following conditions
+-- are met:
+-- 1. Redistributions of source code must retain the above copyright
+--notice, this list of conditions and the following disclaimer.
+-- 2. Redistributions in binary form must reproduce the above copyright
+--notice, this list of conditions and the following disclaimer in the
+--documentation and/or other materials provided with the distribution.
+--
+-- THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+-- ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+-- TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+-- PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+-- BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+-- POSSIBILITY OF SUCH DAMAGE.
+--
+--
+-- Commentary:
+-- A happy number is a number defined by the following process: Starting with
+-- any positive integer, replace the number by the sum of the squares of its
+-- digits, and repeat the process until the number equals 1 (where it will
+-- stay), or it loops endlessly in a cycle which does not include 1. Those
+-- numbers for which this process ends in 1 are happy numbers, while those that
+-- do not end in 1 are unhappy numbers (or sad numbers).
+--
+-- For more information on happy numbers, and the algorithms, see
+--  http://en.wikipedia.org/wiki/Happy_number
+--
+-- The happy number generator is here only to have something that the user
+-- can read from our device.  Any other arbitrary data generator could
+-- have been used.  The algorithm is not critical to the implementation
+-- of the module.
+
+local HAPPY_NUMBER = 1
+
+-- If n is not happy then its sequence ends in the cycle:
+-- 4, 16, 37, 58, 89, 145, 42, 20, 4, ...
+local SAD_NUMBER = 4
+
+-- This following algorithm is designed for numbers of the integer type.
+-- Integer numbers are used by default in the NetBSD kernel, as there would be
+-- need for additional overhead in context-switch with support for floats.
+
+function dsum(n)
+	local sum = 0
+	while n > 0 do
+		local x = n % 10
+		sum = sum + (x * x)
+		n = n / 10
+	end
+	return sum
+end
+
+function is_happy(n)
+	while true do
+		local total = dsum(n)
+
+		if total == HAPPY_NUMBER then
+			return 1
+		end
+		if total == SAD_NUMBER then
+			return 0
+		end
+
+		n = total
+	end
+end
Index: src/sys/modules/examples/luareadhappy/luareadhappy.c
diff -u /dev/null src/sys/modules/examples/luareadhappy/luareadhappy.c:1.1
--- /dev/null	Sat Apr 15 04:27:30 2017
+++ src/sys/modules/examples/luareadhappy/luareadhappy.c	Sat Apr 15 04:27:30 2017
@@ -0,0 +1,217 @@
+/*	$NetBSD: luareadhappy.c,v 1.1 2017/04/15 

CVS commit: src/share/man/man9

2017-04-14 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Apr 15 04:08:24 UTC 2017

Modified Files:
src/share/man/man9: klua_lock.9

Log Message:
Improve wording. Use standard section headers. Improve table formatting.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/man/man9/klua_lock.9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man9/klua_lock.9
diff -u src/share/man/man9/klua_lock.9:1.1 src/share/man/man9/klua_lock.9:1.2
--- src/share/man/man9/klua_lock.9:1.1	Sat Apr 15 03:33:05 2017
+++ src/share/man/man9/klua_lock.9	Sat Apr 15 04:08:24 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: klua_lock.9,v 1.1 2017/04/15 03:33:05 kamil Exp $
+.\"	$NetBSD: klua_lock.9,v 1.2 2017/04/15 04:08:24 wiz Exp $
 .\"
 .\" Copyright (c) 2015 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -92,14 +92,14 @@ This parameter is used in the logic of
 prohibiting the case of creating a state from kernel and destroying it in
 the userland.
 .Pp
-The kernel Lua API is designed after ther userland Lua API.
+The kernel Lua API is designed after the userland Lua API.
 .Ss List of Functions
-.Bl -column "copysignX" "gammaX3XX" "inverse trigonometric funcX"
-.It Sy kernel API Sy userland API Sy Description
+.Bl -column "kluaL_newstateX" "luaL_newstateX" "create a Lua state with custom allocatorX"
+.It Sy kernel API Ta Sy userland API Ta Sy Description
 .It Xr klua_lock 3 Ta lua_lock Ta lock a Lua state
 .It Xr klua_unlock 3 Ta lua_unlock Ta unlock a Lua state
 .It Xr klua_close 3 Ta lua_close Ta destroy a Lua state
-.It Xr klua_newstate 3 Ta lua_newstate Ta create a Lua state with cusom allocator
+.It Xr klua_newstate 3 Ta lua_newstate Ta create a Lua state with custom allocator
 .It Xr kluaL_newstate 3 Ta luaL_newstate Ta create a Lua state
 .El
 .Pp
@@ -126,9 +126,9 @@ The
 .Fn klua_newstate
 and
 .Fn kluaL_newstate
-functions are used to create and register new kernel Lua state.
+functions are used to create and register a new kernel Lua state.
 .Fn klua_newstate
-takes additional standard parameter of type
+takes an additional standard parameter of type
 .Fa f ,
 defined by the proper Lua release and an opaque pointer
 .Fa ud
@@ -149,7 +149,7 @@ The
 argument is used to define the type of
 .Xr mutex 9
 by the system interrupt priority level.
-.Sh RETURN FUNCTIONS
+.Sh RETURN VALUES
 The
 .Fn klua_lock ,
 .Fn klua_unlock ,



CVS commit: src/share/man/man9

2017-04-14 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Apr 15 04:07:52 UTC 2017

Modified Files:
src/share/man/man9: klua_mod_register.9

Log Message:
Improve wording.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/man/man9/klua_mod_register.9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man9/klua_mod_register.9
diff -u src/share/man/man9/klua_mod_register.9:1.1 src/share/man/man9/klua_mod_register.9:1.2
--- src/share/man/man9/klua_mod_register.9:1.1	Sat Apr 15 03:33:05 2017
+++ src/share/man/man9/klua_mod_register.9	Sat Apr 15 04:07:52 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: klua_mod_register.9,v 1.1 2017/04/15 03:33:05 kamil Exp $
+.\"	$NetBSD: klua_mod_register.9,v 1.2 2017/04/15 04:07:52 wiz Exp $
 .\"
 .\" Copyright (c) 2015 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -43,7 +43,7 @@
 .Sh DESCRIPTION
 The Lua kernel bindings are designed to provide functionality to Lua scripts
 not available in the language itself, e.g. to access core kernel functionality.
-This mechanism is utilizing the lua_modules functionality.
+This mechanism uses the lua_modules functionality.
 .Pp
 The lua_module structure is declared as follows:
 .Bd -literal
@@ -63,7 +63,7 @@ Lua, this is part is maintained with the
 .Ft open
 element in the standard Lua way.
 .Ft refcount
-protects the module from unplogging it when in use.
+protects the module from unloading it when in use.
 The last parameter
 .Ft mod_next
 is used for the standard container
@@ -71,7 +71,7 @@ is used for the standard container
 .Pp
 The
 .Fn klua_mod_register
-function registers new function available to the
+function registers a new function available to the
 .Xr lua 9
 device and possible to be used in a Lua code by the
 .Dv require
@@ -89,7 +89,7 @@ parameter is a unique identifier of the 
 points to a function used in the C and Lua cooperation,
 defined with the appropriate standard Lua API.
 .Pp
-Once registered a C function must be deregistered with the
+Once registered, a C function must be deregistered with the
 .Fn klua_mod_unregister
 function.
 This function takes as its parameter the unique literal identifier of the



CVS commit: src

2017-04-14 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Apr 15 03:33:05 UTC 2017

Modified Files:
src/distrib/sets/lists/comp: mi
src/share/man/man9: Makefile
Added Files:
src/share/man/man9: klua_lock.9 klua_mod_register.9

Log Message:
Add new documentation for klua_mod_register(9) and klua_lock(9)

Lua kernel bindings.


To generate a diff of this commit:
cvs rdiff -u -r1.2121 -r1.2122 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.407 -r1.408 src/share/man/man9/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man9/klua_lock.9 \
src/share/man/man9/klua_mod_register.9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2121 src/distrib/sets/lists/comp/mi:1.2122
--- src/distrib/sets/lists/comp/mi:1.2121	Fri Apr 14 15:20:39 2017
+++ src/distrib/sets/lists/comp/mi	Sat Apr 15 03:33:05 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2121 2017/04/14 15:20:39 riastradh Exp $
+#	$NetBSD: mi,v 1.2122 2017/04/15 03:33:05 kamil Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -10578,6 +10578,8 @@
 ./usr/share/man/cat9/kfilter_register.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/kfilter_unregister.0	comp-sys-catman		.cat
 ./usr/share/man/cat9/killproc.0			comp-sys-catman		.cat
+./usr/share/man/cat9/klua_lock.0		comp-sys-catman		.cat
+./usr/share/man/cat9/klua_mod_register.0	comp-sys-catman		.cat
 ./usr/share/man/cat9/kmem.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/kmem_alloc.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/kmem_asprintf.0		comp-sys-catman		.cat
@@ -17892,6 +17894,8 @@
 ./usr/share/man/html9/kfilter_register.html	comp-sys-htmlman	html
 ./usr/share/man/html9/kfilter_unregister.html	comp-sys-htmlman	html
 ./usr/share/man/html9/killproc.html		comp-sys-htmlman	html
+./usr/share/man/html9/klua_lock.html		comp-sys-htmlman	html
+./usr/share/man/html9/klua_mod_register.html	comp-sys-htmlman	html
 ./usr/share/man/html9/kmem.html			comp-sys-htmlman	html
 ./usr/share/man/html9/kmem_alloc.html		comp-sys-htmlman	html
 ./usr/share/man/html9/kmem_asprintf.html	comp-sys-htmlman	html
@@ -25358,6 +25362,8 @@
 ./usr/share/man/man9/kfilter_register.9		comp-sys-man		.man
 ./usr/share/man/man9/kfilter_unregister.9	comp-sys-man		.man
 ./usr/share/man/man9/killproc.9			comp-sys-man		.man
+./usr/share/man/man9/klua_lock.9		comp-sys-man		.man
+./usr/share/man/man9/klua_mod_register.9	comp-sys-man		.man
 ./usr/share/man/man9/kmem.9			comp-sys-man		.man
 ./usr/share/man/man9/kmem_alloc.9		comp-sys-man		.man
 ./usr/share/man/man9/kmem_asprintf.9		comp-sys-man		.man

Index: src/share/man/man9/Makefile
diff -u src/share/man/man9/Makefile:1.407 src/share/man/man9/Makefile:1.408
--- src/share/man/man9/Makefile:1.407	Thu Apr  6 10:46:52 2017
+++ src/share/man/man9/Makefile	Sat Apr 15 03:33:05 2017
@@ -1,4 +1,4 @@
-#   $NetBSD: Makefile,v 1.407 2017/04/06 10:46:52 abhinav Exp $
+#   $NetBSD: Makefile,v 1.408 2017/04/15 03:33:05 kamil Exp $
 
 #	Makefile for section 9 (kernel function and variable) manual pages.
 
@@ -29,7 +29,7 @@ MAN=	accept_filter.9 accf_data.9 accf_ht
 	in_getifa.9 \
 	in4_cksum.9 inittodr.9 interrupt_distribute.9 intro.9 ioasic.9 \
 	ioctl.9 ipkdb.9 ipi.9 isa.9 isapnp.9 itimerfix.9 kauth.9 kcopy.9 \
-	kcpuset.9 kernhist.9 kmem.9 kpause.9 \
+	kcpuset.9 kernhist.9 klua_lock.9 klua_mod_register.9 kmem.9 kpause.9 \
 	kfilter_register.9 knote.9 \
 	kprintf.9 kthread.9 linedisc.9 lock.9 log.9 ltsleep.9 \
 	LWP_CACHE_CREDS.9 \

Added files:

Index: src/share/man/man9/klua_lock.9
diff -u /dev/null src/share/man/man9/klua_lock.9:1.1
--- /dev/null	Sat Apr 15 03:33:05 2017
+++ src/share/man/man9/klua_lock.9	Sat Apr 15 03:33:05 2017
@@ -0,0 +1,182 @@
+.\"	$NetBSD: klua_lock.9,v 1.1 2017/04/15 03:33:05 kamil Exp $
+.\"
+.\" Copyright (c) 2015 The NetBSD Foundation, Inc.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to The NetBSD Foundation
+.\" by Kamil Rytarowski.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"notice, this list of conditions and the following disclaimer in the
+.\"documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+.\" BE LIABLE FOR 

CVS commit: src/sys/arch/arm/nvidia

2017-04-14 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Apr 15 00:35:12 UTC 2017

Modified Files:
src/sys/arch/arm/nvidia: tegra_fdt.c

Log Message:
Replace early init node name list with a list of compatible strings.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/nvidia/tegra_fdt.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/nvidia/tegra_fdt.c
diff -u src/sys/arch/arm/nvidia/tegra_fdt.c:1.2 src/sys/arch/arm/nvidia/tegra_fdt.c:1.3
--- src/sys/arch/arm/nvidia/tegra_fdt.c:1.2	Tue Dec 22 22:10:36 2015
+++ src/sys/arch/arm/nvidia/tegra_fdt.c	Sat Apr 15 00:35:12 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_fdt.c,v 1.2 2015/12/22 22:10:36 jmcneill Exp $ */
+/* $NetBSD: tegra_fdt.c,v 1.3 2017/04/15 00:35:12 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -29,7 +29,7 @@
 #include "opt_tegra.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tegra_fdt.c,v 1.2 2015/12/22 22:10:36 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_fdt.c,v 1.3 2017/04/15 00:35:12 jmcneill Exp $");
 
 #include 
 #include 
@@ -65,17 +65,29 @@ void
 tegrafdt_attach(device_t parent, device_t self, void *aux)
 {
 	const char *tegrafdt_init[] = {
-		"interrupt-controller",
-		"clock",
-		"pinmux",
-		"gpio",
-		"regulators",
-		"fuse",
-		"dma",
-		"pmc",
-		"memory-controller",
-		"i2c",
-		"usb-phy"
+		/* interrupt controllers */
+		"nvidia,tegra124-ictlr",
+		"arm,cortex-a15-gic",
+		/* clocks */
+		"nvidia,tegra124-car",
+		"nvidia,tegra124-dfll",
+		/* pinmux */
+		"nvidia,tegra124-pinmux",
+		"nvidia,tegra124-gpio",
+		/* regulators */
+		"regulator-fixed",
+		/* fuse */
+		"nvidia,tegra124-efuse",
+		/* dma */
+		"nvidia,tegra124-apbdma",
+		/* pmc */
+		"nvidia,tegra124-pmc",
+		/* memory controller */
+		"nvidia,tegra124-mc",
+		/* i2c */
+		"nvidia,tegra124-i2c",
+		/* usb phy */
+		"nvidia,tegra124-usb-phy",
 	};
 
 	tegrafdt_found = true;



CVS commit: src/sys

2017-04-14 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Apr 14 22:55:06 UTC 2017

Modified Files:
src/sys/arch/evbarm/conf: EXYNOS TEGRA
src/sys/dev/fdt: fdtbus.c files.fdt
Removed Files:
src/sys/dev/fdt: simplebus.c

Log Message:
Remove simplebus driver and allow fdtbus to attach directly to itself.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/evbarm/conf/EXYNOS \
src/sys/arch/evbarm/conf/TEGRA
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/fdt/fdtbus.c
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/fdt/files.fdt
cvs rdiff -u -r1.1 -r0 src/sys/dev/fdt/simplebus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/conf/EXYNOS
diff -u src/sys/arch/evbarm/conf/EXYNOS:1.12 src/sys/arch/evbarm/conf/EXYNOS:1.13
--- src/sys/arch/evbarm/conf/EXYNOS:1.12	Sun Feb 19 07:47:00 2017
+++ src/sys/arch/evbarm/conf/EXYNOS	Fri Apr 14 22:55:06 2017
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: EXYNOS,v 1.12 2017/02/19 07:47:00 rin Exp $
+#	$NetBSD: EXYNOS,v 1.13 2017/04/14 22:55:06 jmcneill Exp $
 #
 #	ODROID-XU -- ODROID-XU4 Exynos5422 based kernel
 #
@@ -203,9 +203,7 @@ armgtmr0	at armperiph?			# Generic Timer
 
 # On-board I/O
 exynosfdt0	at mainbus?
-fdt0		at exynosfdt0 
-simplebus*	at fdt?
-fdt*		at simplebus?
+fdt?		at fdtbus?
 
 fregulator*	at fdt?
 
Index: src/sys/arch/evbarm/conf/TEGRA
diff -u src/sys/arch/evbarm/conf/TEGRA:1.12 src/sys/arch/evbarm/conf/TEGRA:1.13
--- src/sys/arch/evbarm/conf/TEGRA:1.12	Tue Mar 28 15:09:29 2017
+++ src/sys/arch/evbarm/conf/TEGRA	Fri Apr 14 22:55:06 2017
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: TEGRA,v 1.12 2017/03/28 15:09:29 skrll Exp $
+#	$NetBSD: TEGRA,v 1.13 2017/04/14 22:55:06 jmcneill Exp $
 #
 #	NVIDIA Tegra K1 (T124)
 #
@@ -34,9 +34,7 @@ armgtmr0	at armperiph?# ARM Generic 
 
 # On-board I/O
 tegrafdt0	at mainbus?
-fdt0		at tegrafdt0 
-simplebus*	at fdt?
-fdt*		at simplebus?
+fdt*		at fdtbus?
 
 fregulator*	at fdt?
 gpiokeys*	at fdt?

Index: src/sys/dev/fdt/fdtbus.c
diff -u src/sys/dev/fdt/fdtbus.c:1.5 src/sys/dev/fdt/fdtbus.c:1.6
--- src/sys/dev/fdt/fdtbus.c:1.5	Thu Apr 13 22:27:07 2017
+++ src/sys/dev/fdt/fdtbus.c	Fri Apr 14 22:55:06 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: fdtbus.c,v 1.5 2017/04/13 22:27:07 jmcneill Exp $ */
+/* $NetBSD: fdtbus.c,v 1.6 2017/04/14 22:55:06 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdtbus.c,v 1.5 2017/04/13 22:27:07 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdtbus.c,v 1.6 2017/04/14 22:55:06 jmcneill Exp $");
 
 #include 
 #include 
@@ -56,11 +56,17 @@ static int
 fdt_match(device_t parent, cfdata_t cf, void *aux)
 {
 	const struct fdt_attach_args *faa = aux;
+	const char * const compatible[] = { "simple-bus", NULL };
+	int match;
 
 	if (!OF_child(faa->faa_phandle))
 		return 0;
 
-	return 1;
+	match = of_match_compatible(faa->faa_phandle, compatible);
+	if (match)
+		return match;
+
+	return OF_finddevice("/") == faa->faa_phandle;
 }
 
 static void

Index: src/sys/dev/fdt/files.fdt
diff -u src/sys/dev/fdt/files.fdt:1.7 src/sys/dev/fdt/files.fdt:1.8
--- src/sys/dev/fdt/files.fdt:1.7	Wed Dec 30 04:23:39 2015
+++ src/sys/dev/fdt/files.fdt	Fri Apr 14 22:55:06 2017
@@ -1,4 +1,4 @@
-# $NetBSD: files.fdt,v 1.7 2015/12/30 04:23:39 marty Exp $
+# $NetBSD: files.fdt,v 1.8 2017/04/14 22:55:06 jmcneill Exp $
 
 include	"external/bsd/libfdt/conf/files.libfdt"
 
@@ -6,14 +6,10 @@ defflag	opt_fdt.hFDT: libfdt, ofw_su
 
 define	fdtbus { } : clk
 
-device	fdt { }
+device	fdt { } : fdtbus
 attach	fdt at fdtbus
 file	dev/fdt/fdtbus.c			fdt
 
-device	simplebus : fdtbus
-attach	simplebus at fdt
-file	dev/fdt/simplebus.c			simplebus
-
 device	fregulator
 attach	fregulator at fdt
 file	dev/fdt/fixedregulator.c		fregulator



CVS commit: src/sys/netipsec

2017-04-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Apr 14 22:35:05 UTC 2017

Modified Files:
src/sys/netipsec: xform_ipip.c

Log Message:
PR/52161: Ryota Ozaki: Fix AH tunnel ipsec for ipv6. Compute plen right,
don't forget to subtract the ipv6 header length.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/netipsec/xform_ipip.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/netipsec/xform_ipip.c
diff -u src/sys/netipsec/xform_ipip.c:1.43 src/sys/netipsec/xform_ipip.c:1.44
--- src/sys/netipsec/xform_ipip.c:1.43	Thu Apr  6 05:20:07 2017
+++ src/sys/netipsec/xform_ipip.c	Fri Apr 14 18:35:05 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: xform_ipip.c,v 1.43 2017/04/06 09:20:07 ozaki-r Exp $	*/
+/*	$NetBSD: xform_ipip.c,v 1.44 2017/04/14 22:35:05 christos Exp $	*/
 /*	$FreeBSD: src/sys/netipsec/xform_ipip.c,v 1.3.2.1 2003/01/24 05:11:36 sam Exp $	*/
 /*	$OpenBSD: ip_ipip.c,v 1.25 2002/06/10 18:04:55 itojun Exp $ */
 
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xform_ipip.c,v 1.43 2017/04/06 09:20:07 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xform_ipip.c,v 1.44 2017/04/14 22:35:05 christos Exp $");
 
 /*
  * IP-inside-IP processing
@@ -562,7 +562,7 @@ ipip_output(
 		ip6o->ip6_flow = 0;
 		ip6o->ip6_vfc &= ~IPV6_VERSION_MASK;
 		ip6o->ip6_vfc |= IPV6_VERSION;
-		ip6o->ip6_plen = htons(m->m_pkthdr.len);
+		ip6o->ip6_plen = htons(m->m_pkthdr.len - sizeof(*ip6o));
 		ip6o->ip6_hlim = ip_defttl;
 		ip6o->ip6_dst = saidx->dst.sin6.sin6_addr;
 		ip6o->ip6_src = saidx->src.sin6.sin6_addr;



CVS commit: src/sys/netipsec

2017-04-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Apr 14 22:29:17 UTC 2017

Modified Files:
src/sys/netipsec: xform_ah.c

Log Message:
- fix old refactoring which zeroed the wrong part of the buffer.
- simplify.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/netipsec/xform_ah.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/netipsec/xform_ah.c
diff -u src/sys/netipsec/xform_ah.c:1.48 src/sys/netipsec/xform_ah.c:1.49
--- src/sys/netipsec/xform_ah.c:1.48	Fri Apr 14 14:06:11 2017
+++ src/sys/netipsec/xform_ah.c	Fri Apr 14 18:29:17 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: xform_ah.c,v 1.48 2017/04/14 18:06:11 christos Exp $	*/
+/*	$NetBSD: xform_ah.c,v 1.49 2017/04/14 22:29:17 christos Exp $	*/
 /*	$FreeBSD: src/sys/netipsec/xform_ah.c,v 1.1.4.1 2003/01/24 05:11:36 sam Exp $	*/
 /*	$OpenBSD: ip_ah.c,v 1.63 2001/06/26 06:18:58 angelos Exp $ */
 /*
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xform_ah.c,v 1.48 2017/04/14 18:06:11 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xform_ah.c,v 1.49 2017/04/14 22:29:17 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -425,7 +425,7 @@ ah_massage_headers(struct mbuf **m0, int
 
 /* Zeroize all other options. */
 count = ptr[off + 1];
-memcpy(ptr + off, ipseczeroes, count);
+memcpy(ptr, ipseczeroes, count);
 off += count;
 break;
 			}
@@ -722,14 +722,12 @@ ah_input(struct mbuf *m, const struct se
 	}
 
 	/* Allocate IPsec-specific opaque crypto info. */
-	if (mtag == NULL) {
-		tc = (struct tdb_crypto *) malloc(sizeof (struct tdb_crypto) +
-			skip + rplen + authsize, M_XDATA, M_NOWAIT|M_ZERO);
-	} else {
-		/* Hash verification has already been done successfully. */
-		tc = (struct tdb_crypto *) malloc(sizeof (struct tdb_crypto),
-		M_XDATA, M_NOWAIT|M_ZERO);
-	}
+	size_t size = sizeof(*tc);
+	size_t extra = skip + rplen + authsize;
+	if (mtag == NULL)
+		size += extra;
+
+	tc = malloc(size, M_XDATA, M_NOWAIT|M_ZERO);
 	if (tc == NULL) {
 		DPRINTF(("%s: failed to allocate tdb_crypto\n", __func__));
 		AH_STATINC(AH_STAT_CRYPTO);
@@ -738,7 +736,7 @@ ah_input(struct mbuf *m, const struct se
 		return ENOBUFS;
 	}
 
-	error = m_makewritable(, 0, skip + rplen + authsize, M_NOWAIT);
+	error = m_makewritable(, 0, extra, M_NOWAIT);
 	if (error) {
 		m_freem(m);
 		DPRINTF(("%s: failed to copyback_cow\n", __func__));
@@ -754,8 +752,7 @@ ah_input(struct mbuf *m, const struct se
 		 * Save the authenticator, the skipped portion of the packet,
 		 * and the AH header.
 		 */
-		m_copydata(m, 0, skip + rplen + authsize, (tc + 1));
-
+		m_copydata(m, 0, extra, (tc + 1));
 		/* Zeroize the authenticator on the packet. */
 		m_copyback(m, skip + rplen, authsize, ipseczeroes);
 
@@ -788,8 +785,8 @@ ah_input(struct mbuf *m, const struct se
 	tc->tc_skip = skip;
 	tc->tc_ptr = mtag; /* Save the mtag we've identified. */
 
-	DPRINTF(("%s: hash over %d bytes, skip %d: "
-		 "crda len %d skip %d inject %d\n", __func__,
+	DPRINTF(("%s: mtag %p hash over %d bytes, skip %d: "
+		 "crda len %d skip %d inject %d\n", __func__, mtag,
 		 crp->crp_ilen, tc->tc_skip,
 		 crda->crd_len, crda->crd_skip, crda->crd_inject));
 
@@ -906,10 +903,10 @@ ah_input_cb(struct cryptop *crp)
 	 */
 	if (mtag == NULL) {
 		ptr = (char *) (tc + 1);
+		const u_int8_t * = ptr + skip + rplen;
 
 		/* Verify authenticator. */
-		if (!consttime_memequal(ptr + skip + rplen, calc, authsize)) {
-			u_int8_t * = ptr + skip+rplen;
+		if (!consttime_memequal(, calc, authsize)) {
 			DPRINTF(("%s: authentication hash mismatch " \
 			"over %d bytes " \
 			"for packet in SA %s/%08lx:\n" \
@@ -1012,9 +1009,9 @@ ah_output(
 	struct tdb_crypto *tc;
 	struct mbuf *mi;
 	struct cryptop *crp;
-	u_int16_t iplen;
+	uint16_t iplen;
 	int error, rplen, authsize, maxpacketsize, roff;
-	u_int8_t prot;
+	uint8_t prot;
 	struct newah *ah;
 
 	IPSEC_SPLASSERT_SOFTNET("ah_output");
@@ -1029,16 +1026,19 @@ ah_output(
 	/* Figure out header size. */
 	rplen = HDRSIZE(sav);
 
+	size_t ipoffs;
 	/* Check for maximum packet size violations. */
 	switch (sav->sah->saidx.dst.sa.sa_family) {
 #ifdef INET
 	case AF_INET:
 		maxpacketsize = IP_MAXPACKET;
+		ipoffs = offsetof(struct ip, ip_len);
 		break;
 #endif /* INET */
 #ifdef INET6
 	case AF_INET6:
 		maxpacketsize = IPV6_MAXPACKET;
+		ipoffs = offsetof(struct ip6_hdr, ip6_plen);
 		break;
 #endif /* INET6 */
 	default:
@@ -1145,8 +1145,7 @@ ah_output(
 	crda->crd_klen = _KEYBITS(sav->key_auth);
 
 	/* Allocate IPsec-specific opaque crypto info. */
-	tc = (struct tdb_crypto *) malloc(
-		sizeof(struct tdb_crypto) + skip, M_XDATA, M_NOWAIT|M_ZERO);
+	tc = malloc(sizeof(*tc) + skip, M_XDATA, M_NOWAIT|M_ZERO);
 	if (tc == NULL) {
 		crypto_freereq(crp);
 		DPRINTF(("%s: failed to allocate tdb_crypto\n", __func__));
@@ -1155,48 +1154,29 @@ ah_output(
 		goto bad;
 	}
 

CVS commit: xsrc/external/mit/xf86-input-ws/dist/src

2017-04-14 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Fri Apr 14 19:19:43 UTC 2017

Modified Files:
xsrc/external/mit/xf86-input-ws/dist/src: ws.c

Log Message:
be somewhat smarter with mux devices:
- don't trust the device type, if we're on a mux that may not be the whole
  story
- always call ioctl(WSMOUSEIO_GCALIBCOORDS)
- check .samplelen to see if we're in raw mode
With this touchscreens on mux devices should Just Work(tm) even if they're
not the first device on the mux.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 xsrc/external/mit/xf86-input-ws/dist/src/ws.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/external/mit/xf86-input-ws/dist/src/ws.c
diff -u xsrc/external/mit/xf86-input-ws/dist/src/ws.c:1.10 xsrc/external/mit/xf86-input-ws/dist/src/ws.c:1.11
--- xsrc/external/mit/xf86-input-ws/dist/src/ws.c:1.10	Thu Apr  6 20:55:03 2017
+++ xsrc/external/mit/xf86-input-ws/dist/src/ws.c	Fri Apr 14 19:19:43 2017
@@ -265,47 +265,45 @@ wsPreInit12(InputDriverPtr drv, InputInf
 		rc = BadValue;
 		goto fail;
 	}
-	if (priv->type == WSMOUSE_TYPE_TPANEL) {
+
+	/* assume screen coordinate space until proven wrong */
+	priv->min_x = 0;
+	priv->max_x = screenInfo.screens[priv->screen_no]->width - 1;
+	priv->min_y = 0;
+	priv->max_y = screenInfo.screens[priv->screen_no]->height - 1;
+	priv->raw = 0;
+
+	/* don't rely on the device type - we may be listening to a mux */		
+	if (ioctl(pInfo->fd, WSMOUSEIO_GCALIBCOORDS,
+		>coords) != 0) {
+		/* can't get absolute coordinate space - assume mouse */
+		pInfo->type_name = XI_MOUSE;
+	} else if (priv->coords.samplelen == WSMOUSE_CALIBCOORDS_RESET) {
+		/*
+		 * we're getting raw coordinates - update accordingly and hope
+		 * that there is no other absolute positioning device on the
+		 * same mux
+		 */
+		priv->min_x = priv->coords.minx;
+		priv->max_x = priv->coords.maxx;
+		priv->min_y = priv->coords.miny;
+		priv->max_y = priv->coords.maxy;
+		priv->raw = 1;
 		pInfo->type_name = XI_TOUCHSCREEN;
-		priv->raw = xf86SetBoolOption(pInfo->options, "Raw", 1);
 	} else {
-		pInfo->type_name = XI_MOUSE;
-		priv->raw = xf86SetBoolOption(pInfo->options, "Raw", 0);
-		if (priv->raw) {
-			xf86Msg(X_WARNING, "Device is not a touch panel,"
-			"ignoring 'Option \"Raw\"'\n");
-			priv->raw = 0;
-		}
+		/*
+		 * touchscreen not in raw mode, should send us screen
+		 * coordinates 
+		 */
+		pInfo->type_name = XI_TOUCHSCREEN;
 	}
+
 	if (priv->raw) {
 		xf86Msg(X_CONFIG,
 		"%s device will work in raw mode\n",
 		pInfo->name);
 	}
 
-	if (priv->type == WSMOUSE_TYPE_TPANEL && priv->raw) {
-		
-		if (ioctl(pInfo->fd, WSMOUSEIO_GCALIBCOORDS,
-			>coords) != 0) {
-			xf86Msg(X_ERROR, "GCALIBCOORDS failed %s\n",
-			strerror(errno));
-			wsClose(pInfo);
-			rc = BadValue;
-			goto fail;
-		}
-		/* get default coordinate space from kernel */
-		priv->min_x = priv->coords.minx;
-		priv->max_x = priv->coords.maxx;
-		priv->min_y = priv->coords.miny;
-		priv->max_y = priv->coords.maxy;
-	} else {
-		/* in calibrated mode, coordinate space, is screen coords */
-		priv->min_x = 0;
-		priv->max_x = screenInfo.screens[priv->screen_no]->width - 1;
-		priv->min_y = 0;
-		priv->max_y = screenInfo.screens[priv->screen_no]->height - 1;
-	}
-
 	/* Allow options to override this */
 	priv->min_x = xf86SetIntOption(pInfo->options, "MinX", priv->min_x);
 	xf86Msg(X_INFO, "%s minimum x position: %d\n",



CVS commit: src/sys/netipsec

2017-04-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Apr 14 18:06:11 UTC 2017

Modified Files:
src/sys/netipsec: xform_ah.c

Log Message:
change into __func__


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/netipsec/xform_ah.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/netipsec/xform_ah.c
diff -u src/sys/netipsec/xform_ah.c:1.47 src/sys/netipsec/xform_ah.c:1.48
--- src/sys/netipsec/xform_ah.c:1.47	Thu Apr 13 12:38:32 2017
+++ src/sys/netipsec/xform_ah.c	Fri Apr 14 14:06:11 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: xform_ah.c,v 1.47 2017/04/13 16:38:32 christos Exp $	*/
+/*	$NetBSD: xform_ah.c,v 1.48 2017/04/14 18:06:11 christos Exp $	*/
 /*	$FreeBSD: src/sys/netipsec/xform_ah.c,v 1.1.4.1 2003/01/24 05:11:36 sam Exp $	*/
 /*	$OpenBSD: ip_ah.c,v 1.63 2001/06/26 06:18:58 angelos Exp $ */
 /*
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xform_ah.c,v 1.47 2017/04/13 16:38:32 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xform_ah.c,v 1.48 2017/04/14 18:06:11 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -166,7 +166,7 @@ ah_hdrsiz(const struct secasvar *sav)
 	if (sav != NULL) {
 		int authsize;
 		IPSEC_ASSERT(sav->tdb_authalgxform != NULL,
-			("ah_hdrsiz: null xform"));
+			("%s: null xform", __func__));
 		/*XXX not right for null algorithm--does it matter??*/
 		authsize = AUTHSIZE(sav);
 		size = roundup(authsize, sizeof (u_int32_t)) + HDRSIZE(sav);
@@ -189,8 +189,8 @@ ah_init0(struct secasvar *sav, const str
 
 	thash = ah_algorithm_lookup(sav->alg_auth);
 	if (thash == NULL) {
-		DPRINTF(("ah_init: unsupported authentication algorithm %u\n",
-			sav->alg_auth));
+		DPRINTF(("%s: unsupported authentication algorithm %u\n",
+			__func__, sav->alg_auth));
 		return EINVAL;
 	}
 	/*
@@ -200,21 +200,21 @@ ah_init0(struct secasvar *sav, const str
 	 */
 	/* NB: replay state is setup elsewhere (sigh) */
 	if (((sav->flags_X_EXT_OLD) == 0) ^ (sav->replay != NULL)) {
-		DPRINTF(("ah_init: replay state block inconsistency, "
-			"%s algorithm %s replay state\n",
+		DPRINTF(("%s: replay state block inconsistency, "
+			"%s algorithm %s replay state\n", __func__,
 			(sav->flags & SADB_X_EXT_OLD) ? "old" : "new",
 			sav->replay == NULL ? "without" : "with"));
 		return EINVAL;
 	}
 	if (sav->key_auth == NULL) {
-		DPRINTF(("ah_init: no authentication key for %s "
-			"algorithm\n", thash->name));
+		DPRINTF(("%s: no authentication key for %s algorithm\n",
+			__func__, thash->name));
 		return EINVAL;
 	}
 	keylen = _KEYLEN(sav->key_auth);
 	if (keylen != thash->keysize && thash->keysize != 0) {
-		DPRINTF(("ah_init: invalid keylength %d, algorithm "
-			 "%s requires keysize %d\n",
+		DPRINTF(("%s: invalid keylength %d, algorithm %s requires "
+			 "keysize %d\n", __func__,
 			 keylen, thash->name, thash->keysize));
 		return EINVAL;
 	}
@@ -297,7 +297,7 @@ ah_massage_headers(struct mbuf **m0, int
 		 */
 		*m0 = m = m_pullup(m, skip);
 		if (m == NULL) {
-			DPRINTF(("ah_massage_headers: m_pullup failed\n"));
+			DPRINTF(("%s: m_pullup failed\n", __func__));
 			return ENOBUFS;
 		}
 
@@ -352,9 +352,8 @@ ah_massage_headers(struct mbuf **m0, int
 			off + 1 < skip)
 ;
 			else {
-DPRINTF(("ah_massage_headers: illegal IPv4 "
-"option length for option %d\n",
-ptr[off]));
+DPRINTF(("%s: illegal IPv4 option length for "
+"option %d\n", __func__, ptr[off]));
 
 m_freem(m);
 return EINVAL;
@@ -376,9 +375,9 @@ ah_massage_headers(struct mbuf **m0, int
 			case 0x95:	/* RFC1770 */
 /* Sanity check for option length. */
 if (ptr[off + 1] < 2) {
-	DPRINTF(("ah_massage_headers: "
-	"illegal IPv4 option length for "
-	"option %d\n", ptr[off]));
+	DPRINTF(("%s: illegal IPv4 option "
+	"length for option %d\n", __func__,
+	ptr[off]));
 
 	m_freem(m);
 	return EINVAL;
@@ -391,9 +390,9 @@ ah_massage_headers(struct mbuf **m0, int
 			case IPOPT_SSRR:
 /* Sanity check for option length. */
 if (ptr[off + 1] < 2) {
-	DPRINTF(("ah_massage_headers: "
-	"illegal IPv4 option length for "
-	"option %d\n", ptr[off]));
+	DPRINTF(("%s: illegal IPv4 option "
+	"length for option %d\n", __func__,
+	ptr[off]));
 
 	m_freem(m);
 	return EINVAL;
@@ -417,9 +416,9 @@ ah_massage_headers(struct mbuf **m0, int
 			default:
 /* Sanity check for option length. */
 if (ptr[off + 1] < 2) {
-	DPRINTF(("ah_massage_headers: "
-	"illegal IPv4 option length for "
-	"option %d\n", ptr[off]));
+	DPRINTF(("%s: illegal IPv4 option "
+	"length for option %d\n", __func__,
+	ptr[off]));
 	m_freem(m);
 	return EINVAL;
 }
@@ -433,8 +432,8 @@ ah_massage_headers(struct mbuf **m0, int
 
 			/* Sanity check. */
 			if (off > skip)	{
-DPRINTF(("ah_massage_headers(): 

CVS commit: src/usr.sbin/makefs

2017-04-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Apr 14 15:40:35 UTC 2017

Modified Files:
src/usr.sbin/makefs: msdos.c

Log Message:
leave the size alone and set the create_size to include the offset. It
does not matter anyway, but it makes more sense this way.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/usr.sbin/makefs/msdos.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/makefs/msdos.c
diff -u src/usr.sbin/makefs/msdos.c:1.19 src/usr.sbin/makefs/msdos.c:1.20
--- src/usr.sbin/makefs/msdos.c:1.19	Thu Apr 13 13:20:59 2017
+++ src/usr.sbin/makefs/msdos.c	Fri Apr 14 11:40:35 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: msdos.c,v 1.19 2017/04/13 17:20:59 christos Exp $	*/
+/*	$NetBSD: msdos.c,v 1.20 2017/04/14 15:40:35 christos Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: msdos.c,v 1.19 2017/04/13 17:20:59 christos Exp $");
+__RCSID("$NetBSD: msdos.c,v 1.20 2017/04/14 15:40:35 christos Exp $");
 #endif	/* !__lint */
 
 #include 
@@ -157,9 +157,9 @@ msdos_makefs(const char *image, const ch
 	assert(root != NULL);
 	assert(fsopts != NULL);
 
-	fsopts->size = fsopts->offset + fsopts->maxsize;
+	fsopts->size = fsopts->maxsize;
 	msdos_opt->options.create_size = MAX(msdos_opt->options.create_size,
-		fsopts->size);
+	fsopts->offset + fsopts->size);
 	msdos_opt->options.offset = fsopts->offset;
 	if (msdos_opt->options.bytes_per_sector == 0) {
 		if (fsopts->sectorsize == -1)



CVS commit: src/sbin/newfs_msdos

2017-04-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Apr 14 15:39:29 UTC 2017

Modified Files:
src/sbin/newfs_msdos: mkfs_msdos.c

Log Message:
Use the create_size if given to compute the real size instead of stat'ing
the file again, which might have been larger to start with.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sbin/newfs_msdos/mkfs_msdos.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/newfs_msdos/mkfs_msdos.c
diff -u src/sbin/newfs_msdos/mkfs_msdos.c:1.12 src/sbin/newfs_msdos/mkfs_msdos.c:1.13
--- src/sbin/newfs_msdos/mkfs_msdos.c:1.12	Thu Feb 16 17:42:25 2017
+++ src/sbin/newfs_msdos/mkfs_msdos.c	Fri Apr 14 11:39:29 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: mkfs_msdos.c,v 1.12 2017/02/16 22:42:25 christos Exp $	*/
+/*	$NetBSD: mkfs_msdos.c,v 1.13 2017/04/14 15:39:29 christos Exp $	*/
 
 /*
  * Copyright (c) 1998 Robert Nordier
@@ -37,7 +37,7 @@
 static const char rcsid[] =
   "$FreeBSD: src/sbin/newfs_msdos/newfs_msdos.c,v 1.15 2000/10/10 01:49:37 wollman Exp $";
 #else
-__RCSID("$NetBSD: mkfs_msdos.c,v 1.12 2017/02/16 22:42:25 christos Exp $");
+__RCSID("$NetBSD: mkfs_msdos.c,v 1.13 2017/04/14 15:39:29 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -235,7 +235,7 @@ static int got_siginfo = 0; /* received 
 static int check_mounted(const char *, mode_t);
 #endif
 static int getstdfmt(const char *, struct bpb *);
-static int getbpbinfo(int, const char *, const char *, int, struct bpb *, int);
+static int getbpbinfo(int, const char *, const char *, int, struct bpb *, off_t);
 static void print_bpb(struct bpb *);
 static int ckgeom(const char *, u_int, const char *);
 static int oklabel(const char *);
@@ -331,7 +331,7 @@ mkfs_msdos(const char *fname, const char
 if (!(o.floppy || (o.drive_heads && o.sectors_per_track &&
 	o.bytes_per_sector && o.size && o.hidden_sectors_set))) {
 	if (getbpbinfo(fd, fname, dtype, o.hidden_sectors_set, ,
-	o.create_size != 0) == -1)
+	o.create_size) == -1)
 	return -1;
 	bpb.bsec -= (o.offset / bpb.bps);
 	if (bpb.spc == 0) { /* set defaults */
@@ -817,7 +817,7 @@ getstdfmt(const char *fmt, struct bpb *b
  */
 static int
 getbpbinfo(int fd, const char *fname, const char *dtype, int iflag,
-struct bpb *bpb, int create)
+struct bpb *bpb, off_t create_size)
 {
 const char *s1, *s2;
 int part;
@@ -835,26 +835,31 @@ getbpbinfo(int fd, const char *fname, co
 
 #ifndef MAKEFS
 int maxpartitions = getmaxpartitions();
+struct disk_geom geo;
+struct dkwedge_info dkw;
 
 // XXX: Does not work with wedges
 if (s2 && *s2 >= 'a' && *s2 <= 'a' + maxpartitions - 1) {
 	part = *s2++ - 'a';
 }
 #endif
-if (((part != -1) && ((!iflag && part != -1) || !bpb->bsec)) ||
-	!bpb->bps || !bpb->spt || !bpb->hds) {
-	u_int sector_size;
-	u_int nsectors;
-	u_int ntracks;
-	u_int size;
-#ifndef MAKEFS
-	struct disk_geom geo;
-	struct dkwedge_info dkw;
 
-	if (!create && getdiskinfo(fname, fd, NULL, , ) != -1) {
-	sector_size = geo.dg_secsize = 512;
-	nsectors = geo.dg_nsectors = 63;
-	ntracks = geo.dg_ntracks = 255;
+if (!(((part != -1) && ((!iflag && part != -1) || !bpb->bsec)) ||
+	!bpb->bps || !bpb->spt || !bpb->hds)) {
+	return 0;
+}
+
+u_int sector_size = 512;
+u_int nsectors = 63;
+u_int ntracks = 255;
+u_int size;
+
+if (create_size == 0) {
+#ifndef MAKEFS
+	if (getdiskinfo(fname, fd, NULL, , ) != -1) {
+	sector_size = geo.dg_secsize;
+	nsectors = geo.dg_nsectors;
+	ntracks = geo.dg_ntracks;
 	size = dkw.dkw_size;
 	} else
 #endif
@@ -865,39 +870,39 @@ getbpbinfo(int fd, const char *fname, co
 		warnx("Can't get disk size for `%s'", fname);
 		return -1;
 	}
-	/* create a fake geometry for a file image */
-	sector_size = 512;
-	nsectors = 63;
-	ntracks = 255;
 	size = st.st_size / sector_size;
 	}
-	if (!bpb->bps) {
-	if (ckgeom(fname, sector_size, "bytes/sector") == -1)
-		return -1;
-	bpb->bps = sector_size;
-	}
+} else {
+	size = create_size / sector_size;
+}
 
-	if (nsectors > 63) {
-		/*
-		 * The kernel doesn't accept BPB with spt > 63.
-		 * (see sys/fs/msdosfs/msdosfs_vfsops.c:msdosfs_mountfs())
-		 * If values taken from disklabel don't match these
-		 * restrictions, use popular BIOS default values instead.
-		 */
-		nsectors = 63;
-	}
-	if (!bpb->spt) {
-	if (ckgeom(fname, nsectors, "sectors/track") == -1)
-		return -1;
-	bpb->spt = nsectors;
-	}
-	if (!bpb->hds)
-	if (ckgeom(fname, ntracks, "drive heads") == -1)
-		return -1;
-	bpb->hds = ntracks;
-	if (!bpb->bsec)
-	bpb->bsec = size;
+if (!bpb->bps) {
+	if (ckgeom(fname, sector_size, "bytes/sector") == -1)
+	return -1;
+	bpb->bps = sector_size;
+}
+
+if (nsectors > 63) {
+	/*
+	 * The kernel doesn't accept BPB with spt > 63.
+	 * (see 

CVS commit: src/distrib/sets/lists/debug

2017-04-14 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Apr 14 15:21:28 UTC 2017

Modified Files:
src/distrib/sets/lists/debug: shl.mi

Log Message:
libdevmapper is conditional on lvm.


To generate a diff of this commit:
cvs rdiff -u -r1.165 -r1.166 src/distrib/sets/lists/debug/shl.mi

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/debug/shl.mi
diff -u src/distrib/sets/lists/debug/shl.mi:1.165 src/distrib/sets/lists/debug/shl.mi:1.166
--- src/distrib/sets/lists/debug/shl.mi:1.165	Fri Apr 14 02:43:27 2017
+++ src/distrib/sets/lists/debug/shl.mi	Fri Apr 14 15:21:28 2017
@@ -1,11 +1,11 @@
-# $NetBSD: shl.mi,v 1.165 2017/04/14 02:43:27 ozaki-r Exp $
+# $NetBSD: shl.mi,v 1.166 2017/04/14 15:21:28 riastradh Exp $
 ./usr/lib/libbfd_g.a		comp-c-debuglib	debuglib,compatfile,binutils
 ./usr/libdata/debug/lib		base-sys-usr	debug,dynamicroot,compatdir
 ./usr/libdata/debug/lib/libblacklist.so.0.0.debug		comp-sys-debug	debug,dynamicroot
 ./usr/libdata/debug/lib/libc.so.12.206.debug			comp-sys-debug	debug,dynamicroot
 ./usr/libdata/debug/lib/libcrypt.so.1.0.debug			comp-sys-debug	debug,dynamicroot
 ./usr/libdata/debug/lib/libcrypto.so.12.0.debug			comp-sys-debug	debug,dynamicroot,crypto
-./usr/libdata/debug/lib/libdevmapper.so.1.0.debug		comp-sys-debug	debug,dynamicroot
+./usr/libdata/debug/lib/libdevmapper.so.1.0.debug		comp-sys-debug	debug,dynamicroot,lvm
 ./usr/libdata/debug/lib/libdm.so.0.0.debug 			comp-sys-debug	debug,dynamicroot
 ./usr/libdata/debug/lib/libedit.so.3.1.debug			comp-sys-debug	debug,dynamicroot
 ./usr/libdata/debug/lib/libevent.so.4.1.debug			comp-sys-debug	debug,dynamicroot



CVS commit: src/distrib/sets/lists

2017-04-14 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Apr 14 15:20:40 UTC 2017

Modified Files:
src/distrib/sets/lists/comp: mi
src/distrib/sets/lists/debug: mi

Log Message:
cvslatest is unconditional, not conditional on cvs.


To generate a diff of this commit:
cvs rdiff -u -r1.2120 -r1.2121 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.205 -r1.206 src/distrib/sets/lists/debug/mi

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2120 src/distrib/sets/lists/comp/mi:1.2121
--- src/distrib/sets/lists/comp/mi:1.2120	Fri Apr 14 02:43:27 2017
+++ src/distrib/sets/lists/comp/mi	Fri Apr 14 15:20:39 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2120 2017/04/14 02:43:27 ozaki-r Exp $
+#	$NetBSD: mi,v 1.2121 2017/04/14 15:20:39 riastradh Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -3959,7 +3959,7 @@
 ./usr/share/man/cat1/crunchgen.0		comp-c-catman		.cat
 ./usr/share/man/cat1/crunchide.0		comp-c-catman		.cat
 ./usr/share/man/cat1/cvs.0			comp-cvs-catman		cvs,.cat
-./usr/share/man/cat1/cvslatest.0		comp-cvs-catman		cvs,.cat
+./usr/share/man/cat1/cvslatest.0		comp-cvs-catman		.cat
 ./usr/share/man/cat1/elf2aout.0			comp-sysutil-catman	.cat
 ./usr/share/man/cat1/elf2ecoff.0		comp-sysutil-catman	.cat
 ./usr/share/man/cat1/elfedit.0			comp-util-catman	binutils,.cat
@@ -11484,7 +11484,7 @@
 ./usr/share/man/html1/crunchgen.html		comp-c-htmlman		html
 ./usr/share/man/html1/crunchide.html		comp-c-htmlman		html
 ./usr/share/man/html1/cvs.html			comp-cvs-htmlman	cvs,html
-./usr/share/man/html1/cvslatest.html		comp-cvs-htmlman	cvs,html
+./usr/share/man/html1/cvslatest.html		comp-cvs-htmlman	html
 ./usr/share/man/html1/elf2aout.html		comp-sysutil-htmlman	html
 ./usr/share/man/html1/elf2ecoff.html		comp-sysutil-htmlman	html
 ./usr/share/man/html1/elfedit.html		comp-util-htmlman	binutils,html
@@ -18748,7 +18748,7 @@
 ./usr/share/man/man1/crunchgen.1		comp-c-man		.man
 ./usr/share/man/man1/crunchide.1		comp-c-man		.man
 ./usr/share/man/man1/cvs.1			comp-cvs-man		cvs,.man
-./usr/share/man/man1/cvslatest.1		comp-cvs-man		cvs,.man
+./usr/share/man/man1/cvslatest.1		comp-cvs-man		.man
 ./usr/share/man/man1/elf2aout.1			comp-sysutil-man	.man
 ./usr/share/man/man1/elf2ecoff.1		comp-sysutil-man	.man
 ./usr/share/man/man1/elfedit.1			comp-util-man		binutils,.man

Index: src/distrib/sets/lists/debug/mi
diff -u src/distrib/sets/lists/debug/mi:1.205 src/distrib/sets/lists/debug/mi:1.206
--- src/distrib/sets/lists/debug/mi:1.205	Fri Apr 14 02:43:27 2017
+++ src/distrib/sets/lists/debug/mi	Fri Apr 14 15:20:39 2017
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.205 2017/04/14 02:43:27 ozaki-r Exp $
+# $NetBSD: mi,v 1.206 2017/04/14 15:20:39 riastradh Exp $
 ./etc/mtree/set.debug   comp-sys-root
 ./usr/lib	comp-sys-usr		compatdir
 ./usr/lib/i18n/libBIG5_g.a			comp-c-debuglib		debuglib,compatfile
@@ -497,7 +497,7 @@
 ./usr/libdata/debug/usr/bin/ctfmerge.debug	comp-util-debug		ctf,debug
 ./usr/libdata/debug/usr/bin/cut.debug		comp-util-debug		debug
 ./usr/libdata/debug/usr/bin/cvs.debug		comp-cvs-debug		cvs,debug
-./usr/libdata/debug/usr/bin/cvslatest.debug	comp-cvs-debug		cvs,debug
+./usr/libdata/debug/usr/bin/cvslatest.debug	comp-cvs-debug		debug
 ./usr/libdata/debug/usr/bin/db.debug		comp-util-debug		debug
 ./usr/libdata/debug/usr/bin/dc.debug		comp-util-debug		debug
 ./usr/libdata/debug/usr/bin/delv.debug		comp-bind-bin		debug



CVS commit: src/distrib/utils/embedded/files

2017-04-14 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Apr 14 13:47:22 UTC 2017

Modified Files:
src/distrib/utils/embedded/files: resize_disklabel

Log Message:
Grow the MBR partition table entry for the BSD partition before
growing the disklabel.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/distrib/utils/embedded/files/resize_disklabel

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/utils/embedded/files/resize_disklabel
diff -u src/distrib/utils/embedded/files/resize_disklabel:1.1 src/distrib/utils/embedded/files/resize_disklabel:1.2
--- src/distrib/utils/embedded/files/resize_disklabel:1.1	Mon Apr  6 20:19:28 2015
+++ src/distrib/utils/embedded/files/resize_disklabel	Fri Apr 14 13:47:21 2017
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: resize_disklabel,v 1.1 2015/04/06 20:19:28 jmcneill Exp $
+# $NetBSD: resize_disklabel,v 1.2 2017/04/14 13:47:21 jmcneill Exp $
 #
 
 # PROVIDE: resize_disklabel
@@ -33,6 +33,30 @@ get_rawpart_sectors()
 	/sbin/disklabel $disk | grep "^ $rawpart:" | awk '{ print $2; }'
 }
 
+grow_mbrpart()
+{
+	disk=$1
+	rawpart=$(get_rawpart)
+
+	eval $(/sbin/fdisk -S $disk)
+	if [ ! "$PART1ID" = "169" ]; then
+		warn "No NetBSD partition found in MBR partition #1"
+		return
+	fi
+
+	ts=$(($(get_total_sectors $disk) - ${PART1START}))
+	rs=${PART1SIZE}
+
+	if [ "$ts" = "$rs" ]; then
+		return
+	fi
+
+	oldsize=$(($rs * 512 / 1024 / 1024))
+	newsize=$(($ts * 512 / 1024 / 1024))
+	echo "Growing $disk MBR partition #1 (${oldsize}MB -> ${newsize}MB)"
+	/sbin/fdisk -f -u -1 -s 169/${PART1START}/${ts} ${disk}
+}
+
 grow_disklabel()
 {
 	disk=$1
@@ -64,6 +88,7 @@ resize_disklabel_start()
 		return
 	fi
 
+	grow_mbrpart "${resize_disklabel_disk}"
 	grow_disklabel "${resize_disklabel_disk}" "${resize_disklabel_part}"
 }
 



CVS commit: src/doc

2017-04-14 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Apr 14 10:02:49 UTC 2017

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
Note import of dhcpcd-7.0.0-beta3


To generate a diff of this commit:
cvs rdiff -u -r1.1431 -r1.1432 src/doc/3RDPARTY
cvs rdiff -u -r1.2273 -r1.2274 src/doc/CHANGES

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1431 src/doc/3RDPARTY:1.1432
--- src/doc/3RDPARTY:1.1431	Thu Apr 13 20:18:22 2017
+++ src/doc/3RDPARTY	Fri Apr 14 10:02:49 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1431 2017/04/13 20:18:22 christos Exp $
+#	$NetBSD: 3RDPARTY,v 1.1432 2017/04/14 10:02:49 roy Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -334,8 +334,8 @@ Notes:
 Use the dhcp2netbsd script.
 
 Package:	dhcpcd
-Version:	7.0.0-beta2
-Current Vers:	7.0.0-beta2
+Version:	7.0.0-beta3
+Current Vers:	7.0.0-beta3
 Maintainer:	roy
 Archive Site:	ftp://roy.marples.name/pub/dhcpcd/
 Home Page:	http://roy.marples.name/projects/dhcpcd/

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2273 src/doc/CHANGES:1.2274
--- src/doc/CHANGES:1.2273	Fri Apr 14 10:01:48 2017
+++ src/doc/CHANGES	Fri Apr 14 10:02:49 2017
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2273 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2274 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -499,3 +499,4 @@ Changes from NetBSD 7.0 to NetBSD 8.0:
 	dc(1): Import from OpenBSD (replaced GPL version) [christos 20170410]
 	bind: Import version 9.10.4-P8. [christos 20170413]
 	ntp: Import ntp 4.2.8p10. [christos 20170413]
+	dhcpcd: Import dhcpcd 7.0.0-beta3 [roy 20170414]



CVS commit: src/doc

2017-04-14 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Apr 14 10:01:48 UTC 2017

Modified Files:
src/doc: CHANGES

Log Message:
Backdate a note about adding RO_MSGFILTER.


To generate a diff of this commit:
cvs rdiff -u -r1.2272 -r1.2273 src/doc/CHANGES

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2272 src/doc/CHANGES:1.2273
--- src/doc/CHANGES:1.2272	Thu Apr 13 20:18:22 2017
+++ src/doc/CHANGES	Fri Apr 14 10:01:48 2017
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2272 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2273 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -495,6 +495,7 @@ Changes from NetBSD 7.0 to NetBSD 8.0:
 	dhcpcd(8): Import dhcpcd-7.0.0-beta2 [roy 20170402]
 	ptrace(2): Add operations to single step specified threads:
 		PT_SETSTEP and PT_CLEARSTEP [kamil 20170408]
+	route(4): Add RO_MSGFILTER [roy 20170411]
 	dc(1): Import from OpenBSD (replaced GPL version) [christos 20170410]
 	bind: Import version 9.10.4-P8. [christos 20170413]
 	ntp: Import ntp 4.2.8p10. [christos 20170413]



CVS commit: src/external/bsd/dhcpcd/sbin/dhcpcd

2017-04-14 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Apr 14 10:00:06 UTC 2017

Modified Files:
src/external/bsd/dhcpcd/sbin/dhcpcd: Makefile

Log Message:
Build logerr support.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile
diff -u src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile:1.39 src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile:1.40
--- src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile:1.39	Fri Apr 14 07:55:55 2017
+++ src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile	Fri Apr 14 10:00:06 2017
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.39 2017/04/14 07:55:55 roy Exp $
+# $NetBSD: Makefile,v 1.40 2017/04/14 10:00:06 roy Exp $
 #
 
 WARNS?=		6
@@ -8,7 +8,7 @@ USE_FORT?=	yes	# network client (local s
 .include "../../Makefile.inc"
 
 PROG=		dhcpcd
-SRCS=		common.c control.c dhcpcd.c duid.c eloop.c
+SRCS=		common.c control.c dhcpcd.c duid.c eloop.c logerr.c
 SRCS+=		if.c if-options.c route.c sa.c script.c
 SRCS+=		dhcp-common.c dhcpcd-embedded.c
 SRCS+=		if-bsd.c



CVS commit: src/external/bsd/dhcpcd/dist

2017-04-14 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Apr 14 09:56:32 UTC 2017

Modified Files:
src/external/bsd/dhcpcd/dist/src: bpf.c dhcpcd.c if-options.c
Removed Files:
src/external/bsd/dhcpcd/dist/test: GNUmakefile Makefile test.c test.h
test_hmac_md5.c

Log Message:
Sync


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/dhcpcd/dist/src/bpf.c \
src/external/bsd/dhcpcd/dist/src/dhcpcd.c \
src/external/bsd/dhcpcd/dist/src/if-options.c
cvs rdiff -u -r1.1.1.1 -r0 src/external/bsd/dhcpcd/dist/test/GNUmakefile \
src/external/bsd/dhcpcd/dist/test/Makefile \
src/external/bsd/dhcpcd/dist/test/test.c \
src/external/bsd/dhcpcd/dist/test/test.h \
src/external/bsd/dhcpcd/dist/test/test_hmac_md5.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/dhcpcd/dist/src/bpf.c
diff -u src/external/bsd/dhcpcd/dist/src/bpf.c:1.2 src/external/bsd/dhcpcd/dist/src/bpf.c:1.3
--- src/external/bsd/dhcpcd/dist/src/bpf.c:1.2	Mon Apr  3 00:42:20 2017
+++ src/external/bsd/dhcpcd/dist/src/bpf.c	Fri Apr 14 09:56:32 2017
@@ -48,13 +48,13 @@
 #include 
 #include 
 #include 
-#include 
 
 #include "common.h"
 #include "arp.h"
 #include "bpf.h"
 #include "dhcp.h"
 #include "if.h"
+#include "logerr.h"
 
 #define	ARP_ADDRS_MAX	3
 
@@ -150,7 +150,7 @@ bpf_open(struct interface *ifp, int (*fi
 		goto eexit;
 	if (pv.bv_major != BPF_MAJOR_VERSION ||
 	pv.bv_minor < BPF_MINOR_VERSION) {
-		syslog(LOG_ERR, "BPF version mismatch - recompile");
+		logerrx("BPF version mismatch - recompile");
 		goto eexit;
 	}
 
@@ -174,7 +174,6 @@ bpf_open(struct interface *ifp, int (*fi
 			goto eexit;
 		state->buffer = nb;
 		state->buffer_size = buf_len;
-		state->buffer_len = state->buffer_pos = 0;
 	}
 
 #ifdef BIOCIMMEDIATE
@@ -222,8 +221,6 @@ bpf_read(struct interface *ifp, int fd, 
 		bytes = -1;
 		memcpy(, state->buffer + state->buffer_pos,
 		sizeof(packet));
-		if (packet.bh_caplen != packet.bh_datalen)
-			goto next; /* Incomplete packet, drop. */
 		if (state->buffer_pos + packet.bh_caplen + packet.bh_hdrlen >
 		state->buffer_len)
 			goto next; /* Packet beyond buffer, drop. */
@@ -288,6 +285,16 @@ bpf_send(const struct interface *ifp, in
 }
 #endif
 
+int
+bpf_close(struct interface *ifp, int fd)
+{
+	struct ipv4_state *state = IPV4_STATE(ifp);
+
+	/* Rewind the buffer on closing. */
+	state->buffer_len = state->buffer_pos = 0;
+	return close(fd);
+}
+
 static unsigned int
 bpf_cmp_hwaddr(struct bpf_insn *bpf, size_t bpf_len, size_t off,
 bool equal, uint8_t *hwaddr, size_t hwaddr_len)
@@ -428,6 +435,7 @@ bpf_arp(struct interface *ifp, int fd)
 	struct bpf_insn bpf[3+ bpf_arp_filter_len + bpf_arp_hw + bpf_arp_extra];
 	struct bpf_insn *bp;
 	struct iarp_state *state;
+	uint16_t arp_len;
 
 	if (fd == -1)
 		return 0;
@@ -438,6 +446,7 @@ bpf_arp(struct interface *ifp, int fd)
 	case ARPHRD_ETHER:
 		memcpy(bp, bpf_arp_ether, sizeof(bpf_arp_ether));
 		bp += bpf_arp_ether_len;
+		arp_len = sizeof(struct ether_header)+sizeof(struct ether_arp);
 		break;
 	default:
 		errno = EINVAL;
@@ -465,13 +474,13 @@ bpf_arp(struct interface *ifp, int fd)
 		TAILQ_FOREACH(astate, >arp_states, next) {
 			if (++naddrs > ARP_ADDRS_MAX) {
 errno = ENOBUFS;
-syslog(LOG_ERR, "%s: %m", __func__);
+logerr(__func__);
 break;
 			}
 			BPF_SET_JUMP(bp, BPF_JMP + BPF_JEQ + BPF_K,
 			 htonl(astate->addr.s_addr), 0, 1);
 			bp++;
-			BPF_SET_STMT(bp, BPF_RET + BPF_K, BPF_WHOLEPACKET);
+			BPF_SET_STMT(bp, BPF_RET + BPF_K, arp_len);
 			bp++;
 		}
 
@@ -496,8 +505,7 @@ bpf_arp(struct interface *ifp, int fd)
 			BPF_SET_JUMP(bp, BPF_JMP + BPF_JEQ + BPF_K,
 			 htonl(astate->addr.s_addr), 0, 1);
 			bp++;
-			BPF_SET_STMT(bp, BPF_RET + BPF_K,
-			 BPF_WHOLEPACKET);
+			BPF_SET_STMT(bp, BPF_RET + BPF_K, arp_len);
 			bp++;
 		}
 
Index: src/external/bsd/dhcpcd/dist/src/dhcpcd.c
diff -u src/external/bsd/dhcpcd/dist/src/dhcpcd.c:1.2 src/external/bsd/dhcpcd/dist/src/dhcpcd.c:1.3
--- src/external/bsd/dhcpcd/dist/src/dhcpcd.c:1.2	Thu Apr  6 14:00:34 2017
+++ src/external/bsd/dhcpcd/dist/src/dhcpcd.c	Fri Apr 14 09:56:32 2017
@@ -44,7 +44,6 @@ const char dhcpcd_copyright[] = "Copyrig
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
@@ -63,6 +62,7 @@ const char dhcpcd_copyright[] = "Copyrig
 #include "ipv4ll.h"
 #include "ipv6.h"
 #include "ipv6nd.h"
+#include "logerr.h"
 #include "script.h"
 
 #ifdef HAVE_UTIL_H
@@ -173,7 +173,7 @@ handle_exit_timeout(void *arg)
 	struct dhcpcd_ctx *ctx;
 
 	ctx = arg;
-	syslog(LOG_ERR, "timed out");
+	logerrx("timed out");
 	if (!(ctx->options & DHCPCD_MASTER)) {
 		eloop_exit(ctx->eloop, EXIT_FAILURE);
 		return;
@@ -258,16 +258,14 @@ dhcpcd_ipwaited(struct dhcpcd_ctx *ctx)
 
 	TAILQ_FOREACH(ifp, ctx->ifaces, next) {
 		if ((af = dhcpcd_ifafwaiting(ifp)) != AF_MAX) {
-			

CVS import: src/external/bsd/dhcpcd/dist

2017-04-14 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Apr 14 09:53:07 UTC 2017

Update of /cvsroot/src/external/bsd/dhcpcd/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv23241

Log Message:
Import dhcpcd-7.0.0-beta3 with the following changes:
  *  restored --logfile support as a few people complained it vanished
 The new logging code even makes the overall binary size smaller
 on most platforms.
  *  BPF filter now trims garbage trailing the payload
 OK, it's not garbage, but userland doesn't know some drivers append
 FCS to it.
  *  support NetBSD's RO_MSGFILTER socket option to reduce avoid context
 switching for route(4) messages that don't interest us.
  *  Don't open sockets if just sending signals.
  *  HMAC-MD5 test's now check expectations in code rather than relying
 on visual confirmation.
  *  added eloop-bench to test performance of eloop with available
 polling mechanisms.


Status:

Vendor Tag: roy
Release Tags:   dhcpcd-7-0-0-beta3

U src/external/bsd/dhcpcd/dist/.arcconfig
U src/external/bsd/dhcpcd/dist/.gitignore
U src/external/bsd/dhcpcd/dist/BUILDING.md
U src/external/bsd/dhcpcd/dist/LICENSE
U src/external/bsd/dhcpcd/dist/Makefile
U src/external/bsd/dhcpcd/dist/Makefile.inc
U src/external/bsd/dhcpcd/dist/README.md
U src/external/bsd/dhcpcd/dist/config-null.mk
U src/external/bsd/dhcpcd/dist/configure
U src/external/bsd/dhcpcd/dist/iconfig.mk
U src/external/bsd/dhcpcd/dist/compat/_strtoi.h
U src/external/bsd/dhcpcd/dist/compat/arc4random.c
U src/external/bsd/dhcpcd/dist/compat/arc4random.h
U src/external/bsd/dhcpcd/dist/compat/bitops.h
U src/external/bsd/dhcpcd/dist/compat/queue.h
U src/external/bsd/dhcpcd/dist/compat/arc4random_uniform.c
U src/external/bsd/dhcpcd/dist/compat/arc4random_uniform.h
U src/external/bsd/dhcpcd/dist/compat/reallocarray.c
U src/external/bsd/dhcpcd/dist/compat/dprintf.c
U src/external/bsd/dhcpcd/dist/compat/dprintf.h
U src/external/bsd/dhcpcd/dist/compat/endian.h
U src/external/bsd/dhcpcd/dist/compat/pidfile.c
U src/external/bsd/dhcpcd/dist/compat/pidfile.h
U src/external/bsd/dhcpcd/dist/compat/reallocarray.h
U src/external/bsd/dhcpcd/dist/compat/strtoi.c
U src/external/bsd/dhcpcd/dist/compat/strtoi.h
U src/external/bsd/dhcpcd/dist/compat/strtou.c
U src/external/bsd/dhcpcd/dist/compat/crypt/md5.c
U src/external/bsd/dhcpcd/dist/compat/crypt/md5.h
U src/external/bsd/dhcpcd/dist/compat/crypt/sha256.c
U src/external/bsd/dhcpcd/dist/compat/crypt/sha256.h
U src/external/bsd/dhcpcd/dist/src/GNUmakefile
U src/external/bsd/dhcpcd/dist/src/Makefile
U src/external/bsd/dhcpcd/dist/src/arp.c
U src/external/bsd/dhcpcd/dist/src/arp.h
U src/external/bsd/dhcpcd/dist/src/auth.c
U src/external/bsd/dhcpcd/dist/src/auth.h
C src/external/bsd/dhcpcd/dist/src/bpf.c
U src/external/bsd/dhcpcd/dist/src/bpf.h
U src/external/bsd/dhcpcd/dist/src/common.c
U src/external/bsd/dhcpcd/dist/src/common.h
U src/external/bsd/dhcpcd/dist/src/control.c
U src/external/bsd/dhcpcd/dist/src/control.h
U src/external/bsd/dhcpcd/dist/src/dhcp-common.c
U src/external/bsd/dhcpcd/dist/src/defs.h
U src/external/bsd/dhcpcd/dist/src/dev.c
U src/external/bsd/dhcpcd/dist/src/dev.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd-definitions.conf
U src/external/bsd/dhcpcd/dist/src/dhcp-common.h
U src/external/bsd/dhcpcd/dist/src/dhcp.c
U src/external/bsd/dhcpcd/dist/src/dhcp.h
U src/external/bsd/dhcpcd/dist/src/dhcp6.c
U src/external/bsd/dhcpcd/dist/src/dhcp6.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf.5.in
U src/external/bsd/dhcpcd/dist/src/dhcpcd.8.in
U src/external/bsd/dhcpcd/dist/src/dhcpcd-definitions-small.conf
U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.c.in
U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.h.in
C src/external/bsd/dhcpcd/dist/src/dhcpcd.c
U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf
U src/external/bsd/dhcpcd/dist/src/genembedc
U src/external/bsd/dhcpcd/dist/src/dhcpcd.h
U src/external/bsd/dhcpcd/dist/src/duid.c
U src/external/bsd/dhcpcd/dist/src/duid.h
U src/external/bsd/dhcpcd/dist/src/eloop.c
U src/external/bsd/dhcpcd/dist/src/eloop.h
U src/external/bsd/dhcpcd/dist/src/if-linux-wext.c
U src/external/bsd/dhcpcd/dist/src/genembedh
U src/external/bsd/dhcpcd/dist/src/if-bsd.c
U src/external/bsd/dhcpcd/dist/src/if-linux.c
C src/external/bsd/dhcpcd/dist/src/if-options.c
U src/external/bsd/dhcpcd/dist/src/if-options.h
U src/external/bsd/dhcpcd/dist/src/if-sun.c
U src/external/bsd/dhcpcd/dist/src/if.c
U src/external/bsd/dhcpcd/dist/src/if.h
U src/external/bsd/dhcpcd/dist/src/ipv4.c
U src/external/bsd/dhcpcd/dist/src/ipv4.h
U src/external/bsd/dhcpcd/dist/src/ipv4ll.c
U src/external/bsd/dhcpcd/dist/src/ipv4ll.h
U src/external/bsd/dhcpcd/dist/src/ipv6.c
U src/external/bsd/dhcpcd/dist/src/ipv6.h
U src/external/bsd/dhcpcd/dist/src/ipv6nd.c
U src/external/bsd/dhcpcd/dist/src/ipv6nd.h
N src/external/bsd/dhcpcd/dist/src/logerr.c
N src/external/bsd/dhcpcd/dist/src/logerr.h
U src/external/bsd/dhcpcd/dist/src/route.c
U 

CVS commit: src/sys/arch/arm/nvidia

2017-04-14 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Apr 14 09:50:56 UTC 2017

Modified Files:
src/sys/arch/arm/nvidia: tegra124_car.c

Log Message:
Add GPU gating clock


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/nvidia/tegra124_car.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/nvidia/tegra124_car.c
diff -u src/sys/arch/arm/nvidia/tegra124_car.c:1.8 src/sys/arch/arm/nvidia/tegra124_car.c:1.9
--- src/sys/arch/arm/nvidia/tegra124_car.c:1.8	Thu Jan 12 01:12:08 2017
+++ src/sys/arch/arm/nvidia/tegra124_car.c	Fri Apr 14 09:50:56 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra124_car.c,v 1.8 2017/01/12 01:12:08 maya Exp $ */
+/* $NetBSD: tegra124_car.c,v 1.9 2017/04/14 09:50:56 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tegra124_car.c,v 1.8 2017/01/12 01:12:08 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra124_car.c,v 1.9 2017/04/14 09:50:56 jmcneill Exp $");
 
 #include 
 #include 
@@ -636,6 +636,7 @@ static struct tegra_clk tegra124_car_clo
 		CAR_PLLP_OUTC_REG, CAR_PLLP_OUTC_OUT5_CLKEN),
 	CLK_GATE_U("xusb_host", "xusb_host_src", CAR_DEV_U_XUSB_HOST),
 	CLK_GATE_W("xusb_ss", "xusb_ss_src", CAR_DEV_W_XUSB_SS),
+	CLK_GATE_X("gpu", "pll_ref", CAR_DEV_X_GPU),
 };
 
 struct tegra124_car_rst {



CVS commit: src/sys/arch/x86/pci

2017-04-14 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Fri Apr 14 09:34:46 UTC 2017

Modified Files:
src/sys/arch/x86/pci: pci_msi_machdep.c

Log Message:
disable msi/msix when the system doesn't detect ioapic. This would fix PR 
kern/52111.

Some system does not detect ioapic when "boot -1", disable acpi, and so on.
In such cases, msi/msix doesn't work, so disable them.

This patch is implemented by nonaka@n.o, I just commit by proxy, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/x86/pci/pci_msi_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x86/pci/pci_msi_machdep.c
diff -u src/sys/arch/x86/pci/pci_msi_machdep.c:1.10 src/sys/arch/x86/pci/pci_msi_machdep.c:1.11
--- src/sys/arch/x86/pci/pci_msi_machdep.c:1.10	Mon Nov 28 05:00:41 2016
+++ src/sys/arch/x86/pci/pci_msi_machdep.c	Fri Apr 14 09:34:46 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_msi_machdep.c,v 1.10 2016/11/28 05:00:41 knakahara Exp $	*/
+/*	$NetBSD: pci_msi_machdep.c,v 1.11 2017/04/14 09:34:46 knakahara Exp $	*/
 
 /*
  * Copyright (c) 2015 Internet Initiative Japan Inc.
@@ -34,9 +34,10 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_msi_machdep.c,v 1.10 2016/11/28 05:00:41 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_msi_machdep.c,v 1.11 2017/04/14 09:34:46 knakahara Exp $");
 
 #include "opt_intrdebug.h"
+#include "ioapic.h"
 
 #include 
 #include 
@@ -162,6 +163,13 @@ pci_msi_alloc_common(pci_intr_handle_t *
 	pci_intr_handle_t *vectors;
 	int error, i;
 
+#if NIOAPIC > 0
+	if (nioapics == 0) {
+		DPRINTF(("no IOAPIC.\n"));
+		return ENODEV;
+	}
+#endif
+
 	if ((pa->pa_flags & PCI_FLAGS_MSI_OKAY) == 0) {
 		DPRINTF(("PCI host bridge does not support MSI.\n"));
 		return ENODEV;
@@ -244,6 +252,13 @@ pci_msix_alloc_common(pci_intr_handle_t 
 	pci_intr_handle_t *vectors;
 	int error, i;
 
+#if NIOAPIC > 0
+	if (nioapics == 0) {
+		DPRINTF(("no IOAPIC.\n"));
+		return ENODEV;
+	}
+#endif
+
 	if ((pa->pa_flags & PCI_FLAGS_MSIX_OKAY) == 0) {
 		DPRINTF(("PCI host bridge does not support MSI-X.\n"));
 		return ENODEV;



CVS commit: src/bin/sh

2017-04-14 Thread Abhinav Upadhyay
Module Name:src
Committed By:   abhinav
Date:   Fri Apr 14 08:48:01 UTC 2017

Modified Files:
src/bin/sh: sh.1

Log Message:
Fix mandoc -Tlint warnings:
s/PP/Pp
Remove Pp before It


To generate a diff of this commit:
cvs rdiff -u -r1.130 -r1.131 src/bin/sh/sh.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/sh/sh.1
diff -u src/bin/sh/sh.1:1.130 src/bin/sh/sh.1:1.131
--- src/bin/sh/sh.1:1.130	Fri Apr 14 08:40:30 2017
+++ src/bin/sh/sh.1	Fri Apr 14 08:48:01 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sh.1,v 1.130 2017/04/14 08:40:30 abhinav Exp $
+.\"	$NetBSD: sh.1,v 1.131 2017/04/14 08:48:01 abhinav Exp $
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
 .\"
@@ -1286,7 +1286,7 @@ and
 operators (in both prefix and postfix forms) and the
 .Dq \&,
 (comma) operator, which are currently not supported.
-.PP
+.Pp
 It should not be necessary to state that the C operators which
 operate on, or produce, pointer types, are not supported.
 Those include unary
@@ -1970,7 +1970,6 @@ variables.
 With the
 .Fl p
 option specified the output will be formatted suitably for non-interactive use.
-.Pp
 .It return [ Ar n ]
 Stop executing the current function or a dot command with return value of
 .Ar n
@@ -2168,7 +2167,6 @@ the current limit is displayed.
 Limits of an arbitrary process can be displayed or set using the
 .Xr sysctl 8
 utility.
-.Pp
 .It umask Op Ar mask
 Set the value of umask (see
 .Xr umask 2 )



CVS commit: src/bin/sh

2017-04-14 Thread Abhinav Upadhyay
Module Name:src
Committed By:   abhinav
Date:   Fri Apr 14 08:40:30 UTC 2017

Modified Files:
src/bin/sh: sh.1

Log Message:
Instead of removing markup as I did in the last commit, use markup but properly.
Hint taken from FreeBSD man page.

ok wiz@


To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 src/bin/sh/sh.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/sh/sh.1
diff -u src/bin/sh/sh.1:1.129 src/bin/sh/sh.1:1.130
--- src/bin/sh/sh.1:1.129	Mon Apr  3 14:08:37 2017
+++ src/bin/sh/sh.1	Fri Apr 14 08:40:30 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sh.1,v 1.129 2017/04/03 14:08:37 abhinav Exp $
+.\"	$NetBSD: sh.1,v 1.130 2017/04/14 08:40:30 abhinav Exp $
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
 .\"
@@ -1701,12 +1701,12 @@ can be accessed are determined by the va
 variable.
 The value of first or last or both are one of the following:
 .Bl -tag -width 5n
-.It [+]number
+.It Oo Cm + Oc Ns Ar number
 A positive number representing a command number; command numbers can be
 displayed with the
 .Fl l
 option.
-.It \-number
+.It Cm \- Ns Ar number
 A negative decimal number representing the command that was executed
 number of commands previously.
 For example, \-1 is the immediately previous command.



CVS commit: src/external/bsd/dhcpcd/sbin/dhcpcd

2017-04-14 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Apr 14 07:55:55 UTC 2017

Modified Files:
src/external/bsd/dhcpcd/sbin/dhcpcd: Makefile

Log Message:
Generate dhcpcd-embedded.c for dependencies too.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile
diff -u src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile:1.38 src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile:1.39
--- src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile:1.38	Thu Apr 13 18:12:32 2017
+++ src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile	Fri Apr 14 07:55:55 2017
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.38 2017/04/13 18:12:32 roy Exp $
+# $NetBSD: Makefile,v 1.39 2017/04/14 07:55:55 roy Exp $
 #
 
 WARNS?=		6
@@ -14,7 +14,7 @@ SRCS+=		dhcp-common.c dhcpcd-embedded.c
 SRCS+=		if-bsd.c
 
 # Need to generate this for dependencies
-DPSRCS+=	dhcpcd-embedded.h
+DPSRCS+=	dhcpcd-embedded.h dhcpcd-embedded.c
 
 CPPFLAGS+=	-DHAVE_CONFIG_H -D_OPENBSD_SOURCE
 



CVS commit: src/usr.sbin/makefs

2017-04-14 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Apr 14 07:09:43 UTC 2017

Modified Files:
src/usr.sbin/makefs: makefs.8

Log Message:
Whitespace fixes.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/usr.sbin/makefs/makefs.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/makefs/makefs.8
diff -u src/usr.sbin/makefs/makefs.8:1.62 src/usr.sbin/makefs/makefs.8:1.63
--- src/usr.sbin/makefs/makefs.8:1.62	Thu Apr 13 17:21:29 2017
+++ src/usr.sbin/makefs/makefs.8	Fri Apr 14 07:09:43 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: makefs.8,v 1.62 2017/04/13 17:21:29 christos Exp $
+.\"	$NetBSD: makefs.8,v 1.63 2017/04/14 07:09:43 wiz Exp $
 .\"
 .\" Copyright (c) 2001-2003 Wasabi Systems, Inc.
 .\" All rights reserved.
@@ -205,8 +205,8 @@ This is equivalent of setting both the m
 and the maximum
 .Fl ( M )
 sizes to
-.Ar image-size.
-For 
+.Ar image-size .
+For
 .Sy ffs
 and
 .Sy msdos