CVS commit: src/sbin/gpt

2022-11-21 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Nov 22 00:25:52 UTC 2022

Modified Files:
src/sbin/gpt: gpt.c resizedisk.c

Log Message:
Big-Endian fixes.


To generate a diff of this commit:
cvs rdiff -u -r1.83 -r1.84 src/sbin/gpt/gpt.c
cvs rdiff -u -r1.19 -r1.20 src/sbin/gpt/resizedisk.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/gpt/gpt.c
diff -u src/sbin/gpt/gpt.c:1.83 src/sbin/gpt/gpt.c:1.84
--- src/sbin/gpt/gpt.c:1.83	Sun Nov 20 11:57:02 2022
+++ src/sbin/gpt/gpt.c	Tue Nov 22 00:25:52 2022
@@ -35,7 +35,7 @@
 __FBSDID("$FreeBSD: src/sbin/gpt/gpt.c,v 1.16 2006/07/07 02:44:23 marcel Exp $");
 #endif
 #ifdef __RCSID
-__RCSID("$NetBSD: gpt.c,v 1.83 2022/11/20 11:57:02 mlelstv Exp $");
+__RCSID("$NetBSD: gpt.c,v 1.84 2022/11/22 00:25:52 mlelstv Exp $");
 #endif
 
 #include 
@@ -578,6 +578,7 @@ gpt_open(const char *dev, int flags, int
 	if (found) {
 		struct map *map;
 		struct gpt_hdr *hdr;
+		uint64_t lba;
 
 		/*
 		 * read secondary GPT from position stored in primary header
@@ -585,8 +586,9 @@ gpt_open(const char *dev, int flags, int
 		 */
 		map = map_find(gpt, MAP_TYPE_PRI_GPT_HDR);
 		hdr = map ? map->map_data : NULL;
-		if (hdr && hdr->hdr_lba_alt > 0 && hdr->hdr_lba_alt < (uint64_t)devsz) {
-			if (gpt_gpt(gpt, (off_t)hdr->hdr_lba_alt, found) == -1)
+		lba = le64toh(hdr->hdr_lba_alt);
+		if (hdr && lba > 0 && lba < (uint64_t)devsz) {
+			if (gpt_gpt(gpt, (off_t)lba, found) == -1)
 goto close;
 		}
 	} else {

Index: src/sbin/gpt/resizedisk.c
diff -u src/sbin/gpt/resizedisk.c:1.19 src/sbin/gpt/resizedisk.c:1.20
--- src/sbin/gpt/resizedisk.c:1.19	Sun Nov 20 11:57:02 2022
+++ src/sbin/gpt/resizedisk.c	Tue Nov 22 00:25:52 2022
@@ -33,7 +33,7 @@
 __FBSDID("$FreeBSD: src/sbin/gpt/add.c,v 1.14 2006/06/22 22:05:28 marcel Exp $");
 #endif
 #ifdef __RCSID
-__RCSID("$NetBSD: resizedisk.c,v 1.19 2022/11/20 11:57:02 mlelstv Exp $");
+__RCSID("$NetBSD: resizedisk.c,v 1.20 2022/11/22 00:25:52 mlelstv Exp $");
 #endif
 
 #include 
@@ -194,7 +194,7 @@ resizedisk(gpt_t gpt, off_t sector, off_
 	}
 
 	hdr = gpt->gpt->map_data;
-	hdr->hdr_lba_alt = (uint64_t)gpt->tpg->map_start;
+	hdr->hdr_lba_alt = htole64((uint64_t)gpt->tpg->map_start);
 	hdr->hdr_crc_self = 0;
 	hdr->hdr_lba_end = htole64((uint64_t)(gpt->lbt->map_start - 1));
 	hdr->hdr_crc_self =



CVS commit: src/sbin/gpt

2022-11-21 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Nov 22 00:25:52 UTC 2022

Modified Files:
src/sbin/gpt: gpt.c resizedisk.c

Log Message:
Big-Endian fixes.


To generate a diff of this commit:
cvs rdiff -u -r1.83 -r1.84 src/sbin/gpt/gpt.c
cvs rdiff -u -r1.19 -r1.20 src/sbin/gpt/resizedisk.c

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



CVS commit: src/share/man/man4

2022-11-21 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Nov 21 23:51:10 UTC 2022

Modified Files:
src/share/man/man4: bmx280thp.4

Log Message:
Fix typos. New sentence, new line.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/man/man4/bmx280thp.4

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



CVS commit: src/share/man/man4

2022-11-21 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Nov 21 23:51:10 UTC 2022

Modified Files:
src/share/man/man4: bmx280thp.4

Log Message:
Fix typos. New sentence, new line.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/man/man4/bmx280thp.4

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/man4/bmx280thp.4
diff -u src/share/man/man4/bmx280thp.4:1.1 src/share/man/man4/bmx280thp.4:1.2
--- src/share/man/man4/bmx280thp.4:1.1	Mon Nov 21 21:24:00 2022
+++ src/share/man/man4/bmx280thp.4	Mon Nov 21 23:51:10 2022
@@ -1,4 +1,4 @@
-.\" $NetBSD: bmx280thp.4,v 1.1 2022/11/21 21:24:00 brad Exp $
+.\" $NetBSD: bmx280thp.4,v 1.2 2022/11/21 23:51:10 wiz Exp $
 .\"
 .\" Copyright (c) 2022 Brad Spencer 
 .\"
@@ -36,7 +36,7 @@ The
 argument selects the address at the
 .Xr iic 4
 bus.
-The percision of the measurement can be changed through
+The precision of the measurement can be changed through
 .Xr sysctl 8
 nodes.
 .Sh SYSCTL VARIABLES
@@ -47,12 +47,13 @@ variables are provided:
 .It Li hw.bmx280thp0.osrs_t
 .It Li hw.bmx280thp0.osrs_p
 .It Li hw.bmx280thp0.osrs_h
-These control oversampling of temperature, pressure and humidity.  The
-valid values are 1, 2, 4, 8, and 16 times oversample.  Humidity is only
-available if the chip is a BME280.
+These control oversampling of temperature, pressure and humidity.
+The valid values are 1, 2, 4, 8, and 16 times oversample.
+Humidity is only available if the chip is a BME280.
 .It Li hw.bmx280thp0.irr_samples
 IRR is a filter that can be used to reduce the noise in the
-measurement.  The value values are 1 (or off), 2, 5, 11 and 22 samples
+measurement.
+The value values are 1 (or off), 2, 5, 11 and 22 samples
 to reach >= 75% of the step response.
 .It Li hw.bmx280thp0.debug
 .It Li hw.bmx280thp0.dump_calibration
@@ -60,7 +61,8 @@ If the driver is compiled with
 .Dv BMX280_DEBUG ,
 these nodes will appear and can be used to set the debugging level and
 provide the calibration constants, upon refresh, that are stored in the
-chip.  Since the constants are fixed, this is a boolean node and will
+chip.
+Since the constants are fixed, this is a boolean node and will
 reset back to false once one dump has been performed.
 .It Li hw.bmx280thp0.readattempts
 A status register tells the driver if the chip is busy with a measurement.
@@ -86,4 +88,5 @@ driver was written by
 .An Brad Spencer Aq Mt b...@anduin.eldar.org .
 .Sh BUGS
 The driver does not support the continuous read mode that the BMP280
-and BME280 has.  This driver does not support the SPI interface.
+and BME280 has.
+This driver does not support the SPI interface.



CVS commit: src

2022-11-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Nov 21 22:01:34 UTC 2022

Modified Files:
src/distrib/sets/lists/base: shl.mi
src/distrib/sets/lists/debug: mi
src/distrib/sets/lists/man: mi
src/distrib/sets/lists/tests: mi
src/etc/mtree: NetBSD.dist.tests
src/lib/lua: Makefile
src/share/man/man3lua: Makefile
src/tests/lib: Makefile
Added Files:
src/lib/lua/libm: Makefile libm.c
src/share/man/man3lua: libm.3lua
src/tests/lib/lua: Makefile Makefile.inc
src/tests/lib/lua/libm: Makefile h_lualibm.c lualibm.lua t_lualibm.sh

Log Message:
lua libm API from Phil Rulon


To generate a diff of this commit:
cvs rdiff -u -r1.941 -r1.942 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.391 -r1.392 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.1756 -r1.1757 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.1233 -r1.1234 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.196 -r1.197 src/etc/mtree/NetBSD.dist.tests
cvs rdiff -u -r1.7 -r1.8 src/lib/lua/Makefile
cvs rdiff -u -r0 -r1.1 src/lib/lua/libm/Makefile src/lib/lua/libm/libm.c
cvs rdiff -u -r1.7 -r1.8 src/share/man/man3lua/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man3lua/libm.3lua
cvs rdiff -u -r1.34 -r1.35 src/tests/lib/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/lua/Makefile \
src/tests/lib/lua/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/tests/lib/lua/libm/Makefile \
src/tests/lib/lua/libm/h_lualibm.c src/tests/lib/lua/libm/lualibm.lua \
src/tests/lib/lua/libm/t_lualibm.sh

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/base/shl.mi
diff -u src/distrib/sets/lists/base/shl.mi:1.941 src/distrib/sets/lists/base/shl.mi:1.942
--- src/distrib/sets/lists/base/shl.mi:1.941	Wed Oct  5 18:40:12 2022
+++ src/distrib/sets/lists/base/shl.mi	Mon Nov 21 17:01:32 2022
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.941 2022/10/05 22:40:12 christos Exp $
+# $NetBSD: shl.mi,v 1.942 2022/11/21 22:01:32 christos Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -966,6 +966,7 @@
 ./usr/lib/lua/5.1/syslog.so	base-obsolete		obsolete
 ./usr/lib/lua/5.3/bozohttpd.so			base-sys-shlib		compatfile
 ./usr/lib/lua/5.3/gpio.so	base-sys-shlib		compatfile
+./usr/lib/lua/5.3/libm.so 			base-sys-shlib		compatfile
 ./usr/lib/lua/5.3/netpgp.so 			base-sys-shlib		compatfile
 ./usr/lib/lua/5.3/sqlite.so	base-sys-shlib		compatfile
 ./usr/lib/lua/5.3/syslog.so	base-sys-shlib		compatfile

Index: src/distrib/sets/lists/debug/mi
diff -u src/distrib/sets/lists/debug/mi:1.391 src/distrib/sets/lists/debug/mi:1.392
--- src/distrib/sets/lists/debug/mi:1.391	Thu Nov 17 03:45:35 2022
+++ src/distrib/sets/lists/debug/mi	Mon Nov 21 17:01:32 2022
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.391 2022/11/17 08:45:35 ozaki-r Exp $
+# $NetBSD: mi,v 1.392 2022/11/21 22:01:32 christos 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
@@ -2400,6 +2400,10 @@
 ./usr/libdata/debug/usr/tests/libexec/ld.elf_so/t_dlvsym.debug		tests-libexec-debug	debug,atf,pic,compattestfile
 ./usr/libdata/debug/usr/tests/libexec/ld.elf_so/t_rtld_r_debug.debug	tests-libexec-debug	debug,atf,pic,compattestfile
 ./usr/libdata/debug/usr/tests/libexec/ld.elf_so/t_ifunc.debug	tests-libexec-debug	debug,atf,pic,compattestfile
+./usr/libdata/debug/usr/tests/libtests-libexec-debug	debug,atf,pic,compattestfile
+./usr/libdata/debug/usr/tests/lib/luatests-libexec-debug	debug,atf,pic,compattestfile
+./usr/libdata/debug/usr/tests/lib/lua/libm			tests-libexec-debug	debug,atf,pic,compattestfile
+./usr/libdata/debug/usr/tests/lib/lua/libm/h_lualibm.debug	tests-libexec-debug	debug,atf,pic,compattestfile
 ./usr/libdata/debug/usr/tests/net/bpf/t_bpf.debug		tests-net-debug		debug,atf,rump
 ./usr/libdata/debug/usr/tests/net/bpf/t_div-by-zero.debug		tests-net-debug		debug,atf,rump
 ./usr/libdata/debug/usr/tests/net/bpf/t_mbuf.debug		tests-net-debug		debug,atf,rump

Index: src/distrib/sets/lists/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1756 src/distrib/sets/lists/man/mi:1.1757
--- src/distrib/sets/lists/man/mi:1.1756	Mon Nov 21 16:24:01 2022
+++ src/distrib/sets/lists/man/mi	Mon Nov 21 17:01:32 2022
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1756 2022/11/21 21:24:01 brad Exp $
+# $NetBSD: mi,v 1.1757 2022/11/21 22:01:32 christos Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -695,6 +695,7 @@
 ./usr/share/man/cat3lua/gpio.unset.0		man-sys-catman		.cat
 ./usr/share/man/cat3lua/gpio.write.0		man-sys-catman		.cat
 ./usr/share/man/cat3lua/intro.0			man-sys-catman		.cat
+./usr/share/man/cat3lua/libm.0			man-sys-catman		.cat
 

CVS commit: src

2022-11-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Nov 21 22:01:34 UTC 2022

Modified Files:
src/distrib/sets/lists/base: shl.mi
src/distrib/sets/lists/debug: mi
src/distrib/sets/lists/man: mi
src/distrib/sets/lists/tests: mi
src/etc/mtree: NetBSD.dist.tests
src/lib/lua: Makefile
src/share/man/man3lua: Makefile
src/tests/lib: Makefile
Added Files:
src/lib/lua/libm: Makefile libm.c
src/share/man/man3lua: libm.3lua
src/tests/lib/lua: Makefile Makefile.inc
src/tests/lib/lua/libm: Makefile h_lualibm.c lualibm.lua t_lualibm.sh

Log Message:
lua libm API from Phil Rulon


To generate a diff of this commit:
cvs rdiff -u -r1.941 -r1.942 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.391 -r1.392 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.1756 -r1.1757 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.1233 -r1.1234 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.196 -r1.197 src/etc/mtree/NetBSD.dist.tests
cvs rdiff -u -r1.7 -r1.8 src/lib/lua/Makefile
cvs rdiff -u -r0 -r1.1 src/lib/lua/libm/Makefile src/lib/lua/libm/libm.c
cvs rdiff -u -r1.7 -r1.8 src/share/man/man3lua/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man3lua/libm.3lua
cvs rdiff -u -r1.34 -r1.35 src/tests/lib/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/lua/Makefile \
src/tests/lib/lua/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/tests/lib/lua/libm/Makefile \
src/tests/lib/lua/libm/h_lualibm.c src/tests/lib/lua/libm/lualibm.lua \
src/tests/lib/lua/libm/t_lualibm.sh

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



CVS commit: src

2022-11-21 Thread Brad Spencer
Module Name:src
Committed By:   brad
Date:   Mon Nov 21 21:29:33 UTC 2022

Modified Files:
src/doc: CHANGES
src/share/man/man4: iic.4

Log Message:
Mention the driver for the Bosch BMP280/BME280


To generate a diff of this commit:
cvs rdiff -u -r1.2931 -r1.2932 src/doc/CHANGES
cvs rdiff -u -r1.34 -r1.35 src/share/man/man4/iic.4

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.2931 src/doc/CHANGES:1.2932
--- src/doc/CHANGES:1.2931	Thu Nov 17 20:43:39 2022
+++ src/doc/CHANGES	Mon Nov 21 21:29:32 2022
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2931 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2932 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -735,3 +735,5 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 		as documented and in POSIX. [riastradh 20221105]
 	aht20temp(4): Driver for the Aosong AHT20 temperature and
 		humidity sensor [brad 20221117]
+	bmx280thp(4): Driver for the Bosch BMP280/BME280 temperature,
+		humidity and pressure sensor [brad 20221121]

Index: src/share/man/man4/iic.4
diff -u src/share/man/man4/iic.4:1.34 src/share/man/man4/iic.4:1.35
--- src/share/man/man4/iic.4:1.34	Thu Nov 17 20:43:39 2022
+++ src/share/man/man4/iic.4	Mon Nov 21 21:29:32 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: iic.4,v 1.34 2022/11/17 20:43:39 brad Exp $
+.\"	$NetBSD: iic.4,v 1.35 2022/11/21 21:29:32 brad Exp $
 .\"	$OpenBSD: iic.4,v 1.74 2008/09/10 16:13:43 reyk Exp $
 .\"
 .\" Copyright (c) 2004, 2006 Alexander Yurchenko 
@@ -183,6 +183,8 @@ Analog Devices ADM1021 temperature senso
 Aosong AHT20 humidity/temperature sensors
 .It Xr am2315temp 4
 Aosong AM2315 humidity/temperature sensors
+.It Xr bmx280thp 4
+Bosch BMP280/BME280 humidity/temperature/pressure sensors
 .It Xr ddc 4
 VESA Display Data Channel V2 devices
 .It Xr dbcool 4



CVS commit: src

2022-11-21 Thread Brad Spencer
Module Name:src
Committed By:   brad
Date:   Mon Nov 21 21:29:33 UTC 2022

Modified Files:
src/doc: CHANGES
src/share/man/man4: iic.4

Log Message:
Mention the driver for the Bosch BMP280/BME280


To generate a diff of this commit:
cvs rdiff -u -r1.2931 -r1.2932 src/doc/CHANGES
cvs rdiff -u -r1.34 -r1.35 src/share/man/man4/iic.4

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



CVS commit: src

2022-11-21 Thread Brad Spencer
Module Name:src
Committed By:   brad
Date:   Mon Nov 21 21:24:02 UTC 2022

Modified Files:
src/distrib/sets/lists/debug: module.mi
src/distrib/sets/lists/man: mi
src/distrib/sets/lists/modules: mi
src/share/man/man4: Makefile
src/sys/dev/i2c: files.i2c
src/sys/dev/sysmon: sysmon_envsys_tables.c
src/sys/modules: Makefile
src/sys/sys: envsys.h
src/usr.sbin/envstat: envstat.8 envstat.c
Added Files:
src/share/man/man4: bmx280thp.4
src/sys/dev/i2c: bmx280.c bmx280reg.h bmx280var.h
src/sys/modules/bmx280thp: Makefile bmx280thp.ioconf

Log Message:
A driver for the Bosch BMP280 / BME280 temperature, humidity and
atmospheric pressure sensor.  This is an inexpensive to moderately
expensive chip available from a large number of places.  The driver
supports all aspects of the two chips, except for the repeating read
mode which would allow for sub-second queries, such as fall detection
or perhaps even as an altimeter.  This driver also only supports the
I2C interface and not the SPI interface.

The BME280, the one with humidity, is not fully tested at this point,
awaiting upon a breakout board and may not show proper humidity.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/distrib/sets/lists/debug/module.mi
cvs rdiff -u -r1.1755 -r1.1756 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.155 -r1.156 src/distrib/sets/lists/modules/mi
cvs rdiff -u -r1.729 -r1.730 src/share/man/man4/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man4/bmx280thp.4
cvs rdiff -u -r0 -r1.1 src/sys/dev/i2c/bmx280.c src/sys/dev/i2c/bmx280reg.h \
src/sys/dev/i2c/bmx280var.h
cvs rdiff -u -r1.124 -r1.125 src/sys/dev/i2c/files.i2c
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/sysmon/sysmon_envsys_tables.c
cvs rdiff -u -r1.272 -r1.273 src/sys/modules/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/modules/bmx280thp/Makefile \
src/sys/modules/bmx280thp/bmx280thp.ioconf
cvs rdiff -u -r1.38 -r1.39 src/sys/sys/envsys.h
cvs rdiff -u -r1.66 -r1.67 src/usr.sbin/envstat/envstat.8
cvs rdiff -u -r1.102 -r1.103 src/usr.sbin/envstat/envstat.c

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/module.mi
diff -u src/distrib/sets/lists/debug/module.mi:1.21 src/distrib/sets/lists/debug/module.mi:1.22
--- src/distrib/sets/lists/debug/module.mi:1.21	Thu Nov 17 19:20:06 2022
+++ src/distrib/sets/lists/debug/module.mi	Mon Nov 21 21:24:01 2022
@@ -1,4 +1,4 @@
-# $NetBSD: module.mi,v 1.21 2022/11/17 19:20:06 brad Exp $
+# $NetBSD: module.mi,v 1.22 2022/11/21 21:24:01 brad Exp $
 ./usr/libdata/debug/@MODULEDIR@	modules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/accf_dataready			modules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/accf_dataready/accf_dataready.kmod.debug	modules-base-kernel	kmod,debug
@@ -22,6 +22,8 @@
 ./usr/libdata/debug/@MODULEDIR@/blake2s/blake2s.kmod.debug		modules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/blowfishmodules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/blowfish/blowfish.kmod.debug		modules-base-kernel	kmod,debug
+./usr/libdata/debug/@MODULEDIR@/bmx280thpmodules-base-kernel	kmod,debug
+./usr/libdata/debug/@MODULEDIR@/bmx280thp/bmx280thp.kmod.debug		modules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/bpfmodules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/bpf/bpf.kmod.debug			modules-base-kernel	kmod,debug
 ./usr/libdata/debug/@MODULEDIR@/bpf_filter			modules-base-kernel	kmod,debug

Index: src/distrib/sets/lists/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1755 src/distrib/sets/lists/man/mi:1.1756
--- src/distrib/sets/lists/man/mi:1.1755	Thu Nov 17 19:20:06 2022
+++ src/distrib/sets/lists/man/mi	Mon Nov 21 21:24:01 2022
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1755 2022/11/17 19:20:06 brad Exp $
+# $NetBSD: mi,v 1.1756 2022/11/21 21:24:01 brad Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -965,6 +965,7 @@
 ./usr/share/man/cat4/bio.0			man-sys-catman		.cat
 ./usr/share/man/cat4/bktr.0			man-sys-catman		.cat
 ./usr/share/man/cat4/bluetooth.0		man-sys-catman		.cat
+./usr/share/man/cat4/bmx280thp.0		man-sys-catman		.cat
 ./usr/share/man/cat4/bmtphy.0			man-sys-catman		.cat
 ./usr/share/man/cat4/bnx.0			man-sys-catman		.cat
 ./usr/share/man/cat4/boca.0			man-sys-catman		.cat
@@ -4237,6 +4238,7 @@
 ./usr/share/man/html4/bio.html			man-sys-htmlman		html
 ./usr/share/man/html4/bktr.html			man-sys-htmlman		html
 ./usr/share/man/html4/bluetooth.html		man-sys-htmlman		html
+./usr/share/man/html4/bmx280thp.html		man-sys-htmlman		html
 ./usr/share/man/html4/bmtphy.html		man-sys-htmlman		html
 ./usr/share/man/html4/bnx.html			man-sys-htmlman		html
 ./usr/share/man/html4/boca.html			man-sys-htmlman		html
@@ -7275,6 +7277,7 @@
 ./usr/share/man/man4/bio.4			man-sys-man		.man
 

CVS commit: src

2022-11-21 Thread Brad Spencer
Module Name:src
Committed By:   brad
Date:   Mon Nov 21 21:24:02 UTC 2022

Modified Files:
src/distrib/sets/lists/debug: module.mi
src/distrib/sets/lists/man: mi
src/distrib/sets/lists/modules: mi
src/share/man/man4: Makefile
src/sys/dev/i2c: files.i2c
src/sys/dev/sysmon: sysmon_envsys_tables.c
src/sys/modules: Makefile
src/sys/sys: envsys.h
src/usr.sbin/envstat: envstat.8 envstat.c
Added Files:
src/share/man/man4: bmx280thp.4
src/sys/dev/i2c: bmx280.c bmx280reg.h bmx280var.h
src/sys/modules/bmx280thp: Makefile bmx280thp.ioconf

Log Message:
A driver for the Bosch BMP280 / BME280 temperature, humidity and
atmospheric pressure sensor.  This is an inexpensive to moderately
expensive chip available from a large number of places.  The driver
supports all aspects of the two chips, except for the repeating read
mode which would allow for sub-second queries, such as fall detection
or perhaps even as an altimeter.  This driver also only supports the
I2C interface and not the SPI interface.

The BME280, the one with humidity, is not fully tested at this point,
awaiting upon a breakout board and may not show proper humidity.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/distrib/sets/lists/debug/module.mi
cvs rdiff -u -r1.1755 -r1.1756 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.155 -r1.156 src/distrib/sets/lists/modules/mi
cvs rdiff -u -r1.729 -r1.730 src/share/man/man4/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man4/bmx280thp.4
cvs rdiff -u -r0 -r1.1 src/sys/dev/i2c/bmx280.c src/sys/dev/i2c/bmx280reg.h \
src/sys/dev/i2c/bmx280var.h
cvs rdiff -u -r1.124 -r1.125 src/sys/dev/i2c/files.i2c
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/sysmon/sysmon_envsys_tables.c
cvs rdiff -u -r1.272 -r1.273 src/sys/modules/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/modules/bmx280thp/Makefile \
src/sys/modules/bmx280thp/bmx280thp.ioconf
cvs rdiff -u -r1.38 -r1.39 src/sys/sys/envsys.h
cvs rdiff -u -r1.66 -r1.67 src/usr.sbin/envstat/envstat.8
cvs rdiff -u -r1.102 -r1.103 src/usr.sbin/envstat/envstat.c

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



CVS commit: src/tests/sbin/fsck_ffs

2022-11-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Nov 21 19:07:36 UTC 2022

Modified Files:
src/tests/sbin/fsck_ffs: t_extattr.sh

Log Message:
vnconfig is used in this tests, so require user root.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/sbin/fsck_ffs/t_extattr.sh

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

Modified files:

Index: src/tests/sbin/fsck_ffs/t_extattr.sh
diff -u src/tests/sbin/fsck_ffs/t_extattr.sh:1.1 src/tests/sbin/fsck_ffs/t_extattr.sh:1.2
--- src/tests/sbin/fsck_ffs/t_extattr.sh:1.1	Thu Nov 17 06:40:40 2022
+++ src/tests/sbin/fsck_ffs/t_extattr.sh	Mon Nov 21 19:07:36 2022
@@ -1,4 +1,4 @@
-# $NetBSD: t_extattr.sh,v 1.1 2022/11/17 06:40:40 chs Exp $
+# $NetBSD: t_extattr.sh,v 1.2 2022/11/21 19:07:36 martin Exp $
 #
 #  Copyright (c) 2021 The NetBSD Foundation, Inc.
 #  All rights reserved.
@@ -45,6 +45,7 @@ cleanup()
 fsck_extattr_enable_head()
 {
 	atf_set "descr" "Checks fsck_ffs enabling extattrs"
+	atf_set "require.user" "root";
 }
 
 fsck_extattr_enable_body()
@@ -85,6 +86,7 @@ fsck_extattr_enable_cleanup()
 fsck_extattr_enable_corrupted_head()
 {
 	atf_set "descr" "Checks fsck_ffs enabling extattrs with corruption"
+	atf_set "require.user" "root";
 }
 
 fsck_extattr_enable_corrupted_body()
@@ -142,6 +144,7 @@ fsck_extattr_enable_corrupted_cleanup()
 fsck_extattr_disable_head()
 {
 	atf_set "descr" "Checks fsck_ffs disabling extattrs"
+	atf_set "require.user" "root";
 }
 
 fsck_extattr_disable_body()



CVS commit: src/tests/sbin/fsck_ffs

2022-11-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Nov 21 19:07:36 UTC 2022

Modified Files:
src/tests/sbin/fsck_ffs: t_extattr.sh

Log Message:
vnconfig is used in this tests, so require user root.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/sbin/fsck_ffs/t_extattr.sh

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



CVS commit: src/sys/arch/hp300

2022-11-21 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Nov 21 16:22:37 UTC 2022

Modified Files:
src/sys/arch/hp300/dev: rd.c rdreg.h
src/sys/arch/hp300/stand/common: rd.c

Log Message:
Use common macro for numbers of cylinders and blocks for HP-IB disks.

No binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.110 -r1.111 src/sys/arch/hp300/dev/rd.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/hp300/dev/rdreg.h
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/hp300/stand/common/rd.c

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



CVS commit: src/sys/arch/hp300

2022-11-21 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Nov 21 16:22:37 UTC 2022

Modified Files:
src/sys/arch/hp300/dev: rd.c rdreg.h
src/sys/arch/hp300/stand/common: rd.c

Log Message:
Use common macro for numbers of cylinders and blocks for HP-IB disks.

No binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.110 -r1.111 src/sys/arch/hp300/dev/rd.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/hp300/dev/rdreg.h
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/hp300/stand/common/rd.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/hp300/dev/rd.c
diff -u src/sys/arch/hp300/dev/rd.c:1.110 src/sys/arch/hp300/dev/rd.c:1.111
--- src/sys/arch/hp300/dev/rd.c:1.110	Sat Jul 31 20:29:36 2021
+++ src/sys/arch/hp300/dev/rd.c	Mon Nov 21 16:22:37 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: rd.c,v 1.110 2021/07/31 20:29:36 andvar Exp $	*/
+/*	$NetBSD: rd.c,v 1.111 2022/11/21 16:22:37 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -72,7 +72,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.110 2021/07/31 20:29:36 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.111 2022/11/21 16:22:37 tsutsui Exp $");
 
 #include "opt_useleds.h"
 
@@ -191,8 +191,8 @@ static const struct rdidentinfo rdidenti
 		.ri_desc = "7945A",
 		.ri_nbpt = NRD7945ABPT,
 		.ri_ntpc = NRD7945ATRK,
-		.ri_ncyl = 968,
-		.ri_nblocks = 108416
+		.ri_ncyl = NRD7945ACYL,
+		.ri_nblocks = NRD7945ABLK
 	},
 
 	[RD9134D] = {
@@ -200,8 +200,8 @@ static const struct rdidentinfo rdidenti
 		.ri_desc = "9134D",
 		.ri_nbpt = NRD9134DBPT,
 		.ri_ntpc = NRD9134DTRK,
-		.ri_ncyl = 303,
-		.ri_nblocks = 29088
+		.ri_ncyl = NRD9134DCYL,
+		.ri_nblocks = NRD9134DBLK
 	},
 
 	[RD9122S] = {
@@ -209,8 +209,8 @@ static const struct rdidentinfo rdidenti
 		.ri_desc = "9122S",
 		.ri_nbpt = NRD9122SBPT,
 		.ri_ntpc = NRD9122STRK,
-		.ri_ncyl = 77,
-		.ri_nblocks = 1232
+		.ri_ncyl = NRD9122SCYL,
+		.ri_nblocks = NRD9122SBLK
 	},
 
 	[RD7912P] = {
@@ -218,8 +218,8 @@ static const struct rdidentinfo rdidenti
 		.ri_desc = "7912P",
 		.ri_nbpt = NRD7912PBPT,
 		.ri_ntpc = NRD7912PTRK,
-		.ri_ncyl = 572,
-		.ri_nblocks = 128128
+		.ri_ncyl = NRD7912PCYL,
+		.ri_nblocks = NRD7912PBLK
 	},
 
 	[RD7914P] = {
@@ -227,8 +227,8 @@ static const struct rdidentinfo rdidenti
 		.ri_desc = "7914P",
 		.ri_nbpt = NRD7914PBPT,
 		.ri_ntpc = NRD7914PTRK,
-		.ri_ncyl = 1152,
-		.ri_nblocks = 258048
+		.ri_ncyl = NRD7914PCYL,
+		.ri_nblocks = NRD7914PBLK
 	},
 
 	[RD7958A] = {
@@ -236,8 +236,8 @@ static const struct rdidentinfo rdidenti
 		.ri_desc = "7958A",
 		.ri_nbpt = NRD7958ABPT,
 		.ri_ntpc = NRD7958ATRK,
-		.ri_ncyl = 1013,
-		.ri_nblocks = 255276
+		.ri_ncyl = NRD7958ACYL,
+		.ri_nblocks = NRD7958ABLK
 	},
 
 	[RD7957A] = {
@@ -245,8 +245,8 @@ static const struct rdidentinfo rdidenti
 		.ri_desc = "7957A",
 		.ri_nbpt = NRD7957ABPT,
 		.ri_ntpc = NRD7957ATRK,
-		.ri_ncyl = 1036,
-		.ri_nblocks = 159544
+		.ri_ncyl = NRD7957ACYL,
+		.ri_nblocks = NRD7957ABLK
 	},
 
 	[RD7933H] = {
@@ -254,8 +254,8 @@ static const struct rdidentinfo rdidenti
 		.ri_desc = "7933H",
 		.ri_nbpt = NRD7933HBPT,
 		.ri_ntpc = NRD7933HTRK,
-		.ri_ncyl = 1321,
-		.ri_nblocks = 789958
+		.ri_ncyl = NRD7933HCYL,
+		.ri_nblocks = NRD7933HBLK
 	},
 
 	[RD9134L] = {
@@ -263,8 +263,8 @@ static const struct rdidentinfo rdidenti
 		.ri_desc = "9134L",
 		.ri_nbpt = NRD9134LBPT,
 		.ri_ntpc = NRD9134LTRK,
-		.ri_ncyl = 973,
-		.ri_nblocks = 77840
+		.ri_ncyl = NRD9134LCYL,
+		.ri_nblocks = NRD9134LBLK
 	},
 
 	[RD7936H] = {
@@ -272,8 +272,8 @@ static const struct rdidentinfo rdidenti
 		.ri_desc = "7936H",
 		.ri_nbpt = NRD7936HBPT,
 		.ri_ntpc = NRD7936HTRK,
-		.ri_ncyl = 698,
-		.ri_nblocks = 600978
+		.ri_ncyl = NRD7936HCYL,
+		.ri_nblocks = NRD7936HBLK
 	},
 
 	[RD7937H] = {
@@ -281,8 +281,8 @@ static const struct rdidentinfo rdidenti
 		.ri_desc = "7937H",
 		.ri_nbpt = NRD7937HBPT,
 		.ri_ntpc = NRD7937HTRK,
-		.ri_ncyl = 698,
-		.ri_nblocks = 1116102
+		.ri_ncyl = NRD7937HCYL,
+		.ri_nblocks = NRD7937HBLK
 	},
 
 	[RD7914CT] = {
@@ -290,8 +290,8 @@ static const struct rdidentinfo rdidenti
 		.ri_desc = "7914CT",
 		.ri_nbpt = NRD7914PBPT,
 		.ri_ntpc = NRD7914PTRK,
-		.ri_ncyl = 1152,
-		.ri_nblocks = 258048
+		.ri_ncyl = NRD7914PCYL,
+		.ri_nblocks = NRD7914PBLK
 	},
 
 	[RD7946A] = {
@@ -299,8 +299,8 @@ static const struct rdidentinfo rdidenti
 		.ri_desc = "7946A",
 		.ri_nbpt = NRD7945ABPT,
 		.ri_ntpc = NRD7945ATRK,
-		.ri_ncyl = 968,
-		.ri_nblocks = 108416
+		.ri_ncyl = NRD7945ACYL,
+		.ri_nblocks = NRD7945ABLK
 	},
 
 	[RD9122D] = {
@@ -308,8 +308,8 @@ static const struct rdidentinfo rdidenti
 		.ri_desc = "9122D",
 		.ri_nbpt = NRD9122SBPT,
 		.ri_ntpc = NRD9122STRK,
-		.ri_ncyl = 77,
-		.ri_nblocks = 1232
+		.ri_ncyl = NRD9122SCYL,
+		.ri_nblocks = NRD9122SBLK
 	},
 
 	[RD7957B] = {
@@ -317,8 +317,8 @@ static const struct rdidentinfo 

CVS commit: src/tests/sbin/gpt

2022-11-21 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Nov 21 16:06:00 UTC 2022

Modified Files:
src/tests/sbin/gpt: t_gpt.sh

Log Message:
Adapt to recent gpt(8) change which now issues a message when
the secondary GPT header is moved.   Do it this way rather than
just using -q to suppress the message, so the test verifies that
the appropriate action was taken.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/tests/sbin/gpt/t_gpt.sh

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



CVS commit: src/tests/sbin/gpt

2022-11-21 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Mon Nov 21 16:06:00 UTC 2022

Modified Files:
src/tests/sbin/gpt: t_gpt.sh

Log Message:
Adapt to recent gpt(8) change which now issues a message when
the secondary GPT header is moved.   Do it this way rather than
just using -q to suppress the message, so the test verifies that
the appropriate action was taken.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/tests/sbin/gpt/t_gpt.sh

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

Modified files:

Index: src/tests/sbin/gpt/t_gpt.sh
diff -u src/tests/sbin/gpt/t_gpt.sh:1.16 src/tests/sbin/gpt/t_gpt.sh:1.17
--- src/tests/sbin/gpt/t_gpt.sh:1.16	Wed Mar 22 19:13:40 2017
+++ src/tests/sbin/gpt/t_gpt.sh	Mon Nov 21 16:06:00 2022
@@ -1,4 +1,4 @@
-# $NetBSD: t_gpt.sh,v 1.16 2017/03/22 19:13:40 martin Exp $
+# $NetBSD: t_gpt.sh,v 1.17 2022/11/21 16:06:00 kre Exp $
 #
 # Copyright (c) 2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -239,7 +239,7 @@ resize_2part_head() {
 resize_2part_body() {
 	prepare_2part
 	zerodd seek="$newsize" count=1
-	silence gpt resizedisk "$disk"
+	match 'Moving secondary GPT header' gpt resizedisk "$disk"
 	file "$src/gpt.resizedisk.show.normal" gpt show "$disk"
 	match "$(partresmsg 2 1058 19390)" gpt resize -i 2 "$disk"
 	file "$src/gpt.resizepart.show.normal" gpt show "$disk"



CVS commit: src/sys/arch/hp300/stand/common

2022-11-21 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Nov 21 15:36:29 UTC 2022

Modified Files:
src/sys/arch/hp300/stand/common: if_le.c

Log Message:
Make local functions and variables static.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/hp300/stand/common/if_le.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/hp300/stand/common/if_le.c
diff -u src/sys/arch/hp300/stand/common/if_le.c:1.13 src/sys/arch/hp300/stand/common/if_le.c:1.14
--- src/sys/arch/hp300/stand/common/if_le.c:1.13	Sat Jun 21 02:02:40 2014
+++ src/sys/arch/hp300/stand/common/if_le.c	Mon Nov 21 15:36:29 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_le.c,v 1.13 2014/06/21 02:02:40 tsutsui Exp $	*/
+/*	$NetBSD: if_le.c,v 1.14 2022/11/21 15:36:29 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1993 Adam Glass
@@ -72,12 +72,12 @@ struct le_sel {
 	int	le_bonus;
 };
 
-int le_probe(struct netif *, void *);
-int le_match(struct netif *, void *);
-void le_init(struct iodesc *, void *);
-int le_get(struct iodesc *, void *, size_t, saseconds_t);
-int le_put(struct iodesc *, void *, size_t);
-void le_end(struct netif *);
+static int le_probe(struct netif *, void *);
+static int le_match(struct netif *, void *);
+static void le_init(struct iodesc *, void *);
+static int le_get(struct iodesc *, void *, size_t, saseconds_t);
+static int le_put(struct iodesc *, void *, size_t);
+static void le_end(struct netif *);
 
 static inline void lewrcsr(struct le_softc *, uint16_t, uint16_t);
 static inline uint16_t lerdcsr(struct le_softc *, uint16_t);
@@ -92,7 +92,7 @@ static int le_poll(struct iodesc *, void
 int le_debug = 0;
 #endif
 
-struct le_sel le0conf[] = {
+static struct le_sel le0conf[] = {
 /* offsets for:	   ID   REGS MEM   NVRAM	le_heat	le_bonus*/
 {		0,	0x4000, 0x8000, 0xC008,	1,	10   }
 };
@@ -100,7 +100,7 @@ struct le_sel le0conf[] = {
 
 extern struct netif_stats	le_stats[];
 
-struct netif_dif le_ifs[] = {
+static struct netif_dif le_ifs[] = {
 /*	dif_unit	dif_nsel	dif_stats	dif_private	*/
 {	0,		NLE0CONF,	_stats[0],	le0conf,	},
 };
@@ -120,7 +120,7 @@ struct netif_driver le_driver = {
 	NLE_IFS			/* netif_nifs */
 };
 
-struct le_softc le_softc[NLE];
+static struct le_softc le_softc[NLE];
 
 static inline void
 lewrcsr(struct le_softc *sc, uint16_t port, uint16_t val)
@@ -211,7 +211,7 @@ leinit(void)
 	}
 }
 
-int
+static int
 le_match(struct netif *nif, void *machdep_hint)
 {
 	struct le_sel *sels;
@@ -232,7 +232,7 @@ le_match(struct netif *nif, void *machde
 	return rv;
 }
 
-int
+static int
 le_probe(struct netif *nif, void *machdep_hint)
 {
 #if 0
@@ -307,7 +307,7 @@ le_mem_summary(int unit)
 #define le_mem_summary(u)
 #endif
 
-void
+static void
 le_error(int unit, char *str, uint16_t stat)
 {
 
@@ -328,7 +328,7 @@ le_error(int unit, char *str, uint16_t s
 	((u_long)(a) - (u_long)sc->sc_mem)
 
 /* LANCE initialization block set up. */
-void
+static void
 lememinit(struct le_softc *sc)
 {
 	int i;
@@ -388,7 +388,7 @@ lememinit(struct le_softc *sc)
 	}
 }
 
-void
+static void
 le_reset(int unit, u_char *myea)
 {
 	struct le_softc *sc = _softc[unit];
@@ -450,7 +450,7 @@ le_reset(int unit, u_char *myea)
 	le_mem_summary(unit);
 }
 
-int
+static int
 le_poll(struct iodesc *desc, void *pkt, int len)
 {
 	int unit = /*nif->nif_unit*/0;
@@ -525,7 +525,7 @@ cleanup:
 	return length;
 }
 
-int
+static int
 le_put(struct iodesc *desc, void *pkt, size_t len)
 {
 	int unit = /*nif->nif_unit*/0;
@@ -627,7 +627,7 @@ le_put(struct iodesc *desc, void *pkt, s
 }
 
 
-int
+static int
 le_get(struct iodesc *desc, void *pkt, size_t len, saseconds_t timeout)
 {
 	satime_t t;
@@ -640,7 +640,7 @@ le_get(struct iodesc *desc, void *pkt, s
 	return cc;
 }
 
-void
+static void
 le_init(struct iodesc *desc, void *machdep_hint)
 {
 	struct netif *nif = desc->io_netif;
@@ -658,7 +658,7 @@ le_init(struct iodesc *desc, void *machd
 	le_reset(unit, desc->myea);
 }
 
-void
+static void
 le_end(struct netif *nif)
 {
 	int unit = nif->nif_unit;



CVS commit: src/sys/arch/hp300/stand/common

2022-11-21 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Nov 21 15:36:29 UTC 2022

Modified Files:
src/sys/arch/hp300/stand/common: if_le.c

Log Message:
Make local functions and variables static.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/hp300/stand/common/if_le.c

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



CVS commit: src/sys/arch/hp300/stand/common

2022-11-21 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Nov 21 15:05:44 UTC 2022

Modified Files:
src/sys/arch/hp300/stand/common: rd.c

Log Message:
Make local variables static and read only ones const.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/hp300/stand/common/rd.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/hp300/stand/common/rd.c
diff -u src/sys/arch/hp300/stand/common/rd.c:1.12 src/sys/arch/hp300/stand/common/rd.c:1.13
--- src/sys/arch/hp300/stand/common/rd.c:1.12	Mon Nov 21 14:55:08 2022
+++ src/sys/arch/hp300/stand/common/rd.c	Mon Nov 21 15:05:44 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: rd.c,v 1.12 2022/11/21 14:55:08 tsutsui Exp $	*/
+/*	$NetBSD: rd.c,v 1.13 2022/11/21 15:05:44 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -52,12 +52,12 @@
 #include 
 #include 
 
-struct	rd_iocmd rd_ioc;
-struct	rd_rscmd rd_rsc;
-struct	rd_stat rd_stat;
-struct	rd_ssmcmd rd_ssmc;
+static struct	rd_iocmd rd_ioc;
+static struct	rd_rscmd rd_rsc;
+static struct	rd_stat rd_stat;
+static struct	rd_ssmcmd rd_ssmc;
 
-struct	disklabel rdlabel;
+static struct	disklabel rdlabel;
 
 struct	rdminilabel {
 	u_short	npart;
@@ -88,9 +88,9 @@ static void rdreset(int, int);
 static int rdgetinfo(struct rd_softc *);
 static int rderror(int, int, int);
 
-struct rd_softc rd_softc[NHPIB][NRD];
+static struct rd_softc rd_softc[NHPIB][NRD];
 
-struct rdidentinfo rdidentinfo[] = {
+static const struct rdidentinfo rdidentinfo[] = {
 	[RD7945A]  = { RD7946AID,	0,	 108416 },
 	[RD9134D]  = { RD9134DID,	1,	  29088 },
 	[RD9122S]  = { RD9134LID,	1,	   1232 },
@@ -115,9 +115,9 @@ struct rdidentinfo rdidentinfo[] = {
 	[RD7911A]  = { RD7911AID,	0,	  54912 },
 	[RD7941A]  = { RD7946AID,	0,	  46464 }
 };
-int numrdidentinfo = sizeof(rdidentinfo) / sizeof(rdidentinfo[0]);
+static const int numrdidentinfo = sizeof(rdidentinfo) / sizeof(rdidentinfo[0]);
 
-int
+static int
 rdinit(int ctlr, int unit)
 {
 	struct rd_softc *rs = _softc[ctlr][unit];
@@ -210,7 +210,7 @@ rdident(int ctlr, int unit)
 	return id;
 }
 
-char io_buf[MAXBSIZE];
+static char io_buf[MAXBSIZE];
 
 static int
 rdgetinfo(struct rd_softc *rs)



CVS commit: src/sys/arch/hp300/stand/common

2022-11-21 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Nov 21 15:05:44 UTC 2022

Modified Files:
src/sys/arch/hp300/stand/common: rd.c

Log Message:
Make local variables static and read only ones const.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/hp300/stand/common/rd.c

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



CVS commit: src/sys/arch/hp300/stand/common

2022-11-21 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Nov 21 14:55:08 UTC 2022

Modified Files:
src/sys/arch/hp300/stand/common: rd.c

Log Message:
Sync a list of HP-IB disk IDs with kernel's one.

Now bootloader can boot from 2202A, 7908A, 7911A, and 7941A.
Tested on 425t and HPDisk.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/hp300/stand/common/rd.c

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



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

2022-11-21 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Nov 21 12:21:17 UTC 2022

Modified Files:
src/sys/arch/x86/include: specialreg.h

Log Message:
Update AMD CPUID Fn8000_001b

 - Add IbsFetchCtlExtd and IbsOpData4.
 - Fix typo (lbs -> Ibs).


To generate a diff of this commit:
cvs rdiff -u -r1.197 -r1.198 src/sys/arch/x86/include/specialreg.h

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/include/specialreg.h
diff -u src/sys/arch/x86/include/specialreg.h:1.197 src/sys/arch/x86/include/specialreg.h:1.198
--- src/sys/arch/x86/include/specialreg.h:1.197	Wed Nov 16 14:55:50 2022
+++ src/sys/arch/x86/include/specialreg.h	Mon Nov 21 12:21:17 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: specialreg.h,v 1.197 2022/11/16 14:55:50 msaitoh Exp $	*/
+/*	$NetBSD: specialreg.h,v 1.198 2022/11/21 12:21:17 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2014-2020 The NetBSD Foundation, Inc.
@@ -908,12 +908,15 @@
 #define CPUID_IBS_OPCNTEXT	__BIT(6)  /* OpCurCnt and OpMaxCnt extended */
 #define CPUID_IBS_RIPINVALIDCHK	__BIT(7)  /* Invalid RIP indication */
 #define CPUID_IBS_OPBRNFUSE	__BIT(8)  /* Fused branch micro-op indicate */
+#define CPUID_IBS_FETCHCTLEXTD	__BIT(9)  /* IC_IBS_EXTD_CTL MSR */
+#define CPUID_IBS_OPDATA4	__BIT(10) /* IBS op data 4 MSR */
 #define CPUID_IBS_L3MISSFILT	__BIT(11) /* L3 Miss Filtering */
 
 #define CPUID_IBS_FLAGS	 "\20"		   \
 	"\1IBSFFV"	"\2FetchSam"	"\3OpSam"	"\4RdWrOpCnt"	   \
 	"\5OpCnt"	"\6BrnTrgt"	"\7OpCntExt"	"\10RipInvalidChk" \
-	"\11OpBrnFuse"	"\12B9""\14IbsL3MissFiltering"
+	"\11OpBrnFuse" "\12IbsFetchCtlExtd" "\13IbsOpData4"		   \
+		   "\14IbsL3MissFiltering"
 
 /*
  * AMD Cache Topology Information.
@@ -980,7 +983,7 @@
 	"\1" "SME"	"\2" "SEV"	"\3" "PageFlushMsr"	"\4" "SEV-ES" \
 	"\5" "SEV-SNP"	"\6" "VMPL"	"\7RMPQUERY"	"\10VmplSSS"	  \
 	"\11SecureTSC"	"\12TscAuxVirt"	"\13HwEnfCacheCoh"  "\14" "64BitHost" \
-	"\15" "RSTRINJ"	"\16" "ALTINJ"	"\17" "DebugSwap" "\20PreventHostlbs" \
+	"\15" "RSTRINJ"	"\16" "ALTINJ"	"\17" "DebugSwap" "\20PreventHostIbs" \
 	"\21VTE"  "\22VmgexitParam" "\23VirtualTomMsr" "\24IbsVirtGuest"  \
 	"\31VmsaRegProt" "\32SmtProtection"  \
 	"\35SvsmCommPageMSR" "\36NestedVirtSnpMsr"



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

2022-11-21 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Nov 21 12:21:17 UTC 2022

Modified Files:
src/sys/arch/x86/include: specialreg.h

Log Message:
Update AMD CPUID Fn8000_001b

 - Add IbsFetchCtlExtd and IbsOpData4.
 - Fix typo (lbs -> Ibs).


To generate a diff of this commit:
cvs rdiff -u -r1.197 -r1.198 src/sys/arch/x86/include/specialreg.h

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



CVS commit: src/sys/fs/union

2022-11-21 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Mon Nov 21 10:37:14 UTC 2022

Modified Files:
src/sys/fs/union: union_vfsops.c

Log Message:
When testing whiteout support on the underlying file system
union_mount() should not use a NULL componentname as not all
file systems can handle it.

Use static { LOOKUP, NOCRED } componentname instead.

Reported-by: syzbot+ecda308a1dd965283...@syzkaller.appspotmail.com
Reported-by: syzbot+9b687847ee5f43e94...@syzkaller.appspotmail.com
Reported-by: syzbot+9f9d1a841734f9f50...@syzkaller.appspotmail.com


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 src/sys/fs/union/union_vfsops.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/fs/union/union_vfsops.c
diff -u src/sys/fs/union/union_vfsops.c:1.84 src/sys/fs/union/union_vfsops.c:1.85
--- src/sys/fs/union/union_vfsops.c:1.84	Fri Nov  4 11:20:39 2022
+++ src/sys/fs/union/union_vfsops.c	Mon Nov 21 10:37:14 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: union_vfsops.c,v 1.84 2022/11/04 11:20:39 hannken Exp $	*/
+/*	$NetBSD: union_vfsops.c,v 1.85 2022/11/21 10:37:14 hannken Exp $	*/
 
 /*
  * Copyright (c) 1994 The Regents of the University of California.
@@ -77,7 +77,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: union_vfsops.c,v 1.84 2022/11/04 11:20:39 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: union_vfsops.c,v 1.85 2022/11/21 10:37:14 hannken Exp $");
 
 #include 
 #include 
@@ -205,9 +205,13 @@ union_mount(struct mount *mp, const char
 	 * supports whiteout operations
 	 */
 	if ((mp->mnt_flag & MNT_RDONLY) == 0) {
+		static struct componentname nullcn = {
+			.cn_nameiop = LOOKUP,
+			.cn_cred = NOCRED
+		};
+
 		vn_lock(um->um_uppervp, LK_EXCLUSIVE | LK_RETRY);
-		error = VOP_WHITEOUT(um->um_uppervp,
-		(struct componentname *) 0, LOOKUP);
+		error = VOP_WHITEOUT(um->um_uppervp, , LOOKUP);
 		VOP_UNLOCK(um->um_uppervp);
 		if (error)
 			goto bad;



CVS commit: src/sys/fs/union

2022-11-21 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Mon Nov 21 10:37:14 UTC 2022

Modified Files:
src/sys/fs/union: union_vfsops.c

Log Message:
When testing whiteout support on the underlying file system
union_mount() should not use a NULL componentname as not all
file systems can handle it.

Use static { LOOKUP, NOCRED } componentname instead.

Reported-by: syzbot+ecda308a1dd965283...@syzkaller.appspotmail.com
Reported-by: syzbot+9b687847ee5f43e94...@syzkaller.appspotmail.com
Reported-by: syzbot+9f9d1a841734f9f50...@syzkaller.appspotmail.com


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 src/sys/fs/union/union_vfsops.c

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



CVS commit: src/sys/netinet

2022-11-21 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Mon Nov 21 09:51:13 UTC 2022

Modified Files:
src/sys/netinet: ip_output.c

Log Message:
Fix panic on packet sending via a route with rt_ifa of AF_LINK.

A route with rt_ifa of AF_LINK can be set by some routing daemons when
it adds a route that has a gateway of AF_LINK.  If there is no address on
a target interface, the kernel sets an AF_LINK address of the interface to
rt_ifa of the route.  In that case, a variable of a local address in
ip_output (ia) can be NULL and we need more NULL-checks of it.


To generate a diff of this commit:
cvs rdiff -u -r1.323 -r1.324 src/sys/netinet/ip_output.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/netinet/ip_output.c
diff -u src/sys/netinet/ip_output.c:1.323 src/sys/netinet/ip_output.c:1.324
--- src/sys/netinet/ip_output.c:1.323	Fri Nov  4 09:00:58 2022
+++ src/sys/netinet/ip_output.c	Mon Nov 21 09:51:13 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_output.c,v 1.323 2022/11/04 09:00:58 ozaki-r Exp $	*/
+/*	$NetBSD: ip_output.c,v 1.324 2022/11/21 09:51:13 knakahara Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_output.c,v 1.323 2022/11/04 09:00:58 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_output.c,v 1.324 2022/11/21 09:51:13 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -531,6 +531,15 @@ ip_output(struct mbuf *m0, struct mbuf *
 	if (in_nullhost(ip->ip_src)) {
 		struct ifaddr *xifa;
 
+		/* If rt_ifa is AF_LINK, ia can be NULL. */
+		if (ia == NULL) {
+			KASSERTMSG(rt->rt_ifa->ifa_addr->sa_family == AF_LINK,
+			"sa_family=%d", rt->rt_ifa->ifa_addr->sa_family);
+			IP_STATINC(IP_STAT_NOROUTE);
+			error = EHOSTUNREACH;
+			goto bad;
+		}
+
 		xifa = >ia_ifa;
 		if (xifa->ifa_getifa != NULL) {
 			ia4_release(ia, _ia);
@@ -582,6 +591,15 @@ ip_output(struct mbuf *m0, struct mbuf *
 
 sendit:
 	if ((flags & (IP_FORWARDING|IP_NOIPNEWID)) == 0) {
+		/* If rt_ifa is AF_LINK, ia can be NULL. */
+		if (ia == NULL) {
+			KASSERTMSG(rt->rt_ifa->ifa_addr->sa_family == AF_LINK,
+			"sa_family=%d", rt->rt_ifa->ifa_addr->sa_family);
+			IP_STATINC(IP_STAT_NOROUTE);
+			error = EHOSTUNREACH;
+			goto bad;
+		}
+
 		if (m->m_pkthdr.len < IP_MINFRAGSIZE) {
 			ip->ip_id = 0;
 		} else if ((m->m_pkthdr.csum_flags & M_CSUM_TSOv4) == 0) {



CVS commit: src/sys/netinet

2022-11-21 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Mon Nov 21 09:51:13 UTC 2022

Modified Files:
src/sys/netinet: ip_output.c

Log Message:
Fix panic on packet sending via a route with rt_ifa of AF_LINK.

A route with rt_ifa of AF_LINK can be set by some routing daemons when
it adds a route that has a gateway of AF_LINK.  If there is no address on
a target interface, the kernel sets an AF_LINK address of the interface to
rt_ifa of the route.  In that case, a variable of a local address in
ip_output (ia) can be NULL and we need more NULL-checks of it.


To generate a diff of this commit:
cvs rdiff -u -r1.323 -r1.324 src/sys/netinet/ip_output.c

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