CVS commit: [perseant-stdc-iso10646] src/lib/libc

2017-07-30 Thread Konrad Schroder
Module Name:src
Committed By:   perseant
Date:   Mon Jul 31 04:29:50 UTC 2017

Modified Files:
src/lib/libc/citrus [perseant-stdc-iso10646]: citrus_lc_collate.c
src/lib/libc/locale [perseant-stdc-iso10646]: collate_local.h
collate_locale.c unicode_collate.c unicode_nfd_qc_data.h
unicode_ucd.c unicode_ucd.h

Log Message:
Support loading collation data from file.  Began with FreeBSD's
xlocale_collate, but had to change it somewhat to accommodate the
requirements of the Unicode Collation Algorithm (in particular,
there are maps from single-character collation elements to
multiple collation weight vectors, and multiple-to-multiple
mappings as well).


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/lib/libc/citrus/citrus_lc_collate.c
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/lib/libc/locale/collate_local.h \
src/lib/libc/locale/collate_locale.c \
src/lib/libc/locale/unicode_collate.c \
src/lib/libc/locale/unicode_nfd_qc_data.h \
src/lib/libc/locale/unicode_ucd.c src/lib/libc/locale/unicode_ucd.h

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/citrus/citrus_lc_collate.c
diff -u src/lib/libc/citrus/citrus_lc_collate.c:1.1.2.1 src/lib/libc/citrus/citrus_lc_collate.c:1.1.2.2
--- src/lib/libc/citrus/citrus_lc_collate.c:1.1.2.1	Fri Jul 14 15:53:07 2017
+++ src/lib/libc/citrus/citrus_lc_collate.c	Mon Jul 31 04:29:50 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: citrus_lc_collate.c,v 1.1.2.1 2017/07/14 15:53:07 perseant Exp $ */
+/* $NetBSD: citrus_lc_collate.c,v 1.1.2.2 2017/07/31 04:29:50 perseant Exp $ */
 
 /*-
  * Copyright (c)2008 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_lc_collate.c,v 1.1.2.1 2017/07/14 15:53:07 perseant Exp $");
+__RCSID("$NetBSD: citrus_lc_collate.c,v 1.1.2.2 2017/07/31 04:29:50 perseant Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "reentrant.h"
@@ -65,13 +65,13 @@ __RCSID("$NetBSD: citrus_lc_collate.c,v 
 /*
  * macro required by nb_lc_template(_decl).h
  */
-#define _CATEGORY_TYPE  _CollateLocale
+#define _CATEGORY_TYPE  struct xlocale_collate
 
 #include "nb_lc_template_decl.h"
 
 static int
 _citrus_LC_COLLATE_create_impl(const char * __restrict root,
-const char * __restrict name, _CollateLocale ** __restrict pdata)
+const char * __restrict name, struct xlocale_collate ** __restrict pdata)
 {
 	char path[PATH_MAX + 1];
 	int ret;
@@ -92,7 +92,7 @@ _citrus_LC_COLLATE_create_impl(const cha
 }
 
 static __inline void
-_PREFIX(update_global)(_CollateLocale *data)
+_PREFIX(update_global)(struct xlocale_collate *data)
 {
 	_DIAGASSERT(data != NULL);
 }

Index: src/lib/libc/locale/collate_local.h
diff -u src/lib/libc/locale/collate_local.h:1.1.2.1 src/lib/libc/locale/collate_local.h:1.1.2.2
--- src/lib/libc/locale/collate_local.h:1.1.2.1	Fri Jul 14 15:53:08 2017
+++ src/lib/libc/locale/collate_local.h	Mon Jul 31 04:29:50 2017
@@ -1,26 +1,45 @@
-/*	$NetBSD: collate_local.h,v 1.1.2.1 2017/07/14 15:53:08 perseant Exp $	*/
+/*	$NetBSD: collate_local.h,v 1.1.2.2 2017/07/31 04:29:50 perseant Exp $	*/
 
 #ifndef	_COLLATE_LOCAL_H_
 #define	_COLLATE_LOCAL_H_
 
 #include 
+#include "collate.h"
 
 #include "unicode_ucd.h"
 
 typedef struct _CollateLocale {
 	void		*coll_variable;
 	size_t		 coll_variable_len;
-	struct ucd_coll *coll_data;
+	struct ucd_coll*coll_data; /* XXX obsolescent */
 	size_t   coll_data_len;
+	const struct _FileCollateLocale *coll_fcl;
+#define coll_collinfo  coll_fcl->fcl_collinfo
+#define coll_char_data coll_fcl->fcl_char_data
+	const collate_subst_t  *coll_subst;
+	const collate_chain_t  *coll_chains;
+	const collate_large_t  *coll_large;
 } _CollateLocale;
 
+typedef struct _FileCollateLocale {
+	collate_info_t  fcl_collinfo;
+	collate_char_t  fcl_char_data[0x100];
+/*
+These fields are variable length (perhaps 0)
+	and follow the previous fields in the file:
+	collate_chain_t *chains;
+	collate_large_t *large;
+	collate_subst_t *subst;
+*/
+} _FileCollateLocale;
+
 /*
  * global variables
  */
-extern __dso_hidden const _CollateLocale _DefaultCollateLocale;
+extern __dso_hidden const struct xlocale_collate _DefaultCollateLocale;
 
 __BEGIN_DECLS
-int _collate_load(const char * __restrict, size_t, _CollateLocale ** __restrict);
+int _collate_load(const char * __restrict, size_t, struct xlocale_collate ** __restrict);
 __END_DECLS
 
 #endif	/* !_COLLATE_LOCAL_H_ */
Index: src/lib/libc/locale/collate_locale.c
diff -u src/lib/libc/locale/collate_locale.c:1.1.2.1 src/lib/libc/locale/collate_locale.c:1.1.2.2
--- src/lib/libc/locale/collate_locale.c:1.1.2.1	Fri Jul 14 15:53:08 2017
+++ src/lib/libc/locale/collate_locale.c	Mon Jul 31 04:29:50 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: collate_locale.c,v 1.1.2.1 2017/07/14 15:53:08 perseant Exp $	*/
+/*	$NetBSD: collate_locale.c,v 1.1.2.2 

CVS commit: src/sys/opencrypto

2017-07-30 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Mon Jul 31 04:25:45 UTC 2017

Modified Files:
src/sys/opencrypto: crypto.c

Log Message:
use pool_cache(9) instead of pool(9) as they can be called concurrently.


To generate a diff of this commit:
cvs rdiff -u -r1.99 -r1.100 src/sys/opencrypto/crypto.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/crypto.c
diff -u src/sys/opencrypto/crypto.c:1.99 src/sys/opencrypto/crypto.c:1.100
--- src/sys/opencrypto/crypto.c:1.99	Mon Jul 31 04:23:48 2017
+++ src/sys/opencrypto/crypto.c	Mon Jul 31 04:25:45 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: crypto.c,v 1.99 2017/07/31 04:23:48 knakahara Exp $ */
+/*	$NetBSD: crypto.c,v 1.100 2017/07/31 04:25:45 knakahara Exp $ */
 /*	$FreeBSD: src/sys/opencrypto/crypto.c,v 1.4.2.5 2003/02/26 00:14:05 sam Exp $	*/
 /*	$OpenBSD: crypto.c,v 1.41 2002/07/17 23:52:38 art Exp $	*/
 
@@ -53,7 +53,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: crypto.c,v 1.99 2017/07/31 04:23:48 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: crypto.c,v 1.100 2017/07/31 04:25:45 knakahara Exp $");
 
 #include 
 #include 
@@ -360,9 +360,9 @@ sysctl_opencrypto_kq_maxlen(SYSCTLFN_ARG
  * Crypto op and desciptor data structures are allocated
  * from separate private zones(FreeBSD)/pools(netBSD/OpenBSD) .
  */
-struct pool cryptop_pool;
-struct pool cryptodesc_pool;
-struct pool cryptkop_pool;
+static pool_cache_t cryptop_cache;
+static pool_cache_t cryptodesc_cache;
+static pool_cache_t cryptkop_cache;
 
 int	crypto_usercrypto = 1;		/* userland may open /dev/crypto */
 int	crypto_userasymcrypto = 1;	/* userland may do asym crypto reqs */
@@ -571,12 +571,12 @@ crypto_init0(void)
 	int error;
 
 	mutex_init(_drv_mtx, MUTEX_DEFAULT, IPL_NONE);
-	pool_init(_pool, sizeof(struct cryptop), 0, 0,  
-		  0, "cryptop", NULL, IPL_NET);
-	pool_init(_pool, sizeof(struct cryptodesc), 0, 0,
-		  0, "cryptodesc", NULL, IPL_NET);
-	pool_init(_pool, sizeof(struct cryptkop), 0, 0,
-		  0, "cryptkop", NULL, IPL_NET);
+	cryptop_cache = pool_cache_init(sizeof(struct cryptop),
+	coherency_unit, 0, 0, "cryptop", NULL, IPL_NET, NULL, NULL, NULL);
+	cryptodesc_cache = pool_cache_init(sizeof(struct cryptodesc),
+	coherency_unit, 0, 0, "cryptdesc", NULL, IPL_NET, NULL, NULL, NULL);
+	cryptkop_cache = pool_cache_init(sizeof(struct cryptkop),
+	coherency_unit, 0, 0, "cryptkop", NULL, IPL_NET, NULL, NULL, NULL);
 
 	crypto_crp_qs_percpu = percpu_alloc(sizeof(struct crypto_crp_qs));
 	percpu_foreach(crypto_crp_qs_percpu, crypto_crp_qs_init_pc, NULL);
@@ -702,9 +702,9 @@ crypto_destroy(bool exit_kthread)
 
 	percpu_free(crypto_crp_qs_percpu, sizeof(struct crypto_crp_qs));
 
-	pool_destroy(_pool);
-	pool_destroy(_pool);
-	pool_destroy(_pool);
+	pool_cache_destroy(cryptop_cache);
+	pool_cache_destroy(cryptodesc_cache);
+	pool_cache_destroy(cryptkop_cache);
 
 	mutex_destroy(_drv_mtx);
 
@@ -1624,9 +1624,9 @@ crypto_freereq(struct cryptop *crp)
 
 	while ((crd = crp->crp_desc) != NULL) {
 		crp->crp_desc = crd->crd_next;
-		pool_put(_pool, crd);
+		pool_cache_put(cryptodesc_cache, crd);
 	}
-	pool_put(_pool, crp);
+	pool_cache_put(cryptop_cache, crp);
 }
 
 /*
@@ -1652,14 +1652,14 @@ crypto_getreq(int num)
 	}
 	crypto_put_crp_ret_qs(curcpu());
 
-	crp = pool_get(_pool, 0);
+	crp = pool_cache_get(cryptop_cache, 0);
 	if (crp == NULL) {
 		return NULL;
 	}
 	memset(crp, 0, sizeof(struct cryptop));
 
 	while (num--) {
-		crd = pool_get(_pool, 0);
+		crd = pool_cache_get(cryptodesc_cache, 0);
 		if (crd == NULL) {
 			crypto_freereq(crp);
 			return NULL;
@@ -1691,7 +1691,7 @@ crypto_kfreereq(struct cryptkop *krp)
 		panic("crypto_kfreereq() freeing krp on RETQ\n");
 	}
 
-	pool_put(_pool, krp);
+	pool_cache_put(cryptkop_cache, krp);
 }
 
 /*
@@ -1717,7 +1717,7 @@ crypto_kgetreq(int num __unused, int prf
 	}
 	crypto_put_crp_ret_qs(curcpu());
 
-	krp = pool_get(_pool, prflags);
+	krp = pool_cache_get(cryptkop_cache, prflags);
 	if (krp == NULL) {
 		return NULL;
 	}



CVS commit: src/sys/opencrypto

2017-07-30 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Mon Jul 31 04:23:48 UTC 2017

Modified Files:
src/sys/opencrypto: crypto.c

Log Message:
use kmem_alloc KPI instead of malloc KPI.


To generate a diff of this commit:
cvs rdiff -u -r1.98 -r1.99 src/sys/opencrypto/crypto.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/crypto.c
diff -u src/sys/opencrypto/crypto.c:1.98 src/sys/opencrypto/crypto.c:1.99
--- src/sys/opencrypto/crypto.c:1.98	Mon Jul 31 04:21:59 2017
+++ src/sys/opencrypto/crypto.c	Mon Jul 31 04:23:48 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: crypto.c,v 1.98 2017/07/31 04:21:59 knakahara Exp $ */
+/*	$NetBSD: crypto.c,v 1.99 2017/07/31 04:23:48 knakahara Exp $ */
 /*	$FreeBSD: src/sys/opencrypto/crypto.c,v 1.4.2.5 2003/02/26 00:14:05 sam Exp $	*/
 /*	$OpenBSD: crypto.c,v 1.41 2002/07/17 23:52:38 art Exp $	*/
 
@@ -53,12 +53,11 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: crypto.c,v 1.98 2017/07/31 04:21:59 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: crypto.c,v 1.99 2017/07/31 04:23:48 knakahara Exp $");
 
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -474,8 +473,6 @@ sysctl_opencrypto_setup(struct sysctllog
 		   CTL_CREATE, CTL_EOL);
 }
 
-MALLOC_DEFINE(M_CRYPTO_DATA, "crypto", "crypto session records");
-
 /*
  * Synchronization: read carefully, this is non-trivial.
  *
@@ -590,8 +587,8 @@ crypto_init0(void)
 		return ENOMEM;
 	}
 
-	crypto_drivers = malloc(CRYPTO_DRIVERS_INITIAL *
-	sizeof(struct cryptocap), M_CRYPTO_DATA, M_NOWAIT | M_ZERO);
+	crypto_drivers = kmem_zalloc(CRYPTO_DRIVERS_INITIAL *
+	sizeof(struct cryptocap), KM_NOSLEEP);
 	if (crypto_drivers == NULL) {
 		printf("crypto_init: cannot malloc driver table\n");
 		return ENOMEM;
@@ -699,7 +696,8 @@ crypto_destroy(bool exit_kthread)
 
 	mutex_enter(_drv_mtx);
 	if (crypto_drivers != NULL)
-		free(crypto_drivers, M_CRYPTO_DATA);
+		kmem_free(crypto_drivers,
+		crypto_drivers_num * sizeof(struct cryptocap));
 	mutex_exit(_drv_mtx);
 
 	percpu_free(crypto_crp_qs_percpu, sizeof(struct crypto_crp_qs));
@@ -931,8 +929,8 @@ crypto_get_driverid(u_int32_t flags)
 			return -1;
 		}
 
-		newdrv = malloc(2 * crypto_drivers_num *
-		sizeof(struct cryptocap), M_CRYPTO_DATA, M_NOWAIT|M_ZERO);
+		newdrv = kmem_zalloc(2 * crypto_drivers_num *
+		sizeof(struct cryptocap), KM_NOSLEEP);
 		if (newdrv == NULL) {
 			mutex_exit(_drv_mtx);
 			printf("crypto: no space to expand driver table!\n");
@@ -941,10 +939,10 @@ crypto_get_driverid(u_int32_t flags)
 
 		memcpy(newdrv, crypto_drivers,
 		crypto_drivers_num * sizeof(struct cryptocap));
+		kmem_free(crypto_drivers,
+		crypto_drivers_num * sizeof(struct cryptocap));
 
 		crypto_drivers_num *= 2;
-
-		free(crypto_drivers, M_CRYPTO_DATA);
 		crypto_drivers = newdrv;
 
 		cap = crypto_checkdriver_uninit(i);



CVS commit: [perseant-stdc-iso10646] src/lib/libc/citrus

2017-07-30 Thread Konrad Schroder
Module Name:src
Committed By:   perseant
Date:   Mon Jul 31 04:23:35 UTC 2017

Modified Files:
src/lib/libc/citrus [perseant-stdc-iso10646]: citrus_ctype.h
citrus_ctype_template.h
src/lib/libc/citrus/modules [perseant-stdc-iso10646]: citrus_big5.c
citrus_euc.c citrus_iso2022.c citrus_mskanji.c

Log Message:
Make the compilation conditional on __STDC_ISO_10646__, so that applications
that need one of the East Asian locales but don't want __STDC_ISO_10646__
don't have to pay the penalty for it.


To generate a diff of this commit:
cvs rdiff -u -r1.3.22.1 -r1.3.22.2 src/lib/libc/citrus/citrus_ctype.h
cvs rdiff -u -r1.36.22.1 -r1.36.22.2 \
src/lib/libc/citrus/citrus_ctype_template.h
cvs rdiff -u -r1.15.18.2 -r1.15.18.3 \
src/lib/libc/citrus/modules/citrus_big5.c
cvs rdiff -u -r1.17.20.2 -r1.17.20.3 src/lib/libc/citrus/modules/citrus_euc.c
cvs rdiff -u -r1.23.22.2 -r1.23.22.3 \
src/lib/libc/citrus/modules/citrus_iso2022.c
cvs rdiff -u -r1.14.22.2 -r1.14.22.3 \
src/lib/libc/citrus/modules/citrus_mskanji.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/libc/citrus/citrus_ctype.h
diff -u src/lib/libc/citrus/citrus_ctype.h:1.3.22.1 src/lib/libc/citrus/citrus_ctype.h:1.3.22.2
--- src/lib/libc/citrus/citrus_ctype.h:1.3.22.1	Fri Jul 21 20:22:29 2017
+++ src/lib/libc/citrus/citrus_ctype.h	Mon Jul 31 04:23:35 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_ctype.h,v 1.3.22.1 2017/07/21 20:22:29 perseant Exp $	*/
+/*	$NetBSD: citrus_ctype.h,v 1.3.22.2 2017/07/31 04:23:35 perseant Exp $	*/
 
 /*-
  * Copyright (c)2002 Citrus Project,
@@ -30,6 +30,7 @@
 #ifndef _CITRUS_CTYPE_H_
 #define _CITRUS_CTYPE_H_
 
+#include  /* For __STDC_ISO_10646__ */
 #include "citrus_ctype_local.h"
 
 typedef struct _citrus_ctype_rec *_citrus_ctype_t;
@@ -185,6 +186,7 @@ _citrus_ctype_wctob(_citrus_ctype_t cc, 
 	return (*cc->cc_ops->co_wctob)(cc, c, cresult);
 }
 
+#ifdef __STDC_ISO_10646__
 static __inline int
 _citrus_ctype_ucs2kt(_citrus_ctype_t cc,
 		  wchar_kuten_t * __restrict ktp,
@@ -202,6 +204,11 @@ _citrus_ctype_kt2ucs(_citrus_ctype_t cc,
 	_DIAGASSERT(cc && cc->cc_ops && cc->cc_ops->co_kt2ucs);
 	return (*cc->cc_ops->co_kt2ucs)(cc->cc_closure, up, kt);
 }
+#else
+/* Define away the calls to these functions */
+#define _citrus_ctype_ucs2kt(cl, ktp, wc) do {} while (0)
+#define _citrus_ctype_kt2ucs(cl, up, kt) do {} while (0)
+#endif
 
 extern _citrus_ctype_rec_t _citrus_ctype_default;
 

Index: src/lib/libc/citrus/citrus_ctype_template.h
diff -u src/lib/libc/citrus/citrus_ctype_template.h:1.36.22.1 src/lib/libc/citrus/citrus_ctype_template.h:1.36.22.2
--- src/lib/libc/citrus/citrus_ctype_template.h:1.36.22.1	Fri Jul 21 20:22:29 2017
+++ src/lib/libc/citrus/citrus_ctype_template.h	Mon Jul 31 04:23:35 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_ctype_template.h,v 1.36.22.1 2017/07/21 20:22:29 perseant Exp $	*/
+/*	$NetBSD: citrus_ctype_template.h,v 1.36.22.2 2017/07/31 04:23:35 perseant Exp $	*/
 
 /*-
  * Copyright (c)2002 Citrus Project,
@@ -118,6 +118,7 @@
  *
  */
 
+#include  /* For __STDC_ISO_10646__ */
 
 /* prototypes */
 
@@ -938,6 +939,7 @@ _FUNCNAME(ctype_wctob)(_citrus_ctype_rec
 	return 0;
 }
 
+#ifdef __STDC_ISO_10646__
 static __inline int
 /*ARGSUSED*/
 _FUNCNAME(ctype_ucs2kt)(void * __restrict cl,
@@ -953,4 +955,8 @@ _FUNCNAME(ctype_kt2ucs)(void * __restric
 {
 	return _FUNCNAME(kt2ucs)(_CEI_TO_EI(_TO_CEI(cl)), up, kt);
 }
-
+#else
+/* Define away the calls to these functions */
+#define _FUNCNAME(ctype_ucs2kt)(cl, ktp, wc) do {} while (0)
+#define _FUNCNAME(ctype_kt2ucs)(cl, up, kt) do {} while (0)
+#endif

Index: src/lib/libc/citrus/modules/citrus_big5.c
diff -u src/lib/libc/citrus/modules/citrus_big5.c:1.15.18.2 src/lib/libc/citrus/modules/citrus_big5.c:1.15.18.3
--- src/lib/libc/citrus/modules/citrus_big5.c:1.15.18.2	Fri Jul 21 20:22:29 2017
+++ src/lib/libc/citrus/modules/citrus_big5.c	Mon Jul 31 04:23:35 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_big5.c,v 1.15.18.2 2017/07/21 20:22:29 perseant Exp $	*/
+/*	$NetBSD: citrus_big5.c,v 1.15.18.3 2017/07/31 04:23:35 perseant Exp $	*/
 
 /*-
  * Copyright (c)2002, 2006 Citrus Project,
@@ -60,7 +60,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_big5.c,v 1.15.18.2 2017/07/21 20:22:29 perseant Exp $");
+__RCSID("$NetBSD: citrus_big5.c,v 1.15.18.3 2017/07/31 04:23:35 perseant Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -134,6 +134,7 @@ typedef struct {
 #define _ENCODING_IS_STATE_DEPENDENT	0
 #define _STATE_NEEDS_EXPLICIT_INIT(_ps_)	0
 
+#ifdef __STDC_ISO_10646__
 #include "citrus_big5_data.h"
 
 static __inline int
@@ -188,6 +189,9 @@ _FUNCNAME(kt2ucs)(_ENCODING_INFO * __res
 
 	return 0;
 }
+#else
+#include "citrus_u2k_template.h"
+#endif
 
 static __inline void
 /*ARGSUSED*/

Index: src/lib/libc/citrus/modules/citrus_euc.c
diff -u 

CVS commit: src/sys/opencrypto

2017-07-30 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Mon Jul 31 04:21:59 UTC 2017

Modified Files:
src/sys/opencrypto: crypto.c

Log Message:
pack crypto_drivers variables to struct and add cacheline_aligned qualifier.


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/sys/opencrypto/crypto.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/crypto.c
diff -u src/sys/opencrypto/crypto.c:1.97 src/sys/opencrypto/crypto.c:1.98
--- src/sys/opencrypto/crypto.c:1.97	Mon Jul 31 04:19:26 2017
+++ src/sys/opencrypto/crypto.c	Mon Jul 31 04:21:59 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: crypto.c,v 1.97 2017/07/31 04:19:26 knakahara Exp $ */
+/*	$NetBSD: crypto.c,v 1.98 2017/07/31 04:21:59 knakahara Exp $ */
 /*	$FreeBSD: src/sys/opencrypto/crypto.c,v 1.4.2.5 2003/02/26 00:14:05 sam Exp $	*/
 /*	$OpenBSD: crypto.c,v 1.41 2002/07/17 23:52:38 art Exp $	*/
 
@@ -53,7 +53,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: crypto.c,v 1.97 2017/07/31 04:19:26 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: crypto.c,v 1.98 2017/07/31 04:21:59 knakahara Exp $");
 
 #include 
 #include 
@@ -85,10 +85,16 @@ __KERNEL_RCSID(0, "$NetBSD: crypto.c,v 1
  * crypto_drivers table with crypto_get_driverid() and then registering
  * each algorithm they support with crypto_register() and crypto_kregister().
  */
-static kmutex_t crypto_drv_mtx;
 /* Don't directly access crypto_drivers[i], use crypto_checkdriver(i). */
-static	struct cryptocap *crypto_drivers;
-static	int crypto_drivers_num;
+static struct {
+	kmutex_t mtx;
+	int num;
+	struct cryptocap *list;
+} crypto_drv __cacheline_aligned;
+#define crypto_drv_mtx		(crypto_drv.mtx)
+#define crypto_drivers_num	(crypto_drv.num)
+#define crypto_drivers		(crypto_drv.list)
+
 static	void *crypto_q_si;
 static	void *crypto_ret_si;
 



CVS commit: src/sys/opencrypto

2017-07-30 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Mon Jul 31 04:19:26 UTC 2017

Modified Files:
src/sys/opencrypto: crypto.c

Log Message:
refactor: remove glue macros for FreeBSD code.


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.97 src/sys/opencrypto/crypto.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/crypto.c
diff -u src/sys/opencrypto/crypto.c:1.96 src/sys/opencrypto/crypto.c:1.97
--- src/sys/opencrypto/crypto.c:1.96	Wed Jul 26 06:44:01 2017
+++ src/sys/opencrypto/crypto.c	Mon Jul 31 04:19:26 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: crypto.c,v 1.96 2017/07/26 06:44:01 knakahara Exp $ */
+/*	$NetBSD: crypto.c,v 1.97 2017/07/31 04:19:26 knakahara Exp $ */
 /*	$FreeBSD: src/sys/opencrypto/crypto.c,v 1.4.2.5 2003/02/26 00:14:05 sam Exp $	*/
 /*	$OpenBSD: crypto.c,v 1.41 2002/07/17 23:52:38 art Exp $	*/
 
@@ -53,7 +53,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: crypto.c,v 1.96 2017/07/26 06:44:01 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: crypto.c,v 1.97 2017/07/31 04:19:26 knakahara Exp $");
 
 #include 
 #include 
@@ -80,20 +80,6 @@ __KERNEL_RCSID(0, "$NetBSD: crypto.c,v 1
 #include 
 #include 			/* XXX for M_XDATA */
 
-/* below are kludges for residual code wrtitten to FreeBSD interfaces */
-  #define SWI_CRYPTO 17
-  #define register_swi(lvl, fn)  \
-  softint_establish(SOFTINT_NET|SOFTINT_MPSAFE, (void (*)(void *))fn, NULL)
-  #define unregister_swi(lvl, fn)  softint_disestablish(softintr_cookie)
-  #define setsoftcrypto(x)			\
-	do{	\
-		kpreempt_disable();		\
-		softint_schedule(x);		\
-		kpreempt_enable();		\
-	}while(0)
-
-int crypto_ret_q_check(struct cryptop *);
-
 /*
  * Crypto drivers register themselves by allocating a slot in the
  * crypto_drivers table with crypto_get_driverid() and then registering
@@ -103,8 +89,7 @@ static kmutex_t crypto_drv_mtx;
 /* Don't directly access crypto_drivers[i], use crypto_checkdriver(i). */
 static	struct cryptocap *crypto_drivers;
 static	int crypto_drivers_num;
-static	void *softintr_cookie;
-
+static	void *crypto_q_si;
 static	void *crypto_ret_si;
 
 /*
@@ -508,7 +493,7 @@ MALLOC_DEFINE(M_CRYPTO_DATA, "crypto", "
  *
  * This scheme is not intended for SMP machines.
  */
-static	void cryptointr(void);		/* swi thread to dispatch ops */
+static	void cryptointr(void *);	/* swi thread to dispatch ops */
 static	void cryptoret_softint(void *);	/* kernel thread for callbacks*/
 static	int crypto_destroy(bool);
 static	int crypto_invoke(struct cryptop *crp, int hint);
@@ -607,8 +592,8 @@ crypto_init0(void)
 	}
 	crypto_drivers_num = CRYPTO_DRIVERS_INITIAL;
 
-	softintr_cookie = register_swi(SWI_CRYPTO, cryptointr);
-	if (softintr_cookie == NULL) {
+	crypto_q_si = softint_establish(SOFTINT_NET|SOFTINT_MPSAFE, cryptointr, NULL);
+	if (crypto_q_si == NULL) {
 		printf("crypto_init: cannot establish request queue handler\n");
 		return crypto_destroy(false);
 	}
@@ -703,8 +688,8 @@ crypto_destroy(bool exit_kthread)
 	if (crypto_ret_si != NULL)
 		softint_disestablish(crypto_ret_si);
 
-	if (softintr_cookie != NULL)
-		unregister_swi(SWI_CRYPTO, cryptointr);
+	if (crypto_q_si != NULL)
+		softint_disestablish(crypto_q_si);
 
 	mutex_enter(_drv_mtx);
 	if (crypto_drivers != NULL)
@@ -1278,8 +1263,11 @@ crypto_unblock(u_int32_t driverid, int w
 		cap->cc_kqblocked = 0;
 	}
 	crypto_driver_unlock(cap);
-	if (needwakeup)
-		setsoftcrypto(softintr_cookie);
+	if (needwakeup) {
+		kpreempt_disable();
+		softint_schedule(crypto_q_si);
+		kpreempt_enable();
+	}
 
 	return 0;
 }
@@ -1323,8 +1311,11 @@ crypto_dispatch(struct cryptop *crp)
 		TAILQ_INSERT_TAIL(crp_q, crp, crp_next);
 		crypto_put_crp_qs();
 		crp_q = NULL;
-		if (wasempty)
-			setsoftcrypto(softintr_cookie);
+		if (wasempty) {
+			kpreempt_disable();
+			softint_schedule(crypto_q_si);
+			kpreempt_enable();
+		}
 
 		return 0;
 	}
@@ -1901,7 +1892,7 @@ unlock:		crypto_driver_unlock(cap);
  * Software interrupt thread to dispatch crypto requests.
  */
 static void
-cryptointr(void)
+cryptointr(void *arg __unused)
 {
 	struct cryptop *crp, *submit, *cnext;
 	struct cryptkop *krp, *knext;



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

2017-07-30 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Jul 31 00:51:20 UTC 2017

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

Log Message:
Set the correct com type


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/broadcom/bcm2835_com.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_com.c
diff -u src/sys/arch/arm/broadcom/bcm2835_com.c:1.1 src/sys/arch/arm/broadcom/bcm2835_com.c:1.2
--- src/sys/arch/arm/broadcom/bcm2835_com.c:1.1	Sun Jul 30 23:48:32 2017
+++ src/sys/arch/arm/broadcom/bcm2835_com.c	Mon Jul 31 00:51:20 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: bcm2835_com.c,v 1.1 2017/07/30 23:48:32 jmcneill Exp $ */
+/* $NetBSD: bcm2835_com.c,v 1.2 2017/07/31 00:51:20 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_com.c,v 1.1 2017/07/30 23:48:32 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_com.c,v 1.2 2017/07/31 00:51:20 jmcneill Exp $");
 
 #include 
 #include 
@@ -68,7 +68,7 @@ bcm_com_attach(device_t parent, device_t
 	void *ih;
 
 	sc->sc_dev = self;
-	sc->sc_type = COM_TYPE_NORMAL;
+	sc->sc_type = COM_TYPE_BCMAUXUART;
 
 	prop_dictionary_get_uint32(dict, "frequency", >sc_frequency);
 	if (sc->sc_frequency == 0) {



CVS commit: src/sys/arch

2017-07-30 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 30 23:48:32 UTC 2017

Modified Files:
src/sys/arch/arm/broadcom: bcm2835_obio.c bcm2835reg.h files.bcm2835
src/sys/arch/evbarm/conf: RPI
src/sys/arch/evbarm/rpi: rpi_machdep.c
Added Files:
src/sys/arch/arm/broadcom: bcm2835_com.c

Log Message:
Add support for BCM2835 AUX UART.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/broadcom/bcm2835_com.c
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/arm/broadcom/bcm2835_obio.c \
src/sys/arch/arm/broadcom/files.bcm2835
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/arm/broadcom/bcm2835reg.h
cvs rdiff -u -r1.73 -r1.74 src/sys/arch/evbarm/conf/RPI
cvs rdiff -u -r1.74 -r1.75 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/arm/broadcom/bcm2835_obio.c
diff -u src/sys/arch/arm/broadcom/bcm2835_obio.c:1.27 src/sys/arch/arm/broadcom/bcm2835_obio.c:1.28
--- src/sys/arch/arm/broadcom/bcm2835_obio.c:1.27	Sun Jul 30 16:54:36 2017
+++ src/sys/arch/arm/broadcom/bcm2835_obio.c	Sun Jul 30 23:48:32 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm2835_obio.c,v 1.27 2017/07/30 16:54:36 jmcneill Exp $	*/
+/*	$NetBSD: bcm2835_obio.c,v 1.28 2017/07/30 23:48:32 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2012, 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_obio.c,v 1.27 2017/07/30 16:54:36 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_obio.c,v 1.28 2017/07/30 23:48:32 jmcneill Exp $");
 
 #include "locators.h"
 #include "obio.h"
@@ -141,6 +141,13 @@ static const struct ambadev_locators bcm
 		.ad_intr = BCM2835_INT_UART0,
 	},
 	{
+		/* AUX UART */
+		.ad_name = "com",
+		.ad_addr = BCM2835_AUX_UART_BASE,
+		.ad_size = BCM2835_AUX_UART_SIZE,
+		.ad_intr = BCM2835_INT_AUX,
+	},
+	{
 		/* Framebuffer */
 		.ad_name = "fb",
 		.ad_addr = 0,
Index: src/sys/arch/arm/broadcom/files.bcm2835
diff -u src/sys/arch/arm/broadcom/files.bcm2835:1.27 src/sys/arch/arm/broadcom/files.bcm2835:1.28
--- src/sys/arch/arm/broadcom/files.bcm2835:1.27	Sun Jul 30 16:54:36 2017
+++ src/sys/arch/arm/broadcom/files.bcm2835	Sun Jul 30 23:48:32 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: files.bcm2835,v 1.27 2017/07/30 16:54:36 jmcneill Exp $
+#	$NetBSD: files.bcm2835,v 1.28 2017/07/30 23:48:32 jmcneill Exp $
 #
 # Configuration info for Broadcom BCM2835 ARM Peripherals
 #
@@ -57,6 +57,10 @@ file	arch/arm/broadcom/bcm2835_rng.c		bc
 attach	plcom at obio with bcmplcom
 file	arch/arm/broadcom/bcm2835_plcom.c	bcmplcom
 
+# AUX UART (BCM2835_AUX_UART_BASE)
+attach	com at obio with bcmcom
+file	arch/arm/broadcom/bcm2835_com.c		bcmcom
+
 # External Mass Media Controller (BCM2835_EMMC_BASE)
 attach	sdhc at obio with bcmemmc
 file	arch/arm/broadcom/bcm2835_emmc.c	bcmemmc

Index: src/sys/arch/arm/broadcom/bcm2835reg.h
diff -u src/sys/arch/arm/broadcom/bcm2835reg.h:1.19 src/sys/arch/arm/broadcom/bcm2835reg.h:1.20
--- src/sys/arch/arm/broadcom/bcm2835reg.h:1.19	Sun Jul 30 16:54:36 2017
+++ src/sys/arch/arm/broadcom/bcm2835reg.h	Sun Jul 30 23:48:32 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm2835reg.h,v 1.19 2017/07/30 16:54:36 jmcneill Exp $	*/
+/*	$NetBSD: bcm2835reg.h,v 1.20 2017/07/30 23:48:32 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -68,6 +68,7 @@
 #define	BCM2835_PWM_BASE	(BCM2835_PERIPHERALS_BASE_BUS + 0x0020C000)
 #define	BCM2835_BSCSPISLV_BASE	(BCM2835_PERIPHERALS_BASE_BUS + 0x00214000)
 #define	BCM2835_AUX_BASE	(BCM2835_PERIPHERALS_BASE_BUS + 0x00215000)
+#define	BCM2835_AUX_UART_BASE	(BCM2835_PERIPHERALS_BASE_BUS + 0x00215040)
 #define	BCM2835_EMMC_BASE	(BCM2835_PERIPHERALS_BASE_BUS + 0x0030)
 #define	BCM2835_BSC1_BASE	(BCM2835_PERIPHERALS_BASE_BUS + 0x00804000)
 #define	BCM2835_BSC2_BASE	(BCM2835_PERIPHERALS_BASE_BUS + 0x00805000)
@@ -86,7 +87,8 @@
 #define	BCM2835_SPI0_SIZE	0x1000
 #define	BCM2835_BSC_SIZE	0x1000
 #define	BCM2835_PWM_SIZE	0x28
-#define	BCM2835_AUX_SIZE	0x1000
+#define	BCM2835_AUX_SIZE	0x8
+#define	BCM2835_AUX_UART_SIZE	0x40
 #define	BCM2835_SDHOST_SIZE	0x1000
 #define	BCM2835_EMMC_SIZE	0x1000
 #define	BCM2835_USB_SIZE	0x2

Index: src/sys/arch/evbarm/conf/RPI
diff -u src/sys/arch/evbarm/conf/RPI:1.73 src/sys/arch/evbarm/conf/RPI:1.74
--- src/sys/arch/evbarm/conf/RPI:1.73	Sun Jul 30 17:01:27 2017
+++ src/sys/arch/evbarm/conf/RPI	Sun Jul 30 23:48:32 2017
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: RPI,v 1.73 2017/07/30 17:01:27 jmcneill Exp $
+#	$NetBSD: RPI,v 1.74 2017/07/30 23:48:32 jmcneill Exp $
 #
 #	RPi -- Raspberry Pi
 #
@@ -73,6 +73,9 @@ spkr*		at audio?		# PC speaker (synthesi
 # PL011 uart
 plcom0		at obio?
 
+# AUX UART
+com0		at obio?
+
 # Framebuffer console
 genfb0		at obio?
 wsdisplay*	at genfb?

Index: src/sys/arch/evbarm/rpi/rpi_machdep.c
diff -u src/sys/arch/evbarm/rpi/rpi_machdep.c:1.74 src/sys/arch/evbarm/rpi/rpi_machdep.c:1.75
--- 

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

2017-07-30 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 30 23:47:58 UTC 2017

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

Log Message:
Cleanup debug messages


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/broadcom/bcm2835_sdhost.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_sdhost.c
diff -u src/sys/arch/arm/broadcom/bcm2835_sdhost.c:1.1 src/sys/arch/arm/broadcom/bcm2835_sdhost.c:1.2
--- src/sys/arch/arm/broadcom/bcm2835_sdhost.c:1.1	Sun Jul 30 16:54:36 2017
+++ src/sys/arch/arm/broadcom/bcm2835_sdhost.c	Sun Jul 30 23:47:58 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: bcm2835_sdhost.c,v 1.1 2017/07/30 16:54:36 jmcneill Exp $ */
+/* $NetBSD: bcm2835_sdhost.c,v 1.2 2017/07/30 23:47:58 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_sdhost.c,v 1.1 2017/07/30 16:54:36 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_sdhost.c,v 1.2 2017/07/30 23:47:58 jmcneill Exp $");
 
 #include 
 #include 
@@ -114,8 +114,6 @@ static void	sdhost_exec_command(sdmmc_ch
 static void	sdhost_card_enable_intr(sdmmc_chipset_handle_t, int);
 static void	sdhost_card_intr_ack(sdmmc_chipset_handle_t);
 
-void		sdhost_dump_regs(void);
-
 static struct sdmmc_chip_functions sdhost_chip_functions = {
 	.host_reset = sdhost_host_reset,
 	.host_ocr = sdhost_host_ocr,
@@ -203,15 +201,13 @@ sdhost_attach(device_t parent, device_t 
 	aprint_naive("\n");
 	aprint_normal(": SD HOST controller\n");
 
-sdhost_dump_regs();
-
 	prop_dictionary_get_uint32(dict, "frequency", >sc_rate);
 	if (sc->sc_rate == 0) {
 		aprint_error_dev(self, "couldn't get clock frequency\n");
 		return;
 	}
 
-	aprint_normal_dev(self, "ref freq %u Hz\n", sc->sc_rate);
+	aprint_debug_dev(self, "ref freq %u Hz\n", sc->sc_rate);
 
 	if (sdhost_dma_setup(sc) != 0) {
 		aprint_error_dev(self, "failed to setup DMA\n");
@@ -705,28 +701,3 @@ static void
 sdhost_card_intr_ack(sdmmc_chipset_handle_t sch)
 {
 }
-
-void
-sdhost_dump_regs(void)
-{
-	device_t dev = device_find_by_driver_unit("sdhost", 0);
-	if (dev == NULL)
-		return;
-	struct sdhost_softc * const sc = device_private(dev);
-
-	device_printf(dev, "SDCMD  = %08x\n", SDHOST_READ(sc, SDCMD));
-	device_printf(dev, "SDARG  = %08x\n", SDHOST_READ(sc, SDARG));
-	device_printf(dev, "SDTOUT = %08x\n", SDHOST_READ(sc, SDTOUT));
-	device_printf(dev, "SDCDIV = %08x\n", SDHOST_READ(sc, SDCDIV));
-	device_printf(dev, "SDRSP0 = %08x\n", SDHOST_READ(sc, SDRSP0));
-	device_printf(dev, "SDRSP1 = %08x\n", SDHOST_READ(sc, SDRSP1));
-	device_printf(dev, "SDRSP2 = %08x\n", SDHOST_READ(sc, SDRSP2));
-	device_printf(dev, "SDRSP3 = %08x\n", SDHOST_READ(sc, SDRSP3));
-	device_printf(dev, "SDHSTS = %08x\n", SDHOST_READ(sc, SDHSTS));
-	device_printf(dev, "SDVDD  = %08x\n", SDHOST_READ(sc, SDVDD));
-	device_printf(dev, "SDEDM  = %08x\n", SDHOST_READ(sc, SDEDM));
-	device_printf(dev, "SDHCFG = %08x\n", SDHOST_READ(sc, SDHCFG));
-	device_printf(dev, "SDHBCT = %08x\n", SDHOST_READ(sc, SDHBCT));
-	device_printf(dev, "SDDATA = \n");
-	device_printf(dev, "SDHBLC = %08x\n", SDHOST_READ(sc, SDHBLC));
-}



CVS commit: src/lib/libc/stdio

2017-07-30 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Jul 30 23:13:24 UTC 2017

Modified Files:
src/lib/libc/stdio: fputs.3

Log Message:
Bump date for previous.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/lib/libc/stdio/fputs.3

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/stdio/fputs.3
diff -u src/lib/libc/stdio/fputs.3:1.13 src/lib/libc/stdio/fputs.3:1.14
--- src/lib/libc/stdio/fputs.3:1.13	Sun Jul 30 22:53:56 2017
+++ src/lib/libc/stdio/fputs.3	Sun Jul 30 23:13:24 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: fputs.3,v 1.13 2017/07/30 22:53:56 cheusov Exp $
+.\"	$NetBSD: fputs.3,v 1.14 2017/07/30 23:13:24 wiz Exp $
 .\"
 .\" Copyright (c) 1990, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -33,7 +33,7 @@
 .\"
 .\" @(#)fputs.3	8.1 (Berkeley) 6/4/93
 .\"
-.Dd June 4, 1993
+.Dd July 30, 2017
 .Dt FPUTS 3
 .Os
 .Sh NAME



CVS commit: src/usr.bin/csplit

2017-07-30 Thread Aleksey Cheusov
Module Name:src
Committed By:   cheusov
Date:   Sun Jul 30 23:02:53 UTC 2017

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

Log Message:
Compare return value of fputs(3) with EOF instead of 0.
This is POSIX-ly correct and fixes csplit(1) on non-NetBSD systems.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/csplit/csplit.c

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

Modified files:

Index: src/usr.bin/csplit/csplit.c
diff -u src/usr.bin/csplit/csplit.c:1.6 src/usr.bin/csplit/csplit.c:1.7
--- src/usr.bin/csplit/csplit.c:1.6	Wed Aug 31 13:35:46 2011
+++ src/usr.bin/csplit/csplit.c	Sun Jul 30 23:02:53 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: csplit.c,v 1.6 2011/08/31 13:35:46 joerg Exp $	*/
+/*	$NetBSD: csplit.c,v 1.7 2017/07/30 23:02:53 cheusov Exp $	*/
 /*	$FreeBSD: src/usr.bin/csplit/csplit.c,v 1.9 2004/03/22 11:15:03 tjr Exp$	*/
 
 /*-
@@ -47,7 +47,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: csplit.c,v 1.6 2011/08/31 13:35:46 joerg Exp $");
+__RCSID("$NetBSD: csplit.c,v 1.7 2017/07/30 23:02:53 cheusov Exp $");
 #endif
 
 #include 
@@ -201,7 +201,7 @@ main(int argc, char *argv[])
 	/* Copy the rest into a new file. */
 	if (!feof(infile)) {
 		ofp = newfile();
-		while ((p = get_line()) != NULL && fputs(p, ofp) == 0)
+		while ((p = get_line()) != NULL && fputs(p, ofp) != EOF)
 			;
 		if (!sflag)
 			(void)printf("%jd\n", (intmax_t)ftello(ofp));
@@ -403,7 +403,7 @@ do_rexp(const char *expr)
 	/* Read and output lines until we get a match. */
 	first = 1;
 	while ((p = get_line()) != NULL) {
-		if (fputs(p, ofp) != 0)
+		if (fputs(p, ofp) == EOF)
 			break;
 		if (!first && regexec(, p, 0, NULL, 0) == 0)
 			break;
@@ -429,7 +429,7 @@ do_rexp(const char *expr)
 		 * after the match.
 		 */
 		while (--ofs > 0 && (p = get_line()) != NULL)
-			if (fputs(p, ofp) != 0)
+			if (fputs(p, ofp) == EOF)
 break;
 		toomuch(NULL, 0L);
 		nwritten = (intmax_t)ftello(ofp);
@@ -465,7 +465,7 @@ do_lineno(const char *expr)
 		while (lineno + 1 != lastline) {
 			if ((p = get_line()) == NULL)
 errx(1, "%ld: out of range", lastline);
-			if (fputs(p, ofp) != 0)
+			if (fputs(p, ofp) == EOF)
 break;
 		}
 		if (!sflag)



CVS commit: src/lib/libc/stdio

2017-07-30 Thread Aleksey Cheusov
Module Name:src
Committed By:   cheusov
Date:   Sun Jul 30 22:53:56 UTC 2017

Modified Files:
src/lib/libc/stdio: fputs.3

Log Message:
According to POSIX return value of fputs(3) should be a non-netagive value if 
it succeeds


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/lib/libc/stdio/fputs.3

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/stdio/fputs.3
diff -u src/lib/libc/stdio/fputs.3:1.12 src/lib/libc/stdio/fputs.3:1.13
--- src/lib/libc/stdio/fputs.3:1.12	Wed Feb 22 14:58:33 2017
+++ src/lib/libc/stdio/fputs.3	Sun Jul 30 22:53:56 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: fputs.3,v 1.12 2017/02/22 14:58:33 abhinav Exp $
+.\"	$NetBSD: fputs.3,v 1.13 2017/07/30 22:53:56 cheusov Exp $
 .\"
 .\" Copyright (c) 1990, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -67,14 +67,11 @@ and a terminating newline character,
 to the stream
 .Em stdout .
 .Sh RETURN VALUES
-The
+The functions
 .Fn fputs
-function
-returns 0 on success and
-.Dv EOF
-on error;
+and
 .Fn puts
-returns a nonnegative integer on success and
+return a nonnegative integer on success and
 .Dv EOF
 on error.
 .Sh ERRORS



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

2017-07-30 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sun Jul 30 20:46:31 UTC 2017

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

Log Message:
undo debug code


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

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

Modified files:

Index: src/sys/dev/ic/siisata.c
diff -u src/sys/dev/ic/siisata.c:1.30.4.28 src/sys/dev/ic/siisata.c:1.30.4.29
--- src/sys/dev/ic/siisata.c:1.30.4.28	Sun Jul 30 20:24:45 2017
+++ src/sys/dev/ic/siisata.c	Sun Jul 30 20:46:31 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: siisata.c,v 1.30.4.28 2017/07/30 20:24:45 jdolecek Exp $ */
+/* $NetBSD: siisata.c,v 1.30.4.29 2017/07/30 20:46:31 jdolecek Exp $ */
 
 /* from ahcisata_core.c */
 
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: siisata.c,v 1.30.4.28 2017/07/30 20:24:45 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: siisata.c,v 1.30.4.29 2017/07/30 20:46:31 jdolecek Exp $");
 
 #include 
 #include 
@@ -288,7 +288,7 @@ siisata_attach_port(struct siisata_softc
 	sc->sc_chanarray[port] = chp;
 	chp->ch_channel = port;
 	chp->ch_atac = >sc_atac;
-	chp->ch_queue = ata_queue_alloc(4) ; //SIISATA_MAX_SLOTS);
+	chp->ch_queue = ata_queue_alloc(SIISATA_MAX_SLOTS);
 	if (chp->ch_queue == NULL) {
 		aprint_error_dev(sc->sc_atac.atac_dev,
 		"port %d: can't allocate memory "



CVS commit: src/usr.bin/pwait

2017-07-30 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Jul 30 20:37:35 UTC 2017

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

Log Message:
The proper way to validate a condition that's expected to be true is
to assert it, not to bolt it into the program logic in a way that will
cause strange behavior if it accidentally isn't true at some point.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/pwait/pwait.c

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

Modified files:

Index: src/usr.bin/pwait/pwait.c
diff -u src/usr.bin/pwait/pwait.c:1.5 src/usr.bin/pwait/pwait.c:1.6
--- src/usr.bin/pwait/pwait.c:1.5	Wed Mar  4 16:36:12 2015
+++ src/usr.bin/pwait/pwait.c	Sun Jul 30 20:37:35 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pwait.c,v 1.5 2015/03/04 16:36:12 christos Exp $	*/
+/*	$NetBSD: pwait.c,v 1.6 2017/07/30 20:37:35 dholland Exp $	*/
 
 /*-
  * Copyright (c) 2004-2009, Jilles Tjoelker
@@ -37,7 +37,7 @@
 #ifdef __FBSDID
 __FBSDID("$FreeBSD: head/bin/pwait/pwait.c 245506 2013-01-16 18:15:25Z delphij $");
 #endif
-__RCSID("$NetBSD: pwait.c,v 1.5 2015/03/04 16:36:12 christos Exp $");
+__RCSID("$NetBSD: pwait.c,v 1.6 2017/07/30 20:37:35 dholland Exp $");
 
 #include 
 #include 
@@ -53,6 +53,7 @@ __RCSID("$NetBSD: pwait.c,v 1.5 2015/03/
 #include 
 #include 
 #include 
+#include 
 
 static __dead void
 usage(void)
@@ -171,6 +172,7 @@ main(int argc, char *argv[])
 			break;
 		}
 
+		assert(n > 0);
 		for (i = 0; i < n; i++) {
 			status = (int)e[i].data;
 			if (verbose) {
@@ -190,8 +192,7 @@ main(int argc, char *argv[])
 return status;
 		}
 		nleft -= n;
-		// n != 0 here, belt-n-suspenders...
-		if (immediately && n)
+		if (immediately)
 			break;
 	}
 



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

2017-07-30 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sun Jul 30 20:24:45 UTC 2017

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

Log Message:
adjust error recovery to similar shape as ahcisata; also switch to using
siisata_reset_channel(), as that seems more reliably get the HBA to running
state again after some errors

besides this, change several places checking PORT_READY to use
siisata_reinit_port() and properly timeout - seen several cases
where it would just loop there indefinitely on some errors with no
way to get into ddb and no error message, due to the tight DELAY() loop


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

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

Modified files:

Index: src/sys/dev/ic/siisata.c
diff -u src/sys/dev/ic/siisata.c:1.30.4.27 src/sys/dev/ic/siisata.c:1.30.4.28
--- src/sys/dev/ic/siisata.c:1.30.4.27	Wed Jul 19 20:24:59 2017
+++ src/sys/dev/ic/siisata.c	Sun Jul 30 20:24:45 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: siisata.c,v 1.30.4.27 2017/07/19 20:24:59 jdolecek Exp $ */
+/* $NetBSD: siisata.c,v 1.30.4.28 2017/07/30 20:24:45 jdolecek Exp $ */
 
 /* from ahcisata_core.c */
 
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: siisata.c,v 1.30.4.27 2017/07/19 20:24:59 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: siisata.c,v 1.30.4.28 2017/07/30 20:24:45 jdolecek Exp $");
 
 #include 
 #include 
@@ -157,12 +157,12 @@ int siisata_bio_complete(struct ata_chan
 void siisata_bio_kill_xfer(struct ata_channel *, struct ata_xfer *, int);
 int siisata_exec_command(struct ata_drive_datas *, struct ata_xfer *);
 
-static void siisata_reinit_port(struct ata_channel *);
+static void siisata_reinit_port(struct ata_channel *, int);
 static void siisata_device_reset(struct ata_channel *);
 static void siisata_activate_prb(struct siisata_channel *, int);
 static void siisata_deactivate_prb(struct siisata_channel *, int);
 static int siisata_dma_setup(struct ata_channel *, int, void *, size_t, int);
-static void siisata_channel_recover(struct ata_channel *, int, int);
+void siisata_channel_recover(struct ata_channel *, uint32_t);
 
 #if NATAPIBUS > 0
 void siisata_atapibus_attach(struct atabus_softc *);
@@ -266,7 +266,7 @@ siisata_init_port(struct siisata_softc *
 	PRWRITE(sc, PRX(chp->ch_channel, PRO_PCC),
 	PR_PC_32BA | PR_PC_INCOR | PR_PC_PORT_RESET);
 	/* initialize port */
-	siisata_reinit_port(chp);
+	siisata_reinit_port(chp, -1);
 	/* enable CmdErrr+CmdCmpl interrupting */
 	siisata_enable_port_interrupt(chp);
 	/* enable port interrupt */
@@ -288,7 +288,7 @@ siisata_attach_port(struct siisata_softc
 	sc->sc_chanarray[port] = chp;
 	chp->ch_channel = port;
 	chp->ch_atac = >sc_atac;
-	chp->ch_queue = ata_queue_alloc(SIISATA_MAX_SLOTS);
+	chp->ch_queue = ata_queue_alloc(4) ; //SIISATA_MAX_SLOTS);
 	if (chp->ch_queue == NULL) {
 		aprint_error_dev(sc->sc_atac.atac_dev,
 		"port %d: can't allocate memory "
@@ -471,54 +471,29 @@ siisata_intr(void *v)
 static void
 siisata_intr_port(struct siisata_channel *schp)
 {
-	struct siisata_softc *sc;
-	struct ata_channel *chp;
+	struct siisata_softc *sc =
+	(struct siisata_softc *)schp->ata_channel.ch_atac;
+	struct ata_channel *chp = >ata_channel;
 	struct ata_xfer *xfer;
-	u_int slot;
-	uint32_t pss, pis;
-
-	sc = (struct siisata_softc *)schp->ata_channel.ch_atac;
-	chp = >ata_channel;
+	int slot = -1;
+	uint32_t pss, pis, tfd = 0;
+	bool recover = false;
 
 	/* get slot status, clearing completion interrupt (PR_PIS_CMDCMPL) */
 	pss = PRREAD(sc, PRX(chp->ch_channel, PRO_PSS));
+
 	SIISATA_DEBUG_PRINT(("%s: %s port %d, pss 0x%x\n",
 	SIISATANAME(sc), __func__, chp->ch_channel, pss), DEBUG_INTR);
 
-	for (slot = 0; slot < SIISATA_MAX_SLOTS; slot++) {
-		if (((schp->sch_active_slots >> slot) & 1) == 0) {
-			/* there's nothing executing here, skip */
-			continue;
-		}
-		if (((pss >> slot) & 1) != 0) {
-			/* execution is incomplete or unsuccessful, skip
-			 * for now */
-			continue;
-		}
-		xfer = ata_queue_hwslot_to_xfer(chp, slot);
-		if (xfer->c_intr == NULL) {
-			wakeup(schp);
-			continue;
-		}
-		KASSERT(xfer != NULL);
-		KASSERT(xfer->c_intr != NULL);
-		xfer->c_intr(chp, xfer, 0);
-	}
-	/* if no errors, we're done now */
-	if ((pss & PR_PSS_ATTENTION) == 0) {
-		pis = PRREAD(sc, PRX(chp->ch_channel, PRO_PIS));
-		pis &= 0x;
-		if (pis) {
-			PRWRITE(sc, PRX(chp->ch_channel, PRO_PIS),
-			pis & 0xfffcfffc);
-		}
-		return;
-	}
+	/* if no errors, just process finished commands and we're done */
+	if (__predict_true((pss & PR_PSS_ATTENTION) == 0))
+		goto process;
 
 	pis = PRREAD(sc, PRX(chp->ch_channel, PRO_PIS));
 
-	SIISATA_DEBUG_PRINT(("%s: %s port %d, pis 0x%x ", SIISATANAME(sc),
-	__func__, chp->ch_channel, pis), DEBUG_INTR);
+	SIISATA_DEBUG_PRINT(("%s: %s port %d, pis 0x%x ",
+	SIISATANAME(sc), __func__, chp->ch_channel, pis),
+	

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

2017-07-30 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Sun Jul 30 20:16:29 UTC 2017

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

Log Message:
actually change the retry to also use NCQ - with one drive I see
very frequent fatal errors on siisata when switching often between
NCQ and non-NCQ I/O commands with chaos monkey (basically, always
the next NCQ command on a slot which had non-NCQ I/O throws fatal
error); they completely vanish when just using NCQ all the time


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

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

Modified files:

Index: src/sys/dev/ata/wd.c
diff -u src/sys/dev/ata/wd.c:1.428.2.30 src/sys/dev/ata/wd.c:1.428.2.31
--- src/sys/dev/ata/wd.c:1.428.2.30	Sat Jul 29 12:51:22 2017
+++ src/sys/dev/ata/wd.c	Sun Jul 30 20:16:29 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: wd.c,v 1.428.2.30 2017/07/29 12:51:22 jdolecek Exp $ */
+/*	$NetBSD: wd.c,v 1.428.2.31 2017/07/30 20:16:29 jdolecek Exp $ */
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -54,7 +54,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.428.2.30 2017/07/29 12:51:22 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.428.2.31 2017/07/30 20:16:29 jdolecek Exp $");
 
 #include "opt_ata.h"
 #include "opt_wd.h"
@@ -734,16 +734,10 @@ wdstart1(struct wd_softc *wd, struct buf
 		xfer->c_bio.flags |= ATA_LBA48;
 
 	/*
-	 * If NCQ was negotiated, always use it for the first attempt.
-	 * Since device cancels all outstanding requests on error, downgrade
-	 * to non-NCQ on retry, so that the retried transfer would not cause
-	 * cascade failure for the other transfers if it fails again.
-	 * If FUA was requested, we can't downgrade, as that would violate
-	 * the semantics - FUA would not be honored. In that case, continue
-	 * retrying with NCQ.
+	 * If NCQ was negotiated, always use it. Some drives return random
+	 * errors when switching between NCQ and non-NCQ I/O too often. 
 	 */
-	if (wd->drvp->drive_flags & ATA_DRIVE_NCQ &&
-	(xfer->c_retries == 0 || (bp->b_flags & B_MEDIA_FUA))) {
+	if (wd->drvp->drive_flags & ATA_DRIVE_NCQ) {
 		xfer->c_bio.flags |= ATA_LBA48;
 		xfer->c_flags |= C_NCQ;
 



CVS commit: src/sys/arch

2017-07-30 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 30 17:32:59 UTC 2017

Modified Files:
src/sys/arch/arm/broadcom: bcm2835_gpio_subr.c bcm2835_gpio_subr.h
src/sys/arch/evbarm/rpi: rpi_machdep.c

Log Message:
Explicitly configure pin pull-down/up settings for SDIO.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/broadcom/bcm2835_gpio_subr.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/broadcom/bcm2835_gpio_subr.h
cvs rdiff -u -r1.73 -r1.74 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/arm/broadcom/bcm2835_gpio_subr.c
diff -u src/sys/arch/arm/broadcom/bcm2835_gpio_subr.c:1.4 src/sys/arch/arm/broadcom/bcm2835_gpio_subr.c:1.5
--- src/sys/arch/arm/broadcom/bcm2835_gpio_subr.c:1.4	Tue Feb  2 13:55:50 2016
+++ src/sys/arch/arm/broadcom/bcm2835_gpio_subr.c	Sun Jul 30 17:32:59 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm2835_gpio_subr.c,v 1.4 2016/02/02 13:55:50 skrll Exp $	*/
+/*	$NetBSD: bcm2835_gpio_subr.c,v 1.5 2017/07/30 17:32:59 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_gpio_subr.c,v 1.4 2016/02/02 13:55:50 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_gpio_subr.c,v 1.5 2017/07/30 17:32:59 jmcneill Exp $");
 
 #include 
 #include 
@@ -84,3 +84,20 @@ bcm2835gpio_function_read(u_int pin)
 
 	return ((v >> shift) & mask);
 }
+
+void
+bcm2835gpio_function_setpull(u_int pin, u_int pud)
+{
+	const paddr_t iop = BCM2835_PERIPHERALS_BUS_TO_PHYS(BCM2835_GPIO_BASE);
+	const bus_space_tag_t iot = _bs_tag;
+	const bus_space_handle_t ioh = BCM2835_IOPHYSTOVIRT(iop);
+	const u_int mask = 1 << (pin % BCM2835_GPIO_GPPUD_PINS_PER_REGISTER);
+	const u_int regid = (pin / BCM2835_GPIO_GPPUD_PINS_PER_REGISTER);
+
+	bus_space_write_4(iot, ioh, BCM2835_GPIO_GPPUD, pud);
+	delay(1);
+	bus_space_write_4(iot, ioh, BCM2835_GPIO_GPPUDCLK(regid), mask);
+	delay(1);
+	bus_space_write_4(iot, ioh, BCM2835_GPIO_GPPUD, 0);
+	bus_space_write_4(iot, ioh, BCM2835_GPIO_GPPUDCLK(regid), 0);
+}

Index: src/sys/arch/arm/broadcom/bcm2835_gpio_subr.h
diff -u src/sys/arch/arm/broadcom/bcm2835_gpio_subr.h:1.2 src/sys/arch/arm/broadcom/bcm2835_gpio_subr.h:1.3
--- src/sys/arch/arm/broadcom/bcm2835_gpio_subr.h:1.2	Tue Apr 22 18:51:35 2014
+++ src/sys/arch/arm/broadcom/bcm2835_gpio_subr.h	Sun Jul 30 17:32:59 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm2835_gpio_subr.h,v 1.2 2014/04/22 18:51:35 kardel Exp $	*/
+/*	$NetBSD: bcm2835_gpio_subr.h,v 1.3 2017/07/30 17:32:59 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -33,5 +33,6 @@
 
 void  bcm2835gpio_function_select(u_int, u_int);
 u_int bcm2835gpio_function_read(u_int);
+void  bcm2835gpio_function_setpull(u_int, u_int);
 
 #endif /* _BROADCOM_BCM2835_GPIOVAR_H_ */

Index: src/sys/arch/evbarm/rpi/rpi_machdep.c
diff -u src/sys/arch/evbarm/rpi/rpi_machdep.c:1.73 src/sys/arch/evbarm/rpi/rpi_machdep.c:1.74
--- src/sys/arch/evbarm/rpi/rpi_machdep.c:1.73	Sun Jul 30 16:54:36 2017
+++ src/sys/arch/evbarm/rpi/rpi_machdep.c	Sun Jul 30 17:32:59 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: rpi_machdep.c,v 1.73 2017/07/30 16:54:36 jmcneill Exp $	*/
+/*	$NetBSD: rpi_machdep.c,v 1.74 2017/07/30 17:32:59 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rpi_machdep.c,v 1.73 2017/07/30 16:54:36 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rpi_machdep.c,v 1.74 2017/07/30 17:32:59 jmcneill Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_bcm283x.h"
@@ -492,6 +492,9 @@ rpi_pinctrl(void)
 	for (int pin = 34; pin <= 39; pin++) {
 		/* Enable SDHCI on SDIO */
 		bcm2835gpio_function_select(pin, BCM2835_GPIO_ALT3);
+		bcm2835gpio_function_setpull(pin,
+		pin == 34 ? BCM2835_GPIO_GPPUD_PULLOFF :
+		BCM2835_GPIO_GPPUD_PULLUP);
 	}
 #endif
 }



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

2017-07-30 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 30 17:01:27 UTC 2017

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

Log Message:
enable sdhost driver (ok skrll@)


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 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.72 src/sys/arch/evbarm/conf/RPI:1.73
--- src/sys/arch/evbarm/conf/RPI:1.72	Sun Jul 30 16:54:36 2017
+++ src/sys/arch/evbarm/conf/RPI	Sun Jul 30 17:01:27 2017
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: RPI,v 1.72 2017/07/30 16:54:36 jmcneill Exp $
+#	$NetBSD: RPI,v 1.73 2017/07/30 17:01:27 jmcneill Exp $
 #
 #	RPi -- Raspberry Pi
 #
@@ -97,8 +97,8 @@ sdhc* at obio?
 sdmmc*  at sdhc?
 
 # SD host controller
-#sdhost* at obio?
-#sdmmc* at sdhost?
+sdhost* at obio?
+sdmmc* at sdhost?
 
 ld* at sdmmc?
 



CVS commit: src/sys/arch

2017-07-30 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul 30 16:54:36 UTC 2017

Modified Files:
src/sys/arch/arm/broadcom: bcm2835_emmc.c bcm2835_intr.c bcm2835_obio.c
bcm2835reg.h files.bcm2835
src/sys/arch/evbarm/conf: RPI
src/sys/arch/evbarm/rpi: rpi_machdep.c
Added Files:
src/sys/arch/arm/broadcom: bcm2835_sdhost.c

Log Message:
Add driver for the bcm2835 internal SD controller. On boards with SDIO
Wi-Fi, the internal SD controller is used for the SD card slot and the
Arasan SDHCI controller is used for SDIO.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/arm/broadcom/bcm2835_emmc.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/broadcom/bcm2835_intr.c
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/arm/broadcom/bcm2835_obio.c \
src/sys/arch/arm/broadcom/files.bcm2835
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/broadcom/bcm2835_sdhost.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arm/broadcom/bcm2835reg.h
cvs rdiff -u -r1.71 -r1.72 src/sys/arch/evbarm/conf/RPI
cvs rdiff -u -r1.72 -r1.73 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/arm/broadcom/bcm2835_emmc.c
diff -u src/sys/arch/arm/broadcom/bcm2835_emmc.c:1.30 src/sys/arch/arm/broadcom/bcm2835_emmc.c:1.31
--- src/sys/arch/arm/broadcom/bcm2835_emmc.c:1.30	Thu Jun 22 13:13:51 2017
+++ src/sys/arch/arm/broadcom/bcm2835_emmc.c	Sun Jul 30 16:54:36 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm2835_emmc.c,v 1.30 2017/06/22 13:13:51 jmcneill Exp $	*/
+/*	$NetBSD: bcm2835_emmc.c,v 1.31 2017/07/30 16:54:36 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_emmc.c,v 1.30 2017/06/22 13:13:51 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_emmc.c,v 1.31 2017/07/30 16:54:36 jmcneill Exp $");
 
 #include "bcmdmac.h"
 
@@ -107,6 +107,7 @@ bcmemmc_attach(device_t parent, device_t
 	prop_dictionary_t dict = device_properties(self);
 	struct amba_attach_args *aaa = aux;
 	prop_number_t frequency;
+	bool disable = false;
 	int error;
 
 	sc->sc.sc_dev = self;
@@ -122,6 +123,13 @@ bcmemmc_attach(device_t parent, device_t
 	sc->sc.sc_clkbase = 5;	/* Default to 50MHz */
 	sc->sc_iot = aaa->aaa_iot;
 
+	prop_dictionary_get_bool(dict, "disable", );
+	if (disable) {
+		aprint_naive(": disabled\n");
+		aprint_normal(": disabled\n");
+		return;
+	}
+
 	/* Fetch the EMMC clock frequency from property if set. */
 	frequency = prop_dictionary_get(dict, "frequency");
 	if (frequency != NULL) {
@@ -131,8 +139,8 @@ bcmemmc_attach(device_t parent, device_t
 	error = bus_space_map(sc->sc_iot, aaa->aaa_addr, aaa->aaa_size, 0,
 	>sc_ioh);
 	if (error) {
-		aprint_error_dev(self,
-		"can't map registers for %s: %d\n", aaa->aaa_name, error);
+		aprint_error(": can't map registers for %s: %d\n",
+		aaa->aaa_name, error);
 		return;
 	}
 	sc->sc_iob = aaa->aaa_addr;

Index: src/sys/arch/arm/broadcom/bcm2835_intr.c
diff -u src/sys/arch/arm/broadcom/bcm2835_intr.c:1.11 src/sys/arch/arm/broadcom/bcm2835_intr.c:1.12
--- src/sys/arch/arm/broadcom/bcm2835_intr.c:1.11	Sat Aug  1 14:18:00 2015
+++ src/sys/arch/arm/broadcom/bcm2835_intr.c	Sun Jul 30 16:54:36 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm2835_intr.c,v 1.11 2015/08/01 14:18:00 skrll Exp $	*/
+/*	$NetBSD: bcm2835_intr.c,v 1.12 2017/07/30 16:54:36 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2012, 2015 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_intr.c,v 1.11 2015/08/01 14:18:00 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_intr.c,v 1.12 2017/07/30 16:54:36 jmcneill Exp $");
 
 #define _INTR_PRIVATE
 
@@ -163,7 +163,7 @@ static const char * const bcm2835_source
 	"(unused 44)",	"pwa0",		"pwa1",		"(unused 47)",
 	"smi",		"gpio[0]",	"gpio[1]",	"gpio[2]",
 	"gpio[3]",	"i2c",		"spi",		"pcm",
-	"sdio",		"uart",		"(unused 58)",	"(unused 59)",
+	"sdhost",	"uart",		"(unused 58)",	"(unused 59)",
 	"(unused 60)",	"(unused 61)",	"emmc",		"(unused 63)",
 	"Timer",	"Mailbox",	"Doorbell0",	"Doorbell1",
 	"GPU0 Halted",	"GPU1 Halted",	"Illegal #1",	"Illegal #0"

Index: src/sys/arch/arm/broadcom/bcm2835_obio.c
diff -u src/sys/arch/arm/broadcom/bcm2835_obio.c:1.26 src/sys/arch/arm/broadcom/bcm2835_obio.c:1.27
--- src/sys/arch/arm/broadcom/bcm2835_obio.c:1.26	Sat Nov 21 07:41:29 2015
+++ src/sys/arch/arm/broadcom/bcm2835_obio.c	Sun Jul 30 16:54:36 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm2835_obio.c,v 1.26 2015/11/21 07:41:29 mlelstv Exp $	*/
+/*	$NetBSD: bcm2835_obio.c,v 1.27 2017/07/30 16:54:36 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2012, 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_obio.c,v 1.26 2015/11/21 07:41:29 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_obio.c,v 1.27 2017/07/30 16:54:36 jmcneill Exp $");
 
 

CVS commit: src/sys/arch/mips

2017-07-30 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jul 30 16:13:24 UTC 2017

Modified Files:
src/sys/arch/mips/include: svr4_machdep.h
src/sys/arch/mips/mips: svr4_machdep.c

Log Message:
Remove references to COMPAT_IRIX - does not exist anymore.

I believe svr4_machdep.h should be removed when the option is not
implemented on the target architecture; and we should also remove the
associated md.* entries.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/mips/include/svr4_machdep.h
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/mips/mips/svr4_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/mips/include/svr4_machdep.h
diff -u src/sys/arch/mips/include/svr4_machdep.h:1.5 src/sys/arch/mips/include/svr4_machdep.h:1.6
--- src/sys/arch/mips/include/svr4_machdep.h:1.5	Mon Apr 28 20:23:28 2008
+++ src/sys/arch/mips/include/svr4_machdep.h	Sun Jul 30 16:13:24 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: svr4_machdep.h,v 1.5 2008/04/28 20:23:28 martin Exp $ */
+/*	$NetBSD: svr4_machdep.h,v 1.6 2017/07/30 16:13:24 maxv Exp $ */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,9 +30,7 @@
  */
 
 /* 
- * This does not implement COMPAT_SVR4 for MIPS yet. For now we only 
- * have enough definitions to get some svr4_* files needed by COMPAT_IRIX 
- * to build.
+ * This does not implement COMPAT_SVR4 for MIPS. XXX: should be removed.
  */
 
 #ifndef _MIPS_SVR4_MACHDEP_H_

Index: src/sys/arch/mips/mips/svr4_machdep.c
diff -u src/sys/arch/mips/mips/svr4_machdep.c:1.15 src/sys/arch/mips/mips/svr4_machdep.c:1.16
--- src/sys/arch/mips/mips/svr4_machdep.c:1.15	Sun Jul 10 23:21:59 2011
+++ src/sys/arch/mips/mips/svr4_machdep.c	Sun Jul 30 16:13:24 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: svr4_machdep.c,v 1.15 2011/07/10 23:21:59 matt Exp $ */
+/*	$NetBSD: svr4_machdep.c,v 1.16 2017/07/30 16:13:24 maxv Exp $ */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,13 +30,11 @@
  */
 
 /* 
- * This does not implement COMPAT_SVR4 for MIPS yet. For now we only
- * have enough definitions to get some svr4_* files needed by COMPAT_IRIX
- * to build.  
+ * This does not implement COMPAT_SVR4 for MIPS. XXX: should be removed.
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: svr4_machdep.c,v 1.15 2011/07/10 23:21:59 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: svr4_machdep.c,v 1.16 2017/07/30 16:13:24 maxv Exp $");
 
 #include 
 #include 



CVS commit: src/share/man/man7

2017-07-30 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jul 30 16:07:06 UTC 2017

Modified Files:
src/share/man/man7: sysctl.7

Log Message:
Remove lurking reference to TCP_COMPAT_42.


To generate a diff of this commit:
cvs rdiff -u -r1.116 -r1.117 src/share/man/man7/sysctl.7

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

Modified files:

Index: src/share/man/man7/sysctl.7
diff -u src/share/man/man7/sysctl.7:1.116 src/share/man/man7/sysctl.7:1.117
--- src/share/man/man7/sysctl.7:1.116	Tue Jul 11 08:32:17 2017
+++ src/share/man/man7/sysctl.7	Sun Jul 30 16:07:06 2017
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sysctl.7,v 1.116 2017/07/11 08:32:17 wiz Exp $
+.\"	$NetBSD: sysctl.7,v 1.117 2017/07/30 16:07:06 maxv Exp $
 .\"
 .\" Copyright (c) 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"	@(#)sysctl.3	8.4 (Berkeley) 5/9/95
 .\"
-.Dd July 2, 2017
+.Dd July 30, 2017
 .Dt SYSCTL 7
 .Os
 .Sh NAME
@@ -1413,7 +1413,6 @@ The currently defined protocols and name
 .It tcp	mss_ifmtu	integer	yes
 .It tcp	win_scale	integer	yes
 .It tcp	timestamps	integer	yes
-.It tcp	compat_42	integer	yes
 .It tcp	cwm	integer	yes
 .It tcp	cwm_burstsize	integer	yes
 .It tcp	ack_on_push	integer	yes
@@ -1606,10 +1605,6 @@ This can avoid losing a round trip time 
 but has the caveat of potentially defeating TCP's delayed ACK algorithm.
 Use of this option is generally not recommended, but
 the variable exists in case your configuration really needs it.
-.It Li tcp.compat_42
-If set to 1, enables work-arounds for bugs in the 4.2BSD TCP implementation.
-Use of this option is not recommended, although it may be
-required in order to communicate with extremely old TCP implementations.
 .It Li tcp.cwm
 If set to 1, enables use of the Hughes/Touch/Heidemann Congestion Window
 Monitoring algorithm.



CVS commit: src/sys/ufs/ext2fs

2017-07-30 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Jul 30 14:23:54 UTC 2017

Modified Files:
src/sys/ufs/ext2fs: ext2fs_vfsops.c

Log Message:
kmem_xyz(sizeof(struct foo)) --> kmem_xyz(sizeof(*foo))

No change to amd64 binary.


To generate a diff of this commit:
cvs rdiff -u -r1.209 -r1.210 src/sys/ufs/ext2fs/ext2fs_vfsops.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/ext2fs/ext2fs_vfsops.c
diff -u src/sys/ufs/ext2fs/ext2fs_vfsops.c:1.209 src/sys/ufs/ext2fs/ext2fs_vfsops.c:1.210
--- src/sys/ufs/ext2fs/ext2fs_vfsops.c:1.209	Sun May 28 16:38:55 2017
+++ src/sys/ufs/ext2fs/ext2fs_vfsops.c	Sun Jul 30 14:23:54 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ext2fs_vfsops.c,v 1.209 2017/05/28 16:38:55 hannken Exp $	*/
+/*	$NetBSD: ext2fs_vfsops.c,v 1.210 2017/07/30 14:23:54 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1989, 1991, 1993, 1994
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ext2fs_vfsops.c,v 1.209 2017/05/28 16:38:55 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ext2fs_vfsops.c,v 1.210 2017/07/30 14:23:54 riastradh Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -675,7 +675,7 @@ ext2fs_mountfs(struct vnode *devvp, stru
 	if (error)
 		goto out;
 	fs = (struct ext2fs *)bp->b_data;
-	m_fs = kmem_zalloc(sizeof(struct m_ext2fs), KM_SLEEP);
+	m_fs = kmem_zalloc(sizeof(*m_fs), KM_SLEEP);
 	e2fs_sbload(fs, _fs->e2fs);
 
 	brelse(bp, 0);
@@ -684,7 +684,7 @@ ext2fs_mountfs(struct vnode *devvp, stru
 	/* Once swapped, validate and fill in the superblock. */
 	error = ext2fs_sbfill(m_fs, ronly);
 	if (error) {
-		kmem_free(m_fs, sizeof(struct m_ext2fs));
+		kmem_free(m_fs, sizeof(*m_fs));
 		goto out;
 	}
 	m_fs->e2fs_ronly = ronly;
@@ -755,7 +755,7 @@ out:
 	if (bp != NULL)
 		brelse(bp, 0);
 	if (ump) {
-		kmem_free(ump->um_e2fs, sizeof(struct m_ext2fs));
+		kmem_free(ump->um_e2fs, sizeof(*m_fs));
 		kmem_free(ump, sizeof(*ump));
 		mp->mnt_data = NULL;
 	}



CVS commit: src/sys/external/bsd/drm2/dist/drm/ttm

2017-07-30 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Jul 30 13:43:49 UTC 2017

Modified Files:
src/sys/external/bsd/drm2/dist/drm/ttm: ttm_tt.c

Log Message:
Fix error branch in ttm_dma_tt_init to avoid double-free.

Should fix symptom of PR kern/52438, but who knows what underlying
problem causes us to reach the error branch in the first place.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/external/bsd/drm2/dist/drm/ttm/ttm_tt.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/drm2/dist/drm/ttm/ttm_tt.c
diff -u src/sys/external/bsd/drm2/dist/drm/ttm/ttm_tt.c:1.9 src/sys/external/bsd/drm2/dist/drm/ttm/ttm_tt.c:1.10
--- src/sys/external/bsd/drm2/dist/drm/ttm/ttm_tt.c:1.9	Thu Mar  9 08:27:18 2017
+++ src/sys/external/bsd/drm2/dist/drm/ttm/ttm_tt.c	Sun Jul 30 13:43:48 2017
@@ -284,7 +284,8 @@ fail2: __unused
 fail1:	kmem_free(ttm_dma->dma_segs, (ttm->num_pages *
 		sizeof(ttm_dma->dma_segs[0])));
 fail0:	KASSERT(error);
-	ttm_tt_destroy(ttm);
+	drm_free_large(ttm->pages);
+	uao_detach(ttm->swap_storage);
 	/* XXX errno NetBSD->Linux */
 	return -error;
 }



CVS commit: src/sys/arch

2017-07-30 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sun Jul 30 13:12:49 UTC 2017

Modified Files:
src/sys/arch/amiga/conf: DRACO GENERIC GENERIC.in
src/sys/arch/sparc/conf: GENERIC KRUPS MRCOFFEE TADPOLE3GX
src/sys/arch/sparc64/conf: GENERIC NONPLUS64

Log Message:
Disable svr4 and svr4_32 on sparc, sparc64 and amiga - the only places
where they were still enabled.


To generate a diff of this commit:
cvs rdiff -u -r1.181 -r1.182 src/sys/arch/amiga/conf/DRACO
cvs rdiff -u -r1.315 -r1.316 src/sys/arch/amiga/conf/GENERIC
cvs rdiff -u -r1.133 -r1.134 src/sys/arch/amiga/conf/GENERIC.in
cvs rdiff -u -r1.253 -r1.254 src/sys/arch/sparc/conf/GENERIC
cvs rdiff -u -r1.72 -r1.73 src/sys/arch/sparc/conf/KRUPS
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/sparc/conf/MRCOFFEE
cvs rdiff -u -r1.71 -r1.72 src/sys/arch/sparc/conf/TADPOLE3GX
cvs rdiff -u -r1.199 -r1.200 src/sys/arch/sparc64/conf/GENERIC
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/sparc64/conf/NONPLUS64

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

Modified files:

Index: src/sys/arch/amiga/conf/DRACO
diff -u src/sys/arch/amiga/conf/DRACO:1.181 src/sys/arch/amiga/conf/DRACO:1.182
--- src/sys/arch/amiga/conf/DRACO:1.181	Fri Jul 28 19:26:15 2017
+++ src/sys/arch/amiga/conf/DRACO	Sun Jul 30 13:12:49 2017
@@ -1,4 +1,4 @@
-# $NetBSD: DRACO,v 1.181 2017/07/28 19:26:15 maxv Exp $
+# $NetBSD: DRACO,v 1.182 2017/07/30 13:12:49 maxv Exp $
 #
 # This file was automatically created.
 # Changes will be lost when make is run in this directory.
@@ -29,7 +29,7 @@ include "arch/amiga/conf/std.amiga"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.181 $"
+#ident 		"GENERIC-$Revision: 1.182 $"
 
 makeoptions	COPTS="-O2 -fno-reorder-blocks"	# see share/mk/sys.mk
 
@@ -140,7 +140,7 @@ options 	COMPAT_50	# NetBSD 5.0,
 options 	COMPAT_60	# NetBSD 6.0, and
 options 	COMPAT_70	# NetBSD 7.0 binary compatibility.
 options 	COMPAT_SUNOS	# Support to run Sun (m68k) executables
-options 	COMPAT_SVR4	# Support to run SVR4 (m68k) executables
+#options 	COMPAT_SVR4	# Support to run SVR4 (m68k) executables
 options 	COMPAT_NOMID	# allow nonvalid machine id executables
 #options 	COMPAT_LINUX	# Support to run Linux/m68k executables
 

Index: src/sys/arch/amiga/conf/GENERIC
diff -u src/sys/arch/amiga/conf/GENERIC:1.315 src/sys/arch/amiga/conf/GENERIC:1.316
--- src/sys/arch/amiga/conf/GENERIC:1.315	Fri Jul 28 19:26:15 2017
+++ src/sys/arch/amiga/conf/GENERIC	Sun Jul 30 13:12:49 2017
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.315 2017/07/28 19:26:15 maxv Exp $
+# $NetBSD: GENERIC,v 1.316 2017/07/30 13:12:49 maxv Exp $
 #
 # This file was automatically created.
 # Changes will be lost when make is run in this directory.
@@ -29,7 +29,7 @@ include "arch/amiga/conf/std.amiga"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.315 $"
+#ident 		"GENERIC-$Revision: 1.316 $"
 
 makeoptions	COPTS="-O2 -fno-reorder-blocks"	# see share/mk/sys.mk
 
@@ -153,7 +153,7 @@ options 	COMPAT_50	# NetBSD 5.0,
 options 	COMPAT_60	# NetBSD 6.0, and
 options 	COMPAT_70	# NetBSD 7.0 binary compatibility.
 options 	COMPAT_SUNOS	# Support to run Sun (m68k) executables
-options 	COMPAT_SVR4	# Support to run SVR4 (m68k) executables
+#options 	COMPAT_SVR4	# Support to run SVR4 (m68k) executables
 options 	COMPAT_NOMID	# allow nonvalid machine id executables
 #options 	COMPAT_LINUX	# Support to run Linux/m68k executables
 

Index: src/sys/arch/amiga/conf/GENERIC.in
diff -u src/sys/arch/amiga/conf/GENERIC.in:1.133 src/sys/arch/amiga/conf/GENERIC.in:1.134
--- src/sys/arch/amiga/conf/GENERIC.in:1.133	Fri Jul 28 19:26:15 2017
+++ src/sys/arch/amiga/conf/GENERIC.in	Sun Jul 30 13:12:49 2017
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC.in,v 1.133 2017/07/28 19:26:15 maxv Exp $
+# $NetBSD: GENERIC.in,v 1.134 2017/07/30 13:12:49 maxv Exp $
 #
 ##
 # GENERIC machine description file
@@ -52,7 +52,7 @@ include "arch/amiga/conf/std.amiga"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.133 $"
+#ident 		"GENERIC-$Revision: 1.134 $"
 
 m4_ifdef(`INSTALL_CONFIGURATION', `m4_dnl
 makeoptions	COPTS="-Os"
@@ -195,7 +195,7 @@ options 	COMPAT_50	# NetBSD 5.0,
 options 	COMPAT_60	# NetBSD 6.0, and
 options 	COMPAT_70	# NetBSD 7.0 binary compatibility.
 options 	COMPAT_SUNOS	# Support to run Sun (m68k) executables
-options 	COMPAT_SVR4	# Support to run SVR4 (m68k) executables
+#options 	COMPAT_SVR4	# Support to run SVR4 (m68k) executables
 options 	COMPAT_NOMID	# allow nonvalid machine id executables
 #options 	COMPAT_LINUX	# Support to run Linux/m68k executables
 ')m4_dnl

Index: src/sys/arch/sparc/conf/GENERIC
diff -u src/sys/arch/sparc/conf/GENERIC:1.253 src/sys/arch/sparc/conf/GENERIC:1.254
--- src/sys/arch/sparc/conf/GENERIC:1.253	Sat Dec 10 09:44:06 2016
+++ src/sys/arch/sparc/conf/GENERIC	Sun Jul 30 13:12:49 

CVS commit: src/sys/compat/svr4_32

2017-07-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jul 30 12:31:47 UTC 2017

Modified Files:
src/sys/compat/svr4_32: svr4_32_signal.c

Log Message:
make it compile again.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/compat/svr4_32/svr4_32_signal.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_32/svr4_32_signal.c
diff -u src/sys/compat/svr4_32/svr4_32_signal.c:1.29 src/sys/compat/svr4_32/svr4_32_signal.c:1.30
--- src/sys/compat/svr4_32/svr4_32_signal.c:1.29	Fri Jul 28 13:38:36 2017
+++ src/sys/compat/svr4_32/svr4_32_signal.c	Sun Jul 30 08:31:46 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: svr4_32_signal.c,v 1.29 2017/07/28 17:38:36 riastradh Exp $	 */
+/*	$NetBSD: svr4_32_signal.c,v 1.30 2017/07/30 12:31:46 christos Exp $	 */
 
 /*-
  * Copyright (c) 1994, 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: svr4_32_signal.c,v 1.29 2017/07/28 17:38:36 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: svr4_32_signal.c,v 1.30 2017/07/30 12:31:46 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_svr4.h"
@@ -397,16 +397,16 @@ svr4_32_sys_signal(struct lwp *l, const 
 		nbsa.sa_handler = (sig_t)SCARG(uap, handler);
 		sigemptyset(_mask);
 		nbsa.sa_flags = 0;
-		error = sigaction1(l, signum, , , NULL, 0);
+		error = sigaction1(l, native_signo, , , NULL, 0);
 		if (error)
-			return (error);
+			return error;
 		*retval = (u_int)(u_long)obsa.sa_handler;
-		return (0);
+		return 0;
 
 	case SVR4_SIGHOLD_MASK:
 	sighold:
 		sigemptyset();
-		sigaddset(, signum);
+		sigaddset(, native_signo);
 		mutex_enter(p->p_lock);
 		error = sigprocmask1(l, SIG_BLOCK, , 0);
 		mutex_exit(p->p_lock);
@@ -414,7 +414,7 @@ svr4_32_sys_signal(struct lwp *l, const 
 
 	case SVR4_SIGRELSE_MASK:
 		sigemptyset();
-		sigaddset(, signum);
+		sigaddset(, native_signo);
 		mutex_enter(p->p_lock);
 		error = sigprocmask1(l, SIG_UNBLOCK, , 0);
 		mutex_exit(p->p_lock);
@@ -424,17 +424,17 @@ svr4_32_sys_signal(struct lwp *l, const 
 		nbsa.sa_handler = SIG_IGN;
 		sigemptyset(_mask);
 		nbsa.sa_flags = 0;
-		return (sigaction1(l, signum, , 0, NULL, 0));
+		return sigaction1(l, native_signo, , 0, NULL, 0);
 
 	case SVR4_SIGPAUSE_MASK:
 		mutex_enter(p->p_lock);
 		ss = l->l_sigmask;
 		mutex_exit(p->p_lock);
-		sigdelset(, signum);
-		return (sigsuspend1(l, ));
+		sigdelset(, native_signo);
+		return sigsuspend1(l, );
 
 	default:
-		return (ENOSYS);
+		return ENOSYS;
 	}
 }
 



CVS commit: src/sys/arch/emips/emips

2017-07-30 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Sun Jul 30 11:38:57 UTC 2017

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

Log Message:
Initialize iospace_size instead of iospace (will be overwritten) to 64k.
Brings boot of emips on giano a bit closer, but now it's stuck (hangs).


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/emips/emips/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/emips/emips/machdep.c
diff -u src/sys/arch/emips/emips/machdep.c:1.12 src/sys/arch/emips/emips/machdep.c:1.13
--- src/sys/arch/emips/emips/machdep.c:1.12	Thu Dec 22 14:47:54 2016
+++ src/sys/arch/emips/emips/machdep.c	Sun Jul 30 11:38:57 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.12 2016/12/22 14:47:54 cherry Exp $	*/
+/*	$NetBSD: machdep.c,v 1.13 2017/07/30 11:38:57 he Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.12 2016/12/22 14:47:54 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.13 2017/07/30 11:38:57 he Exp $");
 
 #include "opt_ddb.h"
 
@@ -82,8 +82,8 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 
 #include 
 #endif
 
-vaddr_t iospace = 64 * 1024; /* BUGBUG make it an option? */
-vsize_t iospace_size;
+vaddr_t iospace;
+vsize_t iospace_size = 64 * 1024; /* BUGBUG make it an option? */
 
 #include "ksyms.h"