CVS commit: src/usr.bin/config

2014-10-18 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sat Oct 18 06:36:40 UTC 2014

Modified Files:
src/usr.bin/config: defs.h main.c sem.c sem.h

Log Message:
Keep track of attribute (module) dependency using hash2.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/usr.bin/config/defs.h
cvs rdiff -u -r1.68 -r1.69 src/usr.bin/config/main.c
cvs rdiff -u -r1.63 -r1.64 src/usr.bin/config/sem.c
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/config/sem.h

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

Modified files:

Index: src/usr.bin/config/defs.h
diff -u src/usr.bin/config/defs.h:1.57 src/usr.bin/config/defs.h:1.58
--- src/usr.bin/config/defs.h:1.57	Sun Oct 12 05:20:54 2014
+++ src/usr.bin/config/defs.h	Sat Oct 18 06:36:40 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.57 2014/10/12 05:20:54 uebayasi Exp $	*/
+/*	$NetBSD: defs.h,v 1.58 2014/10/18 06:36:40 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -483,6 +483,7 @@ struct	dlhash *defoptlint;	/* lint value
 struct	nvhash *deffstab;	/* defined file systems */
 struct	dlhash *optfiletab;	/* defopt'd option .h files */
 struct	hashtab *attrtab;	/* attributes (locators, etc.) */
+struct	hashtab *attrdeptab;	/* attribute dependencies */
 struct	hashtab *bdevmtab;	/* block devm lookup */
 struct	hashtab *cdevmtab;	/* character devm lookup */
 

Index: src/usr.bin/config/main.c
diff -u src/usr.bin/config/main.c:1.68 src/usr.bin/config/main.c:1.69
--- src/usr.bin/config/main.c:1.68	Tue Oct 14 08:00:27 2014
+++ src/usr.bin/config/main.c	Sat Oct 18 06:36:40 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.68 2014/10/14 08:00:27 uebayasi Exp $	*/
+/*	$NetBSD: main.c,v 1.69 2014/10/18 06:36:40 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -439,6 +439,9 @@ main(int argc, char **argv)
 		return 0;
 	}
 
+	yyfile = dependattrs;
+	dependattrs();
+
 	/*
 	 * Deal with option dependencies.
 	 */

Index: src/usr.bin/config/sem.c
diff -u src/usr.bin/config/sem.c:1.63 src/usr.bin/config/sem.c:1.64
--- src/usr.bin/config/sem.c:1.63	Sun Oct 12 15:35:40 2014
+++ src/usr.bin/config/sem.c	Sat Oct 18 06:36:40 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: sem.c,v 1.63 2014/10/12 15:35:40 uebayasi Exp $	*/
+/*	$NetBSD: sem.c,v 1.64 2014/10/18 06:36:40 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -96,6 +96,7 @@ initsem(void)
 {
 
 	attrtab = ht_new();
+	attrdeptab = ht_new();
 
 	allattr.a_name = netbsd;
 	TAILQ_INIT(allattr.a_files);
@@ -303,6 +304,7 @@ defattr(const char *name, struct loclist
 			attribute, name, dep-a_name);
 			return (1);
 		}
+		(void)ht_insert2(attrdeptab, name, dep-a_name, NULL);
 		CFGDBG(2, attr `%s' depends on attr `%s', name, dep-a_name);
 	}
 
@@ -530,6 +532,7 @@ defdev(struct devbase *dev, struct locli
 		 * Implicit attribute definition for device dependencies.
 		 */
 		refattr(al-al_this-a_name);
+		(void)ht_insert2(attrdeptab, dev-d_name, al-al_this-a_name, NULL);
 		CFGDBG(2, device `%s' depends on attr `%s', dev-d_name,
 		al-al_this-a_name);
 	}
@@ -1947,6 +1950,21 @@ selectattr(struct attr *a)
 	CFGDBG(3, attr selected `%s', a-a_name);
 }
 
+static int
+dumpattrdepcb2(const char *name1, const char *name2, void *v, void *arg)
+{
+
+	CFGDBG(3, attr `%s' depends on attr `%s', name1, name2);
+	return 0;
+}
+
+void
+dependattrs(void)
+{
+
+	ht_enumerate2(attrdeptab, dumpattrdepcb2, NULL);
+}
+
 /*
  * We have an instance of the base foo, so select it and all its
  * attributes for optional foo.
@@ -1959,6 +1977,7 @@ selectbase(struct devbase *d, struct dev
 
 	(void)ht_insert(selecttab, d-d_name, __UNCONST(d-d_name));
 	CFGDBG(3, devbase selected `%s', d-d_name);
+	CFGDBG(5, selecting dependencies of devbase `%s', d-d_name);
 	for (al = d-d_attrs; al != NULL; al = al-al_next) {
 		a = al-al_this;
 		expandattr(a, selectattr);

Index: src/usr.bin/config/sem.h
diff -u src/usr.bin/config/sem.h:1.14 src/usr.bin/config/sem.h:1.15
--- src/usr.bin/config/sem.h:1.14	Fri Oct 10 11:09:50 2014
+++ src/usr.bin/config/sem.h	Sat Oct 18 06:36:40 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: sem.h,v 1.14 2014/10/10 11:09:50 uebayasi Exp $	*/
+/*	$NetBSD: sem.h,v 1.15 2014/10/18 06:36:40 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -61,6 +61,7 @@ struct attr*refattr(const char *);
 int		getrefattr(const char *, struct attr **);
 void		expandattr(struct attr *, void (*)(struct attr *));
 void		selectattr(struct attr *);
+void		dependattrs(void);
 void		setmajor(struct devbase *, int);
 void		addconf(struct config *);
 void		setconf(struct nvlist **, const char *, struct nvlist *);



CVS commit: src/games

2014-10-18 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Oct 18 06:40:18 UTC 2014

Modified Files:
src/games/fortune/datfiles: fortunes2 limerick-o.real
src/games/hack: rumors

Log Message:
1) It's its
2) Whitespace
3) You're all too old to be confusing your with you're


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/games/fortune/datfiles/fortunes2
cvs rdiff -u -r1.6 -r1.7 src/games/fortune/datfiles/limerick-o.real
cvs rdiff -u -r1.2 -r1.3 src/games/hack/rumors

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

Modified files:

Index: src/games/fortune/datfiles/fortunes2
diff -u src/games/fortune/datfiles/fortunes2:1.53 src/games/fortune/datfiles/fortunes2:1.54
--- src/games/fortune/datfiles/fortunes2:1.53	Sat Feb 22 17:21:19 2014
+++ src/games/fortune/datfiles/fortunes2	Sat Oct 18 06:40:18 2014
@@ -2757,7 +2757,7 @@ confirm who I am.
 		-- Captain Freedom
 %
 	Old Barlow was a crossing-tender at a junction where an express train
-demolished an automobile and it's occupants. Being the chief witness, his
+demolished an automobile and its occupants. Being the chief witness, his
 testimony was vitally important. Barlow explained that the night was dark,
 and he waved his lantern frantically, but the driver of the car paid
 no attention to the signal.
@@ -55376,7 +55376,7 @@ You're not Dave.  Who are you?
 You're not drunk if you can lie on the floor without holding on.
 		-- Dean Martin
 %
-You're reasoning is excellent -- it's
+Your reasoning is excellent -- it's
 only your basic assumptions that are wrong.
 %
 You're ugly and your mother dresses you funny.

Index: src/games/fortune/datfiles/limerick-o.real
diff -u src/games/fortune/datfiles/limerick-o.real:1.6 src/games/fortune/datfiles/limerick-o.real:1.7
--- src/games/fortune/datfiles/limerick-o.real:1.6	Thu Oct 29 08:47:07 2009
+++ src/games/fortune/datfiles/limerick-o.real	Sat Oct 18 06:40:18 2014
@@ -1151,7 +1151,7 @@ A vengeful technician named Schmitz
 Caused a disk drive to go on the fritz.
 	He covered the platter
 	With bats' fecal matter.
-Now it's seek time is really the pits.
+Now its seek time is really the pits.
 %
 A very odd pair are the Pitts:
 His balls are as large as her tits,

Index: src/games/hack/rumors
diff -u src/games/hack/rumors:1.2 src/games/hack/rumors:1.3
--- src/games/hack/rumors:1.2	Sun Mar 28 22:43:03 2004
+++ src/games/hack/rumors	Sat Oct 18 06:40:18 2014
@@ -14,7 +14,7 @@ A dragon is just a Snake that ate a scro
 A fading corridor enlightens your insight.
 A glowing potion is too hot to drink.
 A good amulet may protect you against guards.
-A homunculus wouldnt want to hurt a wizard.
+A homunculus wouldn't want to hurt a wizard.
 A jaguar shouldn't frighten you.
 A long worm can be defined recursively. So how should you attack it?
 A long worm hits with all of its length.
@@ -437,7 +437,7 @@ To hit or not to hit, that is the questi
 To reach heaven, escape the dungeon while wearing a ring of levitation.
 Tranquillizers might get you killed.
 Travel fast, use some magic speed!
-Tripe on its own is revolting,  but with onions it's delicious!
+Tripe on its own is revolting, but with onions it's delicious!
 Try hacking in the wee hours: you will have more room.
 Try the fall back end run play against ghosts.
 Ulch, that meat was painted.
@@ -446,7 +446,7 @@ Vampires hate garlic.
 Vault guards always make sure you aren't a shopkeeper.
 Vault guards never disturb their Lords.
 Visitors are requested not to apply genocide to shopkeepers.
-WARNING from H.M. Govt:  Quaffing may be dangerous to your health.
+WARNING from H.M. Govt: Quaffing may be dangerous to your health.
 Wanna fly? Eat a bat.
 Want a hint? Zap a wand of make invisible on your weapon!
 Want fun? Throw a potion in a pool and go swimming!



CVS commit: src/share/examples/puffs/pgfs

2014-10-18 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Oct 18 07:11:07 UTC 2014

Modified Files:
src/share/examples/puffs/pgfs: pgfs_puffs.c

Log Message:
de-foodify comment


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/share/examples/puffs/pgfs/pgfs_puffs.c

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

Modified files:

Index: src/share/examples/puffs/pgfs/pgfs_puffs.c
diff -u src/share/examples/puffs/pgfs/pgfs_puffs.c:1.4 src/share/examples/puffs/pgfs/pgfs_puffs.c:1.5
--- src/share/examples/puffs/pgfs/pgfs_puffs.c:1.4	Wed Apr 11 14:26:44 2012
+++ src/share/examples/puffs/pgfs/pgfs_puffs.c	Sat Oct 18 07:11:07 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pgfs_puffs.c,v 1.4 2012/04/11 14:26:44 yamt Exp $	*/
+/*	$NetBSD: pgfs_puffs.c,v 1.5 2014/10/18 07:11:07 snj Exp $	*/
 
 /*-
  * Copyright (c)2010,2011 YAMAMOTO Takashi,
@@ -32,7 +32,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: pgfs_puffs.c,v 1.4 2012/04/11 14:26:44 yamt Exp $);
+__RCSID($NetBSD: pgfs_puffs.c,v 1.5 2014/10/18 07:11:07 snj Exp $);
 #endif /* not lint */
 
 #include assert.h
@@ -548,7 +548,7 @@ pgfs_node_read(struct puffs_usermount *p
 retry:
 	xc = begin(pu, read);
 	/*
-	 * try to update atime first as it's prune to conflict with other
+	 * try to update atime first as it's prone to conflict with other
 	 * transactions.  eg. read-ahead requests can conflict each other.
 	 * we don't want to retry my_lo_read as it's expensive.
 	 *



CVS commit: src/sys/uvm/pmap

2014-10-18 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 18 09:54:19 UTC 2014

Modified Files:
src/sys/uvm/pmap: pmap_tlb.c

Log Message:
Minor comment update.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/uvm/pmap/pmap_tlb.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/uvm/pmap/pmap_tlb.c
diff -u src/sys/uvm/pmap/pmap_tlb.c:1.8 src/sys/uvm/pmap/pmap_tlb.c:1.9
--- src/sys/uvm/pmap/pmap_tlb.c:1.8	Thu Apr  3 14:46:25 2014
+++ src/sys/uvm/pmap/pmap_tlb.c	Sat Oct 18 09:54:19 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_tlb.c,v 1.8 2014/04/03 14:46:25 matt Exp $	*/
+/*	$NetBSD: pmap_tlb.c,v 1.9 2014/10/18 09:54:19 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(0, $NetBSD: pmap_tlb.c,v 1.8 2014/04/03 14:46:25 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap_tlb.c,v 1.9 2014/10/18 09:54:19 skrll Exp $);
 
 /*
  * Manages address spaces in a TLB.
@@ -437,7 +437,7 @@ pmap_tlb_asid_reinitialize(struct pmap_t
 			tlb_invalidate_asids(KERNEL_PID + 1, ti-ti_asid_max);
 #else /* MULTIPROCESSOR  !PMAP_NEED_TLB_SHOOTDOWN */
 			/*
-			 * For those systems (PowerPC) that don't need require
+			 * For those systems (PowerPC) that don't require
 			 * cross cpu TLB shootdowns, we have to invalidate the
 			 * entire TLB because we can't record the ASIDs in use
 			 * on the other CPUs.  This is hopefully cheaper than



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

2014-10-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 18 11:02:14 UTC 2014

Modified Files:
src/sys/arch/arm/allwinner: awin_gige.c

Log Message:
Fix previous.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/allwinner/awin_gige.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/allwinner/awin_gige.c
diff -u src/sys/arch/arm/allwinner/awin_gige.c:1.9 src/sys/arch/arm/allwinner/awin_gige.c:1.10
--- src/sys/arch/arm/allwinner/awin_gige.c:1.9	Fri Oct 17 20:18:41 2014
+++ src/sys/arch/arm/allwinner/awin_gige.c	Sat Oct 18 11:02:14 2014
@@ -31,7 +31,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(1, $NetBSD: awin_gige.c,v 1.9 2014/10/17 20:18:41 jmcneill Exp $);
+__KERNEL_RCSID(1, $NetBSD: awin_gige.c,v 1.10 2014/10/18 11:02:14 martin Exp $);
 
 #include sys/param.h
 #include sys/bus.h
@@ -132,7 +132,7 @@ awin_gige_attach(device_t parent, device
 	 */
 	if (!prop_dictionary_get_cstring_nocopy(cfg, phy-type, phy_type))
 		phy_type = rgmii;
-	if (strcmp(phy_type, rgmii)) {
+	if (strcmp(phy_type, rgmii) == 0) {
 		clkreg = AWIN_GMAC_CLK_PIT | AWIN_GMAC_CLK_TCS_INT_RGMII;
 	} else if (strcmp(phy_type, mii)) {
 		clkreg = AWIN_GMAC_CLK_TCS_MII;



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

2014-10-18 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 18 11:23:17 UTC 2014

Modified Files:
src/sys/arch/arm/allwinner: awin_gige.c

Log Message:
fix the other strcmp too


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/allwinner/awin_gige.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/allwinner/awin_gige.c
diff -u src/sys/arch/arm/allwinner/awin_gige.c:1.10 src/sys/arch/arm/allwinner/awin_gige.c:1.11
--- src/sys/arch/arm/allwinner/awin_gige.c:1.10	Sat Oct 18 11:02:14 2014
+++ src/sys/arch/arm/allwinner/awin_gige.c	Sat Oct 18 11:23:17 2014
@@ -31,7 +31,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(1, $NetBSD: awin_gige.c,v 1.10 2014/10/18 11:02:14 martin Exp $);
+__KERNEL_RCSID(1, $NetBSD: awin_gige.c,v 1.11 2014/10/18 11:23:17 jmcneill Exp $);
 
 #include sys/param.h
 #include sys/bus.h
@@ -134,7 +134,7 @@ awin_gige_attach(device_t parent, device
 		phy_type = rgmii;
 	if (strcmp(phy_type, rgmii) == 0) {
 		clkreg = AWIN_GMAC_CLK_PIT | AWIN_GMAC_CLK_TCS_INT_RGMII;
-	} else if (strcmp(phy_type, mii)) {
+	} else if (strcmp(phy_type, mii) == 0) {
 		clkreg = AWIN_GMAC_CLK_TCS_MII;
 	} else {
 		panic(unknown phy type '%s', phy_type);



CVS commit: src/sys/external/bsd/drm2/include/linux

2014-10-18 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Sat Oct 18 11:39:54 UTC 2014

Modified Files:
src/sys/external/bsd/drm2/include/linux: io-mapping.h

Log Message:
A void function should not return a value from another void function.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/drm2/include/linux/io-mapping.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/external/bsd/drm2/include/linux/io-mapping.h
diff -u src/sys/external/bsd/drm2/include/linux/io-mapping.h:1.3 src/sys/external/bsd/drm2/include/linux/io-mapping.h:1.4
--- src/sys/external/bsd/drm2/include/linux/io-mapping.h:1.3	Thu Aug 28 13:45:59 2014
+++ src/sys/external/bsd/drm2/include/linux/io-mapping.h	Sat Oct 18 11:39:54 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: io-mapping.h,v 1.3 2014/08/28 13:45:59 riastradh Exp $	*/
+/*	$NetBSD: io-mapping.h,v 1.4 2014/10/18 11:39:54 njoly Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -146,7 +146,7 @@ static inline void
 io_mapping_unmap_atomic(struct io_mapping *mapping, void *ptr)
 {
 
-	return io_mapping_unmap(mapping, ptr);
+	io_mapping_unmap(mapping, ptr);
 }
 
 #endif  /* _LINUX_IO_MAPPING_H_ */



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

2014-10-18 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 18 12:36:08 UTC 2014

Modified Files:
src/sys/arch/arm/allwinner: awin_gige.c

Log Message:
support for phy power gpio pins


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/allwinner/awin_gige.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/allwinner/awin_gige.c
diff -u src/sys/arch/arm/allwinner/awin_gige.c:1.11 src/sys/arch/arm/allwinner/awin_gige.c:1.12
--- src/sys/arch/arm/allwinner/awin_gige.c:1.11	Sat Oct 18 11:23:17 2014
+++ src/sys/arch/arm/allwinner/awin_gige.c	Sat Oct 18 12:36:08 2014
@@ -31,7 +31,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(1, $NetBSD: awin_gige.c,v 1.11 2014/10/18 11:23:17 jmcneill Exp $);
+__KERNEL_RCSID(1, $NetBSD: awin_gige.c,v 1.12 2014/10/18 12:36:08 jmcneill Exp $);
 
 #include sys/param.h
 #include sys/bus.h
@@ -57,6 +57,7 @@ static int awin_gige_intr(void*);
 struct awin_gige_softc {
 	struct dwc_gmac_softc sc_core;
 	void *sc_ih;
+	struct awin_gpio_pindata sc_power_pin;
 };
 
 static const struct awin_gpio_pinset awin_gige_gpio_pinset = {
@@ -94,7 +95,7 @@ awin_gige_attach(device_t parent, device
 	const struct awin_locators * const loc = aio-aio_loc;
 	prop_dictionary_t cfg = device_properties(self);
 	uint32_t clkreg;
-	const char *phy_type;
+	const char *phy_type, *pin_name;
 
 	sc-sc_core.sc_dev = self;
 
@@ -121,6 +122,15 @@ awin_gige_attach(device_t parent, device
 	aprint_normal_dev(self, interrupting on irq %d\n,
 	 loc-loc_intr);
 
+	if (prop_dictionary_get_cstring_nocopy(cfg, phy-power, pin_name)) {
+		if (awin_gpio_pin_reserve(pin_name, sc-sc_power_pin)) {
+			awin_gpio_pindata_write(sc-sc_power_pin, 1);
+		} else {
+			aprint_error_dev(self,
+			failed to reserve GPIO \%s\\n, pin_name);
+		}
+	}
+
 	/*
 	 * Enable GMAC clock
 	 */



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

2014-10-18 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct 18 12:36:39 UTC 2014

Modified Files:
src/sys/arch/evbarm/awin: awin_machdep.c

Log Message:
setup gmac phy power gpio for Bananapi


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/evbarm/awin/awin_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/evbarm/awin/awin_machdep.c
diff -u src/sys/arch/evbarm/awin/awin_machdep.c:1.16 src/sys/arch/evbarm/awin/awin_machdep.c:1.17
--- src/sys/arch/evbarm/awin/awin_machdep.c:1.16	Fri Oct 17 20:24:18 2014
+++ src/sys/arch/evbarm/awin/awin_machdep.c	Sat Oct 18 12:36:39 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: awin_machdep.c,v 1.16 2014/10/17 20:24:18 jmcneill Exp $ */
+/*	$NetBSD: awin_machdep.c,v 1.17 2014/10/18 12:36:39 jmcneill Exp $ */
 
 /*
  * Machine dependent functions for kernel setup for TI OSK5912 board.
@@ -125,7 +125,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: awin_machdep.c,v 1.16 2014/10/17 20:24:18 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: awin_machdep.c,v 1.17 2014/10/18 12:36:39 jmcneill Exp $);
 
 #include opt_machdep.h
 #include opt_ddb.h
@@ -635,6 +635,10 @@ awin_device_register(device_t self, void
 		prop_dictionary_set_cstring(dict, audiopactrl, PH15);
 #endif
 
+#if AWIN_board == AWIN_bpi
+		prop_dictionary_set_cstring(dict, gmacpwren, PH23);
+#endif
+
 		/*
 		 * These pins have no connections.
 		 */
@@ -680,6 +684,9 @@ awin_device_register(device_t self, void
 			prop_dictionary_set_cstring(dict, phy-type, mii);
 		}
 #endif
+#if AWIN_BOARD == AWIN_bpi
+		prop_dictionary_set_cstring(dict, phy-power, gmacpwren);
+#endif
 		return;
 	}
 



CVS commit: src/sys/dev/ic

2014-10-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 18 12:43:26 UTC 2014

Modified Files:
src/sys/dev/ic: dwc_gmac_reg.h

Log Message:
Fix GMAC_MII_CLKMASK and add a few clk setup bits for it.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/ic/dwc_gmac_reg.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/ic/dwc_gmac_reg.h
diff -u src/sys/dev/ic/dwc_gmac_reg.h:1.5 src/sys/dev/ic/dwc_gmac_reg.h:1.6
--- src/sys/dev/ic/dwc_gmac_reg.h:1.5	Mon Oct 13 08:18:52 2014
+++ src/sys/dev/ic/dwc_gmac_reg.h	Sat Oct 18 12:43:25 2014
@@ -76,7 +76,21 @@
 
 #define	GMAC_MII_BUSY			__BIT(0)
 #define	GMAC_MII_WRITE			__BIT(1)
-#define	GMAC_MII_CLKMASK		__BITS(4,2)
+#define	GMAC_MII_CLK_60_100M_DIV42	0x0
+#define	GMAC_MII_CLK_100_150M_DIV62	0x1
+#define	GMAC_MII_CLK_25_35M_DIV16	0x2
+#define	GMAC_MII_CLK_35_60M_DIV26	0x3
+#define	GMAC_MII_CLK_150_250M_DIV102	0x4
+#define	GMAC_MII_CLK_250_300M_DIV124	0x5
+#define	GMAC_MII_CLK_DIV4		0x8
+#define	GMAC_MII_CLK_DIV6		0x9
+#define	GMAC_MII_CLK_DIV8		0xa
+#define	GMAC_MII_CLK_DIV10		0xb
+#define	GMAC_MII_CLK_DIV12		0xc
+#define	GMAC_MII_CLK_DIV14		0xd
+#define	GMAC_MII_CLK_DIV16		0xe
+#define	GMAC_MII_CLK_DIV18		0xf
+#define	GMAC_MII_CLKMASK		__BITS(5,2)
 
 #define	GMAC_BUSMODE_RESET		__BIT(0)
 



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

2014-10-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 18 12:45:25 UTC 2014

Modified Files:
src/sys/arch/arm/allwinner: awin_gige.c

Log Message:
Use symbolic constant instead of (wrong) magic number for mii clk selection.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/arm/allwinner/awin_gige.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/allwinner/awin_gige.c
diff -u src/sys/arch/arm/allwinner/awin_gige.c:1.12 src/sys/arch/arm/allwinner/awin_gige.c:1.13
--- src/sys/arch/arm/allwinner/awin_gige.c:1.12	Sat Oct 18 12:36:08 2014
+++ src/sys/arch/arm/allwinner/awin_gige.c	Sat Oct 18 12:45:25 2014
@@ -31,7 +31,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(1, $NetBSD: awin_gige.c,v 1.12 2014/10/18 12:36:08 jmcneill Exp $);
+__KERNEL_RCSID(1, $NetBSD: awin_gige.c,v 1.13 2014/10/18 12:45:25 martin Exp $);
 
 #include sys/param.h
 #include sys/bus.h
@@ -49,6 +49,7 @@ __KERNEL_RCSID(1, $NetBSD: awin_gige.c,
 #include dev/mii/miivar.h
 
 #include dev/ic/dwc_gmac_var.h
+#include dev/ic/dwc_gmac_reg.h
 
 static int awin_gige_match(device_t, cfdata_t, void *);
 static void awin_gige_attach(device_t, device_t, void *);
@@ -152,7 +153,7 @@ awin_gige_attach(device_t parent, device
 	awin_reg_set_clear(aio-aio_core_bst, aio-aio_ccm_bsh,
 	AWIN_GMAC_CLK_REG, clkreg, AWIN_GMAC_CLK_PIT|AWIN_GMAC_CLK_TCS);
 
-	dwc_gmac_attach(sc-sc_core, 2);
+	dwc_gmac_attach(sc-sc_core, GMAC_MII_CLK_150_250M_DIV102);
 }
 
 static int



CVS commit: [netbsd-7] src/sys/compat/freebsd

2014-10-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 18 14:04:58 UTC 2014

Modified Files:
src/sys/compat/freebsd [netbsd-7]: freebsd_sysctl.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #146):
sys/compat/freebsd/freebsd_sysctl.c: revision 1.17
I'm not sure reading from an unsanitized userland pointer is a good idea.
Some users might be tempted to give 0x01, in which case the kernel will
crash.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.16.4.1 src/sys/compat/freebsd/freebsd_sysctl.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/compat/freebsd/freebsd_sysctl.c
diff -u src/sys/compat/freebsd/freebsd_sysctl.c:1.16 src/sys/compat/freebsd/freebsd_sysctl.c:1.16.4.1
--- src/sys/compat/freebsd/freebsd_sysctl.c:1.16	Tue Feb 25 18:30:09 2014
+++ src/sys/compat/freebsd/freebsd_sysctl.c	Sat Oct 18 14:04:58 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: freebsd_sysctl.c,v 1.16 2014/02/25 18:30:09 pooka Exp $	*/
+/*	$NetBSD: freebsd_sysctl.c,v 1.16.4.1 2014/10/18 14:04:58 martin Exp $	*/
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: freebsd_sysctl.c,v 1.16 2014/02/25 18:30:09 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: freebsd_sysctl.c,v 1.16.4.1 2014/10/18 14:04:58 martin Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -90,7 +90,7 @@ freebsd_sys_sysctl(struct lwp *l, const 
 	} */
 	int error;
 	int name[CTL_MAXNAME];
-	size_t newlen, *oldlenp;
+	size_t newlen, *oldlenp, oldlen;
 	u_int namelen;
 	void *new, *old;
 
@@ -141,9 +141,14 @@ freebsd_sys_sysctl(struct lwp *l, const 
 
 		old = SCARG(uap, old);
 		oldlenp = SCARG(uap, oldlenp);
-		if (old == NULL || oldlenp == NULL || *oldlenp  sizeof(int))
+		if (old == NULL || oldlenp == NULL)
 			return(EINVAL);
 
+		if ((error = copyin(oldlenp, oldlen, sizeof(oldlen
+			return (error);
+		if (oldlen  sizeof(int))
+			return (EINVAL);
+
 		if ((locnew =
 		 (char *) malloc(newlen + 1, M_TEMP, M_WAITOK)) == NULL)
 			return(ENOMEM);
@@ -163,11 +168,11 @@ freebsd_sys_sysctl(struct lwp *l, const 
 
 		oidlen *= sizeof(int);
 		error = copyout(oid, SCARG(uap, old),
-MIN(oidlen, *SCARG(uap, oldlenp)));
+MIN(oidlen, oldlen));
 		if (error)
 			return(error);
 		ktrmibio(-1, UIO_READ, SCARG(uap, old),
-		MIN(oidlen, *SCARG(uap, oldlenp)),  0);
+		MIN(oidlen, oldlen),  0);
 
 		error = copyout(oidlen, SCARG(uap, oldlenp), sizeof(u_int));
 



CVS commit: [netbsd-7] src/doc

2014-10-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 18 14:06:58 UTC 2014

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

Log Message:
Ticket #146


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.57 -r1.1.2.58 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.57 src/doc/CHANGES-7.0:1.1.2.58
--- src/doc/CHANGES-7.0:1.1.2.57	Fri Oct 17 16:13:35 2014
+++ src/doc/CHANGES-7.0	Sat Oct 18 14:06:58 2014
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.0,v 1.1.2.57 2014/10/17 16:13:35 martin Exp $
+# $NetBSD: CHANGES-7.0,v 1.1.2.58 2014/10/18 14:06:58 martin Exp $
 
 A complete list of changes from the initial NetBSD 7.0 branch on 11 Aug 2014
 until the 7.0 release:
@@ -1663,3 +1663,9 @@ crypto/external/bsd/openssh/dist/auth.c	
 	For consistency use options.use_dns when getting the canonical
 	hostname (we do the same below for hosts.allow and deny).
 	[christos, ticket #145]
+
+sys/compat/freebsd/freebsd_sysctl.c		1.17
+
+	Do not access a userland pointer from kernel space directly, use
+	copyin() instead.
+	[maxv, ticket #146]



CVS commit: src/usr.bin/col

2014-10-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct 18 14:56:14 UTC 2014

Modified Files:
src/usr.bin/col: col.c

Log Message:
PR/49291: Henning Petersen: Problem with half-line feeds in input stream.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/usr.bin/col/col.c

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

Modified files:

Index: src/usr.bin/col/col.c
diff -u src/usr.bin/col/col.c:1.17 src/usr.bin/col/col.c:1.18
--- src/usr.bin/col/col.c:1.17	Wed Aug 31 12:24:57 2011
+++ src/usr.bin/col/col.c	Sat Oct 18 10:56:14 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: col.c,v 1.17 2011/08/31 16:24:57 plunky Exp $	*/
+/*	$NetBSD: col.c,v 1.18 2014/10/18 14:56:14 christos Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993, 1994
@@ -42,7 +42,7 @@ __COPYRIGHT(@(#) Copyright (c) 1990, 19
 #if 0
 static char sccsid[] = @(#)col.c	8.5 (Berkeley) 5/4/95;
 #endif
-__RCSID($NetBSD: col.c,v 1.17 2011/08/31 16:24:57 plunky Exp $);
+__RCSID($NetBSD: col.c,v 1.18 2014/10/18 14:56:14 christos Exp $);
 #endif /* not lint */
 
 #include ctype.h
@@ -368,7 +368,7 @@ flush_blanks(void)
 		PUTC('\n');
 	if (half) {
 		PUTC('\033');
-		PUTC('9');
+		PUTC('\011');
 		if (!nb)
 			PUTC('\r');
 	}



CVS commit: src/lib/libedit

2014-10-18 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sat Oct 18 15:07:03 UTC 2014

Modified Files:
src/lib/libedit: filecomplete.c

Log Message:
callers's - caller's


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/lib/libedit/filecomplete.c

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

Modified files:

Index: src/lib/libedit/filecomplete.c
diff -u src/lib/libedit/filecomplete.c:1.33 src/lib/libedit/filecomplete.c:1.34
--- src/lib/libedit/filecomplete.c:1.33	Sat Oct 18 08:33:23 2014
+++ src/lib/libedit/filecomplete.c	Sat Oct 18 15:07:02 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: filecomplete.c,v 1.33 2014/10/18 08:33:23 snj Exp $	*/
+/*	$NetBSD: filecomplete.c,v 1.34 2014/10/18 15:07:02 riz Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include config.h
 #if !defined(lint)  !defined(SCCSID)
-__RCSID($NetBSD: filecomplete.c,v 1.33 2014/10/18 08:33:23 snj Exp $);
+__RCSID($NetBSD: filecomplete.c,v 1.34 2014/10/18 15:07:02 riz Exp $);
 #endif /* not lint  not SCCSID */
 
 #include sys/types.h
@@ -64,7 +64,7 @@ static const Char break_chars[] = { ' ',
  * if ``user'' isn't valid user name or ``txt'' doesn't start
  * w/ '~', returns pointer to strdup()ed copy of ``txt''
  *
- * it's the callers's responsibility to free() the returned string
+ * it's the caller's responsibility to free() the returned string
  */
 char *
 fn_tilde_expand(const char *txt)



CVS commit: src/sys/arch

2014-10-18 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sat Oct 18 16:56:51 UTC 2014

Modified Files:
src/sys/arch/amd64/conf: ALL GENERIC XEN3_DOM0
src/sys/arch/i386/conf: ALL GENERIC INSTALL_FLOPPY XEN3_DOM0
src/sys/arch/x86/pci: files.pci

Log Message:
Install agp_* drivers where pchb(4) is installed except INSTALL_FLOPPY.

XXX
Config around agp(4) is done in quite wrong direction.
pchb - (agpbus) - agp - agp_*
should be:
pchb - (pcibus) - agp_* - (agpbus) - agp


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/amd64/conf/ALL
cvs rdiff -u -r1.399 -r1.400 src/sys/arch/amd64/conf/GENERIC
cvs rdiff -u -r1.109 -r1.110 src/sys/arch/amd64/conf/XEN3_DOM0
cvs rdiff -u -r1.386 -r1.387 src/sys/arch/i386/conf/ALL
cvs rdiff -u -r1.1114 -r1.1115 src/sys/arch/i386/conf/GENERIC
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/i386/conf/INSTALL_FLOPPY
cvs rdiff -u -r1.90 -r1.91 src/sys/arch/i386/conf/XEN3_DOM0
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/x86/pci/files.pci

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/ALL
diff -u src/sys/arch/amd64/conf/ALL:1.20 src/sys/arch/amd64/conf/ALL:1.21
--- src/sys/arch/amd64/conf/ALL:1.20	Fri Sep 19 17:30:03 2014
+++ src/sys/arch/amd64/conf/ALL	Sat Oct 18 16:56:51 2014
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.20 2014/09/19 17:30:03 christos Exp $
+# $NetBSD: ALL,v 1.21 2014/10/18 16:56:51 uebayasi Exp $
 # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp
 #
 # ALL machine description file
@@ -17,7 +17,7 @@ include 	arch/amd64/conf/std.amd64
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		ALL-$Revision: 1.20 $
+#ident 		ALL-$Revision: 1.21 $
 
 maxusers	64		# estimated number of users
 
@@ -454,6 +454,7 @@ hpet0	at ichlpcib?			# High Precision Ev
 fwhrng* at ichlpcib?			# Intel 82802 FWH Random Number Generator
 rdcpcib* at pci? dev ? function ?	# RDC Vortex86/PMX-1000 PCI-ISA w/
 pchb*	at pci? dev ? function ?	# PCI-Host bridges
+options 	AGP_X86
 pcib*	at pci? dev ? function ?	# PCI-ISA bridges
 ppb*	at pci? dev ? function ?	# PCI-PCI bridges
 # XXX 'puc's aren't really bridges, but there's no better place for them here

Index: src/sys/arch/amd64/conf/GENERIC
diff -u src/sys/arch/amd64/conf/GENERIC:1.399 src/sys/arch/amd64/conf/GENERIC:1.400
--- src/sys/arch/amd64/conf/GENERIC:1.399	Fri Sep 19 17:30:03 2014
+++ src/sys/arch/amd64/conf/GENERIC	Sat Oct 18 16:56:51 2014
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.399 2014/09/19 17:30:03 christos Exp $
+# $NetBSD: GENERIC,v 1.400 2014/10/18 16:56:51 uebayasi Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include	arch/amd64/conf/std.amd64
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		GENERIC-$Revision: 1.399 $
+#ident 		GENERIC-$Revision: 1.400 $
 
 maxusers	64		# estimated number of users
 
@@ -331,6 +331,7 @@ pci*	at ppb? bus ?
 
 # PCI bridges
 pchb*	at pci? dev ? function ?	# PCI-Host bridges
+options 	AGP_X86
 pcib*	at pci? dev ? function ?	# PCI-ISA bridges
 ppb*	at pci? dev ? function ?	# PCI-PCI bridges
 # XXX 'puc's aren't really bridges, but there's no better place for them here

Index: src/sys/arch/amd64/conf/XEN3_DOM0
diff -u src/sys/arch/amd64/conf/XEN3_DOM0:1.109 src/sys/arch/amd64/conf/XEN3_DOM0:1.110
--- src/sys/arch/amd64/conf/XEN3_DOM0:1.109	Sat Oct 11 09:50:03 2014
+++ src/sys/arch/amd64/conf/XEN3_DOM0	Sat Oct 18 16:56:51 2014
@@ -1,4 +1,4 @@
-# $NetBSD: XEN3_DOM0,v 1.109 2014/10/11 09:50:03 uebayasi Exp $
+# $NetBSD: XEN3_DOM0,v 1.110 2014/10/18 16:56:51 uebayasi Exp $
 
 include 	arch/amd64/conf/std.xen
 
@@ -255,6 +255,7 @@ ichlpcib* at pci? dev ? function ?	# Int
 	# watchdog and SpeedStep support
 pcib*	at pci? dev ? function ?	# PCI-ISA bridges
 pchb*	at pci? dev ? function ?	# PCI-Host bridges
+options 	AGP_X86
 ppb*	at pci? dev ? function ?	# PCI-PCI bridges
 # XXX 'puc's aren't really bridges, but there's no better place for them here
 puc*	at pci? dev ? function ?	# PCI universal comm. cards

Index: src/sys/arch/i386/conf/ALL
diff -u src/sys/arch/i386/conf/ALL:1.386 src/sys/arch/i386/conf/ALL:1.387
--- src/sys/arch/i386/conf/ALL:1.386	Fri Sep 19 17:30:03 2014
+++ src/sys/arch/i386/conf/ALL	Sat Oct 18 16:56:51 2014
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.386 2014/09/19 17:30:03 christos Exp $
+# $NetBSD: ALL,v 1.387 2014/10/18 16:56:51 uebayasi Exp $
 # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp
 #
 # ALL machine description file
@@ -17,7 +17,7 @@ include 	arch/i386/conf/std.i386
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		ALL-$Revision: 1.386 $
+#ident 		ALL-$Revision: 1.387 $
 
 maxusers	64		# estimated number of users
 
@@ -497,6 +497,7 @@ viapcib* at pci? dev ? function ?	# VIA 
 iic*	at viapcib?
 rdcpcib* at pci? dev ? function ?	# RDC Vortex86/PMX-1000 PCI-ISA w/
 pchb*	at pci? dev ?