CVS commit: src/sys/dev/pckbport

2017-08-15 Thread Ryo ONODERA
Module Name:src
Committed By:   ryoon
Date:   Tue Aug 15 22:23:09 UTC 2017

Modified Files:
src/sys/dev/pckbport: alps.c

Log Message:
Do not print ALPS related message when generic PS/2 case


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/pckbport/alps.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/pckbport/alps.c
diff -u src/sys/dev/pckbport/alps.c:1.1 src/sys/dev/pckbport/alps.c:1.2
--- src/sys/dev/pckbport/alps.c:1.1	Sun Aug 13 08:49:27 2017
+++ src/sys/dev/pckbport/alps.c	Tue Aug 15 22:23:09 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: alps.c,v 1.1 2017/08/13 08:49:27 christos Exp $ */
+/* $NetBSD: alps.c,v 1.2 2017/08/15 22:23:09 ryoon Exp $ */
 
 /*-
  * Copyright (c) 2017 Ryo ONODERA 
@@ -30,7 +30,7 @@
 #include "opt_pms.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: alps.c,v 1.1 2017/08/13 08:49:27 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: alps.c,v 1.2 2017/08/15 22:23:09 ryoon Exp $");
 
 #include 
 #include 
@@ -695,7 +695,7 @@ pms_alps_probe_init(void *opaque)
 	pckbport_flush(psc->sc_kbctag, psc->sc_kbcslot);
 
 	if ((res = pms_alps_e6sig(psc, e6sig)) != 0)
-		goto err;
+		return res; /* This is not ALPS device */
 
 	if ((res = pms_alps_e7sig(psc, e7sig)) != 0)
 		goto err;



CVS commit: src/sys/dev/pckbport

2017-08-15 Thread Ryo ONODERA
Module Name:src
Committed By:   ryoon
Date:   Tue Aug 15 22:23:09 UTC 2017

Modified Files:
src/sys/dev/pckbport: alps.c

Log Message:
Do not print ALPS related message when generic PS/2 case


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

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



CVS commit: src/usr.sbin/installboot

2017-08-15 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Aug 15 21:21:18 UTC 2017

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

Log Message:
Remove superfluous Tn macros.


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/usr.sbin/installboot/installboot.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/installboot/installboot.8
diff -u src/usr.sbin/installboot/installboot.8:1.94 src/usr.sbin/installboot/installboot.8:1.95
--- src/usr.sbin/installboot/installboot.8:1.94	Tue Aug 15 10:11:31 2017
+++ src/usr.sbin/installboot/installboot.8	Tue Aug 15 21:21:18 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: installboot.8,v 1.94 2017/08/15 10:11:31 mrg Exp $
+.\"	$NetBSD: installboot.8,v 1.95 2017/08/15 21:21:18 wiz Exp $
 .\"
 .\" Copyright (c) 2002-2017 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -238,7 +238,7 @@ Supported options are (with the machines
 .Sy [ alpha ]
 Recalculate and restore the Alpha checksum.
 This is the default for
-.Nx Ns Tn /alpha .
+.Nx Ns /alpha .
 .
 .It Sy append
 .Sy [ alpha ,
@@ -312,11 +312,11 @@ BIOS) will be used.
 .Sy pmax ,
 .Sy vax ]
 Recalculate and restore the Sun and
-.Nx Ns Tn /sparc
+.Nx Ns /sparc
 compatible checksum.
 .Em Note :
 The existing
-.Nx Ns Tn /sparc
+.Nx Ns /sparc
 disklabel should use no more than 4 partitions.
 .
 .It Sy timeout=
@@ -439,8 +439,7 @@ Installed into the bootstrap area of the
 .Nm .
 .
 .It Pa /usr/mdec/bootxx_fat16
-Primary bootstrap for
-.Tn MS-DOS
+Primary bootstrap for MS-DOS
 .Sy FAT16
 file systems.
 This differs from
@@ -493,8 +492,7 @@ file systems
 (the default LFS version).
 .
 .It Pa /usr/mdec/bootxx_msdos
-Primary bootstrap for
-.Tn MS-DOS
+Primary bootstrap for MS-DOS
 .Sy FAT
 file systems.
 .
@@ -527,16 +525,16 @@ is not found.
 .
 .El
 .
-.Ss Nx Ns Tn /evbmips files
+.Ss Nx Ns /evbmips files
 .
 The
-.Nx Ns Tn /evbmips
+.Nx Ns /evbmips
 bootstrap files currently only apply to the SBMIPS kernels for the
 SiByte/Broadcom BCM1250 and BCM1480 CPUs.
 .Bl -tag -width /usr/mdec/sbmips/bootxx_cd9660
 .
 .It Pa /usr/mdec/sbmips/boot
-.Nx Ns Tn /evbmips
+.Nx Ns /evbmips
 secondary bootstrap for
 .Sy FFSv1 ,
 .Sy FFSv2 ,
@@ -558,12 +556,12 @@ does not currently support evbmips direc
 .
 .El
 .
-.Ss Nx Ns Tn /hppa files
+.Ss Nx Ns /hppa files
 .
 .Bl -tag -width /usr/mdec/bootxx_ustarfs
 .
 .It Pa /usr/mdec/xxboot
-.Nx Ns Tn /hppa
+.Nx Ns /hppa
 primary bootstrap for
 .Sy FFSv1 ,
 .Sy FFSv2 ,
@@ -571,7 +569,7 @@ primary bootstrap for
 and
 .Sy LFSv2 .
 .It Pa /usr/mdec/cdboot
-.Nx Ns Tn /hppa
+.Nx Ns /hppa
 primary bootstrap for ISO 9660 file system.
 .It Pa /usr/mdec/sdboot
 Synonym for
@@ -579,50 +577,50 @@ Synonym for
 .
 .El
 .
-.Ss Nx Ns Tn /macppc files
+.Ss Nx Ns /macppc files
 .
 .Bl -tag -width /usr/mdec/bootxx_ustarfs
 .
 .It Pa /usr/mdec/bootxx
-.Nx Ns Tn /macppc
+.Nx Ns /macppc
 primary bootstrap.
 .
 .It Pa /usr/mdec/ofwboot
-.Nx Ns Tn /macppc
+.Nx Ns /macppc
 secondary bootstrap.
 .
 .It Pa /ofwboot
 Installed copy of
-.Nx Ns Tn /macppc
+.Nx Ns /macppc
 secondary bootstrap.
 .
 .El
 .
-.Ss Nx Ns Tn /next68k files
+.Ss Nx Ns /next68k files
 .
 .Bl -tag -width /usr/mdec/bootxx_ustarfs
 .
 .It Pa /usr/mdec/boot
-.Nx Ns Tn /next68k
+.Nx Ns /next68k
 bootstrap.
 .
 .El
 .
-.Ss Nx Ns Tn /sparc64 files
+.Ss Nx Ns /sparc64 files
 .
 .Bl -tag -width /usr/mdec/bootxx_ustarfs
 .
 .It Pa /usr/mdec/bootblk
-.Nx Ns Tn /sparc64
+.Nx Ns /sparc64
 primary bootstrap.
 .
 .It Pa /usr/mdec/ofwboot
-.Nx Ns Tn /sparc64
+.Nx Ns /sparc64
 secondary bootstrap.
 .
 .It Pa /ofwboot
 Installed copy of
-.Nx Ns Tn /sparc64
+.Nx Ns /sparc64
 secondary bootstrap.
 .
 .El
@@ -646,12 +644,12 @@ Remove the primary bootstrap from disk
 .Sq sd1 :
 .Dl Ic installboot -c /dev/rsd1c
 .
-.Ss Nx Ns Tn /amiga
+.Ss Nx Ns /amiga
 Modify the command line to change the default from "netbsd -ASn2" to
 "netbsd -S":
 .Dl Ic installboot -m amiga -o command="netbsd -S" /dev/rsd0a /usr/mdec/bootxx_ffs
 .
-.Ss Nx Ns Tn /ews4800mips
+.Ss Nx Ns /ews4800mips
 Install the System V Boot File System primary bootstrap on to disk
 .Sq sd0 ,
 with the secondary bootstrap
@@ -659,7 +657,7 @@ with the secondary bootstrap
 already present in the SysVBFS partition on the disk:
 .Dl Ic installboot /dev/rsd0c /usr/mdec/bootxx_bfs
 .
-.Ss Nx Ns Tn /i386 and Nx Ns Tn /amd64
+.Ss Nx Ns /i386 and Nx Ns /amd64
 Install new boot blocks on an existing
 .Sy FFSv2
 mounted root file system on
@@ -753,7 +751,7 @@ to make the device itself bootable.
 Switch the existing installed bootstrap to use a serial console without
 reinstalling or altering other options such as timeout.
 .Dl Ic installboot -e -o console=com0 /dev/rwd0a
-.Ss Nx Ns Tn /macppc
+.Ss Nx Ns /macppc
 Note the
 .Nm
 utility is only required for macppc machines with OpenFirmware version 2
@@ -766,7 +764,7 @@ Install the Berkeley Fast File System pr
 .Dl Ic installboot /dev/rwd0c /usr/mdec/bootxx 

CVS commit: src/usr.sbin/installboot

2017-08-15 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue Aug 15 21:21:18 UTC 2017

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

Log Message:
Remove superfluous Tn macros.


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/usr.sbin/installboot/installboot.8

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



CVS commit: [jdolecek-ncq] src/sys/dev/ic

2017-08-15 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Tue Aug 15 20:12:29 UTC 2017

Modified Files:
src/sys/dev/ic [jdolecek-ncq]: siisata.c

Log Message:
Use ata_queue_free() instead of free() to deallocate chp->ch_queue during 
detach.


To generate a diff of this commit:
cvs rdiff -u -r1.30.4.35 -r1.30.4.36 src/sys/dev/ic/siisata.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/ic/siisata.c
diff -u src/sys/dev/ic/siisata.c:1.30.4.35 src/sys/dev/ic/siisata.c:1.30.4.36
--- src/sys/dev/ic/siisata.c:1.30.4.35	Sat Aug 12 22:12:04 2017
+++ src/sys/dev/ic/siisata.c	Tue Aug 15 20:12:28 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: siisata.c,v 1.30.4.35 2017/08/12 22:12:04 jdolecek Exp $ */
+/* $NetBSD: siisata.c,v 1.30.4.36 2017/08/15 20:12:28 jakllsch Exp $ */
 
 /* from ahcisata_core.c */
 
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: siisata.c,v 1.30.4.35 2017/08/12 22:12:04 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: siisata.c,v 1.30.4.36 2017/08/15 20:12:28 jakllsch Exp $");
 
 #include 
 #include 
@@ -426,7 +426,8 @@ siisata_detach(struct siisata_softc *sc,
 		bus_dmamem_free(sc->sc_dmat,
 		>sch_prb_seg, schp->sch_prb_nseg);
 
-		free(chp->ch_queue, M_DEVBUF);
+		ata_queue_free(chp->ch_queue);
+		chp->ch_queue = NULL;
 		chp->atabus = NULL;
 
 		ata_channel_detach(chp);



CVS commit: [jdolecek-ncq] src/sys/dev/ic

2017-08-15 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Tue Aug 15 20:12:29 UTC 2017

Modified Files:
src/sys/dev/ic [jdolecek-ncq]: siisata.c

Log Message:
Use ata_queue_free() instead of free() to deallocate chp->ch_queue during 
detach.


To generate a diff of this commit:
cvs rdiff -u -r1.30.4.35 -r1.30.4.36 src/sys/dev/ic/siisata.c

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



Re: CVS commit: src/sys/arch/amd64/conf

2017-08-15 Thread Martin Husemann
On Tue, Aug 15, 2017 at 04:33:19PM +0200, Maxime Villard wrote:
> So we agree? Each compat should be independent.

Yes.

> It seems to me that
> re-implementing (copy-paste) a few functions for linux is a step towards
> direction, isn't it?

No, it isn't (but it MAY be ok for real trivial ones).

Untangling the maze, renaming the common functions and fixing the 
modularization for them is the way to go, IMO.

Martin


Re: CVS commit: src/sys/arch/amd64/conf

2017-08-15 Thread Maxime Villard

Le 15/08/2017 à 14:50, Martin Husemann a écrit :

On Tue, Aug 15, 2017 at 02:48:39PM +0200, Maxime Villard wrote:

Why is it a bad idea re-implement the few compat_xx functions used in
compat_linux? This would eliminate the dependency, and a single modload
would suffice.


Move them into a common module required by all current consumers.


This module already exists, and it's modules/compat. The problem, again,
is that this module will register new syscalls, while we only want the
functions to be available. And it's more than that: if dynamically loaded,
this module may conflict with the kernel, since several COMPAT_xx options
are enabled in GENERIC by default. So you get the same functions twice.

Maxime


Re: CVS commit: src/sys/arch/amd64/conf

2017-08-15 Thread Martin Husemann
On Tue, Aug 15, 2017 at 02:48:39PM +0200, Maxime Villard wrote:
> Why is it a bad idea re-implement the few compat_xx functions used in
> compat_linux? This would eliminate the dependency, and a single modload
> would suffice.

Move them into a common module required by all current consumers.

Martin


Re: CVS commit: src/sys/arch/amd64/conf

2017-08-15 Thread Maxime Villard

Le 04/08/2017 à 10:00, matthew green a écrit :

the setup comes from before modules and it allows code sharing
because the old 43 version matches other systems.  so there's
a single implementation of this code for a large number of
consumers, and the name of it describes where it comes from.
this is entirely as designed and desired.


Thinking about this again; this may have been desired, but it's clearly
a wrong design - and it also was with config(5), regardless of the modules.

The user finds himself in a situation where if he wants to use a linux
binary, he has to enable a whole bunch of unrelated compat options, just
because our compat_linux borrows one function here, and another there, etc.

While I agree that deduplicating code is a good thing in general, it
certainly is not when the subsystems that share the code are this distant,
and when these subsystems end up being less user-friendly.

Why is it a bad idea re-implement the few compat_xx functions used in
compat_linux? This would eliminate the dependency, and a single modload
would suffice.

Maxime


CVS commit: src/distrib/notes/amiga

2017-08-15 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Aug 15 12:15:10 UTC 2017

Modified Files:
src/distrib/notes/amiga: install

Log Message:
Mention the installer question for the boot command.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/distrib/notes/amiga/install

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

Modified files:

Index: src/distrib/notes/amiga/install
diff -u src/distrib/notes/amiga/install:1.35 src/distrib/notes/amiga/install:1.36
--- src/distrib/notes/amiga/install:1.35	Thu Apr 23 01:56:48 2009
+++ src/distrib/notes/amiga/install	Tue Aug 15 12:15:10 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: install,v 1.35 2009/04/23 01:56:48 snj Exp $
+.\"	$NetBSD: install,v 1.36 2017/08/15 12:15:10 mlelstv Exp $
 .\"
 .\" Copyright (c) 1999-2002 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -290,7 +290,7 @@ kern.tgz distribution set, this is an ol
 If you did install the kern.tgz kernel, you normally should answer "n".
 .Pp
 Finally, the installer asks you if you want to install the bootblock
-code on your root disk.
+code on your root disk and, if yes, what boot command it should execute.
 This is a matter of personal choice and can also be done from a running
 .Nx
 system.



CVS commit: src/distrib/notes/amiga

2017-08-15 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Aug 15 12:15:10 UTC 2017

Modified Files:
src/distrib/notes/amiga: install

Log Message:
Mention the installer question for the boot command.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/distrib/notes/amiga/install

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



CVS commit: src/distrib/amiga/miniroot

2017-08-15 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Aug 15 12:07:23 UTC 2017

Modified Files:
src/distrib/amiga/miniroot: install.md

Log Message:
Ask for the boot command. It's necessary for some hardware
configurations and also to enable a serial console in the installed
system.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/distrib/amiga/miniroot/install.md

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

Modified files:

Index: src/distrib/amiga/miniroot/install.md
diff -u src/distrib/amiga/miniroot/install.md:1.27 src/distrib/amiga/miniroot/install.md:1.28
--- src/distrib/amiga/miniroot/install.md:1.27	Sun May 24 22:59:18 2009
+++ src/distrib/amiga/miniroot/install.md	Tue Aug 15 12:07:23 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: install.md,v 1.27 2009/05/24 22:59:18 mlelstv Exp $
+#	$NetBSD: install.md,v 1.28 2017/08/15 12:07:23 mlelstv Exp $
 #
 #
 # Copyright (c) 1996,2006 The NetBSD Foundation, Inc.
@@ -90,8 +90,10 @@ md_installboot() {
 		getresp "y"
 		case "$resp" in
 			y*|Y*)
+echo -n "Boot command? [netbsd -ASn2] "
+getresp "netbsd -ASn2"
 echo "Installing boot block..."
-chroot /mnt /usr/sbin/installboot /dev/r${1}a /usr/mdec/bootxx_ffs
+chroot /mnt /usr/sbin/installboot -o command="$resp" /dev/r${1}a /usr/mdec/bootxx_ffs
 cp -p /mnt/usr/mdec/boot.amiga /mnt/
 ;;
 			*)



CVS commit: src/distrib/amiga/miniroot

2017-08-15 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Aug 15 12:07:23 UTC 2017

Modified Files:
src/distrib/amiga/miniroot: install.md

Log Message:
Ask for the boot command. It's necessary for some hardware
configurations and also to enable a serial console in the installed
system.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/distrib/amiga/miniroot/install.md

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



CVS commit: [jdolecek-ncq] src/sys/dev/ata

2017-08-15 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Tue Aug 15 11:21:32 UTC 2017

Modified Files:
src/sys/dev/ata [jdolecek-ncq]: ata.c

Log Message:
explicitly do not try to activate any further commands when running recovery
xfer; it was kind of implied since the code would not queue another non-NCQ
command when non-NCQ command is active, but this is better for readibility


To generate a diff of this commit:
cvs rdiff -u -r1.132.8.28 -r1.132.8.29 src/sys/dev/ata/ata.c

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



CVS commit: [jdolecek-ncq] src/sys/dev/ata

2017-08-15 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Tue Aug 15 11:21:32 UTC 2017

Modified Files:
src/sys/dev/ata [jdolecek-ncq]: ata.c

Log Message:
explicitly do not try to activate any further commands when running recovery
xfer; it was kind of implied since the code would not queue another non-NCQ
command when non-NCQ command is active, but this is better for readibility


To generate a diff of this commit:
cvs rdiff -u -r1.132.8.28 -r1.132.8.29 src/sys/dev/ata/ata.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/ata/ata.c
diff -u src/sys/dev/ata/ata.c:1.132.8.28 src/sys/dev/ata/ata.c:1.132.8.29
--- src/sys/dev/ata/ata.c:1.132.8.28	Sat Aug 12 22:31:50 2017
+++ src/sys/dev/ata/ata.c	Tue Aug 15 11:21:32 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ata.c,v 1.132.8.28 2017/08/12 22:31:50 jdolecek Exp $	*/
+/*	$NetBSD: ata.c,v 1.132.8.29 2017/08/15 11:21:32 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.132.8.28 2017/08/12 22:31:50 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.132.8.29 2017/08/15 11:21:32 jdolecek Exp $");
 
 #include "opt_ata.h"
 
@@ -1249,7 +1249,7 @@ atastart(struct ata_channel *chp)
 	struct atac_softc *atac = chp->ch_atac;
 	struct ata_queue *chq = chp->ch_queue;
 	struct ata_xfer *xfer, *axfer;
-	bool immediate;
+	bool recovery;
 
 #ifdef ATA_DEBUG
 	int spl1, spl2;
@@ -1276,10 +1276,10 @@ again:
 	if ((xfer = TAILQ_FIRST(>ch_queue->queue_xfer)) == NULL)
 		goto out;
 
-	immediate = ISSET(xfer->c_flags, C_RECOVERY);
+	recovery = ISSET(xfer->c_flags, C_RECOVERY);
 
 	/* is the queue frozen? */
-	if (__predict_false(!immediate && chq->queue_freeze > 0)) {
+	if (__predict_false(!recovery && chq->queue_freeze > 0)) {
 		if (chq->queue_flags & QF_IDLE_WAIT) {
 			chq->queue_flags &= ~QF_IDLE_WAIT;
 			wakeup(>queue_flags);
@@ -1298,7 +1298,7 @@ again:
 	 * Need only check first xfer.
 	 * XXX FIS-based switching - revisit
 	 */
-	if (!immediate && (axfer = TAILQ_FIRST(>ch_queue->active_xfers))) {
+	if (!recovery && (axfer = TAILQ_FIRST(>ch_queue->active_xfers))) {
 		if (!ISSET(xfer->c_flags, C_NCQ) ||
 		!ISSET(axfer->c_flags, C_NCQ) ||
 		xfer->c_drive != axfer->c_drive)
@@ -1344,8 +1344,8 @@ again:
 	 */
 	xfer->c_start(chp, xfer);
 
-	/* Queue more commands if possible */
-	if (chq->queue_active < chq->queue_openings)
+	/* Queue more commands if possible, but not during recovery */
+	if (!recovery && chq->queue_active < chq->queue_openings)
 		goto again;
 
 	return;



CVS commit: src/lib/libm

2017-08-15 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Aug 15 10:40:28 UTC 2017

Modified Files:
src/lib/libm: Makefile

Log Message:
rintl is required for archs that support long double.


To generate a diff of this commit:
cvs rdiff -u -r1.196 -r1.197 src/lib/libm/Makefile

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



CVS commit: src/lib/libm

2017-08-15 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Aug 15 10:40:28 UTC 2017

Modified Files:
src/lib/libm: Makefile

Log Message:
rintl is required for archs that support long double.


To generate a diff of this commit:
cvs rdiff -u -r1.196 -r1.197 src/lib/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/libm/Makefile
diff -u src/lib/libm/Makefile:1.196 src/lib/libm/Makefile:1.197
--- src/lib/libm/Makefile:1.196	Fri Aug 11 20:24:56 2017
+++ src/lib/libm/Makefile	Tue Aug 15 10:40:28 2017
@@ -1,4 +1,4 @@
-#  $NetBSD: Makefile,v 1.196 2017/08/11 20:24:56 he Exp $
+#  $NetBSD: Makefile,v 1.197 2017/08/15 10:40:28 mlelstv Exp $
 #
 #  @(#)Makefile 5.1beta 93/09/24
 #
@@ -193,6 +193,7 @@ COMMON_SRCS += fenv.c
 .if ${MKSOFTFLOAT} == "no"
 COMMON_SRCS += fenv.c
 .endif
+COMMON_SRCS+= s_nexttowardf.c s_rintl.c
 
 .elif (${LIBC_MACHINE_CPU} == "sh3")
 .PATH:	${.CURDIR}/arch/sh3



CVS commit: src/doc

2017-08-15 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Aug 15 10:27:59 UTC 2017

Modified Files:
src/doc: CHANGES

Log Message:
fix spelling in previous


To generate a diff of this commit:
cvs rdiff -u -r1.2303 -r1.2304 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.2303 src/doc/CHANGES:1.2304
--- src/doc/CHANGES:1.2303	Tue Aug 15 10:22:59 2017
+++ src/doc/CHANGES	Tue Aug 15 10:27:59 2017
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2303 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2304 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -47,4 +47,4 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 	lm(4): Add support for NCT5174D, NCT6775F, NCT6779D and NCT679[1235]D.
 		[msaitoh 20170711]
 	arm: Add support for NVIDIA Tegra X1 SoC. [jmcneill 20170720]
-	evmips: Merge sbmips port into ebmips. [mrg 20170815]
+	evbmips: Merge sbmips port into evbmips. [mrg 20170815]



CVS commit: src/doc

2017-08-15 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Aug 15 10:27:59 UTC 2017

Modified Files:
src/doc: CHANGES

Log Message:
fix spelling in previous


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

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



CVS commit: src/doc

2017-08-15 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Aug 15 10:22:59 UTC 2017

Modified Files:
src/doc: CHANGES

Log Message:
note sbmips -> evbmips


To generate a diff of this commit:
cvs rdiff -u -r1.2302 -r1.2303 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.2302 src/doc/CHANGES:1.2303
--- src/doc/CHANGES:1.2302	Sun Aug  6 08:11:38 2017
+++ src/doc/CHANGES	Tue Aug 15 10:22:59 2017
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2302 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2303 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -47,3 +47,4 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 	lm(4): Add support for NCT5174D, NCT6775F, NCT6779D and NCT679[1235]D.
 		[msaitoh 20170711]
 	arm: Add support for NVIDIA Tegra X1 SoC. [jmcneill 20170720]
+	evmips: Merge sbmips port into ebmips. [mrg 20170815]



CVS commit: src/doc

2017-08-15 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Aug 15 10:22:59 UTC 2017

Modified Files:
src/doc: CHANGES

Log Message:
note sbmips -> evbmips


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

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



CVS commit: src

2017-08-15 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Aug 15 10:11:31 UTC 2017

Modified Files:
src/etc/etc.evbmips: MAKEDEV.conf Makefile.inc
src/etc/mtree: Makefile
src/sys/arch/evbmips: Makefile
src/sys/arch/evbmips/stand/sbmips: Makefile.inc
src/usr.sbin/installboot: installboot.8
Added Files:
src/distrib/sets/lists/base: md.evbmips
src/etc/mtree: NetBSD.dist.evbmips
src/sys/arch/evbmips/stand: Makefile

Log Message:
merge the rest of sbmips into evbmips.  install the stand files in
/usr/mdec/sbmips/ and document them in installboot(8) even though
it isn't really ported yet.  also build the SBMIPS kernels.

unfortunately, sbmips has been broken since mips64 merge, but the
fix can happen in the evbmips version, which we might merge into
the older trees anyway.

XXX: releng can turn off sbmips* builds now for -current.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.3 src/distrib/sets/lists/base/md.evbmips
cvs rdiff -u -r1.7 -r1.8 src/etc/etc.evbmips/MAKEDEV.conf
cvs rdiff -u -r1.21 -r1.22 src/etc/etc.evbmips/Makefile.inc
cvs rdiff -u -r1.36 -r1.37 src/etc/mtree/Makefile
cvs rdiff -u -r0 -r1.1 src/etc/mtree/NetBSD.dist.evbmips
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbmips/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/arch/evbmips/stand/Makefile
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbmips/stand/sbmips/Makefile.inc
cvs rdiff -u -r1.93 -r1.94 src/usr.sbin/installboot/installboot.8

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

Modified files:

Index: src/etc/etc.evbmips/MAKEDEV.conf
diff -u src/etc/etc.evbmips/MAKEDEV.conf:1.7 src/etc/etc.evbmips/MAKEDEV.conf:1.8
--- src/etc/etc.evbmips/MAKEDEV.conf:1.7	Sat Dec 24 07:07:06 2016
+++ src/etc/etc.evbmips/MAKEDEV.conf	Tue Aug 15 10:11:31 2017
@@ -1,4 +1,21 @@
-# $NetBSD: MAKEDEV.conf,v 1.7 2016/12/24 07:07:06 mrg Exp $
+# $NetBSD: MAKEDEV.conf,v 1.8 2017/08/15 10:11:31 mrg Exp $
+
+# When creating a /dev file system on MFS, init makes a FS that leaves
+# only 890 (or so) inodes free.  Therefore the "init" case (used by
+# init for that purpose) must be a trimmed down list.
+init)
+	makedev std wd0 wd1 wd2 wd3 sd0 sd1 sd2 sd3 sd4
+	makedev tty00 tty01
+	makedev st0 st1 ch0 cd0 cd1 vnd0 vnd1
+	makedev bpf
+	makedev ccd0 md0 ch0 random
+	makedev cgd0 cgd1
+	makedev raid0
+	makedev ld0 ld1 ld2 ld3
+	makedev usbs
+	makedev ipty
+	makedev local
+	;;
 
 all_md)
 	makedev wscons sd0 sd1 sd2 sd3 sd4
@@ -7,7 +24,7 @@ all_md)
 	makedev ss0 ss1 uk0 uk1
 	makedev ld0 ld1 ld2 ld3
 	makedev tty00 tty01
-	makedev lpa0 lpt0 audio wd0 wd1 fd0 fd1
+	makedev lpa0 lpt0 audio wd0 wd1 wd2 wd3 fd0 fd1
 	makedev satlink0 speaker mlx0
 	makedev scsibus0 scsibus1 scsibus2 scsibus3
 	makedev ses0 ses1 ses2 ses3
@@ -17,12 +34,13 @@ all_md)
 	makedev pci0 pci1 pci2 pci3 pci4 pci5 pci6 pci7
 	makedev altq sysmon
 	makedev iic0 iic1 iic2 iic3 iic4
+	makedev kttcp
 	;;
 
 minimal)
 	makedev std
 	makedev sd0 sd1 sd2 sd3 opty st0 st1 ch0 cd0 cd1 ccd0 ccd1 md0
-	makedev wd0 wd1 fd0 fd1
+	makedev wd0 wd1 wd2 wd3 fd0 fd1
 	makedev flash0 flash1 flash2 flash3 flash4 flash5 flash6 flash7
 	makedev tty00 tty01 ttyE0 ttyE1 wsmouse0 wskbd0 ttyEcfg
 	;;

Index: src/etc/etc.evbmips/Makefile.inc
diff -u src/etc/etc.evbmips/Makefile.inc:1.21 src/etc/etc.evbmips/Makefile.inc:1.22
--- src/etc/etc.evbmips/Makefile.inc:1.21	Mon Sep  5 07:23:43 2016
+++ src/etc/etc.evbmips/Makefile.inc	Tue Aug 15 10:11:31 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.21 2016/09/05 07:23:43 skrll Exp $
+#	$NetBSD: Makefile.inc,v 1.22 2017/08/15 10:11:31 mrg Exp $
 #
 #	etc.evbmips/Makefile.inc -- evbmips-specific etc Makefile targets
 #
@@ -15,23 +15,25 @@ BUILD_KERNELS=		INSTALL_CI20 INSTALL_OMS
 
 KERNEL_SETS+=		P4032 P5064 P6032
 
-.elif ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el"
+. elif ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el"
 KERNEL_SETS=		MALTA32 MALTA64 XLSATX32 XLSATX64
 BUILD_KERNELS=		INSTALL_MALTA32 INSTALL_MALTA64
 BUILD_KERNELS+=		INSTALL_XLSATX32 INSTALL_XLSATX64
 
-.if ${MACHINE_ARCH} == "mips64el"
+. if ${MACHINE_ARCH} == "mips64el"
 KERNEL_SETS+=		P5064-64
 KERNEL_SETS+=		LOONGSON
 BUILD_KERNELS+=		INSTALL_LOONGSON
 KERNEL_SETS+=		GDIUM64
-.else
+. else
 KERNEL_SETS+=		ERLITE
 BUILD_KERNELS+=		INSTALL_ERLITE
-.endif
+. endif
 .else
 KERNEL_SETS=		ALCHEMY DB120 DBAU1500 DBAU1550 MALTA RB433UAH
 BUILD_KERNELS=		INSTALL_MALTA
 
 .endif
 
+# SBMIPS has a kernel for all targets
+KERNEL_SETS+=		SBMIPS${MACHINE_ARCH:S/mips//:C/e[lb]//}

Index: src/etc/mtree/Makefile
diff -u src/etc/mtree/Makefile:1.36 src/etc/mtree/Makefile:1.37
--- src/etc/mtree/Makefile:1.36	Tue Nov 15 22:31:07 2016
+++ src/etc/mtree/Makefile	Tue Aug 15 10:11:31 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.36 2016/11/15 22:31:07 matt Exp $
+#	$NetBSD: Makefile,v 1.37 2017/08/15 10:11:31 mrg Exp $
 
 .include 
 
@@ -21,6 +21,10 @@ EXTRA_DIST_FILES+=	

CVS commit: src

2017-08-15 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Aug 15 10:11:31 UTC 2017

Modified Files:
src/etc/etc.evbmips: MAKEDEV.conf Makefile.inc
src/etc/mtree: Makefile
src/sys/arch/evbmips: Makefile
src/sys/arch/evbmips/stand/sbmips: Makefile.inc
src/usr.sbin/installboot: installboot.8
Added Files:
src/distrib/sets/lists/base: md.evbmips
src/etc/mtree: NetBSD.dist.evbmips
src/sys/arch/evbmips/stand: Makefile

Log Message:
merge the rest of sbmips into evbmips.  install the stand files in
/usr/mdec/sbmips/ and document them in installboot(8) even though
it isn't really ported yet.  also build the SBMIPS kernels.

unfortunately, sbmips has been broken since mips64 merge, but the
fix can happen in the evbmips version, which we might merge into
the older trees anyway.

XXX: releng can turn off sbmips* builds now for -current.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.3 src/distrib/sets/lists/base/md.evbmips
cvs rdiff -u -r1.7 -r1.8 src/etc/etc.evbmips/MAKEDEV.conf
cvs rdiff -u -r1.21 -r1.22 src/etc/etc.evbmips/Makefile.inc
cvs rdiff -u -r1.36 -r1.37 src/etc/mtree/Makefile
cvs rdiff -u -r0 -r1.1 src/etc/mtree/NetBSD.dist.evbmips
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbmips/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/arch/evbmips/stand/Makefile
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbmips/stand/sbmips/Makefile.inc
cvs rdiff -u -r1.93 -r1.94 src/usr.sbin/installboot/installboot.8

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



CVS commit: src/sys/arch/amiga/amiga

2017-08-15 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Aug 15 09:52:49 UTC 2017

Modified Files:
src/sys/arch/amiga/amiga: disksubr.c

Log Message:
Fix check of AmigaDOS environment vector for nonstandard disklabel values.
Don't set a default fsize for CD9660 partitions, the CD9660 filesystem
interprets it as a session offset.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/arch/amiga/amiga/disksubr.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/amiga/amiga/disksubr.c
diff -u src/sys/arch/amiga/amiga/disksubr.c:1.67 src/sys/arch/amiga/amiga/disksubr.c:1.68
--- src/sys/arch/amiga/amiga/disksubr.c:1.67	Sun Mar 12 21:02:47 2017
+++ src/sys/arch/amiga/amiga/disksubr.c	Tue Aug 15 09:52:49 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: disksubr.c,v 1.67 2017/03/12 21:02:47 mlelstv Exp $	*/
+/*	$NetBSD: disksubr.c,v 1.68 2017/08/15 09:52:49 mlelstv Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.67 2017/03/12 21:02:47 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.68 2017/08/15 09:52:49 mlelstv Exp $");
 
 #include 
 #include 
@@ -464,10 +464,14 @@ readdisklabel(dev_t dev, void (*strat)(s
 adt.archtype = ADT_UNKNOWN;
 adt.fstype = FS_UNUSED;
 			}
-		} else if (pbp->e.tabsize > 22 && ISFSARCH_NETBSD(adt)) {
+		} else if (pbp->e.tabsize >= 22 && ISFSARCH_NETBSD(adt)) {
 			pp->p_fsize = pbp->e.fsize;
 			pp->p_frag = pbp->e.frag;
 			pp->p_cpg = pbp->e.cpg;
+		} else if (adt.fstype == FS_ISO9660) {
+			pp->p_fsize = 0;
+			pp->p_frag = 0;
+			pp->p_cpg = 0;
 		} else {
 			pp->p_fsize = 1024;
 			pp->p_frag = 8;



CVS commit: src/sys/arch/amiga/amiga

2017-08-15 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Aug 15 09:52:49 UTC 2017

Modified Files:
src/sys/arch/amiga/amiga: disksubr.c

Log Message:
Fix check of AmigaDOS environment vector for nonstandard disklabel values.
Don't set a default fsize for CD9660 partitions, the CD9660 filesystem
interprets it as a session offset.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/arch/amiga/amiga/disksubr.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/amiga/amiga

2017-08-15 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Tue Aug 15 09:51:43 UTC 2017

Modified Files:
src/sys/arch/amiga/amiga: machdep.c

Log Message:
Simplify. error is constant, so replace it by its value. NFCI


To generate a diff of this commit:
cvs rdiff -u -r1.247 -r1.248 src/sys/arch/amiga/amiga/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/amiga/amiga/machdep.c
diff -u src/sys/arch/amiga/amiga/machdep.c:1.247 src/sys/arch/amiga/amiga/machdep.c:1.248
--- src/sys/arch/amiga/amiga/machdep.c:1.247	Fri Dec 23 07:40:05 2016
+++ src/sys/arch/amiga/amiga/machdep.c	Tue Aug 15 09:51:43 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.247 2016/12/23 07:40:05 maya Exp $	*/
+/*	$NetBSD: machdep.c,v 1.248 2017/08/15 09:51:43 maya Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -50,7 +50,7 @@
 #include "empm.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.247 2016/12/23 07:40:05 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.248 2017/08/15 09:51:43 maya Exp $");
 
 #include 
 #include 
@@ -1181,17 +1181,14 @@ nmihand(struct frame frame)
 int
 cpu_exec_aout_makecmds(struct lwp *l, struct exec_package *epp)
 {
-	int error = ENOEXEC;
 #ifdef COMPAT_NOMID
 	struct exec *execp = epp->ep_hdr;
-#endif
 
-#ifdef COMPAT_NOMID
 	if (!((execp->a_midmag >> 16) & 0x0fff)
 	&& execp->a_midmag == ZMAGIC)
 		return(exec_aout_prep_zmagic(l, epp));
 #endif
-	return(error);
+	return ENOEXEC;
 }
 
 #ifdef MODULAR



CVS commit: src/sys/arch/amiga/amiga

2017-08-15 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Tue Aug 15 09:51:43 UTC 2017

Modified Files:
src/sys/arch/amiga/amiga: machdep.c

Log Message:
Simplify. error is constant, so replace it by its value. NFCI


To generate a diff of this commit:
cvs rdiff -u -r1.247 -r1.248 src/sys/arch/amiga/amiga/machdep.c

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



CVS commit: src/distrib/miniroot

2017-08-15 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Aug 15 09:49:38 UTC 2017

Modified Files:
src/distrib/miniroot: install.sub

Log Message:
Support installing from a CD9660 formatted disk partition.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/distrib/miniroot/install.sub

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

Modified files:

Index: src/distrib/miniroot/install.sub
diff -u src/distrib/miniroot/install.sub:1.45 src/distrib/miniroot/install.sub:1.46
--- src/distrib/miniroot/install.sub:1.45	Wed Apr 30 13:10:48 2008
+++ src/distrib/miniroot/install.sub	Tue Aug 15 09:49:38 2017
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: install.sub,v 1.45 2008/04/30 13:10:48 martin Exp $
+#	$NetBSD: install.sub,v 1.46 2017/08/15 09:49:38 mlelstv Exp $
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -1045,11 +1045,12 @@ mount_a_disk() {
 
 The following filesystem types are supported:
 	1) ffs
+	2) cd9660
 __mount_a_disk_2
 	_md_fstype=`md_native_fstype`
 	_md_fsopts=`md_native_fsopts`
 	if [ ! -z "$_md_fstype" ]; then
-		echo "	2) $_md_fstype"
+		echo "	3) $_md_fstype"
 	else
 		_md_fstype="_undefined_"
 	fi
@@ -1058,7 +1059,7 @@ __mount_a_disk_2
 		echo -n "Which filesystem type? [ffs] "
 		getresp "ffs"
 		case "$resp" in
-			ffs)
+			ffs|cd9660)
 _fstype=$resp
 _fsopts="ro"
 ;;



CVS commit: src/distrib/miniroot

2017-08-15 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Aug 15 09:49:38 UTC 2017

Modified Files:
src/distrib/miniroot: install.sub

Log Message:
Support installing from a CD9660 formatted disk partition.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/distrib/miniroot/install.sub

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



CVS commit: src/sys/arch/mac68k/mac68k

2017-08-15 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Tue Aug 15 09:26:56 UTC 2017

Modified Files:
src/sys/arch/mac68k/mac68k: machdep.c

Log Message:
Remove dead code. it isn't possible to do non-__ELF__ build


To generate a diff of this commit:
cvs rdiff -u -r1.350 -r1.351 src/sys/arch/mac68k/mac68k/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/mac68k/mac68k/machdep.c
diff -u src/sys/arch/mac68k/mac68k/machdep.c:1.350 src/sys/arch/mac68k/mac68k/machdep.c:1.351
--- src/sys/arch/mac68k/mac68k/machdep.c:1.350	Mon Apr  3 17:36:17 2017
+++ src/sys/arch/mac68k/mac68k/machdep.c	Tue Aug 15 09:26:56 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.350 2017/04/03 17:36:17 christos Exp $	*/
+/*	$NetBSD: machdep.c,v 1.351 2017/08/15 09:26:56 maya Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -74,7 +74,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.350 2017/04/03 17:36:17 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.351 2017/08/15 09:26:56 maya Exp $");
 
 #include "opt_adb.h"
 #include "opt_copy_symtab.h"
@@ -872,12 +872,10 @@ getenvvars(u_long flag, char *buf)
 	extern long macos_gmtbias;
 	int root_scsi_id;
 	u_long root_ata_dev;
-#ifdef	__ELF__
 	int i;
 	Elf_Ehdr *ehdr;
 	Elf_Shdr *shp;
 	vaddr_t minsym;
-#endif
 
 	/*
 	 * If flag & 0x8000 == 0, then we're booting with the old booter
@@ -990,7 +988,6 @@ getenvvars(u_long flag, char *buf)
  	ADBReInit_JTBL = getenv("ADBREINIT_JTBL");
  	mrg_ADBIntrPtr = (void *)getenv("ADBINTERRUPT");
 
-#ifdef	__ELF__
 	/*
 	 * Check the ELF headers.
 	 */
@@ -1017,10 +1014,6 @@ getenvvars(u_long flag, char *buf)
 
 	symsize = 1;
 	ssym = (int *)ehdr;
-#else
-	symsize = *(int *)
-	ssym = ((int *)) + 1;
-#endif
 }
 
 static long



CVS commit: src/sys/arch/mac68k/mac68k

2017-08-15 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Tue Aug 15 09:26:56 UTC 2017

Modified Files:
src/sys/arch/mac68k/mac68k: machdep.c

Log Message:
Remove dead code. it isn't possible to do non-__ELF__ build


To generate a diff of this commit:
cvs rdiff -u -r1.350 -r1.351 src/sys/arch/mac68k/mac68k/machdep.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

2017-08-15 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug 15 09:25:00 UTC 2017

Modified Files:
src/sys/arch/amd64/amd64: rbus_machdep.c
src/sys/arch/i386/i386: rbus_machdep.c

Log Message:
Reduce the diff between amd64 and i386, and style.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/amd64/amd64/rbus_machdep.c
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/i386/i386/rbus_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/amd64/amd64/rbus_machdep.c
diff -u src/sys/arch/amd64/amd64/rbus_machdep.c:1.6 src/sys/arch/amd64/amd64/rbus_machdep.c:1.7
--- src/sys/arch/amd64/amd64/rbus_machdep.c:1.6	Sun Jun 29 23:21:28 2014
+++ src/sys/arch/amd64/amd64/rbus_machdep.c	Tue Aug 15 09:25:00 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: rbus_machdep.c,v 1.6 2014/06/29 23:21:28 jakllsch Exp $	*/
+/*	$NetBSD: rbus_machdep.c,v 1.7 2017/08/15 09:25:00 maxv Exp $	*/
 
 /*
  * Copyright (c) 1999
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rbus_machdep.c,v 1.6 2014/06/29 23:21:28 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rbus_machdep.c,v 1.7 2017/08/15 09:25:00 maxv Exp $");
 
 #include "opt_pcifixup.h"
 
@@ -123,7 +123,7 @@ rbus_pccbb_parent_io(struct pci_attach_a
 
 	ret = rbus_new_root_share(pa->pa_iot, ex, start, size, 0);
 	if (ret == NULL)
-	  panic("failed to alloc I/O space");
+		panic("failed to alloc I/O space");
 
 	return ret;
 }

Index: src/sys/arch/i386/i386/rbus_machdep.c
diff -u src/sys/arch/i386/i386/rbus_machdep.c:1.26 src/sys/arch/i386/i386/rbus_machdep.c:1.27
--- src/sys/arch/i386/i386/rbus_machdep.c:1.26	Fri Jul  1 18:14:15 2011
+++ src/sys/arch/i386/i386/rbus_machdep.c	Tue Aug 15 09:25:00 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: rbus_machdep.c,v 1.26 2011/07/01 18:14:15 dyoung Exp $	*/
+/*	$NetBSD: rbus_machdep.c,v 1.27 2017/08/15 09:25:00 maxv Exp $	*/
 
 /*
  * Copyright (c) 1999
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rbus_machdep.c,v 1.26 2011/07/01 18:14:15 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rbus_machdep.c,v 1.27 2017/08/15 09:25:00 maxv Exp $");
 
 #include "opt_pcibios.h"
 #include "opt_pcifixup.h"
@@ -35,8 +35,6 @@ __KERNEL_RCSID(0, "$NetBSD: rbus_machdep
 #include 
 #include 
 
-#include 
-
 #include 
 
 #include 
@@ -88,7 +86,7 @@ rbus_min_start_hint(psize_t ram)
 	aprint_debug("rbus: rbus_min_start from config at %#0" PRIxPADDR "\n",
 	rbus_min_start);
 #else
-if (ram <= 192*1024*1024UL) {
+	if (ram <= 192*1024*1024UL) {
 		/*
 		 * <= 192 MB, so try 0.5 GB.  This will work on
 		 * Thinkpad 600E (2645-4AU), which fails at 1GB, and
@@ -114,7 +112,7 @@ rbus_min_start_hint(psize_t ram)
 	}
 
 	aprint_debug("rbus: rbus_min_start set to %#0" PRIxPADDR "\n",
-	   rbus_min_start);
+	rbus_min_start);
 #endif
 }
 
@@ -151,11 +149,11 @@ rbus_pccbb_parent_mem(struct pci_attach_
 	 * which is not recognised by the kernel as already reserved.
 	 */
 
-	if (start < rbus_min_start) 
+	if (start < rbus_min_start)
 		start = rbus_min_start;
 
 	size = ex->ex_end - start;
-  
+
 	return rbus_new_root_share(pa->pa_memt, ex, start, size, 0);
 }
 
@@ -182,7 +180,7 @@ rbus_pccbb_parent_io(struct pci_attach_a
 
 	ret = rbus_new_root_share(pa->pa_iot, ex, start, size, 0);
 	if (ret == NULL)
-	  panic("failed to alloc I/O space");
+		panic("failed to alloc I/O space");
 
 	return ret;
 }



CVS commit: src/sys/arch

2017-08-15 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug 15 09:25:00 UTC 2017

Modified Files:
src/sys/arch/amd64/amd64: rbus_machdep.c
src/sys/arch/i386/i386: rbus_machdep.c

Log Message:
Reduce the diff between amd64 and i386, and style.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/amd64/amd64/rbus_machdep.c
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/i386/i386/rbus_machdep.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

2017-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 15 09:21:48 UTC 2017

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

Log Message:
add some more getsockopt(2) params


To generate a diff of this commit:
cvs rdiff -u -r1.215 -r1.216 src/sys/netinet/tcp_usrreq.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

2017-08-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 15 09:21:48 UTC 2017

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

Log Message:
add some more getsockopt(2) params


To generate a diff of this commit:
cvs rdiff -u -r1.215 -r1.216 src/sys/netinet/tcp_usrreq.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/tcp_usrreq.c
diff -u src/sys/netinet/tcp_usrreq.c:1.215 src/sys/netinet/tcp_usrreq.c:1.216
--- src/sys/netinet/tcp_usrreq.c:1.215	Fri Jul 28 15:16:41 2017
+++ src/sys/netinet/tcp_usrreq.c	Tue Aug 15 05:21:48 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: tcp_usrreq.c,v 1.215 2017/07/28 19:16:41 maxv Exp $	*/
+/*	$NetBSD: tcp_usrreq.c,v 1.216 2017/08/15 09:21:48 christos Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -99,7 +99,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tcp_usrreq.c,v 1.215 2017/07/28 19:16:41 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_usrreq.c,v 1.216 2017/08/15 09:21:48 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -464,17 +464,14 @@ tcp_ctloutput(int op, struct socket *so,
 #ifdef TCP_SIGNATURE
 		case TCP_MD5SIG:
 			optval = (tp->t_flags & TF_SIGNATURE) ? 1 : 0;
-			error = sockopt_set(sopt, , sizeof(optval));
-			break;
+			goto setval;
 #endif
 		case TCP_NODELAY:
 			optval = tp->t_flags & TF_NODELAY;
-			error = sockopt_set(sopt, , sizeof(optval));
-			break;
+			goto setval;
 		case TCP_MAXSEG:
 			optval = tp->t_peermss;
-			error = sockopt_set(sopt, , sizeof(optval));
-			break;
+			goto setval;
 		case TCP_INFO:
 			tcp_fill_info(tp, );
 			error = sockopt_set(sopt, , sizeof ti);
@@ -483,6 +480,19 @@ tcp_ctloutput(int op, struct socket *so,
 		case TCP_CONGCTL:
 			break;
 #endif
+		case TCP_KEEPIDLE:
+			optval = tp->t_keepidle;
+			goto setval;
+		case TCP_KEEPINTVL:
+			optval = tp->t_keepintvl;
+			goto setval;
+		case TCP_KEEPCNT:
+			optval = tp->t_keepcnt;
+			goto setval;
+		case TCP_KEEPINIT:
+			optval = tp->t_keepcnt;
+setval:			error = sockopt_set(sopt, , sizeof(optval));
+			break;
 		default:
 			error = ENOPROTOOPT;
 			break;



CVS commit: src/sys/arch

2017-08-15 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug 15 09:16:59 UTC 2017

Modified Files:
src/sys/arch/i386/i386: db_interface.c
src/sys/arch/xen/x86: xen_ipi.c

Log Message:
Remove unused arg, to have the same definition as amd64.


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/arch/i386/i386/db_interface.c
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/xen/x86/xen_ipi.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/i386/i386/db_interface.c
diff -u src/sys/arch/i386/i386/db_interface.c:1.73 src/sys/arch/i386/i386/db_interface.c:1.74
--- src/sys/arch/i386/i386/db_interface.c:1.73	Tue Aug 15 06:57:53 2017
+++ src/sys/arch/i386/i386/db_interface.c	Tue Aug 15 09:16:59 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_interface.c,v 1.73 2017/08/15 06:57:53 maxv Exp $	*/
+/*	$NetBSD: db_interface.c,v 1.74 2017/08/15 09:16:59 maxv Exp $	*/
 
 /*
  * Mach Operating System
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.73 2017/08/15 06:57:53 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.74 2017/08/15 09:16:59 maxv Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -87,7 +87,7 @@ const struct db_command db_machine_comma
 
 void kdbprinttrap(int, int);
 #ifdef MULTIPROCESSOR
-extern void ddb_ipi(int, struct trapframe);
+extern void ddb_ipi(struct trapframe);
 extern void ddb_ipi_tss(struct i386tss *);
 static void ddb_suspend(struct trapframe *);
 #ifndef XEN
@@ -299,7 +299,7 @@ cpu_Debugger(void)
  * that the effect is as if the arguments were passed call by reference.
  */
 void
-ddb_ipi(int cpl, struct trapframe frame)
+ddb_ipi(struct trapframe frame)
 {
 
 	ddb_suspend();

Index: src/sys/arch/xen/x86/xen_ipi.c
diff -u src/sys/arch/xen/x86/xen_ipi.c:1.21 src/sys/arch/xen/x86/xen_ipi.c:1.22
--- src/sys/arch/xen/x86/xen_ipi.c:1.21	Sat Aug 12 07:21:57 2017
+++ src/sys/arch/xen/x86/xen_ipi.c	Tue Aug 15 09:16:59 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: xen_ipi.c,v 1.21 2017/08/12 07:21:57 maxv Exp $ */
+/* $NetBSD: xen_ipi.c,v 1.22 2017/08/15 09:16:59 maxv Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -33,10 +33,10 @@
 
 /* 
  * Based on: x86/ipi.c
- * __KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.21 2017/08/12 07:21:57 maxv Exp $");
+ * __KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.22 2017/08/15 09:16:59 maxv Exp $");
  */
 
-__KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.21 2017/08/12 07:21:57 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.22 2017/08/15 09:16:59 maxv Exp $");
 
 #include 
 
@@ -59,11 +59,7 @@ __KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 
 #include 
 #include 
 
-#ifdef __x86_64__
 extern void ddb_ipi(struct trapframe);
-#else
-extern void ddb_ipi(int, struct trapframe);
-#endif /* __x86_64__ */
 
 static void xen_ipi_halt(struct cpu_info *, struct intrframe *);
 static void xen_ipi_synch_fpu(struct cpu_info *, struct intrframe *);
@@ -254,7 +250,7 @@ xen_ipi_ddb(struct cpu_info *ci, struct 
 	tf.tf_esp = intrf->if_esp;
 	tf.tf_ss = intrf->if_ss;
 
-	ddb_ipi(SEL_KPL, tf);
+	ddb_ipi(tf);
 #endif
 }
 



CVS commit: src/sys/arch

2017-08-15 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug 15 09:16:59 UTC 2017

Modified Files:
src/sys/arch/i386/i386: db_interface.c
src/sys/arch/xen/x86: xen_ipi.c

Log Message:
Remove unused arg, to have the same definition as amd64.


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/arch/i386/i386/db_interface.c
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/xen/x86/xen_ipi.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/ia64/include

2017-08-15 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Tue Aug 15 09:09:49 UTC 2017

Modified Files:
src/sys/arch/ia64/include: cdefs.h

Log Message:
Remove fallback definition for __ELF__.

Failing to define it would've been a toolchain bug, not to be worked
around with a simple redefinition. fortunately, it doesn't appear to happen


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/ia64/include/cdefs.h

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



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

2017-08-15 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Tue Aug 15 09:09:49 UTC 2017

Modified Files:
src/sys/arch/ia64/include: cdefs.h

Log Message:
Remove fallback definition for __ELF__.

Failing to define it would've been a toolchain bug, not to be worked
around with a simple redefinition. fortunately, it doesn't appear to happen


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/ia64/include/cdefs.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/ia64/include/cdefs.h
diff -u src/sys/arch/ia64/include/cdefs.h:1.3 src/sys/arch/ia64/include/cdefs.h:1.4
--- src/sys/arch/ia64/include/cdefs.h:1.3	Tue Mar 18 17:11:19 2014
+++ src/sys/arch/ia64/include/cdefs.h	Tue Aug 15 09:09:49 2017
@@ -1,13 +1,8 @@
-/*	$NetBSD: cdefs.h,v 1.3 2014/03/18 17:11:19 christos Exp $	*/
+/*	$NetBSD: cdefs.h,v 1.4 2017/08/15 09:09:49 maya Exp $	*/
 
 #ifndef	_MACHINE_CDEFS_H_
 #define	_MACHINE_CDEFS_H_
 
-/* We're elf only: inspected by sys/cdefs.h  */
-#ifndef __ELF__
-#define __ELF__
-#endif
-
 #define	__ALIGNBYTES		((size_t)15)
 
 #endif /* !_MACHINE_CDEFS_H_ */



CVS commit: src/sys/arch

2017-08-15 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug 15 09:08:39 UTC 2017

Modified Files:
src/sys/arch/amd64/amd64: db_interface.c vector.S
src/sys/arch/x86/x86: lapic.c

Log Message:
Rename intrddb -> intrddbipi, like i386.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/amd64/amd64/db_interface.c
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/amd64/amd64/vector.S
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/x86/x86/lapic.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/amd64/amd64/db_interface.c
diff -u src/sys/arch/amd64/amd64/db_interface.c:1.26 src/sys/arch/amd64/amd64/db_interface.c:1.27
--- src/sys/arch/amd64/amd64/db_interface.c:1.26	Tue Aug 15 06:57:53 2017
+++ src/sys/arch/amd64/amd64/db_interface.c	Tue Aug 15 09:08:39 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_interface.c,v 1.26 2017/08/15 06:57:53 maxv Exp $	*/
+/*	$NetBSD: db_interface.c,v 1.27 2017/08/15 09:08:39 maxv Exp $	*/
 
 /*
  * Mach Operating System
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.26 2017/08/15 06:57:53 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.27 2017/08/15 09:08:39 maxv Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -95,7 +95,7 @@ static bool ddb_mp_online;
 int ddb_cpu = NOCPU;
 
 typedef void (vector)(void);
-extern vector Xintrddb, Xx2apic_intrddb;
+extern vector Xintrddbipi, Xx2apic_intrddbipi;
 
 void
 db_machine_init(void)
@@ -103,10 +103,10 @@ db_machine_init(void)
 
 #ifdef MULTIPROCESSOR
 #ifndef XEN
-	vector *handler = 
+	vector *handler = 
 #if NLAPIC > 0
 	if (lapic_is_x2apic())
-		handler = _intrddb;
+		handler = _intrddbipi;
 #endif
 	ddb_vec = idt_vec_alloc(0xf0, 0xff);
 	setgate([ddb_vec], handler, 1, SDT_SYS386IGT, SEL_KPL,

Index: src/sys/arch/amd64/amd64/vector.S
diff -u src/sys/arch/amd64/amd64/vector.S:1.50 src/sys/arch/amd64/amd64/vector.S:1.51
--- src/sys/arch/amd64/amd64/vector.S:1.50	Sun Jul 16 14:02:48 2017
+++ src/sys/arch/amd64/amd64/vector.S	Tue Aug 15 09:08:39 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vector.S,v 1.50 2017/07/16 14:02:48 cherry Exp $	*/
+/*	$NetBSD: vector.S,v 1.51 2017/08/15 09:08:39 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2007, 2008 The NetBSD Foundation, Inc.
@@ -155,7 +155,7 @@ IDTVEC(resume_lapic_ipi)
 IDTVEC_END(resume_lapic_ipi)
 
 #if defined(DDB)
-IDTVEC(intrddb)
+IDTVEC(intrddbipi)
 1:
 	pushq	$0
 	pushq	$T_BPTFLT
@@ -169,9 +169,9 @@ IDTVEC(intrddb)
 	xorl	%eax,%eax
 	movq	%rax,%cr8
 	INTRFASTEXIT
-IDTVEC_END(intrddb)
+IDTVEC_END(intrddbipi)
 
-IDTVEC(x2apic_intrddb)
+IDTVEC(x2apic_intrddbipi)
 1:
 	pushq	$0
 	pushq	$T_BPTFLT
@@ -187,7 +187,7 @@ IDTVEC(x2apic_intrddb)
 	xorl	%eax,%eax
 	movq	%rax,%cr8
 	INTRFASTEXIT
-IDTVEC_END(x2apic_intrddb)
+IDTVEC_END(x2apic_intrddbipi)
 #endif /* DDB */
 #endif /* MULTIPROCESSOR */
 

Index: src/sys/arch/x86/x86/lapic.c
diff -u src/sys/arch/x86/x86/lapic.c:1.61 src/sys/arch/x86/x86/lapic.c:1.62
--- src/sys/arch/x86/x86/lapic.c:1.61	Fri Aug 11 06:18:29 2017
+++ src/sys/arch/x86/x86/lapic.c	Tue Aug 15 09:08:39 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: lapic.c,v 1.61 2017/08/11 06:18:29 maxv Exp $	*/
+/*	$NetBSD: lapic.c,v 1.62 2017/08/15 09:08:39 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2008 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: lapic.c,v 1.61 2017/08/11 06:18:29 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lapic.c,v 1.62 2017/08/15 09:08:39 maxv Exp $");
 
 #include "acpica.h"
 #include "ioapic.h"
@@ -80,7 +80,7 @@ __KERNEL_RCSID(0, "$NetBSD: lapic.c,v 1.
 #ifdef MULTIPROCESSOR
 #ifdef __x86_64__
 typedef void (vector)(void);
-extern vector Xx2apic_intrddb;
+extern vector Xx2apic_intrddbipi;
 extern int ddb_vec;
 #endif
 #endif
@@ -333,8 +333,8 @@ lapic_setup_bsp(paddr_t lapic_base)
 #endif
 #if defined(DDB) && defined(MULTIPROCESSOR)
 #ifdef __x86_64__
-		setgate([ddb_vec], _intrddb, 1, SDT_SYS386IGT, SEL_KPL,
-		GSEL(GCODE_SEL, SEL_KPL));
+		setgate([ddb_vec], _intrddbipi, 1, SDT_SYS386IGT,
+		SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
 #else
 		/* Set DDB IPI handler in cpu_set_tss_gates() when cpu0 is attached. */
 #endif



CVS commit: src/sys/arch

2017-08-15 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug 15 09:08:39 UTC 2017

Modified Files:
src/sys/arch/amd64/amd64: db_interface.c vector.S
src/sys/arch/x86/x86: lapic.c

Log Message:
Rename intrddb -> intrddbipi, like i386.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/amd64/amd64/db_interface.c
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/amd64/amd64/vector.S
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/x86/x86/lapic.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/x86

2017-08-15 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug 15 08:57:19 UTC 2017

Modified Files:
src/sys/arch/x86/x86: kgdb_machdep.c

Log Message:
style


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/x86/x86/kgdb_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/x86/kgdb_machdep.c
diff -u src/sys/arch/x86/x86/kgdb_machdep.c:1.1 src/sys/arch/x86/x86/kgdb_machdep.c:1.2
--- src/sys/arch/x86/x86/kgdb_machdep.c:1.1	Tue Aug 15 08:51:38 2017
+++ src/sys/arch/x86/x86/kgdb_machdep.c	Tue Aug 15 08:57:19 2017
@@ -1,7 +1,7 @@
-/*	$NetBSD: kgdb_machdep.c,v 1.1 2017/08/15 08:51:38 maxv Exp $	*/
+/*	$NetBSD: kgdb_machdep.c,v 1.2 2017/08/15 08:57:19 maxv Exp $	*/
 
-/*-
- * Copyright (c) 1997 The NetBSD Foundation, Inc.
+/*
+ * Copyright (c) 1997, 2017 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -56,7 +56,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kgdb_machdep.c,v 1.1 2017/08/15 08:51:38 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kgdb_machdep.c,v 1.2 2017/08/15 08:57:19 maxv Exp $");
 
 #include "opt_ddb.h"
 
@@ -92,14 +92,14 @@ kgdb_acc(vaddr_t va, size_t len)
 		else
 			pte = kvtopte(va);
 		if ((*pte & PG_V) == 0)
-			return (0);
+			return 0;
 		if (*pte & PG_PS)
 			va = (va & PG_LGFRAME) + NBPD_L2;
 		else
 			va += PAGE_SIZE;
 	} while (va < last_va);
 
-	return (1);
+	return 1;
 }
 
 void
@@ -118,25 +118,25 @@ kgdb_signal(int type)
 {
 	switch (type) {
 	case T_NMI:
-		return (SIGINT);
+		return SIGINT;
 
 	case T_ALIGNFLT:
-		return (SIGILL);
+		return SIGILL;
 
 	case T_BPTFLT:
 	case T_TRCTRAP:
-		return (SIGTRAP);
+		return SIGTRAP;
 
 	case T_ASTFLT:
 	case T_DOUBLEFLT:
-		return (SIGEMT);
+		return SIGEMT;
 
 	case T_ARITHTRAP:
 	case T_DIVIDE:
 	case T_OFLOW:
 	case T_DNA:
 	case T_FPOPFLT:
-		return (SIGFPE);
+		return SIGFPE;
 
 	case T_PRIVINFLT:
 	case T_PROTFLT:
@@ -144,13 +144,13 @@ kgdb_signal(int type)
 	case T_TSSFLT:
 	case T_SEGNPFLT:
 	case T_STKFLT:
-		return (SIGSEGV);
+		return SIGSEGV;
 
 	case T_BOUND:
-		return (SIGURG);
+		return SIGURG;
 
 	default:
-		return (SIGEMT);
+		return SIGEMT;
 	}
 }
 



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

2017-08-15 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug 15 08:57:19 UTC 2017

Modified Files:
src/sys/arch/x86/x86: kgdb_machdep.c

Log Message:
style


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/x86/x86/kgdb_machdep.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/cats/cats

2017-08-15 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Tue Aug 15 08:52:41 UTC 2017

Modified Files:
src/sys/arch/cats/cats: cats_machdep.c

Log Message:
remove unnecessary include. no aout code here!


To generate a diff of this commit:
cvs rdiff -u -r1.85 -r1.86 src/sys/arch/cats/cats/cats_machdep.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/cats/cats

2017-08-15 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Tue Aug 15 08:52:41 UTC 2017

Modified Files:
src/sys/arch/cats/cats: cats_machdep.c

Log Message:
remove unnecessary include. no aout code here!


To generate a diff of this commit:
cvs rdiff -u -r1.85 -r1.86 src/sys/arch/cats/cats/cats_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/cats/cats/cats_machdep.c
diff -u src/sys/arch/cats/cats/cats_machdep.c:1.85 src/sys/arch/cats/cats/cats_machdep.c:1.86
--- src/sys/arch/cats/cats/cats_machdep.c:1.85	Tue Aug 15 08:47:39 2017
+++ src/sys/arch/cats/cats/cats_machdep.c	Tue Aug 15 08:52:41 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: cats_machdep.c,v 1.85 2017/08/15 08:47:39 maya Exp $	*/
+/*	$NetBSD: cats_machdep.c,v 1.86 2017/08/15 08:52:41 maya Exp $	*/
 
 /*
  * Copyright (c) 1997,1998 Mark Brinicombe.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cats_machdep.c,v 1.85 2017/08/15 08:47:39 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cats_machdep.c,v 1.86 2017/08/15 08:52:41 maya Exp $");
 
 #include "opt_ddb.h"
 #include "opt_modular.h"
@@ -53,7 +53,6 @@ __KERNEL_RCSID(0, "$NetBSD: cats_machdep
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 



CVS commit: src/sys/arch

2017-08-15 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug 15 08:51:38 UTC 2017

Modified Files:
src/sys/arch/amd64/conf: files.amd64
src/sys/arch/i386/conf: files.i386
src/sys/arch/x86/conf: files.x86
src/sys/arch/xen/conf: files.xen
Added Files:
src/sys/arch/x86/x86: kgdb_machdep.c
Removed Files:
src/sys/arch/amd64/amd64: kgdb_machdep.c
src/sys/arch/i386/i386: kgdb_machdep.c

Log Message:
Merge into x86/.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r0 src/sys/arch/amd64/amd64/kgdb_machdep.c
cvs rdiff -u -r1.91 -r1.92 src/sys/arch/amd64/conf/files.amd64
cvs rdiff -u -r1.386 -r1.387 src/sys/arch/i386/conf/files.i386
cvs rdiff -u -r1.23 -r0 src/sys/arch/i386/i386/kgdb_machdep.c
cvs rdiff -u -r1.89 -r1.90 src/sys/arch/x86/conf/files.x86
cvs rdiff -u -r0 -r1.1 src/sys/arch/x86/x86/kgdb_machdep.c
cvs rdiff -u -r1.155 -r1.156 src/sys/arch/xen/conf/files.xen

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/amd64/conf/files.amd64
diff -u src/sys/arch/amd64/conf/files.amd64:1.91 src/sys/arch/amd64/conf/files.amd64:1.92
--- src/sys/arch/amd64/conf/files.amd64:1.91	Tue Aug 15 06:27:40 2017
+++ src/sys/arch/amd64/conf/files.amd64	Tue Aug 15 08:51:38 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: files.amd64,v 1.91 2017/08/15 06:27:40 maxv Exp $
+#	$NetBSD: files.amd64,v 1.92 2017/08/15 08:51:38 maxv Exp $
 #
 # new style config file for amd64 architecture
 #
@@ -43,7 +43,6 @@ file	arch/amd64/amd64/db_disasm.c		ddb
 file	arch/amd64/amd64/db_interface.c		ddb
 file	arch/amd64/amd64/db_machdep.c		ddb
 file	arch/amd64/amd64/kobj_machdep.c		modular
-file	arch/amd64/amd64/kgdb_machdep.c		kgdb
 file	kern/subr_disk_mbr.c			disk
 file	arch/amd64/amd64/gdt.c			machdep
 file	arch/amd64/amd64/machdep.c		machdep

Index: src/sys/arch/i386/conf/files.i386
diff -u src/sys/arch/i386/conf/files.i386:1.386 src/sys/arch/i386/conf/files.i386:1.387
--- src/sys/arch/i386/conf/files.i386:1.386	Tue Aug 15 06:27:40 2017
+++ src/sys/arch/i386/conf/files.i386	Tue Aug 15 08:51:38 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: files.i386,v 1.386 2017/08/15 06:27:40 maxv Exp $
+#	$NetBSD: files.i386,v 1.387 2017/08/15 08:51:38 maxv Exp $
 #
 # new style config file for i386 architecture
 #
@@ -65,7 +65,6 @@ file	kern/subr_spldebug.c		spldebug
 file	arch/i386/i386/gdt.c
 file	arch/i386/i386/i386func.S
 file	arch/i386/i386/ipkdb_glue.c	ipkdb
-file	arch/i386/i386/kgdb_machdep.c	kgdb
 file	arch/i386/i386/kobj_machdep.c	modular
 file	arch/i386/i386/machdep.c
 file 	arch/i386/i386/longrun.c

Index: src/sys/arch/x86/conf/files.x86
diff -u src/sys/arch/x86/conf/files.x86:1.89 src/sys/arch/x86/conf/files.x86:1.90
--- src/sys/arch/x86/conf/files.x86:1.89	Tue Aug 15 06:27:40 2017
+++ src/sys/arch/x86/conf/files.x86	Tue Aug 15 08:51:38 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: files.x86,v 1.89 2017/08/15 06:27:40 maxv Exp $
+#	$NetBSD: files.x86,v 1.90 2017/08/15 08:51:38 maxv Exp $
 
 # options for MP configuration through the MP spec
 defflag opt_mpbios.h MPBIOS MPVERBOSE MPDEBUG MPBIOS_SCANPCI
@@ -84,6 +84,7 @@ file	arch/x86/x86/genfb_machdep.c	machde
 file	arch/x86/x86/identcpu.c		machdep
 file	arch/x86/x86/i8259.c		machdep
 file	arch/x86/x86/intr.c		machdep
+file	arch/x86/x86/kgdb_machdep.c	kgdb
 file	arch/x86/x86/nmi.c		machdep
 file	arch/x86/x86/idt.c		machdep
 file	arch/x86/x86/ipi.c		machdep

Index: src/sys/arch/xen/conf/files.xen
diff -u src/sys/arch/xen/conf/files.xen:1.155 src/sys/arch/xen/conf/files.xen:1.156
--- src/sys/arch/xen/conf/files.xen:1.155	Tue Aug 15 06:27:39 2017
+++ src/sys/arch/xen/conf/files.xen	Tue Aug 15 08:51:38 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: files.xen,v 1.155 2017/08/15 06:27:39 maxv Exp $
+#	$NetBSD: files.xen,v 1.156 2017/08/15 08:51:38 maxv Exp $
 #	NetBSD: files.x86,v 1.10 2003/10/08 17:30:00 bouyer Exp 
 #	NetBSD: files.i386,v 1.254 2004/03/25 23:32:10 jmc Exp 
 
@@ -45,7 +45,6 @@ file	arch/i386/i386/db_machdep.c	ddb
 file	arch/i386/i386/dumpsys.c
 file	arch/i386/i386/gdt.c
 file	arch/i386/i386/ipkdb_glue.c	ipkdb
-file	arch/i386/i386/kgdb_machdep.c	kgdb
 file	arch/i386/i386/kobj_machdep.c	modular
 file	arch/i386/i386/machdep.c
 file	arch/i386/i386/longrun.c
@@ -67,7 +66,6 @@ file	arch/amd64/amd64/cpu_in_cksum.S		(i
 file	arch/amd64/amd64/db_disasm.c		ddb
 file	arch/amd64/amd64/db_interface.c		ddb
 file	arch/amd64/amd64/db_machdep.c		ddb
-file	arch/amd64/amd64/kgdb_machdep.c	 kgdb
 file	arch/amd64/amd64/kobj_machdep.c	 	modular
 file	arch/amd64/amd64/gdt.c
 file	arch/amd64/amd64/machdep.c
@@ -84,6 +82,7 @@ file	arch/x86/x86/db_trace.c		ddb
 file	arch/x86/x86/fpu.c
 file	arch/x86/x86/dbregs.c
 file	arch/xen/x86/hypervisor_machdep.c
+file	arch/x86/x86/kgdb_machdep.c	kgdb
 # file 	arch/x86/x86/mtrr_i686.c	mtrr
 file	arch/x86/x86/syscall.c
 file	arch/xen/x86/x86_xpmap.c

Added files:

Index: src/sys/arch/x86/x86/kgdb_machdep.c
diff -u /dev/null src/sys/arch/x86/x86/kgdb_machdep.c:1.1
--- 

CVS commit: src/sys/arch

2017-08-15 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug 15 08:51:38 UTC 2017

Modified Files:
src/sys/arch/amd64/conf: files.amd64
src/sys/arch/i386/conf: files.i386
src/sys/arch/x86/conf: files.x86
src/sys/arch/xen/conf: files.xen
Added Files:
src/sys/arch/x86/x86: kgdb_machdep.c
Removed Files:
src/sys/arch/amd64/amd64: kgdb_machdep.c
src/sys/arch/i386/i386: kgdb_machdep.c

Log Message:
Merge into x86/.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r0 src/sys/arch/amd64/amd64/kgdb_machdep.c
cvs rdiff -u -r1.91 -r1.92 src/sys/arch/amd64/conf/files.amd64
cvs rdiff -u -r1.386 -r1.387 src/sys/arch/i386/conf/files.i386
cvs rdiff -u -r1.23 -r0 src/sys/arch/i386/i386/kgdb_machdep.c
cvs rdiff -u -r1.89 -r1.90 src/sys/arch/x86/conf/files.x86
cvs rdiff -u -r0 -r1.1 src/sys/arch/x86/x86/kgdb_machdep.c
cvs rdiff -u -r1.155 -r1.156 src/sys/arch/xen/conf/files.xen

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



CVS commit: src/sys/arch/cats/cats

2017-08-15 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Tue Aug 15 08:47:39 UTC 2017

Modified Files:
src/sys/arch/cats/cats: cats_machdep.c

Log Message:
Remove dead code. it isn't possible to do non-__ELF__ builds


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 src/sys/arch/cats/cats/cats_machdep.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/cats/cats

2017-08-15 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Tue Aug 15 08:47:39 UTC 2017

Modified Files:
src/sys/arch/cats/cats: cats_machdep.c

Log Message:
Remove dead code. it isn't possible to do non-__ELF__ builds


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 src/sys/arch/cats/cats/cats_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/cats/cats/cats_machdep.c
diff -u src/sys/arch/cats/cats/cats_machdep.c:1.84 src/sys/arch/cats/cats/cats_machdep.c:1.85
--- src/sys/arch/cats/cats/cats_machdep.c:1.84	Tue Jun 13 15:24:05 2017
+++ src/sys/arch/cats/cats/cats_machdep.c	Tue Aug 15 08:47:39 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: cats_machdep.c,v 1.84 2017/06/13 15:24:05 skrll Exp $	*/
+/*	$NetBSD: cats_machdep.c,v 1.85 2017/08/15 08:47:39 maya Exp $	*/
 
 /*
  * Copyright (c) 1997,1998 Mark Brinicombe.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cats_machdep.c,v 1.84 2017/06/13 15:24:05 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cats_machdep.c,v 1.85 2017/08/15 08:47:39 maya Exp $");
 
 #include "opt_ddb.h"
 #include "opt_modular.h"
@@ -467,18 +467,6 @@ initarm(void *arm_bootargs)
 	fcomcndetach();
 #endif
 
-
-#if NKSYMS || defined(DDB) || defined(MODULAR)
-#ifndef __ELF__		/* XXX */
-	{
-		extern int end;
-		extern int *esym;
-
-		ksyms_addsyms_elf(*(int *), ((int *)) + 1, esym);
-	}
-#endif /* __ELF__ */
-#endif
-
 #ifdef DDB
 	db_machine_init();
 	if (boothowto & RB_KDB)



CVS commit: src/sys/arch/shark/shark

2017-08-15 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Tue Aug 15 08:39:11 UTC 2017

Modified Files:
src/sys/arch/shark/shark: shark_machdep.c

Log Message:
Remove dead code. it isn't possible to do non-__ELF__ builds


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/shark/shark/shark_machdep.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/shark/shark

2017-08-15 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Tue Aug 15 08:39:11 UTC 2017

Modified Files:
src/sys/arch/shark/shark: shark_machdep.c

Log Message:
Remove dead code. it isn't possible to do non-__ELF__ builds


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/shark/shark/shark_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/shark/shark/shark_machdep.c
diff -u src/sys/arch/shark/shark/shark_machdep.c:1.43 src/sys/arch/shark/shark/shark_machdep.c:1.44
--- src/sys/arch/shark/shark/shark_machdep.c:1.43	Fri Mar 10 00:13:08 2017
+++ src/sys/arch/shark/shark/shark_machdep.c	Tue Aug 15 08:39:11 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: shark_machdep.c,v 1.43 2017/03/10 00:13:08 macallan Exp $	*/
+/*	$NetBSD: shark_machdep.c,v 1.44 2017/08/15 08:39:11 maya Exp $	*/
 
 /*
  * Copyright 1997
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: shark_machdep.c,v 1.43 2017/03/10 00:13:08 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: shark_machdep.c,v 1.44 2017/08/15 08:39:11 maya Exp $");
 
 #include "opt_ddb.h"
 #include "opt_modular.h"
@@ -303,18 +303,6 @@ initarm(void *arg)
 	if (fiq_claim(_fiqhandler))
 		panic("Cannot claim FIQ vector.");
 
-#if NKSYMS || defined(DDB) || defined(MODULAR)
-#ifndef __ELF__
-	{
-		struct exec *kernexec = (struct exec *)KERNEL_TEXT_BASE;
-		extern int end;
-		extern char *esym;
-
-		ksyms_addsyms_elf(kernexec->a_syms, , esym);
-	}
-#endif /* __ELF__ */
-#endif /* NKSYMS || defined(DDB) || defined(MODULAR) */
-
 #ifdef DDB
 	db_machine_init();
 	if (boothowto & RB_KDB)



CVS commit: src/sys/arch

2017-08-15 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug 15 08:35:56 UTC 2017

Modified Files:
src/sys/arch/amd64/amd64: kgdb_machdep.c
src/sys/arch/i386/i386: kgdb_machdep.c

Log Message:
Reduce the diff between amd64 and i386. It also fixes a bug in amd64, where
large pages were not handled correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/amd64/amd64/kgdb_machdep.c
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/i386/i386/kgdb_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/amd64/amd64/kgdb_machdep.c
diff -u src/sys/arch/amd64/amd64/kgdb_machdep.c:1.10 src/sys/arch/amd64/amd64/kgdb_machdep.c:1.11
--- src/sys/arch/amd64/amd64/kgdb_machdep.c:1.10	Sun Nov 22 13:41:24 2015
+++ src/sys/arch/amd64/amd64/kgdb_machdep.c	Tue Aug 15 08:35:56 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: kgdb_machdep.c,v 1.10 2015/11/22 13:41:24 maxv Exp $	*/
+/*	$NetBSD: kgdb_machdep.c,v 1.11 2017/08/15 08:35:56 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -56,7 +56,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kgdb_machdep.c,v 1.10 2015/11/22 13:41:24 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kgdb_machdep.c,v 1.11 2017/08/15 08:35:56 maxv Exp $");
 
 #include "opt_ddb.h"
 
@@ -93,7 +93,10 @@ kgdb_acc(vaddr_t va, size_t len)
 			pte = kvtopte(va);
 		if ((*pte & PG_V) == 0)
 			return (0);
-		va += PAGE_SIZE;
+		if (*pte & PG_PS)
+			va = (va & PG_LGFRAME) + NBPD_L2;
+		else
+			va += PAGE_SIZE;
 	} while (va < last_va);
 
 	return (1);
@@ -217,7 +220,6 @@ kgdb_setregs(db_regs_t *regs, kgdb_reg_t
 void
 kgdb_connect(int verbose)
 {
-
 	if (kgdb_dev == NODEV)
 		return;
 

Index: src/sys/arch/i386/i386/kgdb_machdep.c
diff -u src/sys/arch/i386/i386/kgdb_machdep.c:1.22 src/sys/arch/i386/i386/kgdb_machdep.c:1.23
--- src/sys/arch/i386/i386/kgdb_machdep.c:1.22	Sun Apr  3 22:29:26 2011
+++ src/sys/arch/i386/i386/kgdb_machdep.c	Tue Aug 15 08:35:56 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: kgdb_machdep.c,v 1.22 2011/04/03 22:29:26 dyoung Exp $	*/
+/*	$NetBSD: kgdb_machdep.c,v 1.23 2017/08/15 08:35:56 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -56,7 +56,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kgdb_machdep.c,v 1.22 2011/04/03 22:29:26 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kgdb_machdep.c,v 1.23 2017/08/15 08:35:56 maxv Exp $");
 
 #include "opt_ddb.h"
 
@@ -70,10 +70,7 @@ __KERNEL_RCSID(0, "$NetBSD: kgdb_machdep
 #include 
 #include 
 
-#include 
-
 #include 
-#include 
 #include 
 
 /*
@@ -116,7 +113,7 @@ kgdb_entry_notice(int type, db_regs_t *r
  * Translate a trap number into a unix compatible signal value.
  * (gdb only understands unix signal numbers).
  */
-int 
+int
 kgdb_signal(int type)
 {
 	switch (type) {



CVS commit: src/sys/arch

2017-08-15 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug 15 08:35:56 UTC 2017

Modified Files:
src/sys/arch/amd64/amd64: kgdb_machdep.c
src/sys/arch/i386/i386: kgdb_machdep.c

Log Message:
Reduce the diff between amd64 and i386. It also fixes a bug in amd64, where
large pages were not handled correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/amd64/amd64/kgdb_machdep.c
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/i386/i386/kgdb_machdep.c

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



CVS commit: src/sys/dev

2017-08-15 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Tue Aug 15 08:30:21 UTC 2017

Modified Files:
src/sys/dev: audio.c

Log Message:
Clean up mix_write().


To generate a diff of this commit:
cvs rdiff -u -r1.398 -r1.399 src/sys/dev/audio.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/audio.c
diff -u src/sys/dev/audio.c:1.398 src/sys/dev/audio.c:1.399
--- src/sys/dev/audio.c:1.398	Tue Aug 15 08:28:21 2017
+++ src/sys/dev/audio.c	Tue Aug 15 08:30:21 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.398 2017/08/15 08:28:21 isaki Exp $	*/
+/*	$NetBSD: audio.c,v 1.399 2017/08/15 08:30:21 isaki Exp $	*/
 
 /*-
  * Copyright (c) 2016 Nathanial Sloss 
@@ -148,7 +148,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.398 2017/08/15 08:28:21 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.399 2017/08/15 08:30:21 isaki Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -5436,18 +5436,18 @@ mix_write(void *arg)
 	stream_fetcher_t *fetcher;
 	stream_fetcher_t null_fetcher;
 	int cc, cc1, cc2, blksize, error, used;
-	uint8_t *inp, *orig, *tocopy;
+	const uint8_t *orig;
+	uint8_t *tocopy;
 
 	vc = sc->sc_hwvc;
 	blksize = vc->sc_mpr.blksize;
-	cc = blksize;
 	error = 0;
 
 	if (audio_stream_get_used(vc->sc_pustream) > blksize)
 		goto done;
 
 	tocopy = vc->sc_pustream->inp;
-	orig = __UNCONST(sc->sc_pr.s.outp);
+	orig = sc->sc_pr.s.outp;
 	used = blksize;
 	while (used > 0) {
 		cc = used;
@@ -5469,9 +5469,8 @@ mix_write(void *arg)
 		used -= cc;
  	}
 
-	inp = vc->sc_pustream->inp;
 	vc->sc_pustream->inp = audio_stream_add_inp(vc->sc_pustream,
-	inp, blksize);
+	vc->sc_pustream->inp, blksize);
 
 	sc->sc_pr.s.outp = audio_stream_add_outp(>sc_pr.s,
 	sc->sc_pr.s.outp, blksize);



CVS commit: src/sys/dev

2017-08-15 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Tue Aug 15 08:30:21 UTC 2017

Modified Files:
src/sys/dev: audio.c

Log Message:
Clean up mix_write().


To generate a diff of this commit:
cvs rdiff -u -r1.398 -r1.399 src/sys/dev/audio.c

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



CVS commit: src/sys/dev

2017-08-15 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Tue Aug 15 08:28:21 UTC 2017

Modified Files:
src/sys/dev: audio.c

Log Message:
Avoid possibility of integer overflow (and clean up).
- On 32bit arch and type argument is int32_t, orig[m] * tomix[m] is
  calculated first with int32 (possibility of overflow here) and then
  cast to int64_t for assignment.
- bigger_type is sufficient for product and result.


To generate a diff of this commit:
cvs rdiff -u -r1.397 -r1.398 src/sys/dev/audio.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/audio.c
diff -u src/sys/dev/audio.c:1.397 src/sys/dev/audio.c:1.398
--- src/sys/dev/audio.c:1.397	Tue Aug 15 05:31:52 2017
+++ src/sys/dev/audio.c	Tue Aug 15 08:28:21 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.397 2017/08/15 05:31:52 isaki Exp $	*/
+/*	$NetBSD: audio.c,v 1.398 2017/08/15 08:28:21 isaki Exp $	*/
 
 /*-
  * Copyright (c) 2016 Nathanial Sloss 
@@ -148,7 +148,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.397 2017/08/15 05:31:52 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.398 2017/08/15 08:28:21 isaki Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -5515,8 +5515,8 @@ done:
 		  struct virtual_channel *vc)\
 	{\
 		int blksize, cc, cc1, cc2, m, resid;			\
-		int64_t product;	\
-		int64_t result;		\
+		bigger_type product;	\
+		bigger_type result;	\
 		type *orig, *tomix;	\
 	\
 		blksize = sc->sc_pr.blksize;\
@@ -5537,8 +5537,8 @@ done:
 			for (m = 0; m < (cc / (bits / NBBY)); m++) {	\
 tomix[m] = (bigger_type)tomix[m] *	\
 (bigger_type)(vc->sc_swvol) / 255;	\
-result = orig[m] + tomix[m];		\
-product = orig[m] * tomix[m];		\
+result = (bigger_type)orig[m] + tomix[m]; \
+product = (bigger_type)orig[m] * tomix[m]; \
 if (orig[m] > 0 && tomix[m] > 0)	\
 	result -= product / MAXVAL;	\
 else if (orig[m] < 0 && tomix[m] < 0)	\



CVS commit: src/sys/dev

2017-08-15 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Tue Aug 15 08:28:21 UTC 2017

Modified Files:
src/sys/dev: audio.c

Log Message:
Avoid possibility of integer overflow (and clean up).
- On 32bit arch and type argument is int32_t, orig[m] * tomix[m] is
  calculated first with int32 (possibility of overflow here) and then
  cast to int64_t for assignment.
- bigger_type is sufficient for product and result.


To generate a diff of this commit:
cvs rdiff -u -r1.397 -r1.398 src/sys/dev/audio.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

2017-08-15 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug 15 06:57:53 UTC 2017

Modified Files:
src/sys/arch/amd64/amd64: db_interface.c
src/sys/arch/i386/i386: db_interface.c

Log Message:
Reduce the diff between amd64 and i386.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/amd64/amd64/db_interface.c
cvs rdiff -u -r1.72 -r1.73 src/sys/arch/i386/i386/db_interface.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

2017-08-15 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug 15 06:57:53 UTC 2017

Modified Files:
src/sys/arch/amd64/amd64: db_interface.c
src/sys/arch/i386/i386: db_interface.c

Log Message:
Reduce the diff between amd64 and i386.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/amd64/amd64/db_interface.c
cvs rdiff -u -r1.72 -r1.73 src/sys/arch/i386/i386/db_interface.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/amd64/amd64/db_interface.c
diff -u src/sys/arch/amd64/amd64/db_interface.c:1.25 src/sys/arch/amd64/amd64/db_interface.c:1.26
--- src/sys/arch/amd64/amd64/db_interface.c:1.25	Tue May 23 08:54:38 2017
+++ src/sys/arch/amd64/amd64/db_interface.c	Tue Aug 15 06:57:53 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_interface.c,v 1.25 2017/05/23 08:54:38 nonaka Exp $	*/
+/*	$NetBSD: db_interface.c,v 1.26 2017/08/15 06:57:53 maxv Exp $	*/
 
 /*
  * Mach Operating System
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.25 2017/05/23 08:54:38 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.26 2017/08/15 06:57:53 maxv Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -66,9 +66,9 @@ __KERNEL_RCSID(0, "$NetBSD: db_interface
 extern const char *const trap_type[];
 extern int trap_types;
 
-int	db_active;
+int	db_active = 0;
 db_regs_t ddb_regs;	/* register state */
-db_regs_t *ddb_regp;
+db_regs_t *ddb_regp = NULL;
 
 void db_mach_cpu (db_expr_t, bool, db_expr_t, const char *);
 
@@ -77,7 +77,7 @@ const struct db_command db_machine_comma
 	{ DDB_ADD_CMD("cpu",	db_mach_cpu,	0,
 	  "switch to another cpu", "cpu-no", NULL) },
 #endif
-	{ DDB_ADD_CMD(NULL, NULL,  0,NULL,NULL,NULL) },
+	{ DDB_ADD_CMD(NULL, NULL, 0, NULL, NULL, NULL) },
 };
 
 void kdbprinttrap(int, int);
@@ -143,7 +143,6 @@ db_suspend_others(void)
 #else
 		x86_ipi(ddb_vec, LAPIC_DEST_ALLEXCL, LAPIC_DLMODE_FIXED);
 #endif /* XEN */
-
 	}
 	ddb_mp_online = x86_mp_online;
 	x86_mp_online = false;
@@ -201,7 +200,7 @@ kdb_trap(int type, int code, db_regs_t *
 	case -1:	/* keyboard interrupt */
 		break;
 	default:
-		if (!db_onpanic && db_recover==0)
+		if (!db_onpanic && db_recover == 0)
 			return (0);
 
 		kdbprinttrap(type, code);
@@ -235,10 +234,10 @@ kdb_trap(int type, int code, db_regs_t *
 	cnpollc(false);
 	db_active--;
 	splx(s);
-#ifdef MULTIPROCESSOR  
+#ifdef MULTIPROCESSOR
 	db_resume_others();
 	}
-#endif  
+#endif
 	ddb_regp = 
 
 	*regs = ddb_regs;

Index: src/sys/arch/i386/i386/db_interface.c
diff -u src/sys/arch/i386/i386/db_interface.c:1.72 src/sys/arch/i386/i386/db_interface.c:1.73
--- src/sys/arch/i386/i386/db_interface.c:1.72	Tue May 23 08:54:38 2017
+++ src/sys/arch/i386/i386/db_interface.c	Tue Aug 15 06:57:53 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_interface.c,v 1.72 2017/05/23 08:54:38 nonaka Exp $	*/
+/*	$NetBSD: db_interface.c,v 1.73 2017/08/15 06:57:53 maxv Exp $	*/
 
 /*
  * Mach Operating System
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.72 2017/05/23 08:54:38 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.73 2017/08/15 06:57:53 maxv Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -48,8 +48,6 @@ __KERNEL_RCSID(0, "$NetBSD: db_interface
 #include 
 #include 
 
-#include 
-
 #include 
 
 #include 
@@ -75,6 +73,7 @@ extern int trap_types;
 
 int	db_active = 0;
 db_regs_t ddb_regs;	/* register state */
+db_regs_t *ddb_regp = NULL;
 
 void db_mach_cpu (db_expr_t, bool, db_expr_t, const char *);
 
@@ -83,8 +82,7 @@ const struct db_command db_machine_comma
 	{ DDB_ADD_CMD("cpu",	db_mach_cpu,	0,
 	  "switch to another cpu", "cpu-no", NULL) },
 #endif
-		
-	{ DDB_ADD_CMD(NULL, NULL, 0,  NULL,NULL,NULL) },
+	{ DDB_ADD_CMD(NULL, NULL, 0, NULL, NULL, NULL) },
 };
 
 void kdbprinttrap(int, int);
@@ -98,9 +96,7 @@ int ddb_vec;
 static bool ddb_mp_online;
 #endif
 
-db_regs_t *ddb_regp = 0;
-
-#define NOCPU -1
+#define NOCPU	-1
 
 int ddb_cpu = NOCPU;
 
@@ -246,6 +242,7 @@ kdb_trap(int type, int code, db_regs_t *
 	ddb_regs.tf_fs &= 0x;
 	ddb_regs.tf_gs &= 0x;
 	ddb_regs.tf_ss &= 0x;
+
 	s = splhigh();
 	db_active++;
 	cnpollc(true);
@@ -356,6 +353,7 @@ ddb_suspend(struct trapframe *frame)
 	ci->ci_ddb_regs = 
 
 	atomic_or_32(>ci_flags, CPUF_PAUSE);
+
 	while (ci->ci_flags & CPUF_PAUSE)
 		;
 	ci->ci_ddb_regs = 0;
@@ -366,11 +364,7 @@ ddb_suspend(struct trapframe *frame)
 extern void cpu_debug_dump(void); /* XXX */
 
 void
-db_mach_cpu(
-	db_expr_t	addr,
-	bool		have_addr,
-	db_expr_t	count,
-	const char *	modif)
+db_mach_cpu(db_expr_t addr, bool have_addr, db_expr_t count, const char *modif)
 {
 	struct cpu_info *ci;
 	if (!have_addr) {
@@ -401,5 +395,4 @@ db_mach_cpu(
 	ddb_regp = ci->ci_ddb_regs;
 }
 
-
 #endif



CVS commit: src/sys/arch/i386/i386

2017-08-15 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug 15 06:39:37 UTC 2017

Modified Files:
src/sys/arch/i386/i386: db_machdep.c

Log Message:
Remove __ELF__ vestige.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/i386/i386/db_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/i386/i386/db_machdep.c
diff -u src/sys/arch/i386/i386/db_machdep.c:1.5 src/sys/arch/i386/i386/db_machdep.c:1.6
--- src/sys/arch/i386/i386/db_machdep.c:1.5	Sat Jan 11 17:11:50 2014
+++ src/sys/arch/i386/i386/db_machdep.c	Tue Aug 15 06:39:37 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_machdep.c,v 1.5 2014/01/11 17:11:50 christos Exp $	*/
+/*	$NetBSD: db_machdep.c,v 1.6 2017/08/15 06:39:37 maxv Exp $	*/
 
 /* 
  * Mach Operating System
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.5 2014/01/11 17:11:50 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.6 2017/08/15 06:39:37 maxv Exp $");
 
 #include 
 #include 
@@ -131,7 +131,6 @@ db_frame_info(long *frame, db_addr_t cal
 		 * locations rather than on trap, since some traps
 		 * (e.g., npxdna) don't go through trap()
 		 */
-#ifdef __ELF__
 		if (!strcmp(name, "trap_tss")) {
 			*is_trap = TRAP_TSS;
 			narg = 0;
@@ -158,34 +157,6 @@ db_frame_info(long *frame, db_addr_t cal
 narg = 0;
 			}
 		}
-#else
-		if (!strcmp(name, "_trap_tss")) {
-			*is_trap = TRAP_TSS;
-			narg = 0;
-		} else if (!strcmp(name, "_trap")) {
-			*is_trap = TRAP;
-			narg = 0;
-		} else if (!strcmp(name, "_syscall")) {
-			*is_trap = SYSCALL;
-			narg = 0;
-		} else if (name[0] == '_' && name[1] == 'X') {
-			if (!strncmp(name, "_Xintr", 6) ||
-			!strncmp(name, "_Xresume", 8) ||
-			!strncmp(name, "_Xstray", 7) ||
-			!strncmp(name, "_Xhold", 6) ||
-			!strncmp(name, "_Xrecurse", 9) ||
-			!strcmp(name, "_Xdoreti")) {
-*is_trap = INTERRUPT;
-narg = 0;
-			} else if (!strcmp(name, "_Xsoftintr")) {
-*is_trap = SOFTINTR;
-narg = 0;
-			} else if (!strncmp(name, "_Xtss_", 6)) {
-*is_trap = INTERRUPT_TSS;
-narg = 0;
-			}
-		}
-#endif /* __ELF__ */
 	}
 
 	if (offp != NULL)



CVS commit: src/sys/arch/i386/i386

2017-08-15 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug 15 06:39:37 UTC 2017

Modified Files:
src/sys/arch/i386/i386: db_machdep.c

Log Message:
Remove __ELF__ vestige.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/i386/i386/db_machdep.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/x86

2017-08-15 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug 15 06:37:50 UTC 2017

Modified Files:
src/sys/arch/x86/x86: bios32.c

Log Message:
style


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/x86/x86/bios32.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/x86/bios32.c
diff -u src/sys/arch/x86/x86/bios32.c:1.1 src/sys/arch/x86/x86/bios32.c:1.2
--- src/sys/arch/x86/x86/bios32.c:1.1	Tue Aug 15 06:27:40 2017
+++ src/sys/arch/x86/x86/bios32.c	Tue Aug 15 06:37:50 2017
@@ -1,6 +1,6 @@
-/*	$NetBSD: bios32.c,v 1.1 2017/08/15 06:27:40 maxv Exp $	*/
+/*	$NetBSD: bios32.c,v 1.2 2017/08/15 06:37:50 maxv Exp $	*/
 
-/*-
+/*
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
@@ -41,18 +41,18 @@
  *notice, this list of conditions and the following disclaimer.
  * 2. The name of the developer may NOT be used to endorse or promote products
  *derived from this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. 
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
  */
 
 /*
@@ -86,11 +86,11 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bios32.c,v 1.1 2017/08/15 06:27:40 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bios32.c,v 1.2 2017/08/15 06:37:50 maxv Exp $");
 
 #include 
 #include 
-#include  
+#include 
 
 #include 
 #include 
@@ -192,6 +192,55 @@ bios32_init(void)
 	}
 }
 
+/*
+ * Call BIOS32 to locate the specified BIOS32 service, and fill
+ * in the entry point information.
+ */
+int
+bios32_service(uint32_t service, bios32_entry_t e, bios32_entry_info_t ei)
+{
+#ifdef i386
+	uint32_t eax, ebx, ecx, edx;
+	paddr_t entry;
+
+	if (bios32_entry.offset == 0)
+		return 0;	/* BIOS32 not present */
+
+	__asm volatile("lcall *(%%edi)"
+		: "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx)
+		: "0" (service), "1" (0), "D" (_entry));
+
+	if ((eax & 0xff) != 0)
+		return 0;	/* service not found */
+
+	entry = ebx + edx;
+
+	if (entry < BIOS32_START || entry >= BIOS32_END) {
+		aprint_error("BIOS32: entry point for service %c%c%c%c is "
+		"outside allowable range\n",
+		service & 0xff,
+		(service >> 8) & 0xff,
+		(service >> 16) & 0xff,
+		(service >> 24) & 0xff);
+		return 0;
+	}
+
+	e->offset = (void *)ISA_HOLE_VADDR(entry);
+	e->segment = GSEL(GCODE_SEL, SEL_KPL);
+
+	ei->bei_base = ebx;
+	ei->bei_size = ecx;
+	ei->bei_entry = entry;
+#else
+	(void)service;
+	(void)e;
+	(void)ei;
+	panic("bios32_service not implemented on amd64");
+#endif
+
+	return 1;
+}
+
 static int
 smbios2_check_header(const uint8_t *p)
 {
@@ -248,8 +297,7 @@ smbios2_map_kva(const uint8_t *p)
 	pmap_update(pmap_kernel());
 
 	aprint_debug("SMBIOS rev. %d.%d @ 0x%lx (%d entries)\n",
-		sh->majrev, sh->minrev, (u_long)sh->addr,
-		sh->count);
+	sh->majrev, sh->minrev, (u_long)sh->addr, sh->count);
 }
 
 static int
@@ -302,57 +350,8 @@ smbios3_map_kva(const uint8_t *p)
 #endif
 	pmap_update(pmap_kernel());
 
-	aprint_debug("SMBIOS rev. %d.%d.%d @ 0x%lx\n",
-		sh->majrev, sh->minrev, sh->docrev, (u_long)sh->addr);
-}
-
-/*
- * Call BIOS32 to locate the specified BIOS32 service, and fill
- * in the entry point information.
- */
-int
-bios32_service(uint32_t service, bios32_entry_t e, bios32_entry_info_t ei)
-{
-#ifdef i386
-	uint32_t eax, ebx, ecx, edx;
-	paddr_t entry;
-
-	if (bios32_entry.offset == 0)
-		return (0);	/* BIOS32 not 

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

2017-08-15 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug 15 06:37:50 UTC 2017

Modified Files:
src/sys/arch/x86/x86: bios32.c

Log Message:
style


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/x86/x86/bios32.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

2017-08-15 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug 15 06:27:40 UTC 2017

Modified Files:
src/sys/arch/amd64/conf: files.amd64
src/sys/arch/i386/conf: files.i386
src/sys/arch/x86/conf: files.x86
src/sys/arch/xen/conf: files.xen
Added Files:
src/sys/arch/x86/x86: bios32.c
Removed Files:
src/sys/arch/amd64/amd64: bios32.c
src/sys/arch/i386/i386: bios32.c

Log Message:
Merge into x86/.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r0 src/sys/arch/amd64/amd64/bios32.c
cvs rdiff -u -r1.90 -r1.91 src/sys/arch/amd64/conf/files.amd64
cvs rdiff -u -r1.385 -r1.386 src/sys/arch/i386/conf/files.i386
cvs rdiff -u -r1.32 -r0 src/sys/arch/i386/i386/bios32.c
cvs rdiff -u -r1.88 -r1.89 src/sys/arch/x86/conf/files.x86
cvs rdiff -u -r0 -r1.1 src/sys/arch/x86/x86/bios32.c
cvs rdiff -u -r1.154 -r1.155 src/sys/arch/xen/conf/files.xen

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



CVS commit: src/sys/arch

2017-08-15 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug 15 06:27:40 UTC 2017

Modified Files:
src/sys/arch/amd64/conf: files.amd64
src/sys/arch/i386/conf: files.i386
src/sys/arch/x86/conf: files.x86
src/sys/arch/xen/conf: files.xen
Added Files:
src/sys/arch/x86/x86: bios32.c
Removed Files:
src/sys/arch/amd64/amd64: bios32.c
src/sys/arch/i386/i386: bios32.c

Log Message:
Merge into x86/.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r0 src/sys/arch/amd64/amd64/bios32.c
cvs rdiff -u -r1.90 -r1.91 src/sys/arch/amd64/conf/files.amd64
cvs rdiff -u -r1.385 -r1.386 src/sys/arch/i386/conf/files.i386
cvs rdiff -u -r1.32 -r0 src/sys/arch/i386/i386/bios32.c
cvs rdiff -u -r1.88 -r1.89 src/sys/arch/x86/conf/files.x86
cvs rdiff -u -r0 -r1.1 src/sys/arch/x86/x86/bios32.c
cvs rdiff -u -r1.154 -r1.155 src/sys/arch/xen/conf/files.xen

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/amd64/conf/files.amd64
diff -u src/sys/arch/amd64/conf/files.amd64:1.90 src/sys/arch/amd64/conf/files.amd64:1.91
--- src/sys/arch/amd64/conf/files.amd64:1.90	Tue Aug  1 13:47:49 2017
+++ src/sys/arch/amd64/conf/files.amd64	Tue Aug 15 06:27:40 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: files.amd64,v 1.90 2017/08/01 13:47:49 maxv Exp $
+#	$NetBSD: files.amd64,v 1.91 2017/08/15 06:27:40 maxv Exp $
 #
 # new style config file for amd64 architecture
 #
@@ -84,10 +84,6 @@ file	dev/md_root.c			memory_disk_hooks
 
 include	"dev/i2o/files.i2o"
 
-# BIOS32 routines
-define	bios32
-file	arch/amd64/amd64/bios32.c		bios32 needs-flag
-
 #
 # System bus types
 #

Index: src/sys/arch/i386/conf/files.i386
diff -u src/sys/arch/i386/conf/files.i386:1.385 src/sys/arch/i386/conf/files.i386:1.386
--- src/sys/arch/i386/conf/files.i386:1.385	Sat Aug 12 06:46:13 2017
+++ src/sys/arch/i386/conf/files.i386	Tue Aug 15 06:27:40 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: files.i386,v 1.385 2017/08/12 06:46:13 maxv Exp $
+#	$NetBSD: files.i386,v 1.386 2017/08/15 06:27:40 maxv Exp $
 #
 # new style config file for i386 architecture
 #
@@ -117,10 +117,6 @@ include	"dev/i2o/files.i2o"
 define	bioscall
 file	arch/i386/i386/bioscall.S	bioscall needs-flag
 
-# BIOS32 routines
-define	bios32
-file	arch/i386/i386/bios32.c		bios32 needs-flag
-
 # i386 specific mainbus attributes
 define	apmbus {}
 define	pnpbiosbus {}

Index: src/sys/arch/x86/conf/files.x86
diff -u src/sys/arch/x86/conf/files.x86:1.88 src/sys/arch/x86/conf/files.x86:1.89
--- src/sys/arch/x86/conf/files.x86:1.88	Fri Mar 10 14:40:56 2017
+++ src/sys/arch/x86/conf/files.x86	Tue Aug 15 06:27:40 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: files.x86,v 1.88 2017/03/10 14:40:56 maxv Exp $
+#	$NetBSD: files.x86,v 1.89 2017/08/15 06:27:40 maxv Exp $
 
 # options for MP configuration through the MP spec
 defflag opt_mpbios.h MPBIOS MPVERBOSE MPDEBUG MPBIOS_SCANPCI
@@ -21,6 +21,10 @@ define	cpufeaturebus {}
 define  ioapicbus { [apid = -1] }
 define  ipmibus {}
 
+# BIOS32 routines
+define	bios32
+file	arch/x86/x86/bios32.c		bios32 needs-flag
+
 #
 # CPU features
 #

Index: src/sys/arch/xen/conf/files.xen
diff -u src/sys/arch/xen/conf/files.xen:1.154 src/sys/arch/xen/conf/files.xen:1.155
--- src/sys/arch/xen/conf/files.xen:1.154	Sat Aug 12 07:21:57 2017
+++ src/sys/arch/xen/conf/files.xen	Tue Aug 15 06:27:39 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: files.xen,v 1.154 2017/08/12 07:21:57 maxv Exp $
+#	$NetBSD: files.xen,v 1.155 2017/08/15 06:27:39 maxv Exp $
 #	NetBSD: files.x86,v 1.10 2003/10/08 17:30:00 bouyer Exp 
 #	NetBSD: files.i386,v 1.254 2004/03/25 23:32:10 jmc Exp 
 
@@ -152,11 +152,7 @@ include	"arch/xen/conf/files.compat"
 
 # BIOS32 routines
 define	bios32
-ifdef i386
-file	arch/i386/i386/bios32.c		bios32 needs-flag
-elifdef amd64
-file	arch/amd64/amd64/bios32.c	bios32 needs-flag
-endif
+file	arch/x86/x86/bios32.c		bios32 needs-flag
 
 # xen specific mainbus attributes
 define cpubus { [apid = -1] }

Added files:

Index: src/sys/arch/x86/x86/bios32.c
diff -u /dev/null src/sys/arch/x86/x86/bios32.c:1.1
--- /dev/null	Tue Aug 15 06:27:40 2017
+++ src/sys/arch/x86/x86/bios32.c	Tue Aug 15 06:27:40 2017
@@ -0,0 +1,440 @@
+/*	$NetBSD: bios32.c,v 1.1 2017/08/15 06:27:40 maxv Exp $	*/
+
+/*-
+ * Copyright (c) 1999 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
+ * NASA Ames Research Center.
+ *
+ * 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
+ *

CVS commit: src/sys/arch

2017-08-15 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug 15 06:04:28 UTC 2017

Modified Files:
src/sys/arch/amd64/amd64: bios32.c
src/sys/arch/i386/i386: bios32.c

Log Message:
Reduce the diff between i386 and amd64 (bios32_service not implemented
there).


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/amd64/amd64/bios32.c
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/i386/i386/bios32.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

2017-08-15 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Aug 15 06:04:28 UTC 2017

Modified Files:
src/sys/arch/amd64/amd64: bios32.c
src/sys/arch/i386/i386: bios32.c

Log Message:
Reduce the diff between i386 and amd64 (bios32_service not implemented
there).


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/amd64/amd64/bios32.c
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/i386/i386/bios32.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/amd64/amd64/bios32.c
diff -u src/sys/arch/amd64/amd64/bios32.c:1.22 src/sys/arch/amd64/amd64/bios32.c:1.23
--- src/sys/arch/amd64/amd64/bios32.c:1.22	Sat Mar 11 07:21:10 2017
+++ src/sys/arch/amd64/amd64/bios32.c	Tue Aug 15 06:04:28 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: bios32.c,v 1.22 2017/03/11 07:21:10 nonaka Exp $	*/
+/*	$NetBSD: bios32.c,v 1.23 2017/08/15 06:04:28 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bios32.c,v 1.22 2017/03/11 07:21:10 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bios32.c,v 1.23 2017/08/15 06:04:28 maxv Exp $");
 
 #include 
 #include 
@@ -99,12 +99,12 @@ bios32_init(void)
 {
 #if 0	/* XXXfvdl need to set up compatibility segment for this */
 	paddr_t entry = 0;
-	void *p;
+	uint8_t *p;
 	unsigned char cksum;
 	int i;
 
-	for (p = (void *)ISA_HOLE_VADDR(BIOS32_START);
-	 p < (void *)ISA_HOLE_VADDR(BIOS32_END);
+	for (p = (uint8_t *)ISA_HOLE_VADDR(BIOS32_START);
+	 p < (uint8_t *)ISA_HOLE_VADDR(BIOS32_END);
 	 p += 16) {
 		if (*(int *)p != BIOS32_MAKESIG('_', '3', '2', '_'))
 			continue;
@@ -120,7 +120,7 @@ bios32_init(void)
 
 		entry = *(uint32_t *)(p + 4);
 
-		aprint_verbose("BIOS32 rev. %d found at 0x%lx\n",
+		aprint_debug("BIOS32 rev. %d found at 0x%lx\n",
 		*(p + 8), entry);
 
 		if (entry < BIOS32_START ||
@@ -139,7 +139,7 @@ bios32_init(void)
 #endif
 	uint8_t *p;
 
-	/* see if we have SMBIOS extentions */
+	/* see if we have SMBIOS extensions */
 #ifndef XEN
 	if (efi_probe()) {
 		p = efi_getcfgtbl(_UUID_SMBIOS3);
@@ -261,7 +261,7 @@ smbios3_map_kva(const uint8_t *p)
 	if (eva == 0)
 		return;
 
-	smbios_entry.addr = (uint8_t *)(eva + (sh->addr & PGOFSET));
+	smbios_entry.addr = (uint8_t *)(eva + ((vaddr_t)sh->addr & PGOFSET));
 	smbios_entry.len = sh->size;
 	smbios_entry.rev = sh->eprev;
 	smbios_entry.mjr = sh->majrev;
@@ -288,38 +288,10 @@ smbios3_map_kva(const uint8_t *p)
 int
 bios32_service(uint32_t service, bios32_entry_t e, bios32_entry_info_t ei)
 {
-	uint32_t eax, ebx, ecx, edx;
-	paddr_t entry;
-
-	if (bios32_entry.offset == 0)
-		return (0);	/* BIOS32 not present */
-
-	__asm volatile("lcall *(%%rdi)"
-		: "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx)
-		: "0" (service), "1" (0), "D" (_entry));
-
-	if ((eax & 0xff) != 0)
-		return (0);	/* service not found */
-
-	entry = ebx + edx;
-
-	if (entry < BIOS32_START || entry >= BIOS32_END) {
-		aprint_error(
-		"bios32: entry point for service %c%c%c%c is outside "
-		"allowable range\n",
-		service & 0xff,
-		(service >> 8) & 0xff,
-		(service >> 16) & 0xff,
-		(service >> 24) & 0xff);
-		return (0);
-	}
-
-	e->offset = (void *)ISA_HOLE_VADDR(entry);
-	e->segment = GSEL(GCODE_SEL, SEL_KPL);
-
-	ei->bei_base = ebx;
-	ei->bei_size = ecx;
-	ei->bei_entry = entry;
+	(void)service;
+	(void)e;
+	(void)ei;
+	panic("bios32_service not implemented on amd64");
 
 	return (1);
 }

Index: src/sys/arch/i386/i386/bios32.c
diff -u src/sys/arch/i386/i386/bios32.c:1.31 src/sys/arch/i386/i386/bios32.c:1.32
--- src/sys/arch/i386/i386/bios32.c:1.31	Sat Mar 11 23:39:49 2017
+++ src/sys/arch/i386/i386/bios32.c	Tue Aug 15 06:04:28 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: bios32.c,v 1.31 2017/03/11 23:39:49 nonaka Exp $	*/
+/*	$NetBSD: bios32.c,v 1.32 2017/08/15 06:04:28 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -86,12 +86,11 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bios32.c,v 1.31 2017/03/11 23:39:49 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bios32.c,v 1.32 2017/08/15 06:04:28 maxv Exp $");
 
 #include 
 #include 
 #include  
-#include 
 
 #include 
 #include 
@@ -125,12 +124,12 @@ void
 bios32_init(void)
 {
 	paddr_t entry = 0;
-	char *p;
+	uint8_t *p;
 	unsigned char cksum;
 	int i;
 
-	for (p = (char *)ISA_HOLE_VADDR(BIOS32_START);
-	 p < (char *)ISA_HOLE_VADDR(BIOS32_END);
+	for (p = (uint8_t *)ISA_HOLE_VADDR(BIOS32_START);
+	 p < (uint8_t *)ISA_HOLE_VADDR(BIOS32_END);
 	 p += 16) {
 		if (*(int *)p != BIOS32_MAKESIG('_', '3', '2', '_'))
 			continue;
@@ -169,27 +168,26 @@ bios32_init(void)
 		p = efi_getcfgtbl(_UUID_SMBIOS3);
 		if (p != NULL && smbios3_check_header(p)) {
 			smbios3_map_kva(p);
-			goto out;
+			return;
 		}
 		p = efi_getcfgtbl(_UUID_SMBIOS);
 		if (p != NULL && smbios2_check_header(p)) {
 			smbios2_map_kva(p);
-			goto out;
+			return;
 		}
 	}