CVS commit: src/doc

2015-01-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Jan 11 09:54:44 UTC 2015

Modified Files:
src/doc: CHANGES

Log Message:
note GCC 4.8.4.


To generate a diff of this commit:
cvs rdiff -u -r1.2033 -r1.2034 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.2033 src/doc/CHANGES:1.2034
--- src/doc/CHANGES:1.2033	Tue Jan  6 17:48:45 2015
+++ src/doc/CHANGES	Sun Jan 11 09:54:44 2015
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2033 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2034 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -120,3 +120,4 @@ Changes from NetBSD 7.0 to NetBSD 8.0:
 	byacc: update to 20141128 for more bison compat [christos 20150103]
 	mgx: driver for Southland Media Systems (now Quantum 3D) MGX SBus
 		graphics devices [macallan 20150106]
+	gcc: Import GCC 4.8.4.  [mrg 20150109]



CVS commit: src/doc

2015-01-11 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Jan 11 10:00:53 UTC 2015

Modified Files:
src/doc: 3RDPARTY

Log Message:
update for reality.  we don't have GCC 4.1 anymore...


To generate a diff of this commit:
cvs rdiff -u -r1.1189 -r1.1190 src/doc/3RDPARTY

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1189 src/doc/3RDPARTY:1.1190
--- src/doc/3RDPARTY:1.1189	Sun Jan  4 01:52:24 2015
+++ src/doc/3RDPARTY	Sun Jan 11 10:00:53 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1189 2015/01/04 01:52:24 christos Exp $
+#	$NetBSD: 3RDPARTY,v 1.1190 2015/01/11 10:00:53 mrg Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -395,7 +395,7 @@ Notes:
 There is a flex2netbsd script to help newer imports.
 
 Package:	gcc
-Version:	4.1.3-20080831/4.5.4/4.8.3
+Version:	4.5.4/4.8.4
 Current Vers:	4.8.4/4.9.2
 Maintainer:	FSF
 Archive Site:	ftp://ftp.gnu.org/gnu/gcc/



CVS commit: [netbsd-7] src/sys/arch/macppc/stand/ofwboot

2015-01-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jan 11 13:02:41 UTC 2015

Modified Files:
src/sys/arch/macppc/stand/ofwboot [netbsd-7]: boot.h

Log Message:
Pull up following revision(s) (requested by chs in ticket #405):
sys/arch/macppc/stand/ofwboot/boot.h: revision 1.5
Force main into .text


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.14.1 src/sys/arch/macppc/stand/ofwboot/boot.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/macppc/stand/ofwboot/boot.h
diff -u src/sys/arch/macppc/stand/ofwboot/boot.h:1.4 src/sys/arch/macppc/stand/ofwboot/boot.h:1.4.14.1
--- src/sys/arch/macppc/stand/ofwboot/boot.h:1.4	Sun Feb 19 12:02:55 2012
+++ src/sys/arch/macppc/stand/ofwboot/boot.h	Sun Jan 11 13:02:41 2015
@@ -5,7 +5,7 @@
 
 typedef void (*boot_entry_t)(int, int, int (*)(void *), void *, u_int);
 
-void main(void);
+void main(void) __section(".text");
 
 #define MAXBOOTPATHLEN	256
 extern char bootdev[MAXBOOTPATHLEN];



CVS commit: [netbsd-7] src/sys/dev/pci

2015-01-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jan 11 13:05:13 UTC 2015

Modified Files:
src/sys/dev/pci [netbsd-7]: if_dge.c

Log Message:
Pull up following revision(s) (requested by chs in ticket #406):
sys/dev/pci/if_dge.c: revision 1.39
fix device/softc split botch.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.38.2.1 src/sys/dev/pci/if_dge.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/pci/if_dge.c
diff -u src/sys/dev/pci/if_dge.c:1.38 src/sys/dev/pci/if_dge.c:1.38.2.1
--- src/sys/dev/pci/if_dge.c:1.38	Sun Aug 10 16:44:36 2014
+++ src/sys/dev/pci/if_dge.c	Sun Jan 11 13:05:13 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_dge.c,v 1.38 2014/08/10 16:44:36 tls Exp $ */
+/*	$NetBSD: if_dge.c,v 1.38.2.1 2015/01/11 13:05:13 martin Exp $ */
 
 /*
  * Copyright (c) 2004, SUNET, Swedish University Computer Network.
@@ -80,7 +80,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_dge.c,v 1.38 2014/08/10 16:44:36 tls Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_dge.c,v 1.38.2.1 2015/01/11 13:05:13 martin Exp $");
 
 
 
@@ -630,7 +630,7 @@ static uint16_t	dge_eeprom_word(struct d
 static int	dge_xgmii_mediachange(struct ifnet *);
 static void	dge_xgmii_mediastatus(struct ifnet *, struct ifmediareq *);
 static void	dge_xgmii_reset(struct dge_softc *);
-static void	dge_xgmii_writereg(device_t, int, int, int);
+static void	dge_xgmii_writereg(struct dge_softc *, int, int, int);
 
 
 CFATTACH_DECL_NEW(dge, sizeof(struct dge_softc),
@@ -2379,11 +2379,9 @@ phwait(struct dge_softc *sc, int p, int 
 return mdic;
 }
 
-
 static void
-dge_xgmii_writereg(device_t self, int phy, int reg, int val)
+dge_xgmii_writereg(struct dge_softc *sc, int phy, int reg, int val)
 {
-	struct dge_softc *sc = device_private(self);
 	int mdic;
 
 	CSR_WRITE(sc, DGE_MDIRW, val);
@@ -2393,7 +2391,7 @@ dge_xgmii_writereg(device_t self, int ph
 		return;
 	}
 	if (((mdic = phwait(sc, phy, reg, 1, MDIO_WRITE)) & MDIO_CMD)) {
-		printf("%s: read cycle timeout; phy %d reg %d\n",
+		printf("%s: write cycle timeout; phy %d reg %d\n",
 		device_xname(sc->sc_dev), phy, reg);
 		return;
 	}
@@ -2402,7 +2400,7 @@ dge_xgmii_writereg(device_t self, int ph
 static void
 dge_xgmii_reset(struct dge_softc *sc)
 {
-	dge_xgmii_writereg((void *)sc, 0, 0, BMCR_RESET);
+	dge_xgmii_writereg(sc, 0, 0, BMCR_RESET);
 }
 
 static int



CVS commit: src/sys/arch/sparc64/sparc64

2015-01-11 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Sun Jan 11 13:40:22 UTC 2015

Modified Files:
src/sys/arch/sparc64/sparc64: mdesc.c

Log Message:
sun4v: hv_mach_desc() needs a buffer length of zero to return the actual length 
- this also fixes the failing sparc GENERIC_SUN4U build


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/sparc64/sparc64/mdesc.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/sparc64/sparc64/mdesc.c
diff -u src/sys/arch/sparc64/sparc64/mdesc.c:1.1 src/sys/arch/sparc64/sparc64/mdesc.c:1.2
--- src/sys/arch/sparc64/sparc64/mdesc.c:1.1	Sat Jan 10 22:19:26 2015
+++ src/sys/arch/sparc64/sparc64/mdesc.c	Sun Jan 11 13:40:22 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: mdesc.c,v 1.1 2015/01/10 22:19:26 palle Exp $	*/
+/*	$NetBSD: mdesc.c,v 1.2 2015/01/11 13:40:22 palle Exp $	*/
 /*	$OpenBSD: mdesc.c,v 1.7 2014/11/30 22:26:15 kettenis Exp $	*/
 /*
  * Copyright (c) 2009 Mark Kettenis
@@ -42,7 +42,9 @@ mdesc_init(void)
 	vaddr_t va;
 	int err;
 
-	hv_mach_desc((paddr_t)NULL, &len);
+	pa = 0;
+	len = 0;  /* trick to determine actual buffer size */
+	hv_mach_desc(pa, &len);
 	KASSERT(len != 0);
 
 again:



CVS commit: [netbsd-7] src/sys/dev

2015-01-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jan 11 14:13:25 UTC 2015

Modified Files:
src/sys/dev [netbsd-7]: midi.c midi_if.h midivar.h sequencer.c
sequencervar.h
src/sys/dev/usb [netbsd-7]: FILES umidi.c umidi_quirks.c
Removed Files:
src/sys/dev/usb [netbsd-7]: umidireg.h umidivar.h

Log Message:
Pull up following revision(s) (requested by mrg in ticket #407):
sys/dev/midivar.h: revision 1.20
sys/dev/usb/umidivar.h: file removal
sys/dev/midi.c: revision 1.82
sys/dev/midi.c: revision 1.83
sys/dev/usb/FILES: revision 1.13
sys/dev/midi_if.h: revision 1.26
sys/dev/sequencer.c: revision 1.60
sys/dev/sequencer.c: revision 1.61
sys/dev/sequencer.c: revision 1.62
sys/dev/sequencer.c: revision 1.63
sys/dev/usb/umidi_quirks.c: revision 1.19
sys/dev/usb/umidi.c: revision 1.66
sys/dev/usb/umidi.c: revision 1.67
sys/dev/usb/umidi.c: revision 1.68
sys/dev/usb/umidireg.h: file removal
sys/dev/sequencervar.h: revision 1.17
fix the midi_if documentation to properly describe the locks that will
be held during various operations.
various umidi clean ups:
- move the contents of umidi{reg,var}.h into umidi.c directly as they
  are not referenced by any other file.
- remove the useless include of umidi{reg,var}.h from umidi_quirks.c.
- add reference counting and wait/broadcast support to the IO paths.
- fix the error handling in midi_attach() and midi_open().
- sprinkle KASSERT() in several places.
- drop the local interrupt lock before calling into various parts of
  the USB code.  fixes lockdebug issues, and likely hangs.
- rename "binded" member as "bound".
with these most of the panics and problems i've seen are gone.  there
is still one lockdebug panic to deal with that happens when unplugging
umidi while midiplay(1) is running.
various clean ups for midi and sequencer:
midi specific:
- add reference counting for midi operations, and ensure that
  detach waits for other threads to complete before tearing
  down the device completely.
- in detach, halt midi callouts before destroying them
- re-check sc->dying after sleeping in midiread()
- in real_writebytes(), make sure we're open and not dying
- make sure we drop the interrupt lock before calling any code
  that may want to check thread locks.  this is now safe due to
  the above changes.
sequencer specific:
- avoid caching the midi softc in the sequencer softc.  instead,
  every time we want to use it, look it up again and make sure
  it still exists.
this fixes various crashes i've seen in the usb midi code when
detaching the umidi while it is active.
use __func__ in some debug messages.
- check sc->dying after sleeping in several more places, and
  convert it into EIO error where necessary.
- remove a wrong additional mutex_exit() call.
- make sure to check sc->dying under the device lock.
- fix a confusion between midi(4) unit and connected to sequencer
  devices.
- minor comment/debug clean ups.
fixes problems attempting to read or write from the right midi(4)
device using the sequencer(4) device when one or more of the
non-final devices fails to open with midiseq_open().
fix !AUDIO_DEBUG build.
CID/1261465: Dereference after NULL check.
CID/1261467: Unreachable code
actually fix one of the previous:  don't test for NULL after deref.


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.81.2.1 src/sys/dev/midi.c
cvs rdiff -u -r1.25 -r1.25.14.1 src/sys/dev/midi_if.h
cvs rdiff -u -r1.19 -r1.19.14.1 src/sys/dev/midivar.h
cvs rdiff -u -r1.59 -r1.59.2.1 src/sys/dev/sequencer.c
cvs rdiff -u -r1.16 -r1.16.10.1 src/sys/dev/sequencervar.h
cvs rdiff -u -r1.12 -r1.12.22.1 src/sys/dev/usb/FILES
cvs rdiff -u -r1.65 -r1.65.12.1 src/sys/dev/usb/umidi.c
cvs rdiff -u -r1.18 -r1.18.14.1 src/sys/dev/usb/umidi_quirks.c
cvs rdiff -u -r1.8 -r0 src/sys/dev/usb/umidireg.h
cvs rdiff -u -r1.19 -r0 src/sys/dev/usb/umidivar.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/dev/midi.c
diff -u src/sys/dev/midi.c:1.81 src/sys/dev/midi.c:1.81.2.1
--- src/sys/dev/midi.c:1.81	Fri Jul 25 08:10:35 2014
+++ src/sys/dev/midi.c	Sun Jan 11 14:13:25 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: midi.c,v 1.81 2014/07/25 08:10:35 dholland Exp $	*/
+/*	$NetBSD: midi.c,v 1.81.2.1 2015/01/11 14:13:25 martin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: midi.c,v 1.81 2014/07/25 08:10:35 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: midi.c,v 1.81.2.1 2015/01/11 14:13:25 martin Exp $");
 
 #include "midi.h"
 #include "sequencer.h"
@@ -204,6 +204,11 @@ mididetach(device_t self, int flags)
 
 	mutex_enter(sc->lock);
 	sc->dying = 1;
+
+	if (--sc->refcnt >= 0) {
+		/* Wake anything? */
+		(void)cv_timedwait(&sc->detach_cv, sc->lock, hz * 60);
+	}
 	cv_broa

CVS commit: [netbsd-7] src/doc

2015-01-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jan 11 14:15:43 UTC 2015

Modified Files:
src/doc [netbsd-7]: CHANGES-7.0

Log Message:
Tickets #405 - #407


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.158 -r1.1.2.159 src/doc/CHANGES-7.0

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-7.0
diff -u src/doc/CHANGES-7.0:1.1.2.158 src/doc/CHANGES-7.0:1.1.2.159
--- src/doc/CHANGES-7.0:1.1.2.158	Sun Jan 11 06:30:55 2015
+++ src/doc/CHANGES-7.0	Sun Jan 11 14:15:42 2015
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.0,v 1.1.2.158 2015/01/11 06:30:55 snj Exp $
+# $NetBSD: CHANGES-7.0,v 1.1.2.159 2015/01/11 14:15:42 martin Exp $
 
 A complete list of changes from the initial NetBSD 7.0 branch on 11 Aug 2014
 until the 7.0 release:
@@ -13301,3 +13301,48 @@ sys/external/bsd/drm2/dist/drm/radeon/ra
 	set DRM_FILE_PAGE_OFFSET to 0xa000UL for 32 bit platforms.
 	[chs, ticket #404]
 
+sys/arch/macppc/stand/ofwboot/boot.h		1.5
+
+	Force main into .text
+	[chs, ticket #405]
+
+sys/dev/pci/if_dge.c1.39
+
+	Fix device/softc split botch.
+	[chs, ticket #406]
+
+sys/dev/midi.c	1.82-1.83
+sys/dev/midi_if.h1.26
+sys/dev/midivar.h1.20
+sys/dev/sequencer.c1.60-1.63
+sys/dev/sequencervar.h1.17
+sys/dev/usb/FILES1.13
+sys/dev/usb/umidi.c1.66-1.68
+sys/dev/usb/umidi_quirks.c			1.19
+sys/dev/usb/umidireg.hdelete
+sys/dev/usb/umidivar.hdelete
+
+	midi:
+	- add reference counting for midi operations
+	- in detach, halt midi callouts before destroying them
+	- re-check sc->dying after sleeping in midiread()
+	- in real_writebytes(), make sure we're open and not dying
+	- make sure we drop the interrupt lock before calling any code
+	  that may want to check thread locks.
+	- check sc->dying after sleeping in several more places, and
+	  convert it into EIO error where necessary.
+
+	sequencer:
+	- avoid caching the midi softc in the sequencer softc.  instead,
+	  every time we want to use it, look it up again and make sure
+	  it still exists.
+	- fix a confusion between midi(4) unit and connected to sequencer
+	  devices.
+
+	umidi:
+	- add reference counting and wait/broadcast support to the IO paths.
+	- fix the error handling in midi_attach() and midi_open().
+	- drop the local interrupt lock before calling into various parts of
+	  the USB code.  fixes lockdebug issues, and likely hangs.
+	[mrg, ticket #407]
+



CVS commit: src/sys/dev/usb

2015-01-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jan 11 14:19:09 UTC 2015

Modified Files:
src/sys/dev/usb: if_urtwn.c

Log Message:
Pass the correct length to firmware_free. The code previously did
len = firmware_get_size(..) and then used len as a counter while loading
firmware. The result was that in the success path, len = 0. This commit
introduces a new "fwlen" (const) to store the firmware size, and passes it
to firmware_free instead of "len".


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/usb/if_urtwn.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/usb/if_urtwn.c
diff -u src/sys/dev/usb/if_urtwn.c:1.35 src/sys/dev/usb/if_urtwn.c:1.36
--- src/sys/dev/usb/if_urtwn.c:1.35	Wed Jan  7 07:05:48 2015
+++ src/sys/dev/usb/if_urtwn.c	Sun Jan 11 14:19:09 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_urtwn.c,v 1.35 2015/01/07 07:05:48 ozaki-r Exp $	*/
+/*	$NetBSD: if_urtwn.c,v 1.36 2015/01/11 14:19:09 jmcneill Exp $	*/
 /*	$OpenBSD: if_urtwn.c,v 1.20 2011/11/26 06:39:33 ckuethe Exp $	*/
 
 /*-
@@ -23,7 +23,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.35 2015/01/07 07:05:48 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.36 2015/01/11 14:19:09 jmcneill Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -3072,7 +3072,7 @@ urtwn_load_firmware(struct urtwn_softc *
 		error);
 		return (error);
 	}
-	len = firmware_get_size(fwh);
+	const size_t fwlen = len = firmware_get_size(fwh);
 	fw = firmware_malloc(len);
 	if (fw == NULL) {
 		aprint_error_dev(sc->sc_dev,
@@ -3085,7 +3085,7 @@ urtwn_load_firmware(struct urtwn_softc *
 	if (error != 0) {
 		aprint_error_dev(sc->sc_dev,
 		"failed to read firmware (error %d)\n", error);
-		firmware_free(fw, len);
+		firmware_free(fw, fwlen);
 		return (error);
 	}
 
@@ -3175,7 +3175,7 @@ urtwn_load_firmware(struct urtwn_softc *
 		goto fail;
 	}
  fail:
-	firmware_free(fw, len);
+	firmware_free(fw, fwlen);
 	return (error);
 }
 



CVS commit: src/sys

2015-01-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jan 11 14:22:53 UTC 2015

Modified Files:
src/sys/conf: files
src/sys/kern: kern_todr.c

Log Message:
defflag TODR_DEBUG


To generate a diff of this commit:
cvs rdiff -u -r1.1123 -r1.1124 src/sys/conf/files
cvs rdiff -u -r1.37 -r1.38 src/sys/kern/kern_todr.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/conf/files
diff -u src/sys/conf/files:1.1123 src/sys/conf/files:1.1124
--- src/sys/conf/files:1.1123	Sun Jan  4 07:32:32 2015
+++ src/sys/conf/files	Sun Jan 11 14:22:53 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: files,v 1.1123 2015/01/04 07:32:32 uebayasi Exp $
+#	$NetBSD: files,v 1.1124 2015/01/11 14:22:53 jmcneill Exp $
 #	@(#)files.newconf	7.5 (Berkeley) 5/10/93
 
 version 	20141030
@@ -120,6 +120,8 @@ defparam opt_wapbl.h		WAPBL_DEBUG_PRINT
 # printf entropy source
 defflag opt_rnd_printf.h	RND_PRINTF
 
+defflag opt_todr.h		TODR_DEBUG
+
 # compatibility options
 #
 defflag opt_compat_netbsd.h	COMPAT_NETBSD

Index: src/sys/kern/kern_todr.c
diff -u src/sys/kern/kern_todr.c:1.37 src/sys/kern/kern_todr.c:1.38
--- src/sys/kern/kern_todr.c:1.37	Mon Nov 17 02:15:49 2014
+++ src/sys/kern/kern_todr.c	Sun Jan 11 14:22:53 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_todr.c,v 1.37 2014/11/17 02:15:49 christos Exp $	*/
+/*	$NetBSD: kern_todr.c,v 1.38 2015/01/11 14:22:53 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -38,8 +38,10 @@
  *	@(#)clock.c	8.1 (Berkeley) 6/10/93
  */
 
+#include "opt_todr.h"
+
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_todr.c,v 1.37 2014/11/17 02:15:49 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_todr.c,v 1.38 2015/01/11 14:22:53 jmcneill Exp $");
 
 #include 
 #include 



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

2015-01-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jan 11 14:59:13 UTC 2015

Modified Files:
src/sys/arch/arm/rockchip: rockchip_i2c.c

Log Message:
rkiic_wait: fix non-polled mode


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/rockchip/rockchip_i2c.c

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

Modified files:

Index: src/sys/arch/arm/rockchip/rockchip_i2c.c
diff -u src/sys/arch/arm/rockchip/rockchip_i2c.c:1.5 src/sys/arch/arm/rockchip/rockchip_i2c.c:1.6
--- src/sys/arch/arm/rockchip/rockchip_i2c.c:1.5	Thu Jan  1 22:15:40 2015
+++ src/sys/arch/arm/rockchip/rockchip_i2c.c	Sun Jan 11 14:59:13 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: rockchip_i2c.c,v 1.5 2015/01/01 22:15:40 jmcneill Exp $ */
+/* $NetBSD: rockchip_i2c.c,v 1.6 2015/01/11 14:59:13 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014 Jared D. McNeill 
@@ -30,7 +30,7 @@
 #include "opt_rkiic.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rockchip_i2c.c,v 1.5 2015/01/01 22:15:40 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rockchip_i2c.c,v 1.6 2015/01/11 14:59:13 jmcneill Exp $");
 
 #include 
 #include 
@@ -319,16 +319,21 @@ rkiic_wait(struct rkiic_softc *sc, uint3
 		retry = timeout / hz;
 		while (retry > 0) {
 			error = cv_timedwait(&sc->sc_cv, &sc->sc_lock, hz);
-			if (error && error != EWOULDBLOCK)
-return error;
+			if (error) {
+if (error != EWOULDBLOCK) {
+	return error;
+} else {
+	--retry;
+}
+			}
 			if (sc->sc_intr_ipd & mask)
 return 0;
-			--retry;
 		}
 	}
 
 #ifdef RKIIC_DEBUG
-	device_printf(sc->sc_dev, "%s: ipd %#x\n", __func__, sc->sc_intr_ipd);
+	device_printf(sc->sc_dev, "%s: ipd %#x flags %#x\n", __func__,
+	sc->sc_intr_ipd, flags);
 #endif
 	return ETIMEDOUT;
 }



CVS commit: src/sys/dev/i2c

2015-01-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jan 11 15:22:26 UTC 2015

Modified Files:
src/sys/dev/i2c: files.i2c
Added Files:
src/sys/dev/i2c: hym8563.c

Log Message:
add Haoyu Microelectronic HYM8563 RTC driver


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/dev/i2c/files.i2c
cvs rdiff -u -r0 -r1.1 src/sys/dev/i2c/hym8563.c

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

Modified files:

Index: src/sys/dev/i2c/files.i2c
diff -u src/sys/dev/i2c/files.i2c:1.62 src/sys/dev/i2c/files.i2c:1.63
--- src/sys/dev/i2c/files.i2c:1.62	Thu Jan  1 17:33:18 2015
+++ src/sys/dev/i2c/files.i2c	Sun Jan 11 15:22:26 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: files.i2c,v 1.62 2015/01/01 17:33:18 jmcneill Exp $
+#	$NetBSD: files.i2c,v 1.63 2015/01/11 15:22:26 jmcneill Exp $
 
 obsolete defflag	opt_i2cbus.h		I2C_SCAN
 define	i2cbus { }
@@ -245,3 +245,8 @@ file	dev/i2c/ac100.cac100ic		needs-f
 device	act8846pm
 attach	act8846pm at iic
 file	dev/i2c/act8846.c			act8846pm	needs-flag
+
+# Haoyu Microelectronic HYM8563 RTC
+device	hymrtc
+attach	hymrtc at iic
+file	dev/i2c/hym8563.c			hymrtc

Added files:

Index: src/sys/dev/i2c/hym8563.c
diff -u /dev/null src/sys/dev/i2c/hym8563.c:1.1
--- /dev/null	Sun Jan 11 15:22:26 2015
+++ src/sys/dev/i2c/hym8563.c	Sun Jan 11 15:22:26 2015
@@ -0,0 +1,210 @@
+/* $NetBSD: hym8563.c,v 1.1 2015/01/11 15:22:26 jmcneill Exp $ */
+
+/*-
+ * Copyright (c) 2015 Jared D. McNeill 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: hym8563.c,v 1.1 2015/01/11 15:22:26 jmcneill Exp $");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+
+#define HYM_CSR1_REG		0x00
+#define HYM_CSR2_REG		0x01
+#define HYM_SECONDS_REG		0x02
+#define HYM_MINUTES_REG		0x03
+#define HYM_HOURS_REG		0x04
+#define HYM_DAYS_REG		0x05
+#define HYM_WEEKDAYS_REG	0x06
+#define HYM_MONTHS_REG		0x07
+#define HYM_YEARS_REG		0x08
+#define HYM_MINUTE_ALARM_REG	0x09
+#define HYM_HOUR_ALARM_REG	0x0a
+#define HYM_DATE_ALARM_REG	0x0b
+#define HYM_WEEKDAY_ALARM_REG	0x0c
+#define HYM_CLKOUT_CTRL_REG	0x0d
+#define HYM_TIMER_CTRL_REG	0x0e
+#define HYM_TIMER_COUNTDOWN_REG	0x0f
+
+#define HYM_CSR1_TEST		__BIT(7)
+#define HYM_CSR1_STOP		__BIT(5)
+#define HYM_CSR1_TESTC		__BIT(3)
+
+#define HYM_CSR2_TITP		__BIT(4)
+#define HYM_CSR2_AF		__BIT(3)
+#define HYM_CSR2_TF		__BIT(2)
+#define HYM_CSR2_AIE		__BIT(1)
+#define HYM_CSR2_TIE		__BIT(0)
+
+#define HYM_SECONDS_VL		__BIT(7)
+#define HYM_SECONDS_MASK	__BITS(6,0)
+
+#define HYM_MINUTES_MASK	__BITS(6,0)
+
+#define HYM_HOURS_MASK		__BITS(5,0)
+
+#define HYM_DAYS_MASK		__BITS(5,0)
+
+#define HYM_WEEKDAYS_MASK	__BITS(2,0)
+
+#define HYM_MONTHS_C		__BIT(7)
+#define HYM_MONTHS_MASK		__BITS(4,0)
+
+#define HYM_YEARS_MASK		__BITS(7,0)
+
+#define HYM_TODR_OFF		HYM_SECONDS_REG
+#define HYM_TODR_LEN		(HYM_YEARS_REG - HYM_SECONDS_REG + 1)
+#define HYM_TODR_SECONDS	(HYM_SECONDS_REG - HYM_TODR_OFF)
+#define HYM_TODR_MINUTES	(HYM_MINUTES_REG - HYM_TODR_OFF)
+#define HYM_TODR_HOURS		(HYM_HOURS_REG - HYM_TODR_OFF)
+#define HYM_TODR_DAYS		(HYM_DAYS_REG - HYM_TODR_OFF)
+#define HYM_TODR_WEEKDAYS	(HYM_WEEKDAYS_REG - HYM_TODR_OFF)
+#define HYM_TODR_MONTHS		(HYM_MONTHS_REG - HYM_TODR_OFF)
+#define HYM_TODR_YEARS		(HYM_YEARS_REG - HYM_TODR_OFF)
+
+struct hymrtc_softc {
+	device_t	sc_dev;
+	i2c_tag_t	sc_i2c;
+	i2c_addr_t	sc_addr;
+
+	struct todr_chip_handle sc_todr;
+};
+
+static int	hymrtc_match(device_t, cfdata_t, void *);
+static void	hymrtc_attach(device_t, device_t, void *);
+
+static int	hymrtc_rtc_gettime(todr_chip_handle_t, st

CVS commit: src/sys/arch/evbarm/conf

2015-01-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jan 11 15:23:09 UTC 2015

Modified Files:
src/sys/arch/evbarm/conf: ROCKCHIP

Log Message:
add hymrtc driver


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/evbarm/conf/ROCKCHIP

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

Modified files:

Index: src/sys/arch/evbarm/conf/ROCKCHIP
diff -u src/sys/arch/evbarm/conf/ROCKCHIP:1.15 src/sys/arch/evbarm/conf/ROCKCHIP:1.16
--- src/sys/arch/evbarm/conf/ROCKCHIP:1.15	Sat Jan 10 12:50:54 2015
+++ src/sys/arch/evbarm/conf/ROCKCHIP	Sun Jan 11 15:23:09 2015
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: ROCKCHIP,v 1.15 2015/01/10 12:50:54 jmcneill Exp $
+#	$NetBSD: ROCKCHIP,v 1.16 2015/01/11 15:23:09 jmcneill Exp $
 #
 #	Rockchip RK3066/RK3188 based SBC (Single Board Computer)
 #
@@ -186,6 +186,7 @@ rkiic0		at obio0 addr 0x2002d000 size 0x
 iic0		at rkiic0
 rkiic1		at obio0 addr 0x2002f000 size 0x1000 intr 73 port 1 crit 1
 iic1		at rkiic1
+hymrtc0		at iic1 addr 0x51
 act8846pm0	at iic1 addr 0x5a
 rkiic2		at obio0 addr 0x20056000 size 0x2000 intr 74 port 2 crit 1
 iic2		at rkiic2



CVS commit: src/sys/arch/evbarm/conf

2015-01-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jan 11 16:53:42 UTC 2015

Modified Files:
src/sys/arch/evbarm/conf: ROCKCHIP

Log Message:
looks like hym8563 and pcf8563 are compatible, switch to pcf8563rtc driver


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/evbarm/conf/ROCKCHIP

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

Modified files:

Index: src/sys/arch/evbarm/conf/ROCKCHIP
diff -u src/sys/arch/evbarm/conf/ROCKCHIP:1.16 src/sys/arch/evbarm/conf/ROCKCHIP:1.17
--- src/sys/arch/evbarm/conf/ROCKCHIP:1.16	Sun Jan 11 15:23:09 2015
+++ src/sys/arch/evbarm/conf/ROCKCHIP	Sun Jan 11 16:53:42 2015
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: ROCKCHIP,v 1.16 2015/01/11 15:23:09 jmcneill Exp $
+#	$NetBSD: ROCKCHIP,v 1.17 2015/01/11 16:53:42 jmcneill Exp $
 #
 #	Rockchip RK3066/RK3188 based SBC (Single Board Computer)
 #
@@ -186,7 +186,7 @@ rkiic0		at obio0 addr 0x2002d000 size 0x
 iic0		at rkiic0
 rkiic1		at obio0 addr 0x2002f000 size 0x1000 intr 73 port 1 crit 1
 iic1		at rkiic1
-hymrtc0		at iic1 addr 0x51
+pcf8563rtc0	at iic1 addr 0x51
 act8846pm0	at iic1 addr 0x5a
 rkiic2		at obio0 addr 0x20056000 size 0x2000 intr 74 port 2 crit 1
 iic2		at rkiic2



CVS commit: src/sys/dev/i2c

2015-01-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jan 11 16:54:21 UTC 2015

Modified Files:
src/sys/dev/i2c: files.i2c
Removed Files:
src/sys/dev/i2c: hym8563.c

Log Message:
pcf8653 driver is compatible, delete this driver


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/dev/i2c/files.i2c
cvs rdiff -u -r1.1 -r0 src/sys/dev/i2c/hym8563.c

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

Modified files:

Index: src/sys/dev/i2c/files.i2c
diff -u src/sys/dev/i2c/files.i2c:1.63 src/sys/dev/i2c/files.i2c:1.64
--- src/sys/dev/i2c/files.i2c:1.63	Sun Jan 11 15:22:26 2015
+++ src/sys/dev/i2c/files.i2c	Sun Jan 11 16:54:21 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: files.i2c,v 1.63 2015/01/11 15:22:26 jmcneill Exp $
+#	$NetBSD: files.i2c,v 1.64 2015/01/11 16:54:21 jmcneill Exp $
 
 obsolete defflag	opt_i2cbus.h		I2C_SCAN
 define	i2cbus { }
@@ -245,8 +245,3 @@ file	dev/i2c/ac100.cac100ic		needs-f
 device	act8846pm
 attach	act8846pm at iic
 file	dev/i2c/act8846.c			act8846pm	needs-flag
-
-# Haoyu Microelectronic HYM8563 RTC
-device	hymrtc
-attach	hymrtc at iic
-file	dev/i2c/hym8563.c			hymrtc



CVS commit: src/sys/ufs/chfs

2015-01-11 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Sun Jan 11 17:27:54 UTC 2015

Modified Files:
src/sys/ufs/chfs: chfs_vnops.c

Log Message:
Return immediately from successfull cache_lookup().
No need to unlock an unlocked vnode.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/ufs/chfs/chfs_vnops.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/ufs/chfs/chfs_vnops.c
diff -u src/sys/ufs/chfs/chfs_vnops.c:1.22 src/sys/ufs/chfs/chfs_vnops.c:1.23
--- src/sys/ufs/chfs/chfs_vnops.c:1.22	Fri Jul 25 08:20:53 2014
+++ src/sys/ufs/chfs/chfs_vnops.c	Sun Jan 11 17:27:54 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: chfs_vnops.c,v 1.22 2014/07/25 08:20:53 dholland Exp $	*/
+/*	$NetBSD: chfs_vnops.c,v 1.23 2015/01/11 17:27:54 hannken Exp $	*/
 
 /*-
  * Copyright (c) 2010 Department of Software Engineering,
@@ -88,8 +88,7 @@ chfs_lookup(void *v)
 	 * directory/name couple is already in the cache. */
 	if (cache_lookup(dvp, cnp->cn_nameptr, cnp->cn_namelen,
 			 cnp->cn_nameiop, cnp->cn_flags, NULL, vpp)) {
-		error = *vpp == NULLVP ? ENOENT : 0;
-		goto out;
+		return (*vpp == NULLVP ? ENOENT : 0);
 	}
 
 	ip = VTOI(dvp);



CVS commit: src/sys/ufs/chfs

2015-01-11 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Sun Jan 11 17:28:22 UTC 2015

Modified Files:
src/sys/ufs/chfs: chfs_gc.c chfs_vnode.c

Log Message:
Convert a bogus mnt_vnodelist traversal to vfs_vnode_iterator.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/ufs/chfs/chfs_gc.c
cvs rdiff -u -r1.12 -r1.13 src/sys/ufs/chfs/chfs_vnode.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/ufs/chfs/chfs_gc.c
diff -u src/sys/ufs/chfs/chfs_gc.c:1.7 src/sys/ufs/chfs/chfs_gc.c:1.8
--- src/sys/ufs/chfs/chfs_gc.c:1.7	Mon Sep  8 17:41:11 2014
+++ src/sys/ufs/chfs/chfs_gc.c	Sun Jan 11 17:28:22 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: chfs_gc.c,v 1.7 2014/09/08 17:41:11 joerg Exp $	*/
+/*	$NetBSD: chfs_gc.c,v 1.8 2015/01/11 17:28:22 hannken Exp $	*/
 
 /*-
  * Copyright (c) 2010 Department of Software Engineering,
@@ -251,6 +251,7 @@ chfs_gc_fetch_inode(struct chfs_mount *c
 	dbg_gc("vp to ip\n");
 	ip = VTOI(vp);
 	KASSERT(ip);
+	vrele(vp);
 
 	return ip;
 }
@@ -970,6 +971,7 @@ chfs_gcollect_dirent(struct chfs_mount *
 	}
 
 	ip = VTOI(vnode);
+	vrele(vnode);
 
 	/* Remove and obsolete the previous version. */
 	mutex_enter(&chmp->chm_lock_vnocache);
@@ -1006,7 +1008,7 @@ chfs_gcollect_deletion_dirent(struct chf
 
 	nref_len = chfs_nref_len(chmp, cheb, fd->nref);
 
-	(void)chfs_vnode_lookup(chmp, fd->vno);
+	/* XXX This was a noop  (void)chfs_vnode_lookup(chmp, fd->vno); */
 
 	/* Find it in parent dirents. */
 	for (nref = parent->chvc->dirents;

Index: src/sys/ufs/chfs/chfs_vnode.c
diff -u src/sys/ufs/chfs/chfs_vnode.c:1.12 src/sys/ufs/chfs/chfs_vnode.c:1.13
--- src/sys/ufs/chfs/chfs_vnode.c:1.12	Sun Nov  9 18:23:28 2014
+++ src/sys/ufs/chfs/chfs_vnode.c	Sun Jan 11 17:28:22 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: chfs_vnode.c,v 1.12 2014/11/09 18:23:28 maxv Exp $	*/
+/*	$NetBSD: chfs_vnode.c,v 1.13 2015/01/11 17:28:22 hannken Exp $	*/
 
 /*-
  * Copyright (c) 2010 Department of Software Engineering,
@@ -42,18 +42,24 @@
 #include 
 
 /* chfs_vnode_lookup - lookup for a vnode */
+static bool
+chfs_vnode_lookup_selector(void *ctx, struct vnode *vp)
+{
+	ino_t *ino = ctx;
+
+	return (VTOI(vp) != NULL && VTOI(vp)->ino == *ino);
+}
 struct vnode *
 chfs_vnode_lookup(struct chfs_mount *chmp, ino_t vno)
 {
+	struct vnode_iterator *marker;
 	struct vnode *vp;
-	struct chfs_inode *ip;
 
-	TAILQ_FOREACH(vp, &chmp->chm_fsmp->mnt_vnodelist, v_mntvnodes) {
-		ip = VTOI(vp);
-		if (ip && ip->ino == vno)
-			return vp;
-	}
-	return NULL;
+	vfs_vnode_iterator_init(chmp->chm_fsmp, &marker);
+	vp = vfs_vnode_iterator_next(marker, chfs_vnode_lookup_selector, &vno);
+	vfs_vnode_iterator_destroy(marker);
+
+	return vp;
 }
 
 /* chfs_readvnode - reads a vnode from the flash and setups its inode */



CVS commit: src/sys

2015-01-11 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Sun Jan 11 17:29:57 UTC 2015

Modified Files:
src/sys/modules/chfs: Makefile
src/sys/ufs: files.ufs
src/sys/ufs/chfs: chfs.h chfs_inode.h chfs_vfsops.c chfs_vnode.c
chfs_vnops.c
Removed Files:
src/sys/ufs/chfs: chfs_ihash.c

Log Message:
Change chfs from hashlist to vcache.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/modules/chfs/Makefile
cvs rdiff -u -r1.38 -r1.39 src/sys/ufs/files.ufs
cvs rdiff -u -r1.8 -r1.9 src/sys/ufs/chfs/chfs.h
cvs rdiff -u -r1.3 -r0 src/sys/ufs/chfs/chfs_ihash.c
cvs rdiff -u -r1.9 -r1.10 src/sys/ufs/chfs/chfs_inode.h
cvs rdiff -u -r1.14 -r1.15 src/sys/ufs/chfs/chfs_vfsops.c
cvs rdiff -u -r1.13 -r1.14 src/sys/ufs/chfs/chfs_vnode.c
cvs rdiff -u -r1.23 -r1.24 src/sys/ufs/chfs/chfs_vnops.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/modules/chfs/Makefile
diff -u src/sys/modules/chfs/Makefile:1.3 src/sys/modules/chfs/Makefile:1.4
--- src/sys/modules/chfs/Makefile:1.3	Thu Apr 12 15:31:01 2012
+++ src/sys/modules/chfs/Makefile	Sun Jan 11 17:29:57 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.3 2012/04/12 15:31:01 ttoth Exp $
+#	$NetBSD: Makefile,v 1.4 2015/01/11 17:29:57 hannken Exp $
 
 .include "../Makefile.inc"
 
@@ -7,7 +7,7 @@
 CPPFLAGS+=	-DDIAGNOSTIC -DDEBUG -DLOCKDEBUG
 
 KMOD=	chfs
-SRCS=	ebh.c chfs_wbuf.c chfs_vnode_cache.c chfs_ihash.c
+SRCS=	ebh.c chfs_wbuf.c chfs_vnode_cache.c
 SRCS+=  chfs_gc.c
 SRCS+=  chfs_vnode.c chfs_erase.c chfs_write.c chfs_readinode.c
 SRCS+=  chfs_build.c chfs_scan.c chfs_nodeops.c chfs_malloc.c

Index: src/sys/ufs/files.ufs
diff -u src/sys/ufs/files.ufs:1.38 src/sys/ufs/files.ufs:1.39
--- src/sys/ufs/files.ufs:1.38	Sun Nov 16 16:01:39 2014
+++ src/sys/ufs/files.ufs	Sun Jan 11 17:29:57 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: files.ufs,v 1.38 2014/11/16 16:01:39 manu Exp $
+#	$NetBSD: files.ufs,v 1.39 2015/01/11 17:29:57 hannken Exp $
 
 deffs	FFS
 deffs	EXT2FS
@@ -28,7 +28,6 @@ file	ufs/ext2fs/ext2fs_vnops.c	ext2fs
 
 define	chfs: vfs, ffs
 file	ufs/chfs/ebh.c			chfs
-file	ufs/chfs/chfs_ihash.c		chfs
 file	ufs/chfs/chfs_scan.c		chfs
 file	ufs/chfs/chfs_write.c		chfs
 file	ufs/chfs/chfs_vnode_cache.c	chfs

Index: src/sys/ufs/chfs/chfs.h
diff -u src/sys/ufs/chfs/chfs.h:1.8 src/sys/ufs/chfs/chfs.h:1.9
--- src/sys/ufs/chfs/chfs.h:1.8	Fri Oct 19 12:44:39 2012
+++ src/sys/ufs/chfs/chfs.h	Sun Jan 11 17:29:57 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: chfs.h,v 1.8 2012/10/19 12:44:39 ttoth Exp $	*/
+/*	$NetBSD: chfs.h,v 1.9 2015/01/11 17:29:57 hannken Exp $	*/
 
 /*-
  * Copyright (c) 2010 Department of Software Engineering,
@@ -571,18 +571,6 @@ int chfs_read_data(struct chfs_mount*, s
 /* chfs_erase.c */
 int chfs_remap_leb(struct chfs_mount *);
 
-/* chfs_ihash.c */
-void chfs_ihashinit(void);
-void chfs_ihashreinit(void);
-void chfs_ihashdone(void);
-struct vnode *chfs_ihashlookup(dev_t, ino_t);
-struct vnode *chfs_ihashget(dev_t, ino_t, int);
-void chfs_ihashins(struct chfs_inode *);
-void chfs_ihashrem(struct chfs_inode *);
-
-extern kmutex_t	chfs_ihash_lock;
-extern kmutex_t	chfs_hashlock;
-
 /* chfs_gc.c */
 void chfs_gc_trigger(struct chfs_mount *);
 int chfs_gc_thread_should_wake(struct chfs_mount *);

Index: src/sys/ufs/chfs/chfs_inode.h
diff -u src/sys/ufs/chfs/chfs_inode.h:1.9 src/sys/ufs/chfs/chfs_inode.h:1.10
--- src/sys/ufs/chfs/chfs_inode.h:1.9	Mon May 26 19:16:39 2014
+++ src/sys/ufs/chfs/chfs_inode.h	Sun Jan 11 17:29:57 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: chfs_inode.h,v 1.9 2014/05/26 19:16:39 dholland Exp $	*/
+/*	$NetBSD: chfs_inode.h,v 1.10 2015/01/11 17:29:57 hannken Exp $	*/
 
 /*-
  * Copyright (c) 2010 Department of Software Engineering,
@@ -77,8 +77,6 @@ struct chfs_inode
 	struct genfs_node	gnode;
 	kmutex_t inode_lock;		/* lock the fields of chfs_inode */
 
-	LIST_ENTRY(chfs_inode) hash_entry;	/* hash chain */
-
 	struct ufsmount *ump;		/* ufs mount - TODO we should remove it */
 	struct chfs_mount *chmp;	/* chfs mount point - TODO we should remove it */
 

Index: src/sys/ufs/chfs/chfs_vfsops.c
diff -u src/sys/ufs/chfs/chfs_vfsops.c:1.14 src/sys/ufs/chfs/chfs_vfsops.c:1.15
--- src/sys/ufs/chfs/chfs_vfsops.c:1.14	Sun Nov  9 18:23:28 2014
+++ src/sys/ufs/chfs/chfs_vfsops.c	Sun Jan 11 17:29:57 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: chfs_vfsops.c,v 1.14 2014/11/09 18:23:28 maxv Exp $	*/
+/*	$NetBSD: chfs_vfsops.c,v 1.15 2015/01/11 17:29:57 hannken Exp $	*/
 
 /*-
  * Copyright (c) 2010 Department of Software Engineering,
@@ -70,6 +70,8 @@ MODULE(MODULE_CLASS_VFS, chfs, "flash");
 static int chfs_mount(struct mount *, const char *, void *, size_t *);
 static int chfs_unmount(struct mount *, int);
 static int chfs_root(struct mount *, struct vnode **);
+static int chfs_loadvnode(struct mount *, struct vnode *,
+const void *, size_t, const void **);
 static int chfs_vget(struct mount *, ino_t, struct vnode **);
 static int

CVS commit: src/sys/dev/i2c

2015-01-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jan 11 18:05:36 UTC 2015

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

Log Message:
initialize CS1/CS2 regs, honour century flag, return an error on read if 
voltage low bit is set


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/i2c/pcf8563.c

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

Modified files:

Index: src/sys/dev/i2c/pcf8563.c
diff -u src/sys/dev/i2c/pcf8563.c:1.4 src/sys/dev/i2c/pcf8563.c:1.5
--- src/sys/dev/i2c/pcf8563.c:1.4	Thu Nov 20 16:34:26 2014
+++ src/sys/dev/i2c/pcf8563.c	Sun Jan 11 18:05:36 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcf8563.c,v 1.4 2014/11/20 16:34:26 christos Exp $	*/
+/*	$NetBSD: pcf8563.c,v 1.5 2015/01/11 18:05:36 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 2011 Jonathan A. Kollasch
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pcf8563.c,v 1.4 2014/11/20 16:34:26 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pcf8563.c,v 1.5 2015/01/11 18:05:36 jmcneill Exp $");
 
 #include 
 #include 
@@ -91,6 +91,13 @@ pcf8563rtc_attach(device_t parent, devic
 	sc->sc_todr.todr_settime_ymdhms = pcf8563rtc_settime;
 	sc->sc_todr.todr_setwen = NULL;
 
+	iic_acquire_bus(sc->sc_tag, I2C_F_POLL);
+	iic_smbus_write_byte(sc->sc_tag, sc->sc_addr, PCF8563_R_CS1, 0,
+	I2C_F_POLL);
+	iic_smbus_write_byte(sc->sc_tag, sc->sc_addr, PCF8563_R_CS2, 0,
+	I2C_F_POLL);
+	iic_release_bus(sc->sc_tag, I2C_F_POLL);
+
 	todr_attach(&sc->sc_todr);
 }
 
@@ -136,13 +143,18 @@ pcf8563rtc_clock_read(struct pcf8563rtc_
 
 	iic_release_bus(sc->sc_tag, I2C_F_POLL);
 
+	if (bcd[PCF8563_R_SECOND] & PCF8563_M_VL)
+		return 0;
+
 	dt->dt_sec = bcdtobin(bcd[PCF8563_R_SECOND] & PCF8563_M_SECOND);
 	dt->dt_min = bcdtobin(bcd[PCF8563_R_MINUTE] & PCF8563_M_MINUTE);
 	dt->dt_hour = bcdtobin(bcd[PCF8563_R_HOUR] & PCF8563_M_HOUR);
 	dt->dt_day = bcdtobin(bcd[PCF8563_R_DAY] & PCF8563_M_DAY);
 	dt->dt_mon = bcdtobin(bcd[PCF8563_R_MONTH] & PCF8563_M_MONTH);
-	dt->dt_year = bcdtobin(bcd[PCF8563_R_YEAR] & PCF8563_M_YEAR);
-	dt->dt_year += 2000;
+	dt->dt_year = 1900 +
+	(bcdtobin(bcd[PCF8563_R_YEAR] & PCF8563_M_YEAR) % 100);
+	if (bcd[PCF8563_R_MONTH] & PCF8563_M_CENTURY)
+		dt->dt_year += 100;
 
 	return 1;
 }
@@ -160,6 +172,8 @@ pcf8563rtc_clock_write(struct pcf8563rtc
 	bcd[PCF8563_R_WEEKDAY] = bintobcd(dt->dt_wday);
 	bcd[PCF8563_R_MONTH] = bintobcd(dt->dt_mon);
 	bcd[PCF8563_R_YEAR] = bintobcd(dt->dt_year % 100);
+	if (dt->dt_year >= 2000)
+		bcd[PCF8563_R_MONTH] |= PCF8563_M_CENTURY;
 
 	if (iic_acquire_bus(sc->sc_tag, I2C_F_POLL)) {
 		device_printf(sc->sc_dev, "acquire bus for write failed\n");



CVS commit: src/sys/dev/i2c

2015-01-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jan 11 18:56:54 UTC 2015

Modified Files:
src/sys/dev/i2c: pcf8563reg.h

Log Message:
add VL flags


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/i2c/pcf8563reg.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/dev/i2c/pcf8563reg.h
diff -u src/sys/dev/i2c/pcf8563reg.h:1.1 src/sys/dev/i2c/pcf8563reg.h:1.2
--- src/sys/dev/i2c/pcf8563reg.h:1.1	Fri Jan 21 19:11:47 2011
+++ src/sys/dev/i2c/pcf8563reg.h	Sun Jan 11 18:56:54 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcf8563reg.h,v 1.1 2011/01/21 19:11:47 jakllsch Exp $	*/
+/*	$NetBSD: pcf8563reg.h,v 1.2 2015/01/11 18:56:54 jmcneill Exp $	*/
 
 /*
  * Jonathan Kollasch, 2011
@@ -42,6 +42,7 @@
 #define PCF8563_NREGS		0x10
 
 #define PCF8563_M_SECOND	0x7f
+#define PCF8563_M_VL		0x80
 #define PCF8563_M_MINUTE	0x7f
 #define PCF8563_M_HOUR		0x3f
 #define PCF8563_M_DAY		0x3f



CVS commit: src/sys/dev/i2c

2015-01-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jan 11 18:58:09 UTC 2015

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

Log Message:
dont read cs1/cs2 regs when reading clock, only use polling mode when cold, 
invert logic for century flag (1 means 1900, 0 means 2000), set dt_wday when 
reading clock


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/i2c/pcf8563.c

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

Modified files:

Index: src/sys/dev/i2c/pcf8563.c
diff -u src/sys/dev/i2c/pcf8563.c:1.5 src/sys/dev/i2c/pcf8563.c:1.6
--- src/sys/dev/i2c/pcf8563.c:1.5	Sun Jan 11 18:05:36 2015
+++ src/sys/dev/i2c/pcf8563.c	Sun Jan 11 18:58:09 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcf8563.c,v 1.5 2015/01/11 18:05:36 jmcneill Exp $	*/
+/*	$NetBSD: pcf8563.c,v 1.6 2015/01/11 18:58:09 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 2011 Jonathan A. Kollasch
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pcf8563.c,v 1.5 2015/01/11 18:05:36 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pcf8563.c,v 1.6 2015/01/11 18:58:09 jmcneill Exp $");
 
 #include 
 #include 
@@ -127,21 +127,22 @@ static int
 pcf8563rtc_clock_read(struct pcf8563rtc_softc *sc, struct clock_ymdhms *dt)
 {
 	uint8_t bcd[PCF8563_NREGS];
-	uint8_t reg = PCF8563_R_CS1;
+	uint8_t reg = PCF8563_R_SECOND;
+	const int flags = cold ? I2C_F_POLL : 0;
 
-	if (iic_acquire_bus(sc->sc_tag, I2C_F_POLL)) {
+	if (iic_acquire_bus(sc->sc_tag, flags)) {
 		device_printf(sc->sc_dev, "acquire bus for read failed\n");
 		return 0;
 	}
 
 	if (iic_exec(sc->sc_tag, I2C_OP_READ_WITH_STOP, sc->sc_addr, ®, 1,
-		 &bcd[reg], PCF8563_R_YEAR - reg + 1, I2C_F_POLL)) {
-		iic_release_bus(sc->sc_tag, I2C_F_POLL);
+		 &bcd[reg], PCF8563_R_YEAR - reg + 1, flags)) {
+		iic_release_bus(sc->sc_tag, flags);
 		device_printf(sc->sc_dev, "read failed\n");
 		return 0;
 	}
 
-	iic_release_bus(sc->sc_tag, I2C_F_POLL);
+	iic_release_bus(sc->sc_tag, flags);
 
 	if (bcd[PCF8563_R_SECOND] & PCF8563_M_VL)
 		return 0;
@@ -150,10 +151,11 @@ pcf8563rtc_clock_read(struct pcf8563rtc_
 	dt->dt_min = bcdtobin(bcd[PCF8563_R_MINUTE] & PCF8563_M_MINUTE);
 	dt->dt_hour = bcdtobin(bcd[PCF8563_R_HOUR] & PCF8563_M_HOUR);
 	dt->dt_day = bcdtobin(bcd[PCF8563_R_DAY] & PCF8563_M_DAY);
+	dt->dt_wday = bcdtobin(bcd[PCF8563_R_WEEKDAY] & PCF8563_M_WEEKDAY);
 	dt->dt_mon = bcdtobin(bcd[PCF8563_R_MONTH] & PCF8563_M_MONTH);
 	dt->dt_year = 1900 +
 	(bcdtobin(bcd[PCF8563_R_YEAR] & PCF8563_M_YEAR) % 100);
-	if (bcd[PCF8563_R_MONTH] & PCF8563_M_CENTURY)
+	if ((bcd[PCF8563_R_MONTH] & PCF8563_M_CENTURY) == 0)
 		dt->dt_year += 100;
 
 	return 1;
@@ -164,6 +166,7 @@ pcf8563rtc_clock_write(struct pcf8563rtc
 {
 	uint8_t bcd[PCF8563_NREGS];
 	uint8_t reg = PCF8563_R_SECOND;
+	const int flags = cold ? I2C_F_POLL : 0;
 
 	bcd[PCF8563_R_SECOND] = bintobcd(dt->dt_sec);
 	bcd[PCF8563_R_MINUTE] = bintobcd(dt->dt_min);
@@ -172,22 +175,22 @@ pcf8563rtc_clock_write(struct pcf8563rtc
 	bcd[PCF8563_R_WEEKDAY] = bintobcd(dt->dt_wday);
 	bcd[PCF8563_R_MONTH] = bintobcd(dt->dt_mon);
 	bcd[PCF8563_R_YEAR] = bintobcd(dt->dt_year % 100);
-	if (dt->dt_year >= 2000)
+	if (dt->dt_year < 2000)
 		bcd[PCF8563_R_MONTH] |= PCF8563_M_CENTURY;
 
-	if (iic_acquire_bus(sc->sc_tag, I2C_F_POLL)) {
+	if (iic_acquire_bus(sc->sc_tag, flags)) {
 		device_printf(sc->sc_dev, "acquire bus for write failed\n");
 		return 0;
 	}
 
 	if (iic_exec(sc->sc_tag, I2C_OP_WRITE_WITH_STOP, sc->sc_addr, ®, 1,
-		 &bcd[reg], PCF8563_R_YEAR - reg + 1, I2C_F_POLL)) {
-		iic_release_bus(sc->sc_tag, I2C_F_POLL);
+		 &bcd[reg], PCF8563_R_YEAR - reg + 1, flags)) {
+		iic_release_bus(sc->sc_tag, flags);
 		device_printf(sc->sc_dev, "write failed\n");
 		return 0;
 	}
 
-	iic_release_bus(sc->sc_tag, I2C_F_POLL);
+	iic_release_bus(sc->sc_tag, flags);
 
 	return 1;
 }



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

2015-01-11 Thread Ignatios Souvatzis
Module Name:src
Committed By:   is
Date:   Sun Jan 11 19:54:23 UTC 2015

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

Log Message:
Add support for the (cobalt) nullcons to amd64 and i386.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/x86/x86/consinit.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/consinit.c
diff -u src/sys/arch/x86/x86/consinit.c:1.27 src/sys/arch/x86/x86/consinit.c:1.28
--- src/sys/arch/x86/x86/consinit.c:1.27	Wed Mar 12 12:54:33 2014
+++ src/sys/arch/x86/x86/consinit.c	Sun Jan 11 19:54:23 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: consinit.c,v 1.27 2014/03/12 12:54:33 martin Exp $	*/
+/*	$NetBSD: consinit.c,v 1.28 2015/01/11 19:54:23 is Exp $	*/
 
 /*
  * Copyright (c) 1998
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: consinit.c,v 1.27 2014/03/12 12:54:33 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: consinit.c,v 1.28 2015/01/11 19:54:23 is Exp $");
 
 #include "opt_kgdb.h"
 #include "opt_puc.h"
@@ -39,6 +39,9 @@ __KERNEL_RCSID(0, "$NetBSD: consinit.c,v
 #include 
 #include 
 
+#include 
+
+#include "nullcons.h"
 #include "genfb.h"
 #include "vga.h"
 #include "ega.h"
@@ -235,6 +238,14 @@ dokbd:
 		return;
 	}
 #endif
+#if (NNULLCONS > 0)
+	if (!strcmp(consinfo->devname, "nullcons")) {
+		void nullcninit(struct consdev *cn);
+
+		nullcninit(0);
+		return;
+	}
+#endif
 	panic("invalid console device %s", consinfo->devname);
 }
 



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

2015-01-11 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sun Jan 11 20:52:57 UTC 2015

Modified Files:
src/sys/arch/arm/include: profile.h

Log Message:
ARM has deprecated using both PC and LR in the register list of pop with
ARMv6T2, so split the instructions up.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/arm/include/profile.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/arm/include/profile.h
diff -u src/sys/arch/arm/include/profile.h:1.16 src/sys/arch/arm/include/profile.h:1.17
--- src/sys/arch/arm/include/profile.h:1.16	Fri Nov 28 15:37:02 2014
+++ src/sys/arch/arm/include/profile.h	Sun Jan 11 20:52:57 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: profile.h,v 1.16 2014/11/28 15:37:02 skrll Exp $	*/
+/*	$NetBSD: profile.h,v 1.17 2015/01/11 20:52:57 joerg Exp $	*/
 
 /*
  * Copyright (c) 2001 Ben Harris
@@ -76,7 +76,8 @@
 	/*\
 	 * Restore registers that were trashed during mcount		\
 	 */\
-	__asm("pop	{r0-r3, lr, pc}");\
+	__asm("pop	{r0-r3, lr}");	\
+	__asm("pop	{pc}");		\
 	__asm(".size	" MCOUNT_ASM_NAME ", .-" MCOUNT_ASM_NAME);
 #elif defined(__ARM_DWARF_EH__)
 #define	MCOUNT\
@@ -116,7 +117,8 @@
 	/*\
 	 * Restore registers that were trashed during mcount		\
 	 */\
-	__asm("pop	{r0-r3, lr, pc}");\
+	__asm("pop	{r0-r3, lr}");	\
+	__asm("pop	{pc}");		\
 	__asm(".cfi_endproc");		\
 	__asm(".size	" MCOUNT_ASM_NAME ", .-" MCOUNT_ASM_NAME);
 #else
@@ -159,7 +161,8 @@
 	/*\
 	 * Restore registers that were trashed during mcount		\
 	 */\
-	__asm("pop	{r0-r3, lr, pc}");\
+	__asm("pop	{r0-r3, lr}");	\
+	__asm("pop	{pc}");		\
 	__asm(".cfi_endproc");		\
 	__asm(".fnend");		\
 	__asm(".size	" MCOUNT_ASM_NAME ", .-" MCOUNT_ASM_NAME);



CVS commit: src/sys/arch/sparc/stand/ofwboot

2015-01-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jan 11 22:59:25 UTC 2015

Modified Files:
src/sys/arch/sparc/stand/ofwboot: Makefile

Log Message:
Strip debug symbols from ofwboot.

The forth bootsector loading this file when booting from disk is
"simplistic" and does not skip non loadable sections. The five times
bigger file with debug info overruns some important memory contents
with some firmware versions otherwise.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/sparc/stand/ofwboot/Makefile

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/sparc/stand/ofwboot/Makefile
diff -u src/sys/arch/sparc/stand/ofwboot/Makefile:1.32 src/sys/arch/sparc/stand/ofwboot/Makefile:1.33
--- src/sys/arch/sparc/stand/ofwboot/Makefile:1.32	Sun Jan 12 15:26:31 2014
+++ src/sys/arch/sparc/stand/ofwboot/Makefile	Sun Jan 11 22:59:25 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.32 2014/01/12 15:26:31 tsutsui Exp $
+#	$NetBSD: Makefile,v 1.33 2015/01/11 22:59:25 martin Exp $
 
 CURDIR=	${.CURDIR}
 S=	${CURDIR}/../../../..
@@ -103,7 +103,7 @@ ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBK
 .else
 ${PROG}: ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
 	${_MKTARGET_LINK}
-	${LD} -X -N -Ttext ${RELOC} -e ${ENTRY} -o ${PROG} \
+	${LD} -X -N -S -Ttext ${RELOC} -e ${ENTRY} -o ${PROG} \
 	${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}	# native linker
 .endif
 



CVS commit: src/sys/dev/marvell

2015-01-11 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sun Jan 11 22:59:57 UTC 2015

Modified Files:
src/sys/dev/marvell: if_gfe.c

Log Message:
sizeof doesn't evaluate the expression, so increment of rxd doesn't
happen. Move it out.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/dev/marvell/if_gfe.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/marvell/if_gfe.c
diff -u src/sys/dev/marvell/if_gfe.c:1.43 src/sys/dev/marvell/if_gfe.c:1.44
--- src/sys/dev/marvell/if_gfe.c:1.43	Sun Sep 21 17:00:35 2014
+++ src/sys/dev/marvell/if_gfe.c	Sun Jan 11 22:59:57 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_gfe.c,v 1.43 2014/09/21 17:00:35 christos Exp $	*/
+/*	$NetBSD: if_gfe.c,v 1.44 2015/01/11 22:59:57 joerg Exp $	*/
 
 /*
  * Copyright (c) 2002 Allegro Networks, Inc., Wasabi Systems, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_gfe.c,v 1.43 2014/09/21 17:00:35 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_gfe.c,v 1.44 2015/01/11 22:59:57 joerg Exp $");
 
 #include "opt_inet.h"
 
@@ -816,7 +816,7 @@ gfe_rx_rxqinit(struct gfe_softc *sc, enu
 	ds = rxq->rxq_buf_mem.gdm_map->dm_segs;
 	nxtaddr = rxq->rxq_desc_busaddr + sizeof(*rxd);
 	for (idx = 0, rxd = rxq->rxq_descs; idx < GE_RXDESC_MAX;
-	idx++, nxtaddr += sizeof(*(++rxd))) {
+	idx++, rxd++, nxtaddr += sizeof(*rxd)) {
 		rxd->ed_lencnt = htogt32(GE_RXBUF_SIZE << 16);
 		rxd->ed_cmdsts = htogt32(RX_CMD_F|RX_CMD_L|RX_CMD_O|RX_CMD_EI);
 		rxd->ed_bufptr = htogt32(ds->ds_addr + boff);



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

2015-01-11 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Mon Jan 12 01:02:35 UTC 2015

Modified Files:
src/sys/arch/arm/omap: omap3_sdhc.c

Log Message:
spell "regulator" correctly


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/omap/omap3_sdhc.c

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

Modified files:

Index: src/sys/arch/arm/omap/omap3_sdhc.c
diff -u src/sys/arch/arm/omap/omap3_sdhc.c:1.14 src/sys/arch/arm/omap/omap3_sdhc.c:1.15
--- src/sys/arch/arm/omap/omap3_sdhc.c:1.14	Sat Mar 29 23:32:41 2014
+++ src/sys/arch/arm/omap/omap3_sdhc.c	Mon Jan 12 01:02:35 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: omap3_sdhc.c,v 1.14 2014/03/29 23:32:41 matt Exp $	*/
+/*	$NetBSD: omap3_sdhc.c,v 1.15 2015/01/12 01:02:35 jakllsch Exp $	*/
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: omap3_sdhc.c,v 1.14 2014/03/29 23:32:41 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap3_sdhc.c,v 1.15 2015/01/12 01:02:35 jakllsch Exp $");
 
 #include "opt_omap.h"
 
@@ -206,7 +206,7 @@ obiosdhc_attach(device_t parent, device_
 	KASSERT(i < __arraycount(am335x_sdhc));
 #endif
 
-	/* XX: Turn-on regurator via I2C. */
+	/* XX: Turn-on regulator via I2C. */
 	/* XX: And enable ICLOCK/FCLOCK. */
 
 	/* MMCHS Soft reset */



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

2015-01-11 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Mon Jan 12 01:18:38 UTC 2015

Modified Files:
src/sys/arch/arm/arm32: arm32_boot.c

Log Message:
use IPL_NONE for CPU attach message serialization mutex


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/arm32/arm32_boot.c

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

Modified files:

Index: src/sys/arch/arm/arm32/arm32_boot.c
diff -u src/sys/arch/arm/arm32/arm32_boot.c:1.11 src/sys/arch/arm/arm32/arm32_boot.c:1.12
--- src/sys/arch/arm/arm32/arm32_boot.c:1.11	Sat Dec 13 16:11:01 2014
+++ src/sys/arch/arm/arm32/arm32_boot.c	Mon Jan 12 01:18:38 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: arm32_boot.c,v 1.11 2014/12/13 16:11:01 jmcneill Exp $	*/
+/*	$NetBSD: arm32_boot.c,v 1.12 2015/01/12 01:18:38 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003, 2005  Genetec Corporation.  All rights reserved.
@@ -123,7 +123,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: arm32_boot.c,v 1.11 2014/12/13 16:11:01 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: arm32_boot.c,v 1.12 2015/01/12 01:18:38 jakllsch Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -305,7 +305,7 @@ initarm_common(vaddr_t kvm_base, vsize_t
 #endif
 
 #ifdef MULTIPROCESSOR
-	mutex_init(&cpu_hatch_lock, MUTEX_DEFAULT, IPL_HIGH);
+	mutex_init(&cpu_hatch_lock, MUTEX_DEFAULT, IPL_NONE);
 #endif
 
 #ifdef VERBOSE_INIT_ARM



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

2015-01-11 Thread Dennis Ferguson
Module Name:src
Committed By:   dennis
Date:   Mon Jan 12 02:32:33 UTC 2015

Modified Files:
src/sys/arch/powerpc/include: asm.h

Log Message:
Name the offsets to the remaining fields in the ppc64
stack frame header.  Add a stack frame alignment macro
to avoid hard-coding that.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/powerpc/include/asm.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/powerpc/include/asm.h
diff -u src/sys/arch/powerpc/include/asm.h:1.47 src/sys/arch/powerpc/include/asm.h:1.48
--- src/sys/arch/powerpc/include/asm.h:1.47	Sat Aug 23 02:21:44 2014
+++ src/sys/arch/powerpc/include/asm.h	Mon Jan 12 02:32:33 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: asm.h,v 1.47 2014/08/23 02:21:44 matt Exp $	*/
+/*	$NetBSD: asm.h,v 1.48 2015/01/12 02:32:33 dennis Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -104,7 +104,11 @@
 # define SF_SP		 0
 # define SF_CR		 8
 # define SF_LR		16
+# define SF_COMP	24
+# define SF_LD		32
+# define SF_TOC		40
 # define SF_PARAM	SF_HEADER_SZ
+# define SF_ALIGN(x)	(((x) + 0xf) & ~0xf)
 
 # define _XENTRY(y)			\
 	.globl	y;			\



CVS commit: src/lib/libc/arch/powerpc64

2015-01-11 Thread Dennis Ferguson
Module Name:src
Committed By:   dennis
Date:   Mon Jan 12 02:48:20 UTC 2015

Modified Files:
src/lib/libc/arch/powerpc64: SYS.h
src/lib/libc/arch/powerpc64/sys: cerror.S

Log Message:
Replace the branch to __cerror() in powerpc64 syscall stubs
with inline code which does what __cerror() was doing.  #ifdef
that code (i.e. all code) out of cerror.S; __cerror() is no more.
This seems to be necessary to fix the link of rescue/rescue, and
should have the pleasant side effect of making all other workarounds
done to keep the 'b __cerror' working unnecessary.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/powerpc64/SYS.h
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/arch/powerpc64/sys/cerror.S

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

Modified files:

Index: src/lib/libc/arch/powerpc64/SYS.h
diff -u src/lib/libc/arch/powerpc64/SYS.h:1.3 src/lib/libc/arch/powerpc64/SYS.h:1.4
--- src/lib/libc/arch/powerpc64/SYS.h:1.3	Sat Aug 23 02:24:22 2014
+++ src/lib/libc/arch/powerpc64/SYS.h	Mon Jan 12 02:48:20 2015
@@ -1,13 +1,39 @@
-/*	$NetBSD: SYS.h,v 1.3 2014/08/23 02:24:22 matt Exp $	*/
+/*	$NetBSD: SYS.h,v 1.4 2015/01/12 02:48:20 dennis Exp $	*/
 
 #include 
 #include 
 
-#ifdef _CALL_AIX
-#define	BRANCH_TO_CERROR()	b	._C_LABEL(__cerror); nop
-#else
-#define	BRANCH_TO_CERROR()	b	_C_LABEL(__cerror)
-#endif
+/*
+ * Inline what __cerror() is generally used to do since branching
+ * to __cerror() can't be done reliably with the powerpc64 ABI.
+ */
+#ifdef _REENTRANT
+#define	_DO_CERROR_SF_SZ	(SF_SZ + SF_ALIGN(8))
+#define	_DO_CERROR()		mflr	%r0;\
+streg	%r31,-8(%r1)			;\
+streg	%r0,SF_LR(%r1)			;\
+stptru	%r1,-_DO_CERROR_SF_SZ(%r1)	;\
+mr	%r31,%r3			;\
+bl	PIC_PLT(_C_LABEL(__errno))	;\
+nop	;\
+stint	%r31,0(%r3)			;\
+addi	%r1,%r1,_DO_CERROR_SF_SZ	;\
+ldreg	%r0,SF_LR(%r1)			;\
+ldreg	%r31,-8(%r1)			;\
+mtlr	%r0;\
+li	%r3,-1;\
+li	%r4,-1;\
+blr
+#else	/* !_REENTRANT */
+#define	_DO_CERROR()		lwz	%r4,_C_LABEL(errno)@got(%r2)	;\
+stw	%r3,0(%r4)			;\
+li	%r3,-1;\
+li	%r4,-1;\
+blr
+#endif	/* _REENTRANT */
+
+/* Clearly BRANCH_TO_CERROR() no longer does that... */
+#define	BRANCH_TO_CERROR()	_DO_CERROR()
 
 #define	_DOSYSCALL(x)		li	%r0,(SYS_ ## x)		;\
 sc
@@ -19,7 +45,7 @@
 
 #define _SYSCALL(x,y)		.text;\
 .p2align 2			;\
-			2:	BRANCH_TO_CERROR()		;\
+			2:	_DO_CERROR()			;\
 _SYSCALL_NOERROR(x,y)		;\
 bso	2b
 
@@ -33,7 +59,7 @@
 
 #define PSEUDO(x,y)		_SYSCALL_NOERROR(x,y)		;\
 bnslr;\
-BRANCH_TO_CERROR()		;\
+_DO_CERROR()			;\
 END(x)
 
 #define RSYSCALL_NOERROR(x)	PSEUDO_NOERROR(x,x)

Index: src/lib/libc/arch/powerpc64/sys/cerror.S
diff -u src/lib/libc/arch/powerpc64/sys/cerror.S:1.6 src/lib/libc/arch/powerpc64/sys/cerror.S:1.7
--- src/lib/libc/arch/powerpc64/sys/cerror.S:1.6	Sat Aug 23 02:24:22 2014
+++ src/lib/libc/arch/powerpc64/sys/cerror.S	Mon Jan 12 02:48:20 2015
@@ -1,5 +1,8 @@
-/*	$NetBSD: cerror.S,v 1.6 2014/08/23 02:24:22 matt Exp $	*/
+/*	$NetBSD: cerror.S,v 1.7 2015/01/12 02:48:20 dennis Exp $	*/
 
+/* Now inlined in the syscall stubs.  Keep code for a while for mind changes. */
+
+#if 0
 #include 
 #include "SYS.h"
 
@@ -13,26 +16,24 @@
 ENTRY(__cerror)
 #ifdef _REENTRANT
 	mflr	%r0
-	streg	%r0,__SIZEOF_POINTER__(%r1)
-	stptru	%r1,-(4*__SIZEOF_POINTER__)(%r1) # allocate new stack frame
-	streg	%r31,(3*__SIZEOF_POINTER__)(%r1)
+	streg	%r0,SF_LR(%r1)
+	streg	%r31,-8(%r1)
+	stptru	%r1,-(SF_SZ+16)(%r1)	# allocate new stack frame
 	mr	%r31,%r3		# stash away in callee-saved register
 	bl	PIC_PLT(_C_LABEL(__errno))
 	nop
 	stint	%r31,0(%r3)
 
-	ldreg	%r31,(3*__SIZEOF_POINTER__)(%r1)
-	addi	%r1,%r1,4*__SIZEOF_POINTER__
-	ldreg	%r0,__SIZEOF_POINTER__(%r1)
+	addi	%r1,%r1,(SF_SZ+16)
+	ldreg	%r31,-8(%r1)
+	ldreg	%r0,SF_LR(%r1)
 	mtlr	%r0
 #else
-	.pushsection ".toc", "aw"
-.Lerrno:.tc	errno[TC], errno
-	.popsection
-	lwz	%r4,_C_LABEL(.Lerrno)@toc(%r2)
+	lwz	%r4,_C_LABEL(errno)@got(%r2)
 	stw	%r3,0(%r4)
 #endif /* _REENTRANT */
 	li	%r3,-1
 	li	%r4,-1
 	blr
 END(__cerror)
+#endif	/* 0 */