CVS commit: src/sys/net

2014-09-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Sep  5 06:00:05 UTC 2014

Modified Files:
src/sys/net: rtsock.c

Log Message:
Don't use C++ new keyword


To generate a diff of this commit:
cvs rdiff -u -r1.163 -r1.164 src/sys/net/rtsock.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/net/rtsock.c
diff -u src/sys/net/rtsock.c:1.163 src/sys/net/rtsock.c:1.164
--- src/sys/net/rtsock.c:1.163	Sat Aug  9 05:33:01 2014
+++ src/sys/net/rtsock.c	Fri Sep  5 06:00:05 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtsock.c,v 1.163 2014/08/09 05:33:01 rtr Exp $	*/
+/*	$NetBSD: rtsock.c,v 1.164 2014/09/05 06:00:05 matt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rtsock.c,v 1.163 2014/08/09 05:33:01 rtr Exp $);
+__KERNEL_RCSID(0, $NetBSD: rtsock.c,v 1.164 2014/09/05 06:00:05 matt Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_inet.h
@@ -1379,7 +1379,6 @@ sysctl_rtable(SYSCTLFN_ARGS)
 {
 	void 	*where = oldp;
 	size_t	*given = oldlenp;
-	const void *new = newp;
 	int	i, s, error = EINVAL;
 	u_char  af;
 	struct	rt_walkarg w;
@@ -1387,7 +1386,7 @@ sysctl_rtable(SYSCTLFN_ARGS)
 	if (namelen == 1  name[0] == CTL_QUERY)
 		return sysctl_query(SYSCTLFN_CALL(rnode));
 
-	if (new)
+	if (newp)
 		return EPERM;
 	if (namelen != 3)
 		return EINVAL;



CVS commit: src/sys/net

2014-09-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Sep  5 06:01:24 UTC 2014

Modified Files:
src/sys/net: net_stats.h

Log Message:
Cast return value of _NET_STAT_GETREF


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/net/net_stats.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/net/net_stats.h
diff -u src/sys/net/net_stats.h:1.3 src/sys/net/net_stats.h:1.4
--- src/sys/net/net_stats.h:1.3	Sun May  4 07:22:14 2008
+++ src/sys/net/net_stats.h	Fri Sep  5 06:01:24 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: net_stats.h,v 1.3 2008/05/04 07:22:14 thorpej Exp $	*/
+/*	$NetBSD: net_stats.h,v 1.4 2014/09/05 06:01:24 matt Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 #ifdef _KERNEL
 #include sys/percpu.h
 
-#define	_NET_STAT_GETREF(stat)	percpu_getref((stat))
+#define	_NET_STAT_GETREF(stat)	((uint64_t *)percpu_getref((stat)))
 #define	_NET_STAT_PUTREF(stat)	percpu_putref((stat))
 
 #define	_NET_STATINC(stat, x)		\



CVS commit: src/sys/netinet

2014-09-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Sep  5 06:02:11 UTC 2014

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

Log Message:
Deanonymize structure for llinfo_arp.


To generate a diff of this commit:
cvs rdiff -u -r1.158 -r1.159 src/sys/netinet/if_arp.c

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

Modified files:

Index: src/sys/netinet/if_arp.c
diff -u src/sys/netinet/if_arp.c:1.158 src/sys/netinet/if_arp.c:1.159
--- src/sys/netinet/if_arp.c:1.158	Tue Jun  3 01:24:32 2014
+++ src/sys/netinet/if_arp.c	Fri Sep  5 06:02:11 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_arp.c,v 1.158 2014/06/03 01:24:32 ozaki-r Exp $	*/
+/*	$NetBSD: if_arp.c,v 1.159 2014/09/05 06:02:11 matt Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_arp.c,v 1.158 2014/06/03 01:24:32 ozaki-r Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_arp.c,v 1.159 2014/09/05 06:02:11 matt Exp $);
 
 #include opt_ddb.h
 #include opt_inet.h
@@ -153,7 +153,7 @@ static	struct llinfo_arp *arplookup(stru
 static	void in_arpinput(struct mbuf *);
 static	void arp_drainstub(void);
 
-LIST_HEAD(, llinfo_arp) llinfo_arp;
+LIST_HEAD(llinfo_arpq, llinfo_arp) llinfo_arp;
 struct	ifqueue arpintrq = {
 	.ifq_head = NULL,
 	.ifq_tail = NULL,



CVS commit: src/sys/netinet

2014-09-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Sep  5 06:03:51 UTC 2014

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

Log Message:
Don't use C++ keywords (class, template) as variables


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/netinet/tcp_vtw.c

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

Modified files:

Index: src/sys/netinet/tcp_vtw.c
diff -u src/sys/netinet/tcp_vtw.c:1.10 src/sys/netinet/tcp_vtw.c:1.11
--- src/sys/netinet/tcp_vtw.c:1.10	Sun Sep 15 14:47:40 2013
+++ src/sys/netinet/tcp_vtw.c	Fri Sep  5 06:03:51 2014
@@ -124,7 +124,7 @@
 
 #include netinet/tcp_vtw.h
 
-__KERNEL_RCSID(0, $NetBSD: tcp_vtw.c,v 1.10 2013/09/15 14:47:40 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: tcp_vtw.c,v 1.11 2014/09/05 06:03:51 matt Exp $);
 
 #define db_trace(__a, __b)	do { } while (/*CONSTCOND*/0)
 
@@ -1342,9 +1342,9 @@ vtw_init(fatp_ctl_t *fat, vtw_ctl_t *ctl
 /*!\brief	map class to TCP MSL
  */
 static inline uint32_t
-class_to_msl(int class)
+class_to_msl(int msl_class)
 {
-	switch (class) {
+	switch (msl_class) {
 	case 0:
 	case 1:
 		return tcp_msl_remote ? tcp_msl_remote : (TCPTV_MSL  0);
@@ -1875,7 +1875,7 @@ vtw_control(int af, uint32_t msl)
 {
 	fatp_ctl_t	*fat;
 	vtw_ctl_t	*ctl;
-	int		class	= msl_to_class(msl);
+	int		msl_class = msl_to_class(msl);
 
 	if (!vtw_select(af, fat, ctl))
 		return NULL;
@@ -1893,7 +1893,7 @@ vtw_control(int af, uint32_t msl)
 		tcbtable.vestige = tcp_hooks;
 	}
 
-	return ctl + class;
+	return ctl + msl_class;
 }
 
 /*!\brief	add TCP pcb to vestigial timewait
@@ -2249,12 +2249,12 @@ vtw_earlyinit(void)
 /*!\brief	add lalp, fafp entries for debug
  */
 int
-vtw_debug_add(int af, sin_either_t *la, sin_either_t *fa, int msl, int class)
+vtw_debug_add(int af, sin_either_t *la, sin_either_t *fa, int msl, int msl_class)
 {
 	vtw_ctl_t	*ctl;
 	vtw_t		*vtw;
 
-	ctl = vtw_control(af, msl ? msl : class_to_msl(class));
+	ctl = vtw_control(af, msl ? msl : class_to_msl(msl_class));
 	if (!ctl)
 		return 0;
 



CVS commit: src/sys/netinet

2014-09-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Sep  5 06:04:43 UTC 2014

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

Log Message:
Don't use C++ keyword (template) as variable.


To generate a diff of this commit:
cvs rdiff -u -r1.255 -r1.256 src/sys/netinet/tcp_subr.c

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

Modified files:

Index: src/sys/netinet/tcp_subr.c
diff -u src/sys/netinet/tcp_subr.c:1.255 src/sys/netinet/tcp_subr.c:1.256
--- src/sys/netinet/tcp_subr.c:1.255	Sun Mar 16 05:20:30 2014
+++ src/sys/netinet/tcp_subr.c	Fri Sep  5 06:04:43 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: tcp_subr.c,v 1.255 2014/03/16 05:20:30 dholland Exp $	*/
+/*	$NetBSD: tcp_subr.c,v 1.256 2014/09/05 06:04:43 matt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: tcp_subr.c,v 1.255 2014/03/16 05:20:30 dholland Exp $);
+__KERNEL_RCSID(0, $NetBSD: tcp_subr.c,v 1.256 2014/09/05 06:04:43 matt Exp $);
 
 #include opt_inet.h
 #include opt_ipsec.h
@@ -635,7 +635,7 @@ tcp_template(struct tcpcb *tp)
  * segment are as specified by the parameters.
  */
 int
-tcp_respond(struct tcpcb *tp, struct mbuf *template, struct mbuf *m,
+tcp_respond(struct tcpcb *tp, struct mbuf *mtemplate, struct mbuf *m,
 struct tcphdr *th0, tcp_seq ack, tcp_seq seq, int flags)
 {
 #ifdef INET6
@@ -673,11 +673,11 @@ tcp_respond(struct tcpcb *tp, struct mbu
 	ip6 = NULL;
 #endif
 	if (m == 0) {
-		if (!template)
+		if (!mtemplate)
 			return EINVAL;
 
 		/* get family information from template */
-		switch (mtod(template, struct ip *)-ip_v) {
+		switch (mtod(mtemplate, struct ip *)-ip_v) {
 		case 4:
 			family = AF_INET;
 			hlen = sizeof(struct ip);
@@ -710,8 +710,8 @@ tcp_respond(struct tcpcb *tp, struct mbu
 			tlen = 0;
 
 		m-m_data += max_linkhdr;
-		bcopy(mtod(template, void *), mtod(m, void *),
-			template-m_len);
+		bcopy(mtod(mtemplate, void *), mtod(m, void *),
+			mtemplate-m_len);
 		switch (family) {
 		case AF_INET:
 			ip = mtod(m, struct ip *);



CVS commit: src/sys/netinet6

2014-09-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Sep  5 06:06:31 UTC 2014

Modified Files:
src/sys/netinet6: in6_var.h

Log Message:
Don't nest structure definitions.


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/netinet6/in6_var.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/netinet6/in6_var.h
diff -u src/sys/netinet6/in6_var.h:1.70 src/sys/netinet6/in6_var.h:1.71
--- src/sys/netinet6/in6_var.h:1.70	Tue Jul  1 05:49:19 2014
+++ src/sys/netinet6/in6_var.h	Fri Sep  5 06:06:31 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: in6_var.h,v 1.70 2014/07/01 05:49:19 rtr Exp $	*/
+/*	$NetBSD: in6_var.h,v 1.71 2014/09/05 06:06:31 matt Exp $	*/
 /*	$KAME: in6_var.h,v 1.81 2002/06/08 11:16:51 itojun Exp $	*/
 
 /*
@@ -98,6 +98,7 @@ struct in6_ifextra {
 	int ndefrouters;
 };
 
+LIST_HEAD(in6_multihead, in6_multi);
 struct	in6_ifaddr {
 	struct	ifaddr ia_ifa;		/* protocol-independent info */
 #define	ia_ifp		ia_ifa.ifa_ifp
@@ -108,7 +109,7 @@ struct	in6_ifaddr {
 	struct	sockaddr_in6 ia_prefixmask; /* prefix mask */
 	u_int32_t ia_plen;		/* prefix length */
 	struct	in6_ifaddr *ia_next;	/* next in6 list of IP6 addresses */
-	LIST_HEAD(in6_multihead, in6_multi) ia6_multiaddrs;
+	struct	in6_multihead ia6_multiaddrs;
 	/* list of multicast addresses */
 	int	ia6_flags;
 



CVS commit: src/sys/netinet6

2014-09-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Sep  5 06:08:15 UTC 2014

Modified Files:
src/sys/netinet6: in6.c in6_ifattach.c in6_src.c nd6.h nd6_rtr.c

Log Message:
Don't use C++ keyword as variable.
Use different prefix for nd6_prefixctl members than for nd6_prefix members.


To generate a diff of this commit:
cvs rdiff -u -r1.174 -r1.175 src/sys/netinet6/in6.c
cvs rdiff -u -r1.91 -r1.92 src/sys/netinet6/in6_ifattach.c
cvs rdiff -u -r1.54 -r1.55 src/sys/netinet6/in6_src.c
cvs rdiff -u -r1.59 -r1.60 src/sys/netinet6/nd6.h
cvs rdiff -u -r1.93 -r1.94 src/sys/netinet6/nd6_rtr.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/netinet6/in6.c
diff -u src/sys/netinet6/in6.c:1.174 src/sys/netinet6/in6.c:1.175
--- src/sys/netinet6/in6.c:1.174	Tue Jul  1 23:01:54 2014
+++ src/sys/netinet6/in6.c	Fri Sep  5 06:08:15 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: in6.c,v 1.174 2014/07/01 23:01:54 justin Exp $	*/
+/*	$NetBSD: in6.c,v 1.175 2014/09/05 06:08:15 matt Exp $	*/
 /*	$KAME: in6.c,v 1.198 2001/07/18 09:12:38 itojun Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: in6.c,v 1.174 2014/07/01 23:01:54 justin Exp $);
+__KERNEL_RCSID(0, $NetBSD: in6.c,v 1.175 2014/09/05 06:08:15 matt Exp $);
 
 #include opt_inet.h
 #include opt_compat_netbsd.h
@@ -643,7 +643,7 @@ in6_control1(struct socket *so, u_long c
 	case SIOCAIFADDR_IN6:
 	{
 		int i;
-		struct nd_prefixctl pr0;
+		struct nd_prefixctl prc0;
 		struct nd_prefix *pr;
 
 		/* reject read-only flags */
@@ -679,17 +679,17 @@ in6_control1(struct socket *so, u_long c
 		 * convert mask to prefix length (prefixmask has already
 		 * been validated in in6_update_ifa().
 		 */
-		memset(pr0, 0, sizeof(pr0));
-		pr0.ndpr_ifp = ifp;
-		pr0.ndpr_plen = in6_mask2len(ifra-ifra_prefixmask.sin6_addr,
+		memset(prc0, 0, sizeof(prc0));
+		prc0.ndprc_ifp = ifp;
+		prc0.ndprc_plen = in6_mask2len(ifra-ifra_prefixmask.sin6_addr,
 		NULL);
-		if (pr0.ndpr_plen == 128) {
+		if (prc0.ndprc_plen == 128) {
 			break;	/* we don't need to install a host route. */
 		}
-		pr0.ndpr_prefix = ifra-ifra_addr;
+		prc0.ndprc_prefix = ifra-ifra_addr;
 		/* apply the mask for safety. */
 		for (i = 0; i  4; i++) {
-			pr0.ndpr_prefix.sin6_addr.s6_addr32[i] =
+			prc0.ndprc_prefix.sin6_addr.s6_addr32[i] =
 			ifra-ifra_prefixmask.sin6_addr.s6_addr32[i];
 		}
 		/*
@@ -699,19 +699,19 @@ in6_control1(struct socket *so, u_long c
 		 * later advertised RAs (when accept_rtadv is non 0), which is
 		 * an intended behavior.
 		 */
-		pr0.ndpr_raf_onlink = 1; /* should be configurable? */
-		pr0.ndpr_raf_auto =
+		prc0.ndprc_raf_onlink = 1; /* should be configurable? */
+		prc0.ndprc_raf_auto =
 		((ifra-ifra_flags  IN6_IFF_AUTOCONF) != 0);
-		pr0.ndpr_vltime = ifra-ifra_lifetime.ia6t_vltime;
-		pr0.ndpr_pltime = ifra-ifra_lifetime.ia6t_pltime;
+		prc0.ndprc_vltime = ifra-ifra_lifetime.ia6t_vltime;
+		prc0.ndprc_pltime = ifra-ifra_lifetime.ia6t_pltime;
 
 		/* add the prefix if not yet. */
-		if ((pr = nd6_prefix_lookup(pr0)) == NULL) {
+		if ((pr = nd6_prefix_lookup(prc0)) == NULL) {
 			/*
 			 * nd6_prelist_add will install the corresponding
 			 * interface route.
 			 */
-			if ((error = nd6_prelist_add(pr0, NULL, pr)) != 0)
+			if ((error = nd6_prelist_add(prc0, NULL, pr)) != 0)
 return error;
 			if (pr == NULL) {
 log(LOG_ERR, nd6_prelist_add succeeded but 

Index: src/sys/netinet6/in6_ifattach.c
diff -u src/sys/netinet6/in6_ifattach.c:1.91 src/sys/netinet6/in6_ifattach.c:1.92
--- src/sys/netinet6/in6_ifattach.c:1.91	Thu Jun  5 16:06:49 2014
+++ src/sys/netinet6/in6_ifattach.c	Fri Sep  5 06:08:15 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: in6_ifattach.c,v 1.91 2014/06/05 16:06:49 roy Exp $	*/
+/*	$NetBSD: in6_ifattach.c,v 1.92 2014/09/05 06:08:15 matt Exp $	*/
 /*	$KAME: in6_ifattach.c,v 1.124 2001/07/18 08:32:51 jinmei Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: in6_ifattach.c,v 1.91 2014/06/05 16:06:49 roy Exp $);
+__KERNEL_RCSID(0, $NetBSD: in6_ifattach.c,v 1.92 2014/09/05 06:08:15 matt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -529,7 +529,7 @@ in6_ifattach_linklocal(struct ifnet *ifp
 {
 	struct in6_ifaddr *ia __diagused;
 	struct in6_aliasreq ifra;
-	struct nd_prefixctl pr0;
+	struct nd_prefixctl prc0;
 	int i, error;
 
 	/*
@@ -597,24 +597,24 @@ in6_ifattach_linklocal(struct ifnet *ifp
 	 * and add it to the prefix list as a never-expire prefix.
 	 * XXX: this change might affect some existing code base...
 	 */
-	memset(pr0, 0, sizeof(pr0));
-	pr0.ndpr_ifp = ifp;
+	memset(prc0, 0, sizeof(prc0));
+	prc0.ndprc_ifp = ifp;
 	/* this should be 64 at this moment. */
-	pr0.ndpr_plen = in6_mask2len(ifra.ifra_prefixmask.sin6_addr, NULL);
-	pr0.ndpr_prefix = ifra.ifra_addr;
+	prc0.ndprc_plen = in6_mask2len(ifra.ifra_prefixmask.sin6_addr, NULL);
+	prc0.ndprc_prefix = ifra.ifra_addr;
 	

CVS commit: src/sys/ufs/ffs

2014-09-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Sep  5 06:10:08 UTC 2014

Modified Files:
src/sys/ufs/ffs: ffs_snapshot.c

Log Message:
Don't nest structure definitions.


To generate a diff of this commit:
cvs rdiff -u -r1.136 -r1.137 src/sys/ufs/ffs/ffs_snapshot.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/ffs/ffs_snapshot.c
diff -u src/sys/ufs/ffs/ffs_snapshot.c:1.136 src/sys/ufs/ffs/ffs_snapshot.c:1.137
--- src/sys/ufs/ffs/ffs_snapshot.c:1.136	Thu Jul 10 06:02:40 2014
+++ src/sys/ufs/ffs/ffs_snapshot.c	Fri Sep  5 06:10:07 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_snapshot.c,v 1.136 2014/07/10 06:02:40 dholland Exp $	*/
+/*	$NetBSD: ffs_snapshot.c,v 1.137 2014/09/05 06:10:07 matt Exp $	*/
 
 /*
  * Copyright 2000 Marshall Kirk McKusick. All Rights Reserved.
@@ -38,7 +38,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ffs_snapshot.c,v 1.136 2014/07/10 06:02:40 dholland Exp $);
+__KERNEL_RCSID(0, $NetBSD: ffs_snapshot.c,v 1.137 2014/09/05 06:10:07 matt Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_ffs.h
@@ -77,11 +77,13 @@ __KERNEL_RCSID(0, $NetBSD: ffs_snapshot
 
 #include uvm/uvm.h
 
+TAILQ_HEAD(inodelst, inode);			/* List of active snapshots */
+
 struct snap_info {
 	kmutex_t si_lock;			/* Lock this snapinfo */
 	kmutex_t si_snaplock;			/* Snapshot vnode common lock */
 	lwp_t *si_owner;			/* Sanplock owner */
-	TAILQ_HEAD(inodelst, inode) si_snapshots; /* List of active snapshots */
+	struct inodelst si_snapshots;		/* List of active snapshots */
 	daddr_t *si_snapblklist;		/* Snapshot block hints list */
 	uint32_t si_gen;			/* Incremented on change */
 };



CVS commit: src/sys/kern

2014-09-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Sep  5 06:50:58 UTC 2014

Modified Files:
src/sys/kern: kern_module.c

Log Message:
Missed a C++ keyword (DEBUG case)


To generate a diff of this commit:
cvs rdiff -u -r1.100 -r1.101 src/sys/kern/kern_module.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/kern/kern_module.c
diff -u src/sys/kern/kern_module.c:1.100 src/sys/kern/kern_module.c:1.101
--- src/sys/kern/kern_module.c:1.100	Fri Sep  5 05:57:21 2014
+++ src/sys/kern/kern_module.c	Fri Sep  5 06:50:58 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_module.c,v 1.100 2014/09/05 05:57:21 matt Exp $	*/
+/*	$NetBSD: kern_module.c,v 1.101 2014/09/05 06:50:58 matt Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_module.c,v 1.100 2014/09/05 05:57:21 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_module.c,v 1.101 2014/09/05 06:50:58 matt Exp $);
 
 #define _MODULE_INTERNAL
 
@@ -967,7 +967,7 @@ module_do_load(const char *name, bool is
 			 * available for each architecture, so we don't
 			 * print an error if they are missing.
 			 */
-			if (class != MODULE_CLASS_EXEC || error != ENOENT)
+			if (modclass != MODULE_CLASS_EXEC || error != ENOENT)
 module_error(vfs load failed for `%s', 
 error %d, name, error);
 #endif



CVS commit: src/sys/conf

2014-09-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Sep  5 06:52:12 UTC 2014

Modified Files:
src/sys/conf: Makefile.kern.inc

Log Message:
Add a commented out CWARNFLAGS to enable -Wc++-compat but don't treat them
as errors.


To generate a diff of this commit:
cvs rdiff -u -r1.172 -r1.173 src/sys/conf/Makefile.kern.inc

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/Makefile.kern.inc
diff -u src/sys/conf/Makefile.kern.inc:1.172 src/sys/conf/Makefile.kern.inc:1.173
--- src/sys/conf/Makefile.kern.inc:1.172	Thu Aug 21 07:57:25 2014
+++ src/sys/conf/Makefile.kern.inc	Fri Sep  5 06:52:12 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.kern.inc,v 1.172 2014/08/21 07:57:25 skrll Exp $
+#	$NetBSD: Makefile.kern.inc,v 1.173 2014/09/05 06:52:12 matt Exp $
 #
 # This file contains common `MI' targets and definitions and it is included
 # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}.
@@ -75,6 +75,7 @@ CWARNFLAGS+=	-Wold-style-definition
 CWARNFLAGS+=	-Wswitch -Wshadow
 CWARNFLAGS+=	-Wcast-qual -Wwrite-strings
 CWARNFLAGS+=	-Wno-unreachable-code
+#CWARNFLAGS+=	-Wc++-compat -Wno-error=c++-compat
 CWARNFLAGS+=	-Wno-pointer-sign -Wno-attributes
 .  if ${MACHINE} == i386 || ${MACHINE_ARCH} == x86_64 || \
 	${MACHINE_ARCH} == sparc64 || ${MACHINE} == prep



CVS commit: src/usr.bin/make

2014-09-05 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Sep  5 06:57:20 UTC 2014

Modified Files:
src/usr.bin/make: make.1

Log Message:
Reduce pirate slang.


To generate a diff of this commit:
cvs rdiff -u -r1.235 -r1.236 src/usr.bin/make/make.1

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/make/make.1
diff -u src/usr.bin/make/make.1:1.235 src/usr.bin/make/make.1:1.236
--- src/usr.bin/make/make.1:1.235	Thu Sep  4 19:07:47 2014
+++ src/usr.bin/make/make.1	Fri Sep  5 06:57:20 2014
@@ -1,4 +1,4 @@
-.\	$NetBSD: make.1,v 1.235 2014/09/04 19:07:47 christos Exp $
+.\	$NetBSD: make.1,v 1.236 2014/09/05 06:57:20 wiz Exp $
 .\
 .\ Copyright (c) 1990, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -2001,7 +2001,7 @@ Target is not eligible to be added to th
 rules, or as a child dependency for a target.
 .It Ic .JOIN
 Target is a fake node which is considered out of date only if any of its
-children ar out of date.
+children are out of date.
 .It Ic .MADE
 Mark all sources of this target as being up-to-date.
 .It Ic .MAKE



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

2014-09-05 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Sep  5 08:01:05 UTC 2014

Modified Files:
src/sys/arch/arm/samsung: exynos4_loc.c exynos4_reg.h exynos5_loc.c
exynos_gpio.c exynos_intr.h exynos_io.c exynos_io.h exynos_reg.h
exynos_smc.S exynos_soc.c exynos_var.h mct_reg.h mct_var.h smc.h

Log Message:
RCSId police


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/samsung/exynos4_loc.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/arm/samsung/exynos4_reg.h
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/samsung/exynos5_loc.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/samsung/exynos_gpio.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/samsung/exynos_intr.h \
src/sys/arch/arm/samsung/exynos_smc.S src/sys/arch/arm/samsung/mct_reg.h \
src/sys/arch/arm/samsung/smc.h
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/samsung/exynos_io.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/samsung/exynos_io.h
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/samsung/exynos_reg.h
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/arm/samsung/exynos_soc.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/samsung/exynos_var.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/samsung/mct_var.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/samsung/exynos4_loc.c
diff -u src/sys/arch/arm/samsung/exynos4_loc.c:1.10 src/sys/arch/arm/samsung/exynos4_loc.c:1.11
--- src/sys/arch/arm/samsung/exynos4_loc.c:1.10	Thu Aug 28 11:38:14 2014
+++ src/sys/arch/arm/samsung/exynos4_loc.c	Fri Sep  5 08:01:05 2014
@@ -1,3 +1,5 @@
+/*	$NetBSD: exynos4_loc.c,v 1.11 2014/09/05 08:01:05 skrll Exp $	*/
+
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
  * All rights reserved.

Index: src/sys/arch/arm/samsung/exynos4_reg.h
diff -u src/sys/arch/arm/samsung/exynos4_reg.h:1.12 src/sys/arch/arm/samsung/exynos4_reg.h:1.13
--- src/sys/arch/arm/samsung/exynos4_reg.h:1.12	Thu Sep  4 13:06:49 2014
+++ src/sys/arch/arm/samsung/exynos4_reg.h	Fri Sep  5 08:01:05 2014
@@ -1,4 +1,5 @@
-/* $NetBSD */
+/*	$NetBSD: exynos4_reg.h,v 1.13 2014/09/05 08:01:05 skrll Exp $	*/
+
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
  * All rights reserved.

Index: src/sys/arch/arm/samsung/exynos5_loc.c
diff -u src/sys/arch/arm/samsung/exynos5_loc.c:1.11 src/sys/arch/arm/samsung/exynos5_loc.c:1.12
--- src/sys/arch/arm/samsung/exynos5_loc.c:1.11	Thu Sep  4 13:06:49 2014
+++ src/sys/arch/arm/samsung/exynos5_loc.c	Fri Sep  5 08:01:05 2014
@@ -1,3 +1,5 @@
+/*	$NetBSD: exynos5_loc.c,v 1.12 2014/09/05 08:01:05 skrll Exp $	*/
+
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
  * All rights reserved.

Index: src/sys/arch/arm/samsung/exynos_gpio.c
diff -u src/sys/arch/arm/samsung/exynos_gpio.c:1.8 src/sys/arch/arm/samsung/exynos_gpio.c:1.9
--- src/sys/arch/arm/samsung/exynos_gpio.c:1.8	Tue Aug 26 11:49:39 2014
+++ src/sys/arch/arm/samsung/exynos_gpio.c	Fri Sep  5 08:01:05 2014
@@ -1,3 +1,5 @@
+/*	$NetBSD: exynos_gpio.c,v 1.9 2014/09/05 08:01:05 skrll Exp $	*/
+
 /*-
 * Copyright (c) 2014 The NetBSD Foundation, Inc.
 * All rights reserved.
@@ -32,7 +34,7 @@
 #include gpio.h
 
 #include sys/cdefs.h
-__KERNEL_RCSID(1, $NetBSD: exynos_gpio.c,v 1.8 2014/08/26 11:49:39 reinoud Exp $);
+__KERNEL_RCSID(1, $NetBSD: exynos_gpio.c,v 1.9 2014/09/05 08:01:05 skrll Exp $);
 
 #include sys/param.h
 #include sys/bus.h

Index: src/sys/arch/arm/samsung/exynos_intr.h
diff -u src/sys/arch/arm/samsung/exynos_intr.h:1.1 src/sys/arch/arm/samsung/exynos_intr.h:1.2
--- src/sys/arch/arm/samsung/exynos_intr.h:1.1	Sun Apr 13 02:26:26 2014
+++ src/sys/arch/arm/samsung/exynos_intr.h	Fri Sep  5 08:01:05 2014
@@ -1,3 +1,5 @@
+/*	$NetBSD: exynos_intr.h,v 1.2 2014/09/05 08:01:05 skrll Exp $	*/
+
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
  * All rights reserved.
Index: src/sys/arch/arm/samsung/exynos_smc.S
diff -u src/sys/arch/arm/samsung/exynos_smc.S:1.1 src/sys/arch/arm/samsung/exynos_smc.S:1.2
--- src/sys/arch/arm/samsung/exynos_smc.S:1.1	Sun Apr 13 02:26:26 2014
+++ src/sys/arch/arm/samsung/exynos_smc.S	Fri Sep  5 08:01:05 2014
@@ -1,4 +1,5 @@
-/*	$NetBSD: exynos_smc.S,v 1.1 2014/04/13 02:26:26 matt Exp $	*/
+/*	$NetBSD: exynos_smc.S,v 1.2 2014/09/05 08:01:05 skrll Exp $	*/
+
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -32,7 +33,7 @@
 #include arm/asm.h
 #include arm/armreg.h
 
-RCSID($NetBSD: exynos_smc.S,v 1.1 2014/04/13 02:26:26 matt Exp $)
+RCSID($NetBSD: exynos_smc.S,v 1.2 2014/09/05 08:01:05 skrll Exp $)
 
 /*
  * void
Index: src/sys/arch/arm/samsung/mct_reg.h
diff -u src/sys/arch/arm/samsung/mct_reg.h:1.1 src/sys/arch/arm/samsung/mct_reg.h:1.2
--- src/sys/arch/arm/samsung/mct_reg.h:1.1	Sun Apr 13 02:26:26 2014
+++ src/sys/arch/arm/samsung/mct_reg.h	Fri Sep  5 08:01:05 2014
@@ -1,4 +1,5 @@
-/* $NetBSD */
+/*	$NetBSD: mct_reg.h,v 1.2 2014/09/05 08:01:05 skrll Exp $	*/
+
 /*-
  * Copyright (c) 2014 The NetBSD 

CVS commit: src/sys/sys

2014-09-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Sep  5 09:17:04 UTC 2014

Modified Files:
src/sys/sys: file.h

Log Message:
Avoid casting f_data, make it a union of the various pointers it can be.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/sys/file.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/sys/file.h
diff -u src/sys/sys/file.h:1.76 src/sys/sys/file.h:1.77
--- src/sys/sys/file.h:1.76	Fri Sep  5 05:42:50 2014
+++ src/sys/sys/file.h	Fri Sep  5 09:17:04 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: file.h,v 1.76 2014/09/05 05:42:50 matt Exp $	*/
+/*	$NetBSD: file.h,v 1.77 2014/09/05 09:17:04 matt Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -101,11 +101,25 @@ struct fileops {
  * This structure is exported via the KERN_FILE and KERN_FILE2 sysctl
  * calls.  Only add members to the end, do not delete them.
  */
+union file_data {
+	struct vnode *fd_vp;		// DTYPE_VNODE
+	struct socket *fd_so;		// DTYPE_SOCKET
+	struct pipe *fd_pipe;		// DTYPE_PIPE
+	struct kqueue *fd_kq;		// DTYPE_KQUEUE
+	void *fd_data;			// DTYPE_MISC
+	struct rnd_ctx *fd_rndctx;	// DTYPE_MISC (rnd)
+	int fd_devunit;			// DTYPE_MISC (tap)
+	struct bpf_d *fd_bpf;		// DTYPE_MISC (bpf)
+	struct fcrypt *fd_fcrypt;	// DTYPE_CRYPTO is not used
+	struct mqueue *fd_mq;		// DTYPE_MQUEUE
+	struct ksem *fd_ks;		// DTYPE_SEM
+};
+
 struct file {
 	off_t		f_offset;	/* first, is 64-bit */
 	kauth_cred_t 	f_cred;		/* creds associated with descriptor */
 	const struct fileops *f_ops;
-	void		*f_data;	/* descriptor data, e.g. vnode/socket */
+	union file_data	f_undata;	/* descriptor data, e.g. vnode/socket */
 	LIST_ENTRY(file) f_list;	/* list of active files */
 	kmutex_t	f_lock;		/* lock on structure */
 	int		f_flag;		/* see fcntl.h */
@@ -118,6 +132,18 @@ struct file {
 	SLIST_ENTRY(file) f_unplist;	/* deferred close: see uipc_usrreq.c */
 };
 
+#define f_vnode		f_undata.fd_vp
+#define f_socket	f_undata.fd_so
+#define f_pipe		f_undata.fd_pipe
+#define f_kqueue	f_undata.fd_kq
+#define f_data		f_undata.fd_data
+#define f_mqueue	f_undata.fd_mq
+#define f_ksem		f_undata.fd_ks
+
+#define f_rndctx	f_undata.fd_rndctx
+#define f_devunit	f_undata.fd_devunit
+#define f_bpf		f_undata.fd_bpf
+#define f_fcrypt	f_undata.fd_fcrypt
 #endif
 
 /*



CVS commit: src/sys/kern

2014-09-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Sep  5 09:20:59 UTC 2014

Modified Files:
src/sys/kern: exec_script.c kern_descrip.c kern_event.c
kern_ktrace_vfs.c subr_exec_fd.c sys_aio.c sys_descrip.c
sys_generic.c sys_mqueue.c sys_pipe.c sys_socket.c tty_ptm.c
uipc_domain.c uipc_sem.c uipc_socket.c uipc_syscalls.c
uipc_usrreq.c vfs_syscalls.c vfs_vnops.c vfs_xattr.c

Log Message:
Try not to use f_data, use f_{vnode,socket,pipe,mqueue,kqueue,ksem} to get
a correctly typed pointer.


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/kern/exec_script.c
cvs rdiff -u -r1.226 -r1.227 src/sys/kern/kern_descrip.c
cvs rdiff -u -r1.81 -r1.82 src/sys/kern/kern_event.c
cvs rdiff -u -r1.1 -r1.2 src/sys/kern/kern_ktrace_vfs.c
cvs rdiff -u -r1.6 -r1.7 src/sys/kern/subr_exec_fd.c
cvs rdiff -u -r1.39 -r1.40 src/sys/kern/sys_aio.c
cvs rdiff -u -r1.29 -r1.30 src/sys/kern/sys_descrip.c
cvs rdiff -u -r1.129 -r1.130 src/sys/kern/sys_generic.c
cvs rdiff -u -r1.36 -r1.37 src/sys/kern/sys_mqueue.c
cvs rdiff -u -r1.139 -r1.140 src/sys/kern/sys_pipe.c
cvs rdiff -u -r1.72 -r1.73 src/sys/kern/sys_socket.c
cvs rdiff -u -r1.33 -r1.34 src/sys/kern/tty_ptm.c
cvs rdiff -u -r1.94 -r1.95 src/sys/kern/uipc_domain.c
cvs rdiff -u -r1.41 -r1.42 src/sys/kern/uipc_sem.c
cvs rdiff -u -r1.234 -r1.235 src/sys/kern/uipc_socket.c
cvs rdiff -u -r1.172 -r1.173 src/sys/kern/uipc_syscalls.c
cvs rdiff -u -r1.170 -r1.171 src/sys/kern/uipc_usrreq.c
cvs rdiff -u -r1.490 -r1.491 src/sys/kern/vfs_syscalls.c
cvs rdiff -u -r1.190 -r1.191 src/sys/kern/vfs_vnops.c
cvs rdiff -u -r1.32 -r1.33 src/sys/kern/vfs_xattr.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/kern/exec_script.c
diff -u src/sys/kern/exec_script.c:1.73 src/sys/kern/exec_script.c:1.74
--- src/sys/kern/exec_script.c:1.73	Mon Jun 30 17:31:15 2014
+++ src/sys/kern/exec_script.c	Fri Sep  5 09:20:59 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: exec_script.c,v 1.73 2014/06/30 17:31:15 maxv Exp $	*/
+/*	$NetBSD: exec_script.c,v 1.74 2014/09/05 09:20:59 matt Exp $	*/
 
 /*
  * Copyright (c) 1993, 1994, 1996 Christopher G. Demetriou
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: exec_script.c,v 1.73 2014/06/30 17:31:15 maxv Exp $);
+__KERNEL_RCSID(0, $NetBSD: exec_script.c,v 1.74 2014/09/05 09:20:59 matt Exp $);
 
 #if defined(SETUIDSCRIPTS)  !defined(FDSCRIPTS)
 #define FDSCRIPTS		/* Need this for safe set-id scripts. */
@@ -228,7 +228,7 @@ check_shell:
 		epp-ep_flags |= EXEC_HASFD;
 		fp-f_type = DTYPE_VNODE;
 		fp-f_ops = vnops;
-		fp-f_data = (void *) epp-ep_vp;
+		fp-f_vnode = epp-ep_vp;
 		fp-f_flag = FREAD;
 		fd_affix(curproc, fp, epp-ep_fd);
 	}

Index: src/sys/kern/kern_descrip.c
diff -u src/sys/kern/kern_descrip.c:1.226 src/sys/kern/kern_descrip.c:1.227
--- src/sys/kern/kern_descrip.c:1.226	Fri Sep  5 05:57:21 2014
+++ src/sys/kern/kern_descrip.c	Fri Sep  5 09:20:59 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_descrip.c,v 1.226 2014/09/05 05:57:21 matt Exp $	*/
+/*	$NetBSD: kern_descrip.c,v 1.227 2014/09/05 09:20:59 matt Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_descrip.c,v 1.226 2014/09/05 05:57:21 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_descrip.c,v 1.227 2014/09/05 09:20:59 matt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -492,7 +492,7 @@ fd_getvnode(unsigned fd, file_t **fpp)
 		fd_putfile(fd);
 		return EINVAL;
 	}
-	vp = fp-f_data;
+	vp = fp-f_vnode;
 	if (__predict_false(vp-v_type == VBAD)) {
 		/* XXX Is this case really necessary? */
 		fd_putfile(fd);
@@ -517,7 +517,7 @@ fd_getsock1(unsigned fd, struct socket *
 		fd_putfile(fd);
 		return ENOTSOCK;
 	}
-	*sop = (*fp)-f_data;
+	*sop = (*fp)-f_socket;
 	return 0;
 }
 
@@ -704,7 +704,7 @@ fd_close(unsigned fd)
 		lf.l_len = 0;
 		lf.l_type = F_UNLCK;
 		mutex_exit(fdp-fd_lock);
-		(void)VOP_ADVLOCK(fp-f_data, p, F_UNLCK, lf, F_POSIX);
+		(void)VOP_ADVLOCK(fp-f_vnode, p, F_UNLCK, lf, F_POSIX);
 		mutex_enter(fdp-fd_lock);
 	}
 
@@ -825,7 +825,7 @@ closef(file_t *fp)
 		lf.l_start = 0;
 		lf.l_len = 0;
 		lf.l_type = F_UNLCK;
-		(void)VOP_ADVLOCK(fp-f_data, fp, F_UNLCK, lf, F_FLOCK);
+		(void)VOP_ADVLOCK(fp-f_vnode, fp, F_UNLCK, lf, F_FLOCK);
 	}
 	if (fp-f_ops != NULL) {
 		error = (*fp-f_ops-fo_close)(fp);
@@ -2301,7 +2301,7 @@ fill_file(struct kinfo_file *kp, const f
 
 	/* vnode information to glue this file to something */
 	if (fp-f_type == DTYPE_VNODE) {
-		struct vnode *vp = (struct vnode *)fp-f_data;
+		struct vnode *vp = fp-f_vnode;
 
 		kp-ki_vun =	PTRTOUINT64(vp-v_un.vu_socket);
 		kp-ki_vsize =	vp-v_size;

Index: src/sys/kern/kern_event.c
diff -u src/sys/kern/kern_event.c:1.81 src/sys/kern/kern_event.c:1.82
--- src/sys/kern/kern_event.c:1.81	Fri Sep  5 05:57:21 2014
+++ src/sys/kern/kern_event.c	Fri Sep  

CVS commit: src/sys/net

2014-09-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Sep  5 09:22:22 UTC 2014

Modified Files:
src/sys/net: bpf.c if_gre.c if_tap.c

Log Message:
Try not to use f_data, use f_{vnode,socket,pipe,mqueue,kqueue,ksem} to get
a correctly typed pointer.


To generate a diff of this commit:
cvs rdiff -u -r1.187 -r1.188 src/sys/net/bpf.c
cvs rdiff -u -r1.160 -r1.161 src/sys/net/if_gre.c
cvs rdiff -u -r1.77 -r1.78 src/sys/net/if_tap.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/net/bpf.c
diff -u src/sys/net/bpf.c:1.187 src/sys/net/bpf.c:1.188
--- src/sys/net/bpf.c:1.187	Thu Aug  7 03:40:21 2014
+++ src/sys/net/bpf.c	Fri Sep  5 09:22:22 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: bpf.c,v 1.187 2014/08/07 03:40:21 ozaki-r Exp $	*/
+/*	$NetBSD: bpf.c,v 1.188 2014/09/05 09:22:22 matt Exp $	*/
 
 /*
  * Copyright (c) 1990, 1991, 1993
@@ -39,7 +39,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bpf.c,v 1.187 2014/08/07 03:40:21 ozaki-r Exp $);
+__KERNEL_RCSID(0, $NetBSD: bpf.c,v 1.188 2014/09/05 09:22:22 matt Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_bpf.h
@@ -472,7 +472,7 @@ bpfopen(dev_t dev, int flag, int mode, s
 static int
 bpf_close(struct file *fp)
 {
-	struct bpf_d *d = fp-f_data;
+	struct bpf_d *d = fp-f_bpf;
 	int s;
 
 	KERNEL_LOCK(1, NULL);
@@ -497,7 +497,7 @@ bpf_close(struct file *fp)
 	seldestroy(d-bd_sel);
 	softint_disestablish(d-bd_sih);
 	free(d, M_DEVBUF);
-	fp-f_data = NULL;
+	fp-f_bpf = NULL;
 
 	KERNEL_UNLOCK_ONE(NULL);
 
@@ -522,7 +522,7 @@ static int
 bpf_read(struct file *fp, off_t *offp, struct uio *uio,
 kauth_cred_t cred, int flags)
 {
-	struct bpf_d *d = fp-f_data;
+	struct bpf_d *d = fp-f_bpf;
 	int timed_out;
 	int error;
 	int s;
@@ -663,7 +663,7 @@ static int
 bpf_write(struct file *fp, off_t *offp, struct uio *uio,
 kauth_cred_t cred, int flags)
 {
-	struct bpf_d *d = fp-f_data;
+	struct bpf_d *d = fp-f_bpf;
 	struct ifnet *ifp;
 	struct mbuf *m, *mc;
 	int error, s;
@@ -772,7 +772,7 @@ reset_d(struct bpf_d *d)
 static int
 bpf_ioctl(struct file *fp, u_long cmd, void *addr)
 {
-	struct bpf_d *d = fp-f_data;
+	struct bpf_d *d = fp-f_bpf;
 	int s, error = 0;
 
 	/*
@@ -1228,7 +1228,7 @@ bpf_ifname(struct ifnet *ifp, struct ifr
 static int
 bpf_stat(struct file *fp, struct stat *st)
 {
-	struct bpf_d *d = fp-f_data;
+	struct bpf_d *d = fp-f_bpf;
 
 	(void)memset(st, 0, sizeof(*st));
 	KERNEL_LOCK(1, NULL);
@@ -1254,7 +1254,7 @@ bpf_stat(struct file *fp, struct stat *s
 static int
 bpf_poll(struct file *fp, int events)
 {
-	struct bpf_d *d = fp-f_data;
+	struct bpf_d *d = fp-f_bpf;
 	int s = splnet();
 	int revents;
 
@@ -1323,7 +1323,7 @@ static const struct filterops bpfread_fi
 static int
 bpf_kqfilter(struct file *fp, struct knote *kn)
 {
-	struct bpf_d *d = fp-f_data;
+	struct bpf_d *d = fp-f_bpf;
 	struct klist *klist;
 	int s;
 

Index: src/sys/net/if_gre.c
diff -u src/sys/net/if_gre.c:1.160 src/sys/net/if_gre.c:1.161
--- src/sys/net/if_gre.c:1.160	Mon Aug 18 04:28:55 2014
+++ src/sys/net/if_gre.c	Fri Sep  5 09:22:22 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_gre.c,v 1.160 2014/08/18 04:28:55 riastradh Exp $ */
+/*	$NetBSD: if_gre.c,v 1.161 2014/09/05 09:22:22 matt Exp $ */
 
 /*
  * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
@@ -45,7 +45,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_gre.c,v 1.160 2014/08/18 04:28:55 riastradh Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_gre.c,v 1.161 2014/09/05 09:22:22 matt Exp $);
 
 #include opt_atalk.h
 #include opt_gre.h
@@ -1102,7 +1102,7 @@ gre_ssock(struct ifnet *ifp, struct gre_
 
 	GRE_DPRINTF(sc, \n);
 
-	so = (struct socket *)fp-f_data;
+	so = fp-f_socket;
 	pr = so-so_proto;
 
 	GRE_DPRINTF(sc, type %d, proto %d\n, pr-pr_type, pr-pr_protocol);

Index: src/sys/net/if_tap.c
diff -u src/sys/net/if_tap.c:1.77 src/sys/net/if_tap.c:1.78
--- src/sys/net/if_tap.c:1.77	Fri Jul 25 08:10:40 2014
+++ src/sys/net/if_tap.c	Fri Sep  5 09:22:22 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_tap.c,v 1.77 2014/07/25 08:10:40 dholland Exp $	*/
+/*	$NetBSD: if_tap.c,v 1.78 2014/09/05 09:22:22 matt Exp $	*/
 
 /*
  *  Copyright (c) 2003, 2004, 2008, 2009 The NetBSD Foundation.
@@ -33,7 +33,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_tap.c,v 1.77 2014/07/25 08:10:40 dholland Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_tap.c,v 1.78 2014/09/05 09:22:22 matt Exp $);
 
 #if defined(_KERNEL_OPT)
 
@@ -739,7 +739,7 @@ tap_cdev_open(dev_t dev, int flags, int 
  *
  * Once those two steps are successful, we can re-wire the existing file
  * descriptor to its new self.  This is done with fdclone():  it fills the fp
- * structure as needed (notably f_data gets filled with the fifth parameter
+ * structure as needed (notably f_devunit gets filled with the fifth parameter
  * passed, the unit of the tap device which will allows us identifying the
  * device later), and returns EMOVEFD.
  *
@@ -805,7 +805,7 @@ 

CVS commit: src/sys/compat

2014-09-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Sep  5 09:21:55 UTC 2014

Modified Files:
src/sys/compat/common: if_43.c uipc_syscalls_43.c vfs_syscalls_12.c
vfs_syscalls_20.c vfs_syscalls_30.c vfs_syscalls_43.c
vfs_syscalls_50.c
src/sys/compat/ibcs2: ibcs2_misc.c ibcs2_stat.c
src/sys/compat/netbsd32: netbsd32_compat_20.c netbsd32_compat_50.c
netbsd32_fs.c
src/sys/compat/osf1: osf1_file.c osf1_mount.c
src/sys/compat/ossaudio: ossaudio.c
src/sys/compat/sunos: sunos_ioctl.c sunos_misc.c
src/sys/compat/sunos32: sunos32_ioctl.c sunos32_misc.c
src/sys/compat/svr4: svr4_fcntl.c svr4_misc.c svr4_net.c svr4_socket.c
svr4_stream.c
src/sys/compat/svr4_32: svr4_32_fcntl.c svr4_32_misc.c svr4_32_net.c
svr4_32_socket.c
src/sys/compat/ultrix: ultrix_pathname.c

Log Message:
Try not to use f_data, use f_{vnode,socket,pipe,mqueue,kqueue,ksem} to get
a correctly typed pointer.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/compat/common/if_43.c
cvs rdiff -u -r1.44 -r1.45 src/sys/compat/common/uipc_syscalls_43.c
cvs rdiff -u -r1.30 -r1.31 src/sys/compat/common/vfs_syscalls_12.c
cvs rdiff -u -r1.37 -r1.38 src/sys/compat/common/vfs_syscalls_20.c
cvs rdiff -u -r1.33 -r1.34 src/sys/compat/common/vfs_syscalls_30.c
cvs rdiff -u -r1.56 -r1.57 src/sys/compat/common/vfs_syscalls_43.c
cvs rdiff -u -r1.17 -r1.18 src/sys/compat/common/vfs_syscalls_50.c
cvs rdiff -u -r1.112 -r1.113 src/sys/compat/ibcs2/ibcs2_misc.c
cvs rdiff -u -r1.47 -r1.48 src/sys/compat/ibcs2/ibcs2_stat.c
cvs rdiff -u -r1.33 -r1.34 src/sys/compat/netbsd32/netbsd32_compat_20.c
cvs rdiff -u -r1.26 -r1.27 src/sys/compat/netbsd32/netbsd32_compat_50.c
cvs rdiff -u -r1.70 -r1.71 src/sys/compat/netbsd32/netbsd32_fs.c
cvs rdiff -u -r1.42 -r1.43 src/sys/compat/osf1/osf1_file.c
cvs rdiff -u -r1.51 -r1.52 src/sys/compat/osf1/osf1_mount.c
cvs rdiff -u -r1.68 -r1.69 src/sys/compat/ossaudio/ossaudio.c
cvs rdiff -u -r1.61 -r1.62 src/sys/compat/sunos/sunos_ioctl.c
cvs rdiff -u -r1.168 -r1.169 src/sys/compat/sunos/sunos_misc.c
cvs rdiff -u -r1.29 -r1.30 src/sys/compat/sunos32/sunos32_ioctl.c
cvs rdiff -u -r1.74 -r1.75 src/sys/compat/sunos32/sunos32_misc.c
cvs rdiff -u -r1.71 -r1.72 src/sys/compat/svr4/svr4_fcntl.c
cvs rdiff -u -r1.155 -r1.156 src/sys/compat/svr4/svr4_misc.c
cvs rdiff -u -r1.60 -r1.61 src/sys/compat/svr4/svr4_net.c
cvs rdiff -u -r1.22 -r1.23 src/sys/compat/svr4/svr4_socket.c
cvs rdiff -u -r1.80 -r1.81 src/sys/compat/svr4/svr4_stream.c
cvs rdiff -u -r1.35 -r1.36 src/sys/compat/svr4_32/svr4_32_fcntl.c
cvs rdiff -u -r1.74 -r1.75 src/sys/compat/svr4_32/svr4_32_misc.c
cvs rdiff -u -r1.21 -r1.22 src/sys/compat/svr4_32/svr4_32_net.c
cvs rdiff -u -r1.12 -r1.13 src/sys/compat/svr4_32/svr4_32_socket.c
cvs rdiff -u -r1.38 -r1.39 src/sys/compat/ultrix/ultrix_pathname.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/common/if_43.c
diff -u src/sys/compat/common/if_43.c:1.7 src/sys/compat/common/if_43.c:1.8
--- src/sys/compat/common/if_43.c:1.7	Tue Jul  1 05:49:18 2014
+++ src/sys/compat/common/if_43.c	Fri Sep  5 09:21:54 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_43.c,v 1.7 2014/07/01 05:49:18 rtr Exp $	*/
+/*	$NetBSD: if_43.c,v 1.8 2014/09/05 09:21:54 matt Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1990, 1993
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_43.c,v 1.7 2014/07/01 05:49:18 rtr Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_43.c,v 1.8 2014/09/05 09:21:54 matt Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_compat_netbsd.h
@@ -216,7 +216,7 @@ compat_ifioctl(struct socket *so, u_long
 struct lwp *l)
 {
 	int error;
-	struct ifreq *ifr = data;
+	struct ifreq *ifr = (struct ifreq *)data;
 	struct ifnet *ifp = ifunit(ifr-ifr_name);
 	struct sockaddr *sa;
 

Index: src/sys/compat/common/uipc_syscalls_43.c
diff -u src/sys/compat/common/uipc_syscalls_43.c:1.44 src/sys/compat/common/uipc_syscalls_43.c:1.45
--- src/sys/compat/common/uipc_syscalls_43.c:1.44	Fri Nov 14 23:10:57 2008
+++ src/sys/compat/common/uipc_syscalls_43.c	Fri Sep  5 09:21:54 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_syscalls_43.c,v 1.44 2008/11/14 23:10:57 ad Exp $	*/
+/*	$NetBSD: uipc_syscalls_43.c,v 1.45 2014/09/05 09:21:54 matt Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1990, 1993
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uipc_syscalls_43.c,v 1.44 2008/11/14 23:10:57 ad Exp $);
+__KERNEL_RCSID(0, $NetBSD: uipc_syscalls_43.c,v 1.45 2014/09/05 09:21:54 matt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -92,7 +92,7 @@ compat_43_sys_accept(struct lwp *l, cons
 	} */
 	int error;
 
-	if ((error = sys_accept(l, (const void *)uap, retval)) != 0)
+	if ((error = sys_accept(l, (const struct sys_accept_args *)uap, retval)) != 0)
 		return error;
 
 	if 

CVS commit: src/sys/nfs

2014-09-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Sep  5 09:22:30 UTC 2014

Modified Files:
src/sys/nfs: nfs_syscalls.c

Log Message:
Try not to use f_data, use f_{vnode,socket,pipe,mqueue,kqueue,ksem} to get
a correctly typed pointer.


To generate a diff of this commit:
cvs rdiff -u -r1.154 -r1.155 src/sys/nfs/nfs_syscalls.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/nfs/nfs_syscalls.c
diff -u src/sys/nfs/nfs_syscalls.c:1.154 src/sys/nfs/nfs_syscalls.c:1.155
--- src/sys/nfs/nfs_syscalls.c:1.154	Wed Nov 27 22:10:47 2013
+++ src/sys/nfs/nfs_syscalls.c	Fri Sep  5 09:22:30 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_syscalls.c,v 1.154 2013/11/27 22:10:47 christos Exp $	*/
+/*	$NetBSD: nfs_syscalls.c,v 1.155 2014/09/05 09:22:30 matt Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: nfs_syscalls.c,v 1.154 2013/11/27 22:10:47 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: nfs_syscalls.c,v 1.155 2014/09/05 09:22:30 matt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -336,7 +336,7 @@ nfssvc_addsock(file_t *fp, struct mbuf *
 	int error;
 	int val;
 
-	so = (struct socket *)fp-f_data;
+	so = fp-f_socket;
 	tslp = (struct nfssvc_sock *)0;
 	/*
 	 * Add it to the list, as required.
@@ -800,7 +800,7 @@ nfsrv_slpderef(struct nfssvc_sock *slp)
 		if (fp != NULL) {
 			slp-ns_fp = NULL;
 			KASSERT(fp != NULL);
-			KASSERT(fp-f_data == slp-ns_so);
+			KASSERT(fp-f_socket == slp-ns_so);
 			KASSERT(fp-f_count  0);
 			closef(fp);
 			slp-ns_so = NULL;



CVS commit: src/sys/opencrypto

2014-09-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Sep  5 09:23:40 UTC 2014

Modified Files:
src/sys/opencrypto: cryptodev.c ocryptodev.c

Log Message:
Try not to use f_data, use f_fcrypt to get a correctly typed pointer.


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/sys/opencrypto/cryptodev.c
cvs rdiff -u -r1.5 -r1.6 src/sys/opencrypto/ocryptodev.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/opencrypto/cryptodev.c
diff -u src/sys/opencrypto/cryptodev.c:1.80 src/sys/opencrypto/cryptodev.c:1.81
--- src/sys/opencrypto/cryptodev.c:1.80	Mon Aug  4 14:17:18 2014
+++ src/sys/opencrypto/cryptodev.c	Fri Sep  5 09:23:40 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: cryptodev.c,v 1.80 2014/08/04 14:17:18 skrll Exp $ */
+/*	$NetBSD: cryptodev.c,v 1.81 2014/09/05 09:23:40 matt Exp $ */
 /*	$FreeBSD: src/sys/opencrypto/cryptodev.c,v 1.4.2.4 2003/06/03 00:09:02 sam Exp $	*/
 /*	$OpenBSD: cryptodev.c,v 1.53 2002/07/10 22:21:30 mickey Exp $	*/
 
@@ -64,7 +64,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cryptodev.c,v 1.80 2014/08/04 14:17:18 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: cryptodev.c,v 1.81 2014/09/05 09:23:40 matt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -220,7 +220,7 @@ cryptof_write(file_t *fp, off_t *poff,
 int
 cryptof_ioctl(struct file *fp, u_long cmd, void *data)
 {
-	struct fcrypt *fcr = fp-f_data;
+	struct fcrypt *fcr = fp-f_fcrypt;
 	struct csession *cse;
 	struct session_op *sop;
 	struct session_n_op *snop;
@@ -942,7 +942,7 @@ fail:
 static int
 cryptof_close(struct file *fp)
 {
-	struct fcrypt *fcr = fp-f_data;
+	struct fcrypt *fcr = fp-f_fcrypt;
 	struct csession *cse;
 
 	mutex_enter(crypto_mtx);
@@ -953,7 +953,7 @@ cryptof_close(struct file *fp)
 		mutex_enter(crypto_mtx);
 	}
 	seldestroy(fcr-sinfo);
-	fp-f_data = NULL;
+	fp-f_fcrypt = NULL;
 	crypto_refcount--;
 	mutex_exit(crypto_mtx);
 
@@ -2037,7 +2037,7 @@ fail:
 static int  
 cryptof_stat(struct file *fp, struct stat *st)
 {
-	struct fcrypt *fcr = fp-f_data;
+	struct fcrypt *fcr = fp-f_fcrypt;
 
 	(void)memset(st, 0, sizeof(*st));
 
@@ -2056,7 +2056,7 @@ cryptof_stat(struct file *fp, struct sta
 static int  
 cryptof_poll(struct file *fp, int events)
 {
-	struct fcrypt *fcr = (struct fcrypt *)fp-f_data;
+	struct fcrypt *fcr = fp-f_fcrypt;
 	int revents = 0;
 
 	if (!(events  (POLLIN | POLLRDNORM))) {

Index: src/sys/opencrypto/ocryptodev.c
diff -u src/sys/opencrypto/ocryptodev.c:1.5 src/sys/opencrypto/ocryptodev.c:1.6
--- src/sys/opencrypto/ocryptodev.c:1.5	Wed Jan  1 16:06:01 2014
+++ src/sys/opencrypto/ocryptodev.c	Fri Sep  5 09:23:40 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ocryptodev.c,v 1.5 2014/01/01 16:06:01 pgoyette Exp $ */
+/*	$NetBSD: ocryptodev.c,v 1.6 2014/09/05 09:23:40 matt Exp $ */
 /*	$FreeBSD: src/sys/opencrypto/cryptodev.c,v 1.4.2.4 2003/06/03 00:09:02 sam Exp $	*/
 /*	$OpenBSD: cryptodev.c,v 1.53 2002/07/10 22:21:30 mickey Exp $	*/
 
@@ -69,7 +69,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ocryptodev.c,v 1.5 2014/01/01 16:06:01 pgoyette Exp $);
+__KERNEL_RCSID(0, $NetBSD: ocryptodev.c,v 1.6 2014/09/05 09:23:40 matt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -109,7 +109,7 @@ static int	ocryptodev_msession(struct fc
 int
 ocryptof_ioctl(struct file *fp, u_long cmd, void *data)
 {
-	struct fcrypt *fcr = fp-f_data;
+	struct fcrypt *fcr = fp-f_fcrypt;
 	struct csession *cse;
 	struct osession_op *osop;
 	struct osession_n_op *osnop;



CVS commit: src/sys/dev

2014-09-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Sep  5 09:23:14 UTC 2014

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

Log Message:
Try not to use f_data, use f_rndctx to get a correctly typed pointer.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/rndpseudo.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/rndpseudo.c
diff -u src/sys/dev/rndpseudo.c:1.21 src/sys/dev/rndpseudo.c:1.22
--- src/sys/dev/rndpseudo.c:1.21	Sun Aug 10 16:44:35 2014
+++ src/sys/dev/rndpseudo.c	Fri Sep  5 09:23:14 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: rndpseudo.c,v 1.21 2014/08/10 16:44:35 tls Exp $	*/
+/*	$NetBSD: rndpseudo.c,v 1.22 2014/09/05 09:23:14 matt Exp $	*/
 
 /*-
  * Copyright (c) 1997-2013 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rndpseudo.c,v 1.21 2014/08/10 16:44:35 tls Exp $);
+__KERNEL_RCSID(0, $NetBSD: rndpseudo.c,v 1.22 2014/09/05 09:23:14 matt Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_compat_netbsd.h
@@ -360,7 +360,7 @@ rnd_read(struct file *fp, off_t *offp, s
 	if (uio-uio_resid == 0)
 		return 0;
 
-	struct rnd_ctx *const ctx = fp-f_data;
+	struct rnd_ctx *const ctx = fp-f_rndctx;
 	uint8_t *const buf = pool_cache_get(rnd_temp_buffer_cache, PR_WAITOK);
 
 	/*
@@ -817,7 +817,7 @@ rnd_ioctl(struct file *fp, u_long cmd, v
 static int
 rnd_poll(struct file *fp, int events)
 {
-	struct rnd_ctx *const ctx = fp-f_data;
+	struct rnd_ctx *const ctx = fp-f_rndctx;
 	int revents;
 
 	/*
@@ -846,7 +846,7 @@ rnd_poll(struct file *fp, int events)
 static int
 rnd_stat(struct file *fp, struct stat *st)
 {
-	struct rnd_ctx *const ctx = fp-f_data;
+	struct rnd_ctx *const ctx = fp-f_rndctx;
 
 	/* XXX lock, if cprng allocated?  why? */
 	memset(st, 0, sizeof(*st));
@@ -863,11 +863,11 @@ rnd_stat(struct file *fp, struct stat *s
 static int
 rnd_close(struct file *fp)
 {
-	struct rnd_ctx *const ctx = fp-f_data;
+	struct rnd_ctx *const ctx = fp-f_rndctx;
 
 	if (ctx-rc_cprng != NULL)
 		cprng_strong_destroy(ctx-rc_cprng);
-	fp-f_data = NULL;
+	fp-f_rndctx = NULL;
 	pool_cache_put(rnd_ctx_cache, ctx);
 
 	return 0;
@@ -876,7 +876,7 @@ rnd_close(struct file *fp)
 static int
 rnd_kqfilter(struct file *fp, struct knote *kn)
 {
-	struct rnd_ctx *const ctx = fp-f_data;
+	struct rnd_ctx *const ctx = fp-f_rndctx;
 
 	return cprng_strong_kqfilter(rnd_ctx_cprng(ctx), kn);
 }



CVS commit: src/sys/uvm

2014-09-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Sep  5 09:24:21 UTC 2014

Modified Files:
src/sys/uvm: uvm_bio.c

Log Message:
Don't nest structure definitions.


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/sys/uvm/uvm_bio.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/uvm_bio.c
diff -u src/sys/uvm/uvm_bio.c:1.81 src/sys/uvm/uvm_bio.c:1.82
--- src/sys/uvm/uvm_bio.c:1.81	Mon Jul  7 20:14:43 2014
+++ src/sys/uvm/uvm_bio.c	Fri Sep  5 09:24:21 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_bio.c,v 1.81 2014/07/07 20:14:43 riastradh Exp $	*/
+/*	$NetBSD: uvm_bio.c,v 1.82 2014/09/05 09:24:21 matt Exp $	*/
 
 /*
  * Copyright (c) 1998 Chuck Silvers.
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uvm_bio.c,v 1.81 2014/07/07 20:14:43 riastradh Exp $);
+__KERNEL_RCSID(0, $NetBSD: uvm_bio.c,v 1.82 2014/09/05 09:24:21 matt Exp $);
 
 #include opt_uvmhist.h
 #include opt_ubc.h
@@ -93,6 +93,7 @@ struct ubc_map {
 	LIST_ENTRY(ubc_map)	list;		/* per-object list */
 };
 
+TAILQ_HEAD(ubc_inactive_head, ubc_map);
 static struct ubc_object {
 	struct uvm_object uobj;		/* glue for uvm_map() */
 	char *kva;			/* where ubc_object is mapped */
@@ -101,7 +102,7 @@ static struct ubc_object {
 	LIST_HEAD(, ubc_map) *hash;	/* hashtable for cached ubc_map's */
 	u_long hashmask;		/* mask for hashtable */
 
-	TAILQ_HEAD(ubc_inactive_head, ubc_map) *inactive;
+	struct ubc_inactive_head *inactive;
 	/* inactive queues for ubc_map's */
 } ubc_object;
 



CVS commit: src/sys

2014-09-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Sep  5 09:26:16 UTC 2014

Modified Files:
src/sys/fs/union: union_subr.c
src/sys/miscfs/fdesc: fdesc_vnops.c
src/sys/miscfs/procfs: procfs_vfsops.c procfs_vnops.c
src/sys/netsmb: smb_dev.c

Log Message:
Try not to use f_data, use f_{vnode,socket,pipe,mqueue,kqueue,ksem} to get
a correctly typed pointer.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/fs/union/union_subr.c
cvs rdiff -u -r1.123 -r1.124 src/sys/miscfs/fdesc/fdesc_vnops.c
cvs rdiff -u -r1.92 -r1.93 src/sys/miscfs/procfs/procfs_vfsops.c
cvs rdiff -u -r1.191 -r1.192 src/sys/miscfs/procfs/procfs_vnops.c
cvs rdiff -u -r1.42 -r1.43 src/sys/netsmb/smb_dev.c

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

Modified files:

Index: src/sys/fs/union/union_subr.c
diff -u src/sys/fs/union/union_subr.c:1.66 src/sys/fs/union/union_subr.c:1.67
--- src/sys/fs/union/union_subr.c:1.66	Tue Jun 17 12:38:12 2014
+++ src/sys/fs/union/union_subr.c	Fri Sep  5 09:26:16 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: union_subr.c,v 1.66 2014/06/17 12:38:12 hannken Exp $	*/
+/*	$NetBSD: union_subr.c,v 1.67 2014/09/05 09:26:16 matt Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -72,7 +72,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: union_subr.c,v 1.66 2014/06/17 12:38:12 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: union_subr.c,v 1.67 2014/09/05 09:26:16 matt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -1195,7 +1195,7 @@ union_readdirhook(struct vnode **vpp, st
 		return (error);
 	}
 	VOP_UNLOCK(lvp);
-	fp-f_data = lvp;
+	fp-f_vnode = lvp;
 	fp-f_offset = 0;
 	error = vn_close(vp, FREAD, fp-f_cred);
 	if (error)

Index: src/sys/miscfs/fdesc/fdesc_vnops.c
diff -u src/sys/miscfs/fdesc/fdesc_vnops.c:1.123 src/sys/miscfs/fdesc/fdesc_vnops.c:1.124
--- src/sys/miscfs/fdesc/fdesc_vnops.c:1.123	Thu Sep  4 13:29:50 2014
+++ src/sys/miscfs/fdesc/fdesc_vnops.c	Fri Sep  5 09:26:16 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: fdesc_vnops.c,v 1.123 2014/09/04 13:29:50 christos Exp $	*/
+/*	$NetBSD: fdesc_vnops.c,v 1.124 2014/09/05 09:26:16 matt Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -41,7 +41,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: fdesc_vnops.c,v 1.123 2014/09/04 13:29:50 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: fdesc_vnops.c,v 1.124 2014/09/05 09:26:16 matt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -344,9 +344,9 @@ fdesc_attr(int fd, struct vattr *vap, ka
 
 	switch (fp-f_type) {
 	case DTYPE_VNODE:
-		vn_lock((struct vnode *) fp-f_data, LK_SHARED | LK_RETRY);
-		error = VOP_GETATTR((struct vnode *) fp-f_data, vap, cred);
-		VOP_UNLOCK((struct vnode *) fp-f_data);
+		vn_lock(fp-f_vnode, LK_SHARED | LK_RETRY);
+		error = VOP_GETATTR(fp-f_vnode, vap, cred);
+		VOP_UNLOCK(fp-f_vnode);
 		if (error == 0  vap-va_type == VDIR) {
 			/*
 			 * directories can cause loops in the namespace,

Index: src/sys/miscfs/procfs/procfs_vfsops.c
diff -u src/sys/miscfs/procfs/procfs_vfsops.c:1.92 src/sys/miscfs/procfs/procfs_vfsops.c:1.93
--- src/sys/miscfs/procfs/procfs_vfsops.c:1.92	Sun Jul 27 16:47:26 2014
+++ src/sys/miscfs/procfs/procfs_vfsops.c	Fri Sep  5 09:26:16 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: procfs_vfsops.c,v 1.92 2014/07/27 16:47:26 hannken Exp $	*/
+/*	$NetBSD: procfs_vfsops.c,v 1.93 2014/09/05 09:26:16 matt Exp $	*/
 
 /*
  * Copyright (c) 1993
@@ -76,7 +76,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: procfs_vfsops.c,v 1.92 2014/07/27 16:47:26 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: procfs_vfsops.c,v 1.93 2014/09/05 09:26:16 matt Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_compat_netbsd.h
@@ -339,7 +339,7 @@ procfs_loadvnode(struct mount *mp, struc
 			pfs-pfs_mode = S_IRUSR|S_IWUSR;
 			switch (fp-f_type) {
 			case DTYPE_VNODE:
-vxp = fp-f_data;
+vxp = fp-f_vnode;
 
 /*
  * We make symlinks for directories

Index: src/sys/miscfs/procfs/procfs_vnops.c
diff -u src/sys/miscfs/procfs/procfs_vnops.c:1.191 src/sys/miscfs/procfs/procfs_vnops.c:1.192
--- src/sys/miscfs/procfs/procfs_vnops.c:1.191	Sun Jul 27 16:47:26 2014
+++ src/sys/miscfs/procfs/procfs_vnops.c	Fri Sep  5 09:26:16 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: procfs_vnops.c,v 1.191 2014/07/27 16:47:26 hannken Exp $	*/
+/*	$NetBSD: procfs_vnops.c,v 1.192 2014/09/05 09:26:16 matt Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -105,7 +105,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: procfs_vnops.c,v 1.191 2014/07/27 16:47:26 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: procfs_vnops.c,v 1.192 2014/09/05 09:26:16 matt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -821,7 +821,7 @@ procfs_getattr(void *v)
 			switch (fp-f_type) {
 			case DTYPE_VNODE:
 vap-va_bytes = vap-va_size =
-((struct vnode *)fp-f_data)-v_size;
+fp-f_vnode-v_size;
 break;
 			default:
 vap-va_bytes = vap-va_size = 0;

CVS commit: src/sys/netipsec

2014-09-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Sep  5 09:26:44 UTC 2014

Modified Files:
src/sys/netipsec: ipsec.h

Log Message:
Don't use C++ keyword new


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/netipsec/ipsec.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/netipsec/ipsec.h
diff -u src/sys/netipsec/ipsec.h:1.35 src/sys/netipsec/ipsec.h:1.36
--- src/sys/netipsec/ipsec.h:1.35	Fri May 30 01:39:03 2014
+++ src/sys/netipsec/ipsec.h	Fri Sep  5 09:26:44 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipsec.h,v 1.35 2014/05/30 01:39:03 christos Exp $	*/
+/*	$NetBSD: ipsec.h,v 1.36 2014/09/05 09:26:44 matt Exp $	*/
 /*	$FreeBSD: /usr/local/www/cvsroot/FreeBSD/src/sys/netipsec/ipsec.h,v 1.2.4.2 2004/02/14 22:23:23 bms Exp $	*/
 /*	$KAME: ipsec.h,v 1.53 2001/11/20 08:32:38 itojun Exp $	*/
 
@@ -274,8 +274,8 @@ ipsec4_getpolicybysock(
 
 static __inline int
 ipsec_copy_pcbpolicy(
-struct inpcbpolicy *old,
-struct inpcbpolicy *new
+struct inpcbpolicy *oldp,
+struct inpcbpolicy *newp
 )
 {
   /*XXX do nothing */



CVS commit: src/sys/uvm

2014-09-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Sep  5 09:24:48 UTC 2014

Modified Files:
src/sys/uvm: uvm_mmap.c

Log Message:
Use f_vnode instead of f_data


To generate a diff of this commit:
cvs rdiff -u -r1.148 -r1.149 src/sys/uvm/uvm_mmap.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/uvm_mmap.c
diff -u src/sys/uvm/uvm_mmap.c:1.148 src/sys/uvm/uvm_mmap.c:1.149
--- src/sys/uvm/uvm_mmap.c:1.148	Sat Jan 25 17:30:45 2014
+++ src/sys/uvm/uvm_mmap.c	Fri Sep  5 09:24:48 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_mmap.c,v 1.148 2014/01/25 17:30:45 christos Exp $	*/
+/*	$NetBSD: uvm_mmap.c,v 1.149 2014/09/05 09:24:48 matt Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -46,7 +46,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uvm_mmap.c,v 1.148 2014/01/25 17:30:45 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: uvm_mmap.c,v 1.149 2014/09/05 09:24:48 matt Exp $);
 
 #include opt_compat_netbsd.h
 #include opt_pax.h
@@ -400,7 +400,7 @@ sys_mmap(struct lwp *l, const struct sys
 			fd_putfile(fd);
 			return (ENODEV);		/* only mmap vnodes! */
 		}
-		vp = fp-f_data;		/* convert to vnode */
+		vp = fp-f_vnode;		/* convert to vnode */
 		if (vp-v_type != VREG  vp-v_type != VCHR 
 		vp-v_type != VBLK) {
 			fd_putfile(fd);



CVS commit: src/sys/ddb

2014-09-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Sep  5 09:27:24 UTC 2014

Modified Files:
src/sys/ddb: db_xxx.c

Log Message:
Try not to use f_data, use f_{vnode,socket,pipe,mqueue,kqueue,ksem} to get
a correctly typed pointer.


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/sys/ddb/db_xxx.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/ddb/db_xxx.c
diff -u src/sys/ddb/db_xxx.c:1.69 src/sys/ddb/db_xxx.c:1.70
--- src/sys/ddb/db_xxx.c:1.69	Sun Jan  6 03:34:52 2013
+++ src/sys/ddb/db_xxx.c	Fri Sep  5 09:27:24 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_xxx.c,v 1.69 2013/01/06 03:34:52 christos Exp $	*/
+/*	$NetBSD: db_xxx.c,v 1.70 2014/09/05 09:27:24 matt Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1991, 1993
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: db_xxx.c,v 1.69 2013/01/06 03:34:52 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: db_xxx.c,v 1.70 2014/09/05 09:27:24 matt Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_kgdb.h
@@ -157,7 +157,7 @@ db_show_files_cmd(db_expr_t addr, bool h
 	filedesc_t *fdp;
 	fdfile_t *ff;
 	file_t *fp;
-	struct vnode *vn;
+	struct vnode *vp;
 	bool full = false;
 	fdtab_t *dt;
 
@@ -175,18 +175,16 @@ db_show_files_cmd(db_expr_t addr, bool h
 		fp = ff-ff_file;
 
 		/* Only look at vnodes... */
-		if ((fp != NULL)  (fp-f_type == DTYPE_VNODE)) {
-			if (fp-f_data != NULL) {
-vn = (struct vnode *) fp-f_data;
-vfs_vnode_print(vn, full, db_printf);
+		if (fp != NULL  fp-f_type == DTYPE_VNODE
+		 fp-f_vnode != NULL) {
+			vp = fp-f_vnode;
+			vfs_vnode_print(vp, full, db_printf);
 
 #ifdef LOCKDEBUG
-db_printf(\nv_uobj.vmobjlock lock details:\n);
-lockdebug_lock_print(vn-v_uobj.vmobjlock,
-	 db_printf);
-db_printf(\n);
+			db_printf(\nv_uobj.vmobjlock lock details:\n);
+			lockdebug_lock_print(vp-v_uobj.vmobjlock, db_printf);
+			db_printf(\n);
 #endif
-			}
 		}
 	}
 #endif



CVS commit: src/sys/dev/iscsi

2014-09-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Sep  5 09:27:34 UTC 2014

Modified Files:
src/sys/dev/iscsi: iscsi_rcv.c iscsi_send.c

Log Message:
Try not to use f_data, use f_{vnode,socket,pipe,mqueue,kqueue,ksem} to get
a correctly typed pointer.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/iscsi/iscsi_rcv.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/iscsi/iscsi_send.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/iscsi/iscsi_rcv.c
diff -u src/sys/dev/iscsi/iscsi_rcv.c:1.5 src/sys/dev/iscsi/iscsi_rcv.c:1.6
--- src/sys/dev/iscsi/iscsi_rcv.c:1.5	Sun Oct 20 21:11:15 2013
+++ src/sys/dev/iscsi/iscsi_rcv.c	Fri Sep  5 09:27:34 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: iscsi_rcv.c,v 1.5 2013/10/20 21:11:15 christos Exp $	*/
+/*	$NetBSD: iscsi_rcv.c,v 1.6 2014/09/05 09:27:34 matt Exp $	*/
 
 /*-
  * Copyright (c) 2004,2005,2006,2011 The NetBSD Foundation, Inc.
@@ -51,7 +51,7 @@
 STATIC int
 my_soo_read(connection_t *conn, struct uio *u, int flags)
 {
-	struct socket *so = (struct socket *) conn-sock-f_data;
+	struct socket *so = conn-sock-f_socket;
 	int ret;
 #ifdef ISCSI_DEBUG
 	size_t resid = u-uio_resid;

Index: src/sys/dev/iscsi/iscsi_send.c
diff -u src/sys/dev/iscsi/iscsi_send.c:1.8 src/sys/dev/iscsi/iscsi_send.c:1.9
--- src/sys/dev/iscsi/iscsi_send.c:1.8	Sat Dec 29 11:05:30 2012
+++ src/sys/dev/iscsi/iscsi_send.c	Fri Sep  5 09:27:34 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: iscsi_send.c,v 1.8 2012/12/29 11:05:30 mlelstv Exp $	*/
+/*	$NetBSD: iscsi_send.c,v 1.9 2014/09/05 09:27:34 matt Exp $	*/
 
 /*-
  * Copyright (c) 2004,2005,2006,2011 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
 STATIC int
 my_soo_write(connection_t *conn, struct uio *u)
 {
-	struct socket *so = (struct socket *) conn-sock-f_data;
+	struct socket *so = conn-sock-f_socket;
 	size_t resid = u-uio_resid;
 	int ret;
 
@@ -369,9 +369,9 @@ iscsi_send_thread(void *par)
 		 * thread to wake up
 		 */
 		DEBC(conn, 1, (Closing Socket %p\n, conn-sock));
-		solock((struct socket *) fp-f_data);
-		soshutdown((struct socket *) fp-f_data, SHUT_RDWR);
-		sounlock((struct socket *) fp-f_data);
+		solock(fp-f_socket);
+		soshutdown(fp-f_socket, SHUT_RDWR);
+		sounlock(fp-f_socket);
 
 		/* wake up any non-reassignable waiting CCBs */
 		TAILQ_FOREACH_SAFE(ccb, conn-ccbs_waiting, chain, nccb) {



CVS commit: src/sys/external/bsd/drm/dist/shared-core

2014-09-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Sep  5 09:40:44 UTC 2014

Modified Files:
src/sys/external/bsd/drm/dist/shared-core: i915_drv.h i915_suspend.c

Log Message:
Rename enum pipe to enum pipe so it won't conflcit with struct pipe.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/drm/dist/shared-core/i915_drv.h
cvs rdiff -u -r1.6 -r1.7 \
src/sys/external/bsd/drm/dist/shared-core/i915_suspend.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/external/bsd/drm/dist/shared-core/i915_drv.h
diff -u src/sys/external/bsd/drm/dist/shared-core/i915_drv.h:1.5 src/sys/external/bsd/drm/dist/shared-core/i915_drv.h:1.6
--- src/sys/external/bsd/drm/dist/shared-core/i915_drv.h:1.5	Mon Jun 11 16:51:04 2012
+++ src/sys/external/bsd/drm/dist/shared-core/i915_drv.h	Fri Sep  5 09:40:44 2014
@@ -41,7 +41,7 @@
 #define DRIVER_DESC		Intel Graphics
 #define DRIVER_DATE		20080730
 
-enum pipe {
+enum pipex {
 	PIPE_A = 0,
 	PIPE_B,
 };

Index: src/sys/external/bsd/drm/dist/shared-core/i915_suspend.c
diff -u src/sys/external/bsd/drm/dist/shared-core/i915_suspend.c:1.6 src/sys/external/bsd/drm/dist/shared-core/i915_suspend.c:1.7
--- src/sys/external/bsd/drm/dist/shared-core/i915_suspend.c:1.6	Tue Dec 11 07:31:39 2012
+++ src/sys/external/bsd/drm/dist/shared-core/i915_suspend.c	Fri Sep  5 09:40:44 2014
@@ -32,7 +32,7 @@
 #include i915_drm.h
 #include i915_drv.h
 
-static bool i915_pipe_enabled(struct drm_device *dev, enum pipe pipe)
+static bool i915_pipe_enabled(struct drm_device *dev, enum pipex pipe)
 {
 	struct drm_i915_private *dev_priv = dev-dev_private;
 
@@ -42,7 +42,7 @@ static bool i915_pipe_enabled(struct drm
 		return (I915_READ(DPLL_B)  DPLL_VCO_ENABLE);
 }
 
-static void i915_save_palette(struct drm_device *dev, enum pipe pipe)
+static void i915_save_palette(struct drm_device *dev, enum pipex pipe)
 {
 	struct drm_i915_private *dev_priv = dev-dev_private;
 	unsigned long reg = (pipe == PIPE_A ? PALETTE_A : PALETTE_B);
@@ -61,7 +61,7 @@ static void i915_save_palette(struct drm
 		array[i] = I915_READ(reg + (i  2));
 }
 
-static void i915_restore_palette(struct drm_device *dev, enum pipe pipe)
+static void i915_restore_palette(struct drm_device *dev, enum pipex pipe)
 {
 	struct drm_i915_private *dev_priv = dev-dev_private;
 	unsigned long reg = (pipe == PIPE_A ? PALETTE_A : PALETTE_B);



CVS commit: src/sys/miscfs/fdesc

2014-09-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep  5 10:43:26 UTC 2014

Modified Files:
src/sys/miscfs/fdesc: fdesc_vnops.c

Log Message:
The comment about toxicity was correct, restore VNON setting code and
then set the proper type in lookup.


To generate a diff of this commit:
cvs rdiff -u -r1.124 -r1.125 src/sys/miscfs/fdesc/fdesc_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/miscfs/fdesc/fdesc_vnops.c
diff -u src/sys/miscfs/fdesc/fdesc_vnops.c:1.124 src/sys/miscfs/fdesc/fdesc_vnops.c:1.125
--- src/sys/miscfs/fdesc/fdesc_vnops.c:1.124	Fri Sep  5 05:26:16 2014
+++ src/sys/miscfs/fdesc/fdesc_vnops.c	Fri Sep  5 06:43:26 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: fdesc_vnops.c,v 1.124 2014/09/05 09:26:16 matt Exp $	*/
+/*	$NetBSD: fdesc_vnops.c,v 1.125 2014/09/05 10:43:26 christos Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -41,7 +41,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: fdesc_vnops.c,v 1.124 2014/09/05 09:26:16 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: fdesc_vnops.c,v 1.125 2014/09/05 10:43:26 christos Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -295,6 +295,8 @@ bad:
 good:
 	KASSERT(ix != -1);
 	error = vcache_get(dvp-v_mount, ix, sizeof(ix), vpp);
+	if (error == 0  ix == FD_CTTY)
+		(*vpp)-v_type = VCHR;
 	return error;
 }
 
@@ -838,7 +840,6 @@ fdesc_inactive(void *v)
 		struct vnode *a_vp;
 	} */ *ap = v;
 	struct vnode *vp = ap-a_vp;
-#if 0
 	struct fdescnode *fd = VTOFDESC(vp);
 
 	/*
@@ -847,7 +848,6 @@ fdesc_inactive(void *v)
 	 */
 	if (fd-fd_type == Fctty || fd-fd_type == Fdesc)
 		vp-v_type = VNON;
-#endif
 	VOP_UNLOCK(vp);
 	return (0);
 }



CVS commit: src/sys/compat/svr4

2014-09-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep  5 10:47:32 UTC 2014

Modified Files:
src/sys/compat/svr4: svr4_fcntl.c

Log Message:
make this compile again


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/compat/svr4/svr4_fcntl.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/svr4/svr4_fcntl.c
diff -u src/sys/compat/svr4/svr4_fcntl.c:1.72 src/sys/compat/svr4/svr4_fcntl.c:1.73
--- src/sys/compat/svr4/svr4_fcntl.c:1.72	Fri Sep  5 05:21:55 2014
+++ src/sys/compat/svr4/svr4_fcntl.c	Fri Sep  5 06:47:32 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: svr4_fcntl.c,v 1.72 2014/09/05 09:21:55 matt Exp $	 */
+/*	$NetBSD: svr4_fcntl.c,v 1.73 2014/09/05 10:47:32 christos Exp $	 */
 
 /*-
  * Copyright (c) 1994, 1997, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: svr4_fcntl.c,v 1.72 2014/09/05 09:21:55 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: svr4_fcntl.c,v 1.73 2014/09/05 10:47:32 christos Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -220,7 +220,7 @@ fd_revoke(struct lwp *l, int fd, registe
 	vnode_t *vp;
 	int error;
 
-	if ((error = fd_getvnode(SCARG(uap, fd), fp)) != 0)
+	if ((error = fd_getvnode(fd, fp)) != 0)
 		return error;
 
 	vp = fp-f_vnode;



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

2014-09-05 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Sep  5 11:27:57 UTC 2014

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

Log Message:
Copy the list of PHYs from elsewhere.

XXX sys/dev/mii/miidevices.config anyone?


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/evbarm/conf/RPI

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/RPI
diff -u src/sys/arch/evbarm/conf/RPI:1.49 src/sys/arch/evbarm/conf/RPI:1.50
--- src/sys/arch/evbarm/conf/RPI:1.49	Sat Aug 23 20:26:57 2014
+++ src/sys/arch/evbarm/conf/RPI	Fri Sep  5 11:27:57 2014
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: RPI,v 1.49 2014/08/23 20:26:57 dholland Exp $
+#	$NetBSD: RPI,v 1.50 2014/09/05 11:27:57 skrll Exp $
 #
 #	RPi -- Raspberry Pi
 #
@@ -221,7 +221,31 @@ usb* 		at dwctwo?
 # USB device drivers
 include dev/usb/usbdevices.config
 
-ukphy*		at mii? phy ?
+# MII/PHY support
+exphy* 		at mii? phy ?		# 3Com internal PHYs
+gentbi* 	at mii? phy ?		# Generic Ten-Bit 1000BASE-[CLS]X PHYs
+glxtphy*	at mii? phy ?		# Level One LXT-1000 PHYs
+gphyter* 	at mii? phy ?		# NS83861 Gig-E PHY
+icsphy*		at mii? phy ?		# Integrated Circuit Systems ICS189x
+igphy*		at mii? phy ?		# Intel IGP01E1000
+ihphy*		at mii? phy ?		# Intel 82577 PHYs
+ikphy*		at mii? phy ?		# Intel 82563 PHYs
+inphy*		at mii? phy ?		# Intel 82555 PHYs
+iophy*		at mii? phy ?		# Intel 82553 PHYs
+lxtphy*		at mii? phy ?		# Level One LXT-970 PHYs
+makphy*		at mii? phy ?		# Marvell Semiconductor 88E1000 PHYs
+nsphy*		at mii? phy ?		# NS83840 PHYs
+nsphyter*	at mii? phy ? 		# NS83843 PHYs
+pnaphy*		at mii? phy ?		# generic HomePNA PHYs
+qsphy*		at mii? phy ?		# Quality Semiconductor QS6612 PHYs
+rdcphy*		at mii? phy ?		# RDC R6040 10/100 PHY
+rgephy*		at mii? phy ?		# Realtek 8169S/8110S internal PHYs
+rlphy*		at mii? phy ?		# Realtek 8139/8201L PHYs
+sqphy*		at mii? phy ?		# Seeq 80220/80221/80223 PHYs
+tlphy*		at mii? phy ?		# ThunderLAN PHYs
+tqphy*		at mii? phy ?		# TDK Semiconductor PHYs
+urlphy*		at mii? phy ?		# Realtek RTL8150L internal PHYs
+ukphy*		at mii? phy ?		# generic unknown PHYs
 
 # Broadcom Serial Control (I2C)
 bsciic* at obio?



CVS commit: src/lib/libperfuse

2014-09-05 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Fri Sep  5 15:20:17 UTC 2014

Modified Files:
src/lib/libperfuse: ops.c

Log Message:
rmdir dir/.. must return an error. Use ENOTEMPRY like FFS does.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/lib/libperfuse/ops.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/libperfuse/ops.c
diff -u src/lib/libperfuse/ops.c:1.72 src/lib/libperfuse/ops.c:1.73
--- src/lib/libperfuse/ops.c:1.72	Wed Sep  3 23:59:58 2014
+++ src/lib/libperfuse/ops.c	Fri Sep  5 15:20:16 2014
@@ -1,4 +1,4 @@
-/*  $NetBSD: ops.c,v 1.72 2014/09/03 23:59:58 enami Exp $ */
+/*  $NetBSD: ops.c,v 1.73 2014/09/05 15:20:16 manu Exp $ */
 
 /*-
  *  Copyright (c) 2010-2011 Emmanuel Dreyfus. All rights reserved.
@@ -2352,6 +2352,12 @@ perfuse_node_rmdir(struct puffs_usermoun
 	(PERFUSE_NODE_DATA(targ)-pnd_flags  PND_REMOVED))
 		return ENOENT;
 
+	/*
+	 * Attempt to rmdir dir/.. shoud raise ENOTEMPTY
+	 */
+	if (PERFUSE_NODE_DATA(targ)-pnd_nodeid == pnd-pnd_parent_nodeid)
+		return ENOTEMPTY;
+
 	node_ref(opc);
 	node_ref(targ);
 



CVS commit: src/sys/fs/puffs

2014-09-05 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Fri Sep  5 15:39:19 UTC 2014

Modified Files:
src/sys/fs/puffs: puffs_node.c puffs_vnops.c

Log Message:
When changing a directory content, update the ctime/mtime in kernel cache,
otherwise the updated ctime/mtime appears after the cached entry expire.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/fs/puffs/puffs_node.c
cvs rdiff -u -r1.184 -r1.185 src/sys/fs/puffs/puffs_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/fs/puffs/puffs_node.c
diff -u src/sys/fs/puffs/puffs_node.c:1.32 src/sys/fs/puffs/puffs_node.c:1.33
--- src/sys/fs/puffs/puffs_node.c:1.32	Thu Aug 28 08:29:50 2014
+++ src/sys/fs/puffs/puffs_node.c	Fri Sep  5 15:39:18 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: puffs_node.c,v 1.32 2014/08/28 08:29:50 hannken Exp $	*/
+/*	$NetBSD: puffs_node.c,v 1.33 2014/09/05 15:39:18 manu Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006, 2007  Antti Kantee.  All Rights Reserved.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: puffs_node.c,v 1.32 2014/08/28 08:29:50 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: puffs_node.c,v 1.33 2014/09/05 15:39:18 manu Exp $);
 
 #include sys/param.h
 #include sys/hash.h
@@ -180,6 +180,8 @@ puffs_newnode(struct mount *mp, struct v
 		cache_enter(dvp, *vpp, cnp-cn_nameptr, cnp-cn_namelen,
 			cnp-cn_flags);
 
+	puffs_updatenode(VPTOPP(dvp), PUFFS_UPDATECTIME|PUFFS_UPDATEMTIME, 0);
+
 	return 0;
 }
 

Index: src/sys/fs/puffs/puffs_vnops.c
diff -u src/sys/fs/puffs/puffs_vnops.c:1.184 src/sys/fs/puffs/puffs_vnops.c:1.185
--- src/sys/fs/puffs/puffs_vnops.c:1.184	Thu Aug 28 08:29:50 2014
+++ src/sys/fs/puffs/puffs_vnops.c	Fri Sep  5 15:39:18 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: puffs_vnops.c,v 1.184 2014/08/28 08:29:50 hannken Exp $	*/
+/*	$NetBSD: puffs_vnops.c,v 1.185 2014/09/05 15:39:18 manu Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006, 2007  Antti Kantee.  All Rights Reserved.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: puffs_vnops.c,v 1.184 2014/08/28 08:29:50 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: puffs_vnops.c,v 1.185 2014/09/05 15:39:18 manu Exp $);
 
 #include sys/param.h
 #include sys/buf.h
@@ -1805,6 +1805,8 @@ puffs_vnop_remove(void *v)
 
 	PUFFS_MSG_RELEASE(remove);
 
+	puffs_updatenode(VPTOPP(dvp), PUFFS_UPDATECTIME|PUFFS_UPDATEMTIME, 0);
+
 	RELEPN_AND_VP(dvp, dpn);
 	RELEPN_AND_VP(vp, pn);
 
@@ -1922,6 +1924,8 @@ puffs_vnop_rmdir(void *v)
 
 	PUFFS_MSG_RELEASE(rmdir);
 
+	puffs_updatenode(VPTOPP(dvp), PUFFS_UPDATECTIME|PUFFS_UPDATEMTIME, 0);
+
 	/* XXX: some call cache_purge() *for both vnodes* here, investigate */
 	RELEPN_AND_VP(dvp, dpn);
 	RELEPN_AND_VP(vp, pn);
@@ -1967,8 +1971,11 @@ puffs_vnop_link(void *v)
 	 * XXX: stay in touch with the cache.  I don't like this, but
 	 * don't have a better solution either.  See also puffs_rename().
 	 */
-	if (error == 0)
+	if (error == 0) {
 		puffs_updatenode(pn, PUFFS_UPDATECTIME, 0);
+		puffs_updatenode(VPTOPP(dvp),
+ PUFFS_UPDATECTIME|PUFFS_UPDATEMTIME, 0);
+	}
 
 	RELEPN_AND_VP(dvp, dpn);
 	puffs_releasenode(pn);
@@ -2133,6 +2140,12 @@ puffs_vnop_rename(void *v)
 	 */
 	if (error == 0) {
 		puffs_updatenode(fpn, PUFFS_UPDATECTIME, 0);
+		puffs_updatenode(VPTOPP(fdvp),
+ PUFFS_UPDATECTIME|PUFFS_UPDATEMTIME, 0);
+		if (fdvp != tdvp)
+			puffs_updatenode(VPTOPP(tdvp),
+	 PUFFS_UPDATECTIME|PUFFS_UPDATEMTIME,
+	 0);
 
 		if (PUFFS_USE_DOTDOTCACHE(pmp) 
 		(VPTOPP(fvp)-pn_parent != tdvp))



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

2014-09-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Sep  5 18:09:37 UTC 2014

Modified Files:
src/lib/libc/arch/or1k: Makefile.inc SYS.h
Added Files:
src/lib/libc/arch/or1k: syscallargs.awk

Log Message:
The OpenRISC calling standard only passes 6 parameters by register.  Any
others are passed on the stack.  NetBSD syscalls use up to 8 parameters
so that could mean two left on the stack for the kernel to access.  It's
easier for the kernel if userland could fetch into registers beforehand.
So we generate sysassym.h which contains the number of arguments for each
syscall and then use that to determine how many arguments need to be fetched
from the stack.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/arch/or1k/Makefile.inc \
src/lib/libc/arch/or1k/SYS.h
cvs rdiff -u -r0 -r1.1 src/lib/libc/arch/or1k/syscallargs.awk

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/or1k/Makefile.inc
diff -u src/lib/libc/arch/or1k/Makefile.inc:1.1 src/lib/libc/arch/or1k/Makefile.inc:1.2
--- src/lib/libc/arch/or1k/Makefile.inc:1.1	Wed Sep  3 19:34:25 2014
+++ src/lib/libc/arch/or1k/Makefile.inc	Fri Sep  5 18:09:37 2014
@@ -1,9 +1,24 @@
-#	$NetBSD: Makefile.inc,v 1.1 2014/09/03 19:34:25 matt Exp $
+#	$NetBSD: Makefile.inc,v 1.2 2014/09/05 18:09:37 matt Exp $
 
 SRCS+=		__sigaction14_sigtramp.c __sigtramp2.S
 SRCS+=		mulsi3.S
 
-CPPFLAGS+=	-I. -isystem ${DESTDIR}/usr/include/c++
+CPPFLAGS+=	-I.
+
+DPSRCS+=	sysassym.h
+CLEANFILES+=	sysassym.h sysassym.h.tmp
+
+sysassym.h: ${DESTDIR}/usr/include/sys/syscall.h \
+	${DESTDIR}/usr/include/sys/syscallargs.h ${ARCHDIR}/syscallargs.awk
+	${_MKTARGET_CREATE}
+	${TOOL_CAT} \
+		${DESTDIR}/usr/include/sys/syscall.h \
+		${DESTDIR}/usr/include/sys/syscallargs.h | \
+	${TOOL_AWK} -f ${ARCHDIR}/syscallargs.awk | \
+	${TOOL_GENASSYM} -- ${CC} -ffreestanding ${CFLAGS:N-Wa,*} \
+		${CPPFLAGS:N-D*} -D_KMEMUSER \
+		${GENASSYM_CPPFLAGS}  $@.tmp  \
+	mv -f $@.tmp $@
 
 .if ${MKSOFTFLOAT} != no
 .include softfloat/Makefile.inc
Index: src/lib/libc/arch/or1k/SYS.h
diff -u src/lib/libc/arch/or1k/SYS.h:1.1 src/lib/libc/arch/or1k/SYS.h:1.2
--- src/lib/libc/arch/or1k/SYS.h:1.1	Wed Sep  3 19:34:25 2014
+++ src/lib/libc/arch/or1k/SYS.h	Fri Sep  5 18:09:37 2014
@@ -1,23 +1,53 @@
-/*	$NetBSD: SYS.h,v 1.1 2014/09/03 19:34:25 matt Exp $	*/
+/*	$NetBSD: SYS.h,v 1.2 2014/09/05 18:09:37 matt Exp $	*/
+
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Matt Thomas of 3am Software Foundry.
+ *
+ * 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 machine/asm.h
 #include sys/syscall.h
+#include sysassym.h
 
 #define	_DOSYSCALL(x)		l.addi	r13,r0,(SYS_ ## x)	;\
 l.sys	0			;\
 l.nop
 
-#define	_SYSCALL_NOERROR(x,y)	.text;\
-.p2align 2			;\
-			ENTRY(x);\
+#define	_SYSCALL_NOERROR(x,y)	ENTRY(x)			;\
+.if NSYSARGS_##y  6		;\
+l.lwz	r11, 0(r1)		;\
+.endif;\
+.if NSYSARGS_##y  7		;\
+l.lwz	r12, 4(r1)		;\
+.endif;\
 _DOSYSCALL(y)
 
-#define _SYSCALL(x,y)		.text;\
-.align	2			;\
-			2:	l.j	_C_LABEL(__cerror)	;\
-l.nop;\
-_SYSCALL_NOERROR(x,y)		;\
-l.bf	2b			;\
+#define _SYSCALL(x,y)		_SYSCALL_NOERROR(x,y)		;\
+l.bf	_C_LABEL(__cerror)	;\
 l.nop
 
 #define SYSCALL_NOERROR(x)	_SYSCALL_NOERROR(x,x)

Added files:

Index: src/lib/libc/arch/or1k/syscallargs.awk
diff -u /dev/null src/lib/libc/arch/or1k/syscallargs.awk:1.1
--- /dev/null	Fri Sep  5 18:09:37 2014
+++ src/lib/libc/arch/or1k/syscallargs.awk	Fri Sep 

CVS commit: src/external/bsd/cron/dist

2014-09-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep  5 20:55:11 UTC 2014

Modified Files:
src/external/bsd/cron/dist: crontab.c

Log Message:
Rewind the file before we install it so that we can check it.
Before this fix, no checks were made and you could install crap.
XXX: pullup 7


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/cron/dist/crontab.c

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

Modified files:

Index: src/external/bsd/cron/dist/crontab.c
diff -u src/external/bsd/cron/dist/crontab.c:1.7 src/external/bsd/cron/dist/crontab.c:1.8
--- src/external/bsd/cron/dist/crontab.c:1.7	Sat Nov  3 13:33:01 2012
+++ src/external/bsd/cron/dist/crontab.c	Fri Sep  5 16:55:11 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: crontab.c,v 1.7 2012/11/03 17:33:01 christos Exp $	*/
+/*	$NetBSD: crontab.c,v 1.8 2014/09/05 20:55:11 christos Exp $	*/
 
 /* Copyright 1988,1990,1993,1994 by Paul Vixie
  * All rights reserved
@@ -25,7 +25,7 @@
 #if 0
 static char rcsid[] = Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp;
 #else
-__RCSID($NetBSD: crontab.c,v 1.7 2012/11/03 17:33:01 christos Exp $);
+__RCSID($NetBSD: crontab.c,v 1.8 2014/09/05 20:55:11 christos Exp $);
 #endif
 #endif
 
@@ -638,7 +638,7 @@ replace_cmd(void) {
 	 */
 	(void)fprintf(tmp, # DO NOT EDIT THIS FILE - edit the master and reinstall.\n);
 	(void)fprintf(tmp, # (%s installed on %-24.24s)\n, Filename, ctime(now));
-	(void)fprintf(tmp, # (Cron version %s -- %s)\n, CRON_VERSION, $NetBSD: crontab.c,v 1.7 2012/11/03 17:33:01 christos Exp $);
+	(void)fprintf(tmp, # (Cron version %s -- %s)\n, CRON_VERSION, $NetBSD: crontab.c,v 1.8 2014/09/05 20:55:11 christos Exp $);
 
 	/* copy the crontab to the tmp
 	 */
@@ -680,6 +680,7 @@ replace_cmd(void) {
 	 */
 	Set_LineNum(1 - NHEADER_LINES);
 	CheckErrorCount = 0;  eof = FALSE;
+	rewind(tmp);
 	while (!CheckErrorCount  !eof) {
 		switch (load_env(envstr, tmp)) {
 		case ERR:



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

2014-09-05 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Fri Sep  5 21:15:42 UTC 2014

Modified Files:
src/sys/arch/arm/broadcom: bcm2835_genfb.c

Log Message:
allow board-specific ioctl() handlers


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/broadcom/bcm2835_genfb.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/broadcom/bcm2835_genfb.c
diff -u src/sys/arch/arm/broadcom/bcm2835_genfb.c:1.6 src/sys/arch/arm/broadcom/bcm2835_genfb.c:1.7
--- src/sys/arch/arm/broadcom/bcm2835_genfb.c:1.6	Thu Jul 24 21:35:12 2014
+++ src/sys/arch/arm/broadcom/bcm2835_genfb.c	Fri Sep  5 21:15:42 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: bcm2835_genfb.c,v 1.6 2014/07/24 21:35:12 riastradh Exp $ */
+/* $NetBSD: bcm2835_genfb.c,v 1.7 2014/09/05 21:15:42 macallan Exp $ */
 
 /*-
  * Copyright (c) 2013 Jared D. McNeill jmcne...@invisible.ca
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bcm2835_genfb.c,v 1.6 2014/07/24 21:35:12 riastradh Exp $);
+__KERNEL_RCSID(0, $NetBSD: bcm2835_genfb.c,v 1.7 2014/09/05 21:15:42 macallan Exp $);
 
 #include sys/param.h
 #include sys/types.h
@@ -61,9 +61,11 @@ static paddr_t	bcmgenfb_mmap(void *, voi
 static bool	bcmgenfb_shutdown(device_t, int);
 
 void		bcmgenfb_set_console_dev(device_t);
+void		bcmgenfb_set_ioctl(int(*)(void *, void *, u_long, void *, int, struct lwp *));
 void		bcmgenfb_ddb_trap_callback(int);
 
 static device_t bcmgenfb_console_dev = NULL;
+int (*bcmgenfb_ioctl_handler)(void *, void *, u_long, void *, int, struct lwp *) = NULL;
 
 CFATTACH_DECL_NEW(bcmgenfb, sizeof(struct bcmgenfb_softc),
 bcmgenfb_match, bcmgenfb_attach, NULL, NULL);
@@ -152,6 +154,8 @@ bcmgenfb_ioctl(void *v, void *vs, u_long
 			return ret;
 		}
 	default:
+		if (bcmgenfb_ioctl_handler != NULL)
+			return bcmgenfb_ioctl_handler(v, vs, cmd, data, flag, l);
 		return EPASSTHROUGH;
 	}
 }
@@ -182,6 +186,12 @@ bcmgenfb_set_console_dev(device_t dev)
 }
 
 void
+bcmgenfb_set_ioctl(int(*boo)(void *, void *, u_long, void *, int, struct lwp *))
+{
+	bcmgenfb_ioctl_handler = boo;
+}
+
+void
 bcmgenfb_ddb_trap_callback(int where)
 {
 	if (bcmgenfb_console_dev == NULL)



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

2014-09-05 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Fri Sep  5 21:22:35 UTC 2014

Modified Files:
src/sys/arch/evbarm/rpi: rpi_machdep.c

Log Message:
implement WSCONSIO_[G|S]VIDEO by hijacking bcm2835_genfb's ioctl
next step: hardware cursor


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/evbarm/rpi/rpi_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/rpi/rpi_machdep.c
diff -u src/sys/arch/evbarm/rpi/rpi_machdep.c:1.44 src/sys/arch/evbarm/rpi/rpi_machdep.c:1.45
--- src/sys/arch/evbarm/rpi/rpi_machdep.c:1.44	Fri Aug 22 09:49:13 2014
+++ src/sys/arch/evbarm/rpi/rpi_machdep.c	Fri Sep  5 21:22:35 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: rpi_machdep.c,v 1.44 2014/08/22 09:49:13 skrll Exp $	*/
+/*	$NetBSD: rpi_machdep.c,v 1.45 2014/09/05 21:22:35 macallan Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rpi_machdep.c,v 1.44 2014/08/22 09:49:13 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: rpi_machdep.c,v 1.45 2014/09/05 21:22:35 macallan Exp $);
 
 #include opt_evbarm_boardtype.h
 #include opt_ddb.h
@@ -92,6 +92,7 @@ __KERNEL_RCSID(0, $NetBSD: rpi_machdep.
 #if NGENFB  0
 #include dev/videomode/videomode.h
 #include dev/videomode/edidvar.h
+#include dev/wscons/wsconsio.h
 #endif
 
 #if NUKBD  0
@@ -367,8 +368,14 @@ static struct __aligned(16) {
 	},
 };
 
+int rpi_fb_set_video(int);
+int rpi_video_on = WSDISPLAYIO_VIDEO_ON;
+
 extern void bcmgenfb_set_console_dev(device_t dev);
+void bcmgenfb_set_ioctl(int(*)(void *, void *, u_long, void *, int, struct lwp *));
 extern void bcmgenfb_ddb_trap_callback(int where);
+static int	rpi_ioctl(void *, void *, u_long, void *, int, lwp_t *);
+
 #endif
 
 static void
@@ -802,6 +809,71 @@ rpi_fb_init(prop_dictionary_t dict)
 
 	return true;
 }
+
+int
+rpi_fb_set_video(int b)
+{
+	int error;
+	uint32_t res;
+
+	/*
+	 * might as well put it here since we need to re-init it every time
+	 * and it's not like this is going to be called very often anyway
+	 */
+	struct __aligned(16) {
+		struct vcprop_buffer_hdr	vb_hdr;
+		struct vcprop_tag_blankscreen	vbt_blank;
+		struct vcprop_tag end;
+	} vb_setblank =
+	{
+		.vb_hdr = {
+			.vpb_len = sizeof(vb_setblank),
+			.vpb_rcode = VCPROP_PROCESS_REQUEST,
+		},
+		.vbt_blank = {
+			.tag = {
+.vpt_tag = VCPROPTAG_BLANK_SCREEN,
+.vpt_len = VCPROPTAG_LEN(vb_setblank.vbt_blank),
+.vpt_rcode = VCPROPTAG_REQUEST,
+			},
+			.state = (b != 0) ? VCPROP_BLANK_OFF : VCPROP_BLANK_ON,
+		},
+		.end = {
+			.vpt_tag = VCPROPTAG_NULL,
+		},
+	};
+
+	error = bcmmbox_request(BCMMBOX_CHANARM2VC, vb_setblank,
+	sizeof(vb_setblank), res);
+#ifdef RPI_IOCTL_DEBUG
+	printf(%s: %d %d %d %08x %08x\n, __func__, b,
+	vb_setblank.vbt_blank.state, error, res, vb_setblank.vbt_blank.tag.vpt_rcode);
+#endif
+	return (error == 0);
+}
+
+static int
+rpi_ioctl(void *v, void *vs, u_long cmd, void *data, int flag, lwp_t *l)
+{
+
+	switch (cmd) {
+	case WSDISPLAYIO_SVIDEO:
+		{
+			int d = *(int *)data;
+			if (d == rpi_video_on)
+return 0;
+			rpi_video_on = d;
+			rpi_fb_set_video(d);
+		}
+		return 0;
+	case WSDISPLAYIO_GVIDEO:
+		*(int *)data = rpi_video_on;
+		return 0;
+	default:
+		return EPASSTHROUGH;
+	}
+}
+
 #endif
 
 static void
@@ -849,6 +921,7 @@ rpi_device_register(device_t dev, void *
 		char *ptr;
 
 		bcmgenfb_set_console_dev(dev);
+		bcmgenfb_set_ioctl(rpi_ioctl);
 #ifdef DDB
 		db_trap_callback = bcmgenfb_ddb_trap_callback;
 #endif



CVS commit: src/external/bsd/cron

2014-09-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep  5 21:32:37 UTC 2014

Modified Files:
src/external/bsd/cron/bin: Makefile.inc
src/external/bsd/cron/dist: cron.c crontab.c do_command.c entry.c env.c
popen.c

Log Message:
WARNS=6


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/cron/bin/Makefile.inc
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/cron/dist/cron.c
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/cron/dist/crontab.c
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/cron/dist/do_command.c \
src/external/bsd/cron/dist/entry.c
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/cron/dist/env.c
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/cron/dist/popen.c

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

Modified files:

Index: src/external/bsd/cron/bin/Makefile.inc
diff -u src/external/bsd/cron/bin/Makefile.inc:1.2 src/external/bsd/cron/bin/Makefile.inc:1.3
--- src/external/bsd/cron/bin/Makefile.inc:1.2	Fri Sep 16 12:41:20 2011
+++ src/external/bsd/cron/bin/Makefile.inc	Fri Sep  5 17:32:37 2014
@@ -1,5 +1,5 @@
-#	$NetBSD: Makefile.inc,v 1.2 2011/09/16 16:41:20 joerg Exp $
+#	$NetBSD: Makefile.inc,v 1.3 2014/09/05 21:32:37 christos Exp $
 
 .PATH: ${.PARSEDIR}/../dist
-WARNS?=		4
-CWARNFLAGS+=	-Wno-missing-noreturn
+WARNS?=		6
+#CPPFLAGS+=	-DDEBUGGING

Index: src/external/bsd/cron/dist/cron.c
diff -u src/external/bsd/cron/dist/cron.c:1.7 src/external/bsd/cron/dist/cron.c:1.8
--- src/external/bsd/cron/dist/cron.c:1.7	Sat Oct  2 08:22:20 2010
+++ src/external/bsd/cron/dist/cron.c	Fri Sep  5 17:32:37 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: cron.c,v 1.7 2010/10/02 12:22:20 tron Exp $	*/
+/*	$NetBSD: cron.c,v 1.8 2014/09/05 21:32:37 christos Exp $	*/
 
 /* Copyright 1988,1990,1993,1994 by Paul Vixie
  * All rights reserved
@@ -25,7 +25,7 @@
 #if 0
 static char rcsid[] = Id: cron.c,v 1.12 2004/01/23 18:56:42 vixie Exp;
 #else
-__RCSID($NetBSD: cron.c,v 1.7 2010/10/02 12:22:20 tron Exp $);
+__RCSID($NetBSD: cron.c,v 1.8 2014/09/05 21:32:37 christos Exp $);
 #endif
 #endif
 
@@ -39,7 +39,7 @@ static	void	usage(void),
 		run_reboot_jobs(cron_db *),
 		find_jobs(time_t, cron_db *, int, int),
 		set_time(int),
-		cron_sleep(int),
+		cron_sleep(time_t),
 		sigchld_handler(int),
 		sighup_handler(int),
 		sigchld_reaper(void),
@@ -131,7 +131,7 @@ main(int argc, char *argv[]) {
 	 * clockTime: is the time when set_time was last called.
 	 */
 	for (;;) {
-		int timeDiff;
+		time_t timeDiff;
 		enum timejump wakeupKind;
 
 		/* ... wait for the time (in minutes) to change ... */
@@ -169,8 +169,8 @@ main(int argc, char *argv[]) {
  * (wokeup late) run jobs for each virtual
  * minute until caught up.
  */
-Debug(DSCH, ([%ld], normal case %d minutes to go\n,
-(long)getpid(), timeDiff));
+Debug(DSCH, ([%jd], normal case %jd minutes to go\n,
+(intmax_t)getpid(), (intmax_t)timeDiff));
 do {
 	if (job_runqueue())
 		(void)sleep(10);
@@ -192,8 +192,8 @@ main(int argc, char *argv[]) {
  * have a chance to run, and we do our
  * housekeeping.
  */
-Debug(DSCH, ([%ld], DST begins %d minutes to go\n,
-(long)getpid(), timeDiff));
+Debug(DSCH, ([%jd], DST begins %jd minutes to go\n,
+(intmax_t)getpid(), (intmax_t)timeDiff));
 /* run wildcard jobs for current minute */
 find_jobs(timeRunning, database, TRUE, FALSE);
 	
@@ -218,8 +218,8 @@ main(int argc, char *argv[]) {
  * not be repeated.  Virtual time does not
  * change until we are caught up.
  */
-Debug(DSCH, ([%ld], DST ends %d minutes to go\n,
-(long)getpid(), timeDiff));
+Debug(DSCH, ([%jd], DST ends %jd minutes to go\n,
+(intmax_t)getpid(), (intmax_t)timeDiff));
 find_jobs(timeRunning, database, TRUE, FALSE);
 break;
 			default:
@@ -458,7 +458,7 @@ set_time(int initialize) {
  * Try to just hit the next minute.
  */
 static void
-cron_sleep(int target) {
+cron_sleep(time_t target) {
 	time_t t1, t2;
 	int seconds_to_wait;
 

Index: src/external/bsd/cron/dist/crontab.c
diff -u src/external/bsd/cron/dist/crontab.c:1.8 src/external/bsd/cron/dist/crontab.c:1.9
--- src/external/bsd/cron/dist/crontab.c:1.8	Fri Sep  5 16:55:11 2014
+++ src/external/bsd/cron/dist/crontab.c	Fri Sep  5 17:32:37 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: crontab.c,v 1.8 2014/09/05 20:55:11 christos Exp $	*/
+/*	$NetBSD: crontab.c,v 1.9 2014/09/05 21:32:37 christos Exp $	*/
 
 /* Copyright 1988,1990,1993,1994 by Paul Vixie
  * All rights reserved
@@ -25,7 +25,7 @@
 #if 0
 static char rcsid[] = Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp;
 #else
-__RCSID($NetBSD: crontab.c,v 1.8 2014/09/05 20:55:11 christos Exp $);
+__RCSID($NetBSD: crontab.c,v 1.9 2014/09/05 21:32:37 christos Exp $);
 #endif
 #endif
 
@@ -613,7 +613,7 @@ replace_cmd(void) {
 	if (fgets(n2, (int)sizeof(n2), fmaxtabsize) == NULL)  {
 		maxtabsize = 0;
 	} else {
-		maxtabsize = 

CVS commit: src/sys/compat/sunos32

2014-09-05 Thread Takeshi Nakayama
Module Name:src
Committed By:   nakayama
Date:   Fri Sep  5 22:37:09 UTC 2014

Modified Files:
src/sys/compat/sunos32: sunos32_ioctl.c

Log Message:
Fix previous.  There is no uap.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/compat/sunos32/sunos32_ioctl.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/sunos32/sunos32_ioctl.c
diff -u src/sys/compat/sunos32/sunos32_ioctl.c:1.30 src/sys/compat/sunos32/sunos32_ioctl.c:1.31
--- src/sys/compat/sunos32/sunos32_ioctl.c:1.30	Fri Sep  5 09:21:55 2014
+++ src/sys/compat/sunos32/sunos32_ioctl.c	Fri Sep  5 22:37:09 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: sunos32_ioctl.c,v 1.30 2014/09/05 09:21:55 matt Exp $	*/
+/*	$NetBSD: sunos32_ioctl.c,v 1.31 2014/09/05 22:37:09 nakayama Exp $	*/
 /* from: NetBSD: sunos_ioctl.c,v 1.35 2001/02/03 22:20:02 mrg Exp 	*/
 
 /*
@@ -54,7 +54,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sunos32_ioctl.c,v 1.30 2014/09/05 09:21:55 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: sunos32_ioctl.c,v 1.31 2014/09/05 22:37:09 nakayama Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_compat_netbsd32.h
@@ -435,7 +435,7 @@ sunos32_do_ioctl(int fd, int cmd, void *
 	struct vnode *vp;
 	int error;
 
-	if ((error = fd_getvnode(SCARG(uap, fd), fp)) != 0)
+	if ((error = fd_getvnode(fd, fp)) != 0)
 		return error;
 	if ((fp-f_flag  (FREAD|FWRITE)) == 0) {
 		fd_putfile(fd);



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

2014-09-05 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Sep  6 00:15:34 UTC 2014

Modified Files:
src/sys/arch/arm/allwinner: awin_io.c awin_reg.h awin_var.h files.awin
Added Files:
src/sys/arch/arm/allwinner: awin_dma.c

Log Message:
add driver for DMA controller


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/allwinner/awin_dma.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/allwinner/awin_io.c \
src/sys/arch/arm/allwinner/files.awin
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/arm/allwinner/awin_reg.h
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/allwinner/awin_var.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/allwinner/awin_io.c
diff -u src/sys/arch/arm/allwinner/awin_io.c:1.9 src/sys/arch/arm/allwinner/awin_io.c:1.10
--- src/sys/arch/arm/allwinner/awin_io.c:1.9	Thu Sep  4 02:38:18 2014
+++ src/sys/arch/arm/allwinner/awin_io.c	Sat Sep  6 00:15:34 2014
@@ -31,7 +31,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(1, $NetBSD: awin_io.c,v 1.9 2014/09/04 02:38:18 jmcneill Exp $);
+__KERNEL_RCSID(1, $NetBSD: awin_io.c,v 1.10 2014/09/06 00:15:34 jmcneill Exp $);
 
 #include sys/param.h
 #include sys/bus.h
@@ -93,6 +93,7 @@ awinio_print(void *aux, const char *pnp)
 static const struct awin_locators awin_locators[] = {
 	{ awinicu, OFFANDSIZE(INTC), NOPORT, NOINTR, A10|REQ },
 	{ awingpio, OFFANDSIZE(PIO), NOPORT, NOINTR, AANY|REQ },
+	{ awindma, OFFANDSIZE(DMA), NOPORT, AWIN_IRQ_DMA, AANY|REQ },
 	{ awintmr, OFFANDSIZE(TMR), NOPORT, AWIN_IRQ_TMR0, A10 },
 	{ com, OFFANDSIZE(UART0), 0, AWIN_IRQ_UART0, AANY },
 	{ com, OFFANDSIZE(UART1), 1, AWIN_IRQ_UART1, AANY },
Index: src/sys/arch/arm/allwinner/files.awin
diff -u src/sys/arch/arm/allwinner/files.awin:1.9 src/sys/arch/arm/allwinner/files.awin:1.10
--- src/sys/arch/arm/allwinner/files.awin:1.9	Thu Sep  4 02:38:18 2014
+++ src/sys/arch/arm/allwinner/files.awin	Sat Sep  6 00:15:34 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: files.awin,v 1.9 2014/09/04 02:38:18 jmcneill Exp $
+#	$NetBSD: files.awin,v 1.10 2014/09/06 00:15:34 jmcneill Exp $
 #
 # Configuration info for Allwinner ARM Peripherals
 #
@@ -57,6 +57,11 @@ device	awingpio : gpiobus
 attach	awingpio at awinio with awin_gpio
 file	arch/arm/allwinner/awin_gpio.c		awin_gpio | awin_io  needs-flag
 
+# A10/A20 DMA
+device	awindma
+attach	awindma at awinio with awin_dma
+file	arch/arm/allwinner/awin_dma.c		awin_dma
+
 # A10/A20 TWI (IIC)
 device	awiniic : i2cbus, i2cexec, mvi2c
 attach	awiniic at awinio with awin_twi

Index: src/sys/arch/arm/allwinner/awin_reg.h
diff -u src/sys/arch/arm/allwinner/awin_reg.h:1.17 src/sys/arch/arm/allwinner/awin_reg.h:1.18
--- src/sys/arch/arm/allwinner/awin_reg.h:1.17	Thu Sep  4 02:35:26 2014
+++ src/sys/arch/arm/allwinner/awin_reg.h	Sat Sep  6 00:15:34 2014
@@ -248,8 +248,12 @@
 #define AWIN_DDMA_BC_REG		0x000c
 #define AWIN_DDMA_PARA_REG		0x0018
 
+#define AWIN_DMA_IRQ_END_MASK		0x
+#define AWIN_DMA_IRQ_HF_MASK		0x
+#define AWIN_DMA_IRQ_DDMA		__BITS(31,16)
 #define AWIN_DMA_IRQ_DDMA_END(n)	__BIT(17+2*(n))
 #define AWIN_DMA_IRQ_DDMA_HF(n)		__BIT(16+2*(n))
+#define AWIN_DMA_IRQ_NDMA		__BITS(15,0)
 #define AWIN_DMA_IRQ_NDMA_END(n)	__BIT(1+2*(n))
 #define AWIN_DMA_IRQ_NDMA_HF(n)		__BIT(0+2*(n))
 
@@ -730,11 +734,9 @@
 #define AWIN_PLL1_SIG_DELT_PAT_IN	__BIT(3)
 #define AWIN_PLL1_SIG_DELT_PAT_EN	__BIT(2)
 
-#define AWIN_PLL2_CFG_PREVDIV		__BITS(4,0)
-#define AWIN_PLL2_CFG_FACTOR_N		__BITS(14,8)
-#define AWIN_PLL2_CFG_PLLBIAS		__BITS(20,16)
-#define AWIN_PLL2_CFG_VCOBIAS		__BITS(25,21)
 #define AWIN_PLL2_CFG_POSTDIV		__BITS(29,26)
+#define AWIN_PLL2_CFG_FACTOR_N		__BITS(14,8)
+#define AWIN_PLL2_CFG_PREVDIV		__BITS(4,0)
 
 #define AWIN_PLL5_CFG_DDR_CLK_EN	__BIT(29)
 #define AWIN_PLL5_CFG_LDO_EN		__BIT(7)

Index: src/sys/arch/arm/allwinner/awin_var.h
diff -u src/sys/arch/arm/allwinner/awin_var.h:1.11 src/sys/arch/arm/allwinner/awin_var.h:1.12
--- src/sys/arch/arm/allwinner/awin_var.h:1.11	Thu Sep  4 02:36:08 2014
+++ src/sys/arch/arm/allwinner/awin_var.h	Sat Sep  6 00:15:34 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: awin_var.h,v 1.11 2014/09/04 02:36:08 jmcneill Exp $ */
+/* $NetBSD: awin_var.h,v 1.12 2014/09/06 00:15:34 jmcneill Exp $ */
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -72,6 +72,13 @@ struct awin_gpio_pindata {
 	int pd_pin;
 };
 
+enum awin_dma_type {
+	AWIN_DMA_TYPE_NDMA,
+	AWIN_DMA_TYPE_DDMA,
+};
+
+struct awin_dma_channel;
+
 extern struct bus_space awin_bs_tag;
 extern struct bus_space awin_a4x_bs_tag;
 extern bus_space_handle_t awin_core_bsh;
@@ -91,6 +98,13 @@ void	awin_gpio_pinset_acquire(const stru
 void	awin_gpio_pinset_release(const struct awin_gpio_pinset *);
 bool	awin_gpio_pin_reserve(const char *, struct awin_gpio_pindata *);
 
+struct awin_dma_channel *awin_dma_alloc(enum awin_dma_type,
+	  void (*)(void *), void *);
+void	awin_dma_free(struct 

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

2014-09-05 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Sep  6 00:16:36 UTC 2014

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

Log Message:
add awindma


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/evbarm/conf/CUBIEBOARD

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/CUBIEBOARD
diff -u src/sys/arch/evbarm/conf/CUBIEBOARD:1.18 src/sys/arch/evbarm/conf/CUBIEBOARD:1.19
--- src/sys/arch/evbarm/conf/CUBIEBOARD:1.18	Thu Sep  4 02:39:41 2014
+++ src/sys/arch/evbarm/conf/CUBIEBOARD	Sat Sep  6 00:16:36 2014
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: CUBIEBOARD,v 1.18 2014/09/04 02:39:41 jmcneill Exp $
+#	$NetBSD: CUBIEBOARD,v 1.19 2014/09/06 00:16:36 jmcneill Exp $
 #
 #	CUBIEBOARD -- Allwinner A10/A20 Eval Board Kernel
 #
@@ -205,6 +205,11 @@ flash4		at nand0 offset 0x68 size 0	
 
 # Interrupt Controller
 awinicu0	at awinio0 
+
+# DMA Controller
+awindma0	at awinio0
+
+# GPIO Controller
 awingpio0	at awinio0
 
 gpio*		at awingpio?



CVS commit: src/external/bsd/llvm/include

2014-09-05 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sat Sep  6 01:02:21 UTC 2014

Modified Files:
src/external/bsd/llvm/include: Makefile

Log Message:
Install altivec.h for ppc64 too.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/external/bsd/llvm/include/Makefile

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

Modified files:

Index: src/external/bsd/llvm/include/Makefile
diff -u src/external/bsd/llvm/include/Makefile:1.32 src/external/bsd/llvm/include/Makefile:1.33
--- src/external/bsd/llvm/include/Makefile:1.32	Sun Aug 10 17:34:21 2014
+++ src/external/bsd/llvm/include/Makefile	Sat Sep  6 01:02:21 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.32 2014/08/10 17:34:21 joerg Exp $
+#	$NetBSD: Makefile,v 1.33 2014/09/06 01:02:21 joerg Exp $
 
 .include bsd.init.mk
 
@@ -38,7 +38,7 @@ INCS=	__wmmintrin_aes.h \
 	x86intrin.h \
 	xmmintrin.h \
 	xopintrin.h
-.elif ${MACHINE_ARCH} == powerpc
+.elif ${MACHINE_ARCH} == powerpc || ${MACHINE_ARCH} == powerpc64
 INCS=	altivec.h
 .elif ${MACHINE_CPU} == arm
 INCS=	arm_acle.h



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

2014-09-05 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Sep  6 01:08:26 UTC 2014

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

Log Message:
dma support


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/allwinner/awin_ac.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_ac.c
diff -u src/sys/arch/arm/allwinner/awin_ac.c:1.1 src/sys/arch/arm/allwinner/awin_ac.c:1.2
--- src/sys/arch/arm/allwinner/awin_ac.c:1.1	Thu Sep  4 02:38:18 2014
+++ src/sys/arch/arm/allwinner/awin_ac.c	Sat Sep  6 01:08:26 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: awin_ac.c,v 1.1 2014/09/04 02:38:18 jmcneill Exp $ */
+/* $NetBSD: awin_ac.c,v 1.2 2014/09/06 01:08:26 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014 Jared D. McNeill jmcne...@invisible.ca
@@ -29,13 +29,14 @@
 #include locators.h
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: awin_ac.c,v 1.1 2014/09/04 02:38:18 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: awin_ac.c,v 1.2 2014/09/06 01:08:26 jmcneill Exp $);
 
 #include sys/param.h
 #include sys/bus.h
 #include sys/device.h
 #include sys/intr.h
 #include sys/systm.h
+#include uvm/uvm_extern.h
 
 #include sys/audioio.h
 #include dev/audio_if.h
@@ -136,15 +137,14 @@ struct awinac_softc {
 	audio_params_t		sc_pparam;
 
 	void *			sc_ih;
-	void *			sc_sih;
-	int			sc_psamples;
+
+	struct awin_dma_channel *sc_pdma;
 	void			(*sc_pint)(void *);
 	void			*sc_pintarg;
-	int16_t			*sc_pstart;
-	int16_t			*sc_pend;
-	int16_t			*sc_pcur;
+	uint8_t			*sc_pstart;
+	uint8_t			*sc_pend;
+	uint8_t			*sc_pcur;
 	int			sc_pblksize;
-	int			sc_pbytes;
 
 	struct awin_gpio_pindata sc_pactrl_gpio;
 	bool			sc_has_pactrl_gpio;
@@ -157,8 +157,8 @@ static void	awinac_childdet(device_t, de
 
 static void	awinac_init(struct awinac_softc *);
 
-static int	awinac_intr(void *);
-static void	awinac_softintr(void *);
+static void	awinac_pint(void *);
+static int	awinac_play(struct awinac_softc *);
 
 static int	awinac_open(void *, int);
 static void	awinac_close(void *);
@@ -282,11 +282,9 @@ awinac_attach(device_t parent, device_t 
 
 	awinac_init(sc);
 
-	sc-sc_ih = intr_establish(loc-loc_intr, IPL_SCHED, IST_LEVEL,
-	awinac_intr, sc);
-	if (sc-sc_ih == NULL) {
-		aprint_error_dev(self, couldn't establish interrupt %d\n,
-		loc-loc_intr);
+	sc-sc_pdma = awin_dma_alloc(AWIN_DMA_TYPE_NDMA, awinac_pint, sc);
+	if (sc-sc_pdma == NULL) {
+		aprint_error_dev(self, couldn't allocate DMA channel\n);
 		return;
 	}
 
@@ -358,50 +356,48 @@ awinac_init(struct awinac_softc *sc)
 	AC_WRITE(sc, AC_DAC_FIFOS, AC_READ(sc, AC_DAC_FIFOS));
 }
 
-static int
-awinac_intr(void *priv)
+static void
+awinac_pint(void *priv)
 {
 	struct awinac_softc *sc = priv;
-	uint32_t val;
 
-	val = AC_READ(sc, AC_DAC_FIFOS);
-	if ((val  DAC_FIFOS_INT_MASK) == 0)
-		return 0;
-	AC_WRITE(sc, AC_DAC_FIFOS, val);
-
-	if (sc-sc_sih == NULL)
-		return 0;
-
-	if (val  DAC_FIFOS_TXE_INT) {
-		sc-sc_psamples = 0;
-	} else if (val  DAC_FIFOS_TXU_INT) {
-		sc-sc_psamples = __SHIFTOUT(val, DAC_FIFOS_TXE_CNT);
-	}
-
-	if (sc-sc_psamples  AWINAC_TX_TRIG_LEVEL) {
-		softint_schedule(sc-sc_sih);
+	mutex_enter(sc-sc_intr_lock);
+	if (sc-sc_pint == NULL) {
+		mutex_exit(sc-sc_intr_lock);
+		return;
 	}
+	sc-sc_pint(sc-sc_pintarg);
+	mutex_exit(sc-sc_intr_lock);
 
-	return 1;
+	awinac_play(sc);
 }
 
-static void
-awinac_softintr(void *priv)
+static int
+awinac_play(struct awinac_softc *sc)
 {
-	struct awinac_softc *sc = priv;
+	paddr_t physsrc;
+	int error;
 
-	while (sc-sc_psamples  AWINAC_TX_MAX_LEVEL) {
-		AC_WRITE(sc, AC_DAC_TXDATA, *sc-sc_pcur);
-		sc-sc_pcur++;
-		if (sc-sc_pcur == sc-sc_pend)
-			sc-sc_pcur = sc-sc_pstart;
-		sc-sc_psamples++;
-		sc-sc_pbytes += 2;
-		if (sc-sc_pbytes == sc-sc_pblksize) {
-			sc-sc_pint(sc-sc_pintarg);
-			sc-sc_pbytes = 0;
-		}
+	if (!pmap_extract(pmap_kernel(), (vaddr_t)sc-sc_pcur, physsrc)) {
+		device_printf(sc-sc_dev, pmap_extract failed for %p\n,
+		sc-sc_pcur);
+		return ENXIO;
+	}
+
+	error = awin_dma_transfer(sc-sc_pdma,
+	physsrc, AWIN_CORE_PBASE + AWIN_DMA_OFFSET,
+	sc-sc_pblksize);
+	if (error) {
+		device_printf(sc-sc_dev, failed to transfer DMA; error %d\n,
+		error);
+		return error;
 	}
+
+	sc-sc_pcur += sc-sc_pblksize;
+	if (sc-sc_pcur = sc-sc_pend)
+		sc-sc_pcur = sc-sc_pstart;
+
+	return 0;
 }
 
 static int
@@ -495,6 +491,8 @@ awinac_halt_output(void *priv)
 	struct awinac_softc *sc = priv;
 	uint32_t val;
 
+	awin_dma_set_config(sc-sc_pdma, 0);
+
 	if (sc-sc_has_pactrl_gpio)
 		awin_gpio_pindata_write(sc-sc_pactrl_gpio, 0);
 
@@ -505,12 +503,9 @@ awinac_halt_output(void *priv)
 	AC_WRITE(sc, AC_DAC_ACTL, val);
 
 	val = AC_READ(sc, AC_DAC_FIFOC);
-	val = ~DAC_FIFOC_IRQ_EN;
-	val = ~DAC_FIFOC_FIFO_UNDERRUN_IRQ_EN;
+	val = ~DAC_FIFOC_DRQ_EN;
 	AC_WRITE(sc, AC_DAC_FIFOC, val);
 
-	softint_disestablish(sc-sc_sih);
-	sc-sc_sih = NULL;
 	sc-sc_pint = NULL;