Re: CVS commit: src/sys/dev/i2c

2022-11-22 Thread Brad Spencer
Simon Burge  writes:

> Hi Brad,
>
>> Module Name: src
>> Committed By:brad
>> Date:Tue Nov 22 19:40:31 UTC 2022
>>
>> Modified Files:
>>
>>  src/sys/dev/i2c: bmx280.c
>>
>> Log Message:
>>
>> Read the datasheet more closely and put in some delays.  The chip will
>> just return junk if the wait is not long enough to allow a measurement
>> to start.
>
>
> +   /* Hmm... this delay is not documented well..  mostly just a guess...
> +* If it is too short, you will get junk returned as it is possible 
> to try
> +* to ask for the data before the chip has even started... it seems...
> +*/
> +   delay(35000);
>
> This will spin for 35 milliseconds (per sensor read if I read this
> correctly).  Can you please look at using kpause(9) for this delay?
> See some other i2c drivers for examples of this.
>
> Cheers,
> Simon.

Probably possible, may be a couple of days before I can get to
it (or not, depends on how holiday prep goes)...

I have used some of the cv_timedwait stuff in the past and didn't know
about kpause which seems to be suited to what I need to do.  Almost all
sensor chips require some sort of wait after a command is sent, but this
one was particularly frustrating about it.

To give out too much information, all of the other sensors I have worked
with NACK the I2C bus during the measurement cycle.  This one, and
probably all of Bosch's chips, do not do that.  You have to read back a
status register and check to see if it is busy doing something or other.
If you just go ahead and read the data registers when it is busy you get
junk with no hint that it is junk.  But a big "however" is that it is
possible (even for a RPI) to read the status register BEFORE the chip
has even started to do its measurements, get a positive response
(i.e. not busy) and then read the data registers and get junk.  This
was, as one might say, a "surprising development" as the documentation
really does not hint that this sort of thing goes on (or was even
possible to do).




-- 
Brad Spencer - b...@anduin.eldar.org - KC8VKS - http://anduin.eldar.org


Re: CVS commit: src/sys/dev/i2c

2022-11-22 Thread Simon Burge
Hi Brad,

> Module Name:  src
> Committed By: brad
> Date: Tue Nov 22 19:40:31 UTC 2022
>
> Modified Files:
>
>   src/sys/dev/i2c: bmx280.c
>
> Log Message:
>
> Read the datasheet more closely and put in some delays.  The chip will
> just return junk if the wait is not long enough to allow a measurement
> to start.


+   /* Hmm... this delay is not documented well..  mostly just a guess...
+* If it is too short, you will get junk returned as it is possible to 
try
+* to ask for the data before the chip has even started... it seems...
+*/
+   delay(35000);

This will spin for 35 milliseconds (per sensor read if I read this
correctly).  Can you please look at using kpause(9) for this delay?
See some other i2c drivers for examples of this.

Cheers,
Simon.


CVS commit: src/sys/dev/i2c

2022-11-22 Thread Brad Spencer
Module Name:src
Committed By:   brad
Date:   Tue Nov 22 19:40:31 UTC 2022

Modified Files:
src/sys/dev/i2c: bmx280.c

Log Message:
Read the datasheet more closely and put in some delays.  The chip will
just return junk if the wait is not long enough to allow a measurement
to start.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/i2c/bmx280.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/dev/i2c/bmx280.c
diff -u src/sys/dev/i2c/bmx280.c:1.1 src/sys/dev/i2c/bmx280.c:1.2
--- src/sys/dev/i2c/bmx280.c:1.1	Mon Nov 21 21:24:01 2022
+++ src/sys/dev/i2c/bmx280.c	Tue Nov 22 19:40:31 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: bmx280.c,v 1.1 2022/11/21 21:24:01 brad Exp $	*/
+/*	$NetBSD: bmx280.c,v 1.2 2022/11/22 19:40:31 brad Exp $	*/
 
 /*
  * Copyright (c) 2022 Brad Spencer 
@@ -17,7 +17,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bmx280.c,v 1.1 2022/11/21 21:24:01 brad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bmx280.c,v 1.2 2022/11/22 19:40:31 brad Exp $");
 
 /*
   Driver for the Bosch BMP280/BME280 temperature, humidity (sometimes) and
@@ -501,7 +501,7 @@ bmx280_attach(device_t parent, device_t 
 		error);
 	}
 
-	delay(100);
+	delay(3);
 
 	reg = BMX280_REGISTER_ID;
 	error = bmx280_read_register(sc->sc_tag, sc->sc_addr, ®, &chip_id, 1);
@@ -510,7 +510,7 @@ bmx280_attach(device_t parent, device_t 
 		error);
 	}
 
-	delay(100);
+	delay(1000);
 
 	DPRINTF(sc, 2, ("%s: read ID value: %02x\n",
 	device_xname(sc->sc_dev), chip_id));
@@ -718,6 +718,12 @@ bmx280_set_control_and_trigger(struct bm
 		error = EINVAL;
 	}
 
+	/* Hmm... this delay is not documented well..  mostly just a guess...
+	 * If it is too short, you will get junk returned as it is possible to try
+	 * to ask for the data before the chip has even started... it seems...
+	 */
+	delay(35000);
+
 	return error;
 }
 
@@ -731,7 +737,7 @@ bmx280_wait_for_data(struct bmx280_sc *s
 
 	reg = BMX280_REGISTER_STATUS;
 	do {
-		delay(10);
+		delay(1000);
 		ierror = bmx280_read_register(sc->sc_tag, sc->sc_addr, ®, &running, 1);
 		if (ierror) {
 			DPRINTF(sc, 2, ("%s: Refresh failed to read back status: %d\n",



CVS commit: src/sys/dev/i2c

2022-11-22 Thread Brad Spencer
Module Name:src
Committed By:   brad
Date:   Tue Nov 22 19:40:31 UTC 2022

Modified Files:
src/sys/dev/i2c: bmx280.c

Log Message:
Read the datasheet more closely and put in some delays.  The chip will
just return junk if the wait is not long enough to allow a measurement
to start.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/i2c/bmx280.c

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



CVS commit: src/distrib/sets/lists

2022-11-22 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Tue Nov 22 17:35:45 UTC 2022

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

Log Message:
Fix h_lualibm debug set lists.


To generate a diff of this commit:
cvs rdiff -u -r1.392 -r1.393 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.1234 -r1.1235 src/distrib/sets/lists/tests/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/mi
diff -u src/distrib/sets/lists/debug/mi:1.392 src/distrib/sets/lists/debug/mi:1.393
--- src/distrib/sets/lists/debug/mi:1.392	Mon Nov 21 22:01:32 2022
+++ src/distrib/sets/lists/debug/mi	Tue Nov 22 17:35:45 2022
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.392 2022/11/21 22:01:32 christos Exp $
+# $NetBSD: mi,v 1.393 2022/11/22 17:35:45 jakllsch 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
@@ -2386,6 +2386,7 @@
 ./usr/libdata/debug/usr/tests/lib/libutil/t_pidfile.debug		tests-lib-debug		debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/lib/libutil/t_snprintb.debug		tests-lib-debug		debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/lib/libutil/t_sockaddr_snprintf.debug	tests-lib-debug		debug,atf,compattestfile
+./usr/libdata/debug/usr/tests/lib/lua/libm/h_lualibm.debug		tests-lib-debug		debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/lib/semaphore/pthread/t_sem_pth.debug	tests-lib-debug		debug,atf,rump
 ./usr/libdata/debug/usr/tests/libexec/ld.elf_so/h_df_1_noopen1.debug	tests-libexec-debug	debug,atf,pic,compattestfile
 ./usr/libdata/debug/usr/tests/libexec/ld.elf_so/h_df_1_noopen2.debug	tests-libexec-debug	debug,atf,pic,compattestfile
@@ -2400,10 +2401,6 @@
 ./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/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.1234 src/distrib/sets/lists/tests/mi:1.1235
--- src/distrib/sets/lists/tests/mi:1.1234	Mon Nov 21 22:01:33 2022
+++ src/distrib/sets/lists/tests/mi	Tue Nov 22 17:35:45 2022
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1234 2022/11/21 22:01:33 christos Exp $
+# $NetBSD: mi,v 1.1235 2022/11/22 17:35:45 jakllsch Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -152,6 +152,8 @@
 ./usr/libdata/debug/usr/tests/lib/libtre		tests-lib-debug		compattestfile,atf
 ./usr/libdata/debug/usr/tests/lib/libusbhid		tests-lib-debug		compattestfile,atf
 ./usr/libdata/debug/usr/tests/lib/libutil		tests-lib-debug		compattestfile,atf
+./usr/libdata/debug/usr/tests/lib/lua			tests-lib-debug		compattestfile,atf
+./usr/libdata/debug/usr/tests/lib/lua/libm		tests-lib-debug		compattestfile,atf
 ./usr/libdata/debug/usr/tests/lib/semaphore		tests-lib-debug		compattestfile,atf
 ./usr/libdata/debug/usr/tests/lib/semaphore/pthread	tests-lib-debug		compattestfile,atf
 ./usr/libdata/debug/usr/tests/libexec			tests-lib-debug		compattestfile,atf



CVS commit: src/distrib/sets/lists

2022-11-22 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Tue Nov 22 17:35:45 UTC 2022

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

Log Message:
Fix h_lualibm debug set lists.


To generate a diff of this commit:
cvs rdiff -u -r1.392 -r1.393 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.1234 -r1.1235 src/distrib/sets/lists/tests/mi

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



CVS commit: src/sys/arch/luna68k/dev

2022-11-22 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Tue Nov 22 16:17:29 UTC 2022

Modified Files:
src/sys/arch/luna68k/dev: siotty.c

Log Message:
Use explicit struct to represent RX queue buffer data structure.

No binary change.

Maybe the similar change should be applied to MI com(4) and zsc(4)?


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/luna68k/dev/siotty.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/luna68k/dev

2022-11-22 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Tue Nov 22 16:17:29 UTC 2022

Modified Files:
src/sys/arch/luna68k/dev: siotty.c

Log Message:
Use explicit struct to represent RX queue buffer data structure.

No binary change.

Maybe the similar change should be applied to MI com(4) and zsc(4)?


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/luna68k/dev/siotty.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/luna68k/dev/siotty.c
diff -u src/sys/arch/luna68k/dev/siotty.c:1.51 src/sys/arch/luna68k/dev/siotty.c:1.52
--- src/sys/arch/luna68k/dev/siotty.c:1.51	Sat Sep 25 15:18:38 2021
+++ src/sys/arch/luna68k/dev/siotty.c	Tue Nov 22 16:17:29 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: siotty.c,v 1.51 2021/09/25 15:18:38 tsutsui Exp $ */
+/* $NetBSD: siotty.c,v 1.52 2022/11/22 16:17:29 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: siotty.c,v 1.51 2021/09/25 15:18:38 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: siotty.c,v 1.52 2022/11/22 16:17:29 tsutsui Exp $");
 
 #include "opt_ddb.h"
 #include "siotty.h"
@@ -76,6 +76,13 @@ static const struct speedtab siospeedtab
 	{ -1,	0, },
 };
 
+struct siotty_rxqdata {
+	uint8_t data;
+	uint8_t stat;
+};
+
+typedef struct siotty_rxqdata rxqdata_t;
+
 struct siotty_softc {
 	device_t	sc_dev;
 	struct tty	*sc_tty;
@@ -86,10 +93,10 @@ struct siotty_softc {
 	u_int		sc_hwflags;
 #define	SIOTTY_HW_CONSOLE	0x0001
 
-	uint8_t		*sc_rbuf;
-	uint8_t		*sc_rbufend;
-	uint8_t	* volatile sc_rbget;
-	uint8_t	* volatile sc_rbput;
+	rxqdata_t	*sc_rbuf;
+	rxqdata_t	*sc_rbufend;
+	rxqdata_t * volatile sc_rbget;
+	rxqdata_t * volatile sc_rbput;
 	volatile u_int	sc_rbavail;
 
 	uint8_t		*sc_tba;
@@ -192,8 +199,9 @@ siotty_attach(device_t parent, device_t 
 
 	aprint_normal("\n");
 
-	sc->sc_rbuf = kmem_alloc(siotty_rbuf_size * 2, KM_SLEEP);
-	sc->sc_rbufend = sc->sc_rbuf + (siotty_rbuf_size * 2);
+	sc->sc_rbuf = kmem_alloc(siotty_rbuf_size * sizeof(rxqdata_t),
+	KM_SLEEP);
+	sc->sc_rbufend = sc->sc_rbuf + siotty_rbuf_size;
 	sc->sc_rbput = sc->sc_rbget = sc->sc_rbuf;
 	sc->sc_rbavail = siotty_rbuf_size;
 
@@ -217,7 +225,7 @@ siottyintr(void *arg)
 {
 	struct siotty_softc *sc;
 	struct sioreg *sio;
-	uint8_t *put, *end;
+	rxqdata_t *put, *end;
 	uint8_t c;
 	uint16_t rr;
 	int cc;
@@ -241,9 +249,9 @@ siottyintr(void *arg)
 c = sio->sio_data;
 cn_check_magic(sc->sc_tty->t_dev, c,
 siotty_cnm_state);
-put[0] = c;
-put[1] = rr & 0xff;
-put += 2;
+put->data = c;
+put->stat = rr & 0xff;
+put++;
 if (put >= end)
 	put = sc->sc_rbuf;
 cc--;
@@ -294,7 +302,7 @@ siottysoft(void *arg)
 static void
 siotty_rxsoft(struct siotty_softc *sc, struct tty *tp)
 {
-	uint8_t *get, *end;
+	rxqdata_t *get, *end;
 	u_int cc, scc;
 	unsigned int code;
 	uint8_t stat;
@@ -309,15 +317,15 @@ siotty_rxsoft(struct siotty_softc *sc, s
 	}
 
 	while (cc > 0) {
-		code = get[0];
-		stat = get[1];
+		code = get->data;
+		stat = get->stat;
 		if ((stat & RR_FRAMING) != 0)
 			code |= TTY_FE;
 		else if ((stat & RR_PARITY) != 0)
 			code |= TTY_PE;
 
 		(*tp->t_linesw->l_rint)(code, tp);
-		get += 2;
+		get++;
 		if (get >= end)
 			get = sc->sc_rbuf;
 		cc--;



CVS commit: src/tests/lib/lua/libm

2022-11-22 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Nov 22 15:57:03 UTC 2022

Modified Files:
src/tests/lib/lua/libm: h_lualibm.c lualibm.lua

Log Message:
Sync style between Lua script and C source code.
Fix false positive for some tests.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/lua/libm/h_lualibm.c \
src/tests/lib/lua/libm/lualibm.lua

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

Modified files:

Index: src/tests/lib/lua/libm/h_lualibm.c
diff -u src/tests/lib/lua/libm/h_lualibm.c:1.1 src/tests/lib/lua/libm/h_lualibm.c:1.2
--- src/tests/lib/lua/libm/h_lualibm.c:1.1	Mon Nov 21 22:01:33 2022
+++ src/tests/lib/lua/libm/h_lualibm.c	Tue Nov 22 15:57:03 2022
@@ -73,7 +73,7 @@ main(void)
 	TEST(remainder(M_PI, M_E));
 	TEST(rint(M_PI));
 	TEST(rint(M_E));
-	printf("%-24s%+2.13f\n", "scalbn(1.0,2)", scalbn(1.0, 2));
+	printf("%-24s%+2.13f\n", "scalbn(1.0, 2)", scalbn(1.0, 2));
 	TEST(sin(M_PI_4));
 	TEST(sinh(M_PI_4));
 	TEST(sqrt(9.0));
Index: src/tests/lib/lua/libm/lualibm.lua
diff -u src/tests/lib/lua/libm/lualibm.lua:1.1 src/tests/lib/lua/libm/lualibm.lua:1.2
--- src/tests/lib/lua/libm/lualibm.lua:1.1	Mon Nov 21 22:01:33 2022
+++ src/tests/lib/lua/libm/lualibm.lua	Tue Nov 22 15:57:03 2022
@@ -5,88 +5,88 @@ local lm = require("libm")
 local fmtf = "%-24s%+2.13f"
 local fmti = "%-24s%d"
 
-local function test(s,x)
+local function test(s, x)
print(string.format(fmtf, s, x))
 end
 
-local function testb(s,x)
+local function testb(s, x)
print(string.format(fmti, s, x and 1 or 0))
 end
 
-test("M_E",lm.M_E);
-test("M_LOG2E",lm.M_LOG2E)
-test("M_LOG10E",lm.M_LOG10E)
-test("M_LN2",lm.M_LN2)
-test("M_LN10",lm.M_LN10)
-test("M_PI",lm.M_PI)
-test("M_PI_2",lm.M_PI_2)
-test("M_PI_4",lm.M_PI_4)
-test("M_1_PI",lm.M_1_PI)
-test("M_2_PI",lm.M_2_PI)
-test("M_2_SQRTPI",lm.M_2_SQRTPI)
-test("M_SQRT2",lm.M_SQRT2)
-test("M_SQRT1_2",lm.M_SQRT1_2)
+test("M_E", lm.M_E);
+test("M_LOG2E", lm.M_LOG2E)
+test("M_LOG10E", lm.M_LOG10E)
+test("M_LN2", lm.M_LN2)
+test("M_LN10", lm.M_LN10)
+test("M_PI", lm.M_PI)
+test("M_PI_2", lm.M_PI_2)
+test("M_PI_4", lm.M_PI_4)
+test("M_1_PI", lm.M_1_PI)
+test("M_2_PI", lm.M_2_PI)
+test("M_2_SQRTPI", lm.M_2_SQRTPI)
+test("M_SQRT2", lm.M_SQRT2)
+test("M_SQRT1_2", lm.M_SQRT1_2)
 
 test("cos(M_PI_2)", lm.cos(lm.M_PI_2))
-test("acos(cos(M_PI_2))",lm.acos(lm.cos(lm.M_PI_2)))
-test("cosh(M_SQRT1_2)",lm.cosh(lm.M_SQRT1_2))
-test("acosh(cosh(M_SQRT1_2))",lm.acosh(lm.cosh(lm.M_SQRT1_2)))
-test("sin(M_PI_2)",lm.sin(lm.M_PI_2))
-test("asin(sin(M_PI_2))",lm.asin(lm.sin(lm.M_PI_2)))
-test("sinh(M_PI_2)",lm.sinh(lm.M_PI_2))
-test("asinh(sinh(M_PI_2))",lm.asinh(lm.sinh(lm.M_PI_2)))
-test("tan(M_SQRT2)",lm.tan(lm.M_SQRT2))
-test("atan(tan(M_SQRT2))",lm.atan(lm.tan(lm.M_SQRT2)))
-test("tanh(M_SQRT2)",lm.tanh(lm.M_SQRT2))
-test("atanh(tanh(M_SQRT2))",lm.atanh(lm.tanh(lm.M_SQRT2)))
-test("atan2(M_SQRT2,M_SQRT2)",lm.atan2(lm.M_SQRT2,lm.M_SQRT2))
-test("cbrt(8.0)",lm.cbrt(8.0))
-test("ceil(M_PI)",lm.ceil(lm.M_PI))
-test("ceil(M_E)",lm.ceil(lm.M_E))
-test("copysign(-2.0,10.0)",lm.copysign(-2.0,10.0))
-test("copysign(2.0,-10.0)",lm.copysign(2.0,-10.0))
-test("erf(M_SQRT1_2)",lm.erf(lm.M_SQRT1_2))
-test("erfc(M_SQRT1_2)",lm.erfc(lm.M_SQRT1_2))
-test("exp(M_PI_4)",lm.exp(lm.M_PI_4))
-test("exp2(3.0)",lm.exp2(3.0))
-test("expm1(M_PI_4)",lm.expm1(lm.M_PI_4))
-test("fabs(-M_SQRT2)",lm.fabs(-lm.M_SQRT2))
-test("fabs(M_SQRT2)",lm.fabs(lm.M_SQRT2))
-test("fdim(M_PI,M_PI_2)",lm.fdim(lm.M_PI,lm.M_PI_2))
-test("fdim(M_PI,-M_PI_2)",lm.fdim(lm.M_PI,-lm.M_PI_2))
-testb("finite(1.0/0.0)",lm.finite(1.0/0.0))
-test("floor(M_PI)",lm.floor(lm.M_PI))
-test("floor(M_E)",lm.floor(lm.M_E))
-test("fma(M_PI,M_E,M_SQRT2)",lm.fma(lm.M_PI,lm.M_E,lm.M_SQRT2))
-test("fmax(M_PI,M_E)",lm.fmax(lm.M_PI,lm.M_E))
-test("fmin(M_PI,M_E)",lm.fmin(lm.M_PI,lm.M_E))
-test("fmod(100.5,10.0)",lm.fmod(100.5,10.0))
-test("gamma(5.0)",lm.gamma(5.0))
-test("hypot(3.0,4.0)",lm.hypot(3.0,4.0))
+test("acos(cos(M_PI_2))", lm.acos(lm.cos(lm.M_PI_2)))
+test("cosh(M_SQRT1_2)", lm.cosh(lm.M_SQRT1_2))
+test("acosh(cosh(M_SQRT1_2))", lm.acosh(lm.cosh(lm.M_SQRT1_2)))
+test("sin(M_PI_2)", lm.sin(lm.M_PI_2))
+test("asin(sin(M_PI_2))", lm.asin(lm.sin(lm.M_PI_2)))
+test("sinh(M_PI_2)", lm.sinh(lm.M_PI_2))
+test("asinh(sinh(M_PI_2))", lm.asinh(lm.sinh(lm.M_PI_2)))
+test("tan(M_SQRT2)", lm.tan(lm.M_SQRT2))
+test("atan(tan(M_SQRT2))", lm.atan(lm.tan(lm.M_SQRT2)))
+test("tanh(M_SQRT2)", lm.tanh(lm.M_SQRT2))
+test("atanh(tanh(M_SQRT2))", lm.atanh(lm.tanh(lm.M_SQRT2)))
+test("atan2(M_SQRT2, M_SQRT2)", lm.atan2(lm.M_SQRT2, lm.M_SQRT2))
+test("cbrt(8.0)", lm.cbrt(8.0))
+test("ceil(M_PI)", lm.ceil(lm.M_PI))
+test("ceil(M_E)", lm.ceil(lm.M_E))
+test("copysign(-2.0, 10.0)", lm.copysign(-2.0, 10.0))
+test("copysign(2.0, -10.0)", lm.copysign(2.0, -10.0))
+test("erf(M_SQRT1_2)", lm.erf(lm.M_SQRT1_2))
+test("erfc(M_SQRT1_2)", lm.erfc(lm.M_SQRT1_2))
+test("exp(M_PI_4)", lm.exp(l

CVS commit: src/tests/lib/lua/libm

2022-11-22 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Nov 22 15:57:03 UTC 2022

Modified Files:
src/tests/lib/lua/libm: h_lualibm.c lualibm.lua

Log Message:
Sync style between Lua script and C source code.
Fix false positive for some tests.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/lua/libm/h_lualibm.c \
src/tests/lib/lua/libm/lualibm.lua

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



CVS commit: src/lib/lua/libm

2022-11-22 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Nov 22 15:41:05 UTC 2022

Modified Files:
src/lib/lua/libm: Makefile

Log Message:
Correct path for libm.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/lua/libm/Makefile

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

Modified files:

Index: src/lib/lua/libm/Makefile
diff -u src/lib/lua/libm/Makefile:1.1 src/lib/lua/libm/Makefile:1.2
--- src/lib/lua/libm/Makefile:1.1	Mon Nov 21 22:01:33 2022
+++ src/lib/lua/libm/Makefile	Tue Nov 22 15:41:04 2022
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.1 2022/11/21 22:01:33 christos Exp $
+# $NetBSD: Makefile,v 1.2 2022/11/22 15:41:04 rin Exp $
 
 LUA_MODULES = libm
 LUA_SRCS.libm   = libm.c
-LUA_DPLIBS += m /usr/lib
+LUA_DPLIBS += m ${.CURDIR}/../../libm
 
 .include 



CVS commit: src/lib/lua/libm

2022-11-22 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Nov 22 15:41:05 UTC 2022

Modified Files:
src/lib/lua/libm: Makefile

Log Message:
Correct path for libm.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/lua/libm/Makefile

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



CVS commit: src/sys/dev/pci

2022-11-22 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 22 14:55:53 UTC 2022

Modified Files:
src/sys/dev/pci: pcidevs.h pcidevs_data.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.1451 -r1.1452 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1450 -r1.1451 src/sys/dev/pci/pcidevs_data.h

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



CVS commit: src/sys/dev/pci

2022-11-22 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 22 14:55:28 UTC 2022

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Add some Xeon Scalable devices from OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.1470 -r1.1471 src/sys/dev/pci/pcidevs

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

Modified files:

Index: src/sys/dev/pci/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1470 src/sys/dev/pci/pcidevs:1.1471
--- src/sys/dev/pci/pcidevs:1.1470	Wed Oct 26 14:50:26 2022
+++ src/sys/dev/pci/pcidevs	Tue Nov 22 14:55:28 2022
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1470 2022/10/26 14:50:26 msaitoh Exp $
+$NetBSD: pcidevs,v 1.1471 2022/11/22 14:55:28 msaitoh Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -4599,17 +4599,23 @@ product INTEL XEONSC_UBOX_0	0x2014	Xeon 
 product INTEL XEONSC_UBOX_1	0x2015	Xeon Scalable Ubox
 product INTEL XEONSC_UBOX_2	0x2016	Xeon Scalable Ubox
 product INTEL XEONSC_M2PCIR	0x2018	Xeon Scalable M2PCI
+product INTEL XEONSC_HB		0x2020	Xeon Scalable Host
 product INTEL XEONSC_CBDMAR	0x2021	Xeon Scalable CBDMA
 product INTEL XEONSC_MMVTD	0x2024	Xeon Scalable MM/Vt-d
 product INTEL XEONSC_RAS	0x2025	Xeon Scalable RAS
 product INTEL XEONSC_IOAPIC	0x2026	Xeon Scalable I/O APIC
+product INTEL XEONSC_PCIE_1	0x2030	Xeon Scalable PCIe
+product INTEL XEONSC_PCIE_2	0x2031	Xeon Scalable PCIe
+product INTEL XEONSC_PCIE_3	0x2032	Xeon Scalable PCIe
+product INTEL XEONSC_PCIE_4	0x2033	Xeon Scalable PCIe
 product INTEL XEONSC_VTD	0x2034	Xeon Scalable VT-d
 product INTEL XEONSC_RAS_CFG	0x2035	Xeon Scalable RAS Configuration
 product INTEL XEONSC_IOAPIC_C	0x2036	Xeon Scalable IOxAPIC
-product INTEL XEONSC_IMC_1	0x2041	Xeon Scalable IMC
-product INTEL XEONSC_IMC_2	0x2042	Xeon Scalable IMC
-product INTEL XEONSC_IMC_3	0x2043  Xeon Scalable IMC
-product INTEL XEONSC_IMC_4	0x2044  Xeon Scalable IMC
+product INTEL XEONSC_IMC_1	0x2040	Xeon Scalable IMC
+product INTEL XEONSC_IMC_2	0x2041	Xeon Scalable IMC
+product INTEL XEONSC_IMC_3	0x2042	Xeon Scalable IMC
+product INTEL XEONSC_IMC_4	0x2043  Xeon Scalable IMC
+product INTEL XEONSC_IMC_5	0x2044  Xeon Scalable IMC
 product INTEL XEONSC_LMC_1	0x2045  Xeon Scalable LM
 product INTEL XEONSC_LMSC_1	0x2046  Xeon Scalable LMS
 product INTEL XEONSC_LMDPC_1	0x2047  Xeon Scalable LMDP
@@ -4619,15 +4625,29 @@ product INTEL XEONSC_LMSC_2	0x204a	Xeon 
 product INTEL XEONSC_LMDPC_2	0x204b	Xeon Scalable LMDP
 product INTEL XEONSC_M3KTI_1	0x204c	Xeon Scalable M3KTI
 product INTEL XEONSC_M3KTI_2	0x204d	Xeon Scalable M3KTI
+product INTEL XEONSC_M3KTI_3	0x204e	Xeon Scalable M3KTI
 product INTEL XEONSC_CHA_1	0x2054	Xeon Scalable CHA
 product INTEL XEONSC_CHA_2	0x2055	Xeon Scalable CHA
 product INTEL XEONSC_CHA_3	0x2056	Xeon Scalable CHA
 product INTEL XEONSC_CHA_4	0x2057	Xeon Scalable CHA
 product INTEL XEONSC_KTI	0x2058	Xeon Scalable KTI
 product INTEL XEONSC_UPIR	0x2059	Xeon Scalable UPI
-product INTEL XEONSC_PCU_0	0x2080	Xeon Scalable PCU
-product	INTEL XEONSC_PCU_1	0x2081  Xeon Scalable PCU
-product INTEL XEONSC_PCU_2	0x2082	Xeon Scalable PCU
+product INTEL XEONSC_IMC	0x2066	Xeon Scalable IMC
+product INTEL XEONSC_DDRIO_1	0x2068	Xeon Scalable DDRIO
+product INTEL XEONSC_DDRIO_2	0x2069	Xeon Scalable DDRIO
+product INTEL XEONSC_DDRIO_3	0x206a	Xeon Scalable DDRIO
+product INTEL XEONSC_DDRIO_4	0x206b	Xeon Scalable DDRIO
+product INTEL XEONSC_DDRIO_5	0x206c	Xeon Scalable DDRIO
+product INTEL XEONSC_DDRIO_6	0x206d	Xeon Scalable DDRIO
+product INTEL XEONSC_DDRIO_7	0x206e	Xeon Scalable DDRIO
+product INTEL XEONSC_PCU_1	0x2080	Xeon Scalable PCU
+product	INTEL XEONSC_PCU_2	0x2081  Xeon Scalable PCU
+product INTEL XEONSC_PCU_3	0x2082	Xeon Scalable PCU
+product INTEL XEONSC_PCU_4	0x2083	Xeon Scalable PCU
+product INTEL XEONSC_PCU_5	0x2084	Xeon Scalable PCU
+product INTEL XEONSC_PCU_6	0x2085	Xeon Scalable PCU
+product INTEL XEONSC_PCU_7	0x2086	Xeon Scalable PCU
+product INTEL XEONSC_M2PCIE	0x2088	Xeon Scalable M2PCIe
 product INTEL XEONSC_CHA_5	0x208d	Xeon Scalable CHA
 product INTEL XEONSC_CHA_6	0x208e	Xeon Scalable CHA
 product INTEL BSW_HB		0x2280	Braswell Soc Transaction Router



CVS commit: src/sys/dev/pci

2022-11-22 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 22 14:55:28 UTC 2022

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Add some Xeon Scalable devices from OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.1470 -r1.1471 src/sys/dev/pci/pcidevs

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