CVS commit: src/sys/netbt

2015-11-28 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Sat Nov 28 08:57:33 UTC 2015

Modified Files:
src/sys/netbt: l2cap_signal.c

Log Message:
note recent spec additions to L2CAP Info command regarding fixed channels


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/netbt/l2cap_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/netbt/l2cap_signal.c
diff -u src/sys/netbt/l2cap_signal.c:1.16 src/sys/netbt/l2cap_signal.c:1.17
--- src/sys/netbt/l2cap_signal.c:1.16	Sat Feb  9 01:19:05 2013
+++ src/sys/netbt/l2cap_signal.c	Sat Nov 28 08:57:33 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: l2cap_signal.c,v 1.16 2013/02/09 01:19:05 christos Exp $	*/
+/*	$NetBSD: l2cap_signal.c,v 1.17 2015/11/28 08:57:33 plunky Exp $	*/
 
 /*-
  * Copyright (c) 2005 Iain Hibbert.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: l2cap_signal.c,v 1.16 2013/02/09 01:19:05 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: l2cap_signal.c,v 1.17 2015/11/28 08:57:33 plunky Exp $");
 
 #include 
 #include 
@@ -974,6 +974,8 @@ l2cap_recv_info_req(struct mbuf *m, stru
 		 *   0   1   0x0001 L2CAP Signalling Channel (SET)
 		 *   0   2   0x0002 Connectionless Reception
 		 *   0   3   0x0003 AMP Manager Protocol Channel
+		 *   0   7   0x0007 BR/EDR Security Manager
+		 *   7   7   0x003f AMP Test Manager
 		 */
 		le16enc(rsp + 0, cp.type);
 		le16enc(rsp + 2, L2CAP_SUCCESS);



CVS commit: src/external/bsd/nvi

2015-11-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Nov 28 13:20:03 UTC 2015

Modified Files:
src/external/bsd/nvi: Makefile.inc
src/external/bsd/nvi/dist/common: vi_db1.c
src/external/bsd/nvi/dist/ex: ex_script.c
src/external/bsd/nvi/usr.bin/nvi: Makefile

Log Message:
PR/50484: Rin Okuyama: fix the script command of vi(1)


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/nvi/Makefile.inc
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/nvi/dist/common/vi_db1.c
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/nvi/dist/ex/ex_script.c
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/nvi/usr.bin/nvi/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/nvi/Makefile.inc
diff -u src/external/bsd/nvi/Makefile.inc:1.2 src/external/bsd/nvi/Makefile.inc:1.3
--- src/external/bsd/nvi/Makefile.inc:1.2	Wed Nov 25 15:25:20 2015
+++ src/external/bsd/nvi/Makefile.inc	Sat Nov 28 08:20:02 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.2 2015/11/25 20:25:20 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.3 2015/11/28 13:20:02 christos Exp $
 
 .include 
 
@@ -7,4 +7,4 @@ DIST= ${NETBSDSRCDIR}/external/bsd/nvi/d
 BINDIR=/usr/bin
 
 CWARNFLAGS.clang+=	-Wno-error=unused-const-variable
-VERSION=1.81.6-2013-11-20nb1
+VERSION=1.81.6-2013-11-20nb2

Index: src/external/bsd/nvi/dist/common/vi_db1.c
diff -u src/external/bsd/nvi/dist/common/vi_db1.c:1.7 src/external/bsd/nvi/dist/common/vi_db1.c:1.8
--- src/external/bsd/nvi/dist/common/vi_db1.c:1.7	Sun Jan 26 16:43:45 2014
+++ src/external/bsd/nvi/dist/common/vi_db1.c	Sat Nov 28 08:20:03 2015
@@ -15,7 +15,7 @@
 static const char sccsid[] = "Id: db1.c,v 10.1 2002/03/09 12:53:57 skimo Exp  (Berkeley) Date: 2002/03/09 12:53:57 ";
 #endif /* not lint */
 #else
-__RCSID("$NetBSD: vi_db1.c,v 1.7 2014/01/26 21:43:45 christos Exp $");
+__RCSID("$NetBSD: vi_db1.c,v 1.8 2015/11/28 13:20:03 christos Exp $");
 #endif
 
 #include 
@@ -421,10 +421,10 @@ db_insert(SCR *sp, db_recno_t lno, CHAR_
  * db_set --
  *	Store a line in the file.
  *
- * PUBLIC: int db_set __P((SCR *, db_recno_t, CHAR_T *, size_t));
+ * PUBLIC: int db_set __P((SCR *, db_recno_t, const CHAR_T *, size_t));
  */
 int
-db_set(SCR *sp, db_recno_t lno, CHAR_T *p, size_t len)
+db_set(SCR *sp, db_recno_t lno, const CHAR_T *p, size_t len)
 {
 	DBT data, key;
 	EXF *ep;

Index: src/external/bsd/nvi/dist/ex/ex_script.c
diff -u src/external/bsd/nvi/dist/ex/ex_script.c:1.4 src/external/bsd/nvi/dist/ex/ex_script.c:1.5
--- src/external/bsd/nvi/dist/ex/ex_script.c:1.4	Sun Jan 26 16:43:45 2014
+++ src/external/bsd/nvi/dist/ex/ex_script.c	Sat Nov 28 08:20:03 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ex_script.c,v 1.4 2014/01/26 21:43:45 christos Exp $ */
+/*	$NetBSD: ex_script.c,v 1.5 2015/11/28 13:20:03 christos Exp $ */
 /*-
  * Copyright (c) 1992, 1993, 1994
  *	The Regents of the University of California.  All rights reserved.
@@ -19,7 +19,7 @@
 static const char sccsid[] = "Id: ex_script.c,v 10.38 2001/06/25 15:19:19 skimo Exp  (Berkeley) Date: 2001/06/25 15:19:19 ";
 #endif /* not lint */
 #else
-__RCSID("$NetBSD: ex_script.c,v 1.4 2014/01/26 21:43:45 christos Exp $");
+__RCSID("$NetBSD: ex_script.c,v 1.5 2015/11/28 13:20:03 christos Exp $");
 #endif
 
 #include 
@@ -29,7 +29,7 @@ __RCSID("$NetBSD: ex_script.c,v 1.4 2014
 #include 
 #endif
 #include 
-#if defined(HAVE_SYS5_PTY) && !defined(__NetBSD__)
+#if defined(HAVE_SYS5_PTY)
 #include 
 #endif
 #include 
@@ -45,6 +45,9 @@ __RCSID("$NetBSD: ex_script.c,v 1.4 2014
 #include 
 #include 
 #include 
+#ifdef __NetBSD__
+#include 
+#endif
 
 #include "../common/common.h"
 #include "../vi/vi.h"
@@ -55,9 +58,12 @@ static void	sscr_check __P((SCR *));
 static int	sscr_getprompt __P((SCR *));
 static int	sscr_init __P((SCR *));
 static int	sscr_insert __P((SCR *));
-static int	sscr_matchprompt __P((SCR *, CHAR_T *, size_t, size_t *));
+#ifdef __NetBSD__
+#define	sscr_pty openpty
+#else
 static int	sscr_pty __P((int *, int *, char *, struct termios *, void *));
-static int	sscr_setprompt __P((SCR *, CHAR_T *, size_t));
+#endif
+static int	sscr_setprompt __P((SCR *, char *, size_t));
 
 /*
  * ex_script -- : sc[ript][!] [file]
@@ -75,6 +81,17 @@ ex_script(SCR *sp, EXCMD *cmdp)
 		return (1);
 	}
 
+	/* Avoid double run. */
+	if (F_ISSET(sp, SC_SCRIPT)) {
+		msgq(sp, M_ERR,
+		"The script command is already runninng");
+		return (1);
+	}
+
+	/* We're going to need a shell. */
+	if (opts_empty(sp, O_SHELL, 0))
+		return (1);
+
 	/* Switch to the new file. */
 	if (cmdp->argc != 0 && ex_edit(sp, cmdp))
 		return (1);
@@ -96,10 +113,6 @@ sscr_init(SCR *sp)
 	SCRIPT *sc;
 	const char *sh, *sh_path;
 
-	/* We're going to need a shell. */
-	if (opts_empty(sp, O_SHELL, 0))
-		return (1);
-
 	MALLOC_RET(sp, sc, SCRIPT *, sizeof(SCRIPT));
 	sp->script = sc;
 	sc->sh_prompt = NULL;
@@ -209,89 +222,28 @@ static int
 sscr_getprompt(SCR *sp)
 {
 	struct 

CVS commit: src/sys/netbt

2015-11-28 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Sat Nov 28 09:04:34 UTC 2015

Modified Files:
src/sys/netbt: hci.h hci_event.c hci_ioctl.c

Log Message:
add version and extended feature flags defined in 4.2 specification,
add cache for page 2 of extended features and return this in
the SIOCGBTFEAT ioctl (no change in size)


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/netbt/hci.h
cvs rdiff -u -r1.23 -r1.24 src/sys/netbt/hci_event.c
cvs rdiff -u -r1.12 -r1.13 src/sys/netbt/hci_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/netbt/hci.h
diff -u src/sys/netbt/hci.h:1.40 src/sys/netbt/hci.h:1.41
--- src/sys/netbt/hci.h:1.40	Sun Sep  6 06:01:01 2015
+++ src/sys/netbt/hci.h	Sat Nov 28 09:04:34 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: hci.h,v 1.40 2015/09/06 06:01:01 dholland Exp $	*/
+/*	$NetBSD: hci.h,v 1.41 2015/11/28 09:04:34 plunky Exp $	*/
 
 /*-
  * Copyright (c) 2005 Iain Hibbert.
@@ -54,14 +54,15 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $Id: hci.h,v 1.40 2015/09/06 06:01:01 dholland Exp $
+ * $Id: hci.h,v 1.41 2015/11/28 09:04:34 plunky Exp $
  * $FreeBSD: src/sys/netgraph/bluetooth/include/ng_hci.h,v 1.6 2005/01/07 01:45:43 imp Exp $
  */
 
 /*
  * This file contains everything that applications need to know from
  * Host Controller Interface (HCI). Information taken from Bluetooth
- * Core Specifications (v1.1, v2.0 and v2.1)
+ * Core Specifications (v1.1, v2.0, v2.1 + EDR, v3.0 + HS,
+ * v4.0 and v4.2)
  *
  * This file can be included by both kernel and userland applications.
  *
@@ -101,7 +102,10 @@
 #define HCI_SPEC_V20			0x03 /* v2.0 + EDR */
 #define HCI_SPEC_V21			0x04 /* v2.1 + EDR */
 #define HCI_SPEC_V30			0x05 /* v3.0 + HS */
-/* 0x06 - 0xFF - reserved for future use */
+#define HCI_SPEC_V40			0x06 /* v4.0 */
+#define HCI_SPEC_V41			0x07 /* v4.1 */
+#define HCI_SPEC_V42			0x08 /* v4.2 */
+/* 0x09 - 0xFF - reserved for future use */
 
 /* LMP features (and page 0 of extended features) */
 /* --- byte 0 */
@@ -146,8 +150,8 @@
 /* reserved0x04 */
 #define HCI_LMP_AFH_CAPABLE_SLAVE	0x08
 #define HCI_LMP_AFH_CLASS_SLAVE		0x10
-/* reserved0x20 */
-/* reserved0x40 */
+#define HCI_LMP_BR_EDR_UNSUPPORTED	0x20
+#define HCI_LMP_LE_CONTROLLER		0x40
 #define HCI_LMP_3SLOT_EDR_ACL		0x80
 /* --- byte 5 */
 #define HCI_LMP_5SLOT_EDR_ACL		0x01
@@ -160,7 +164,7 @@
 #define HCI_LMP_3SLOT_EDR_eSCO		0x80
 /* --- byte 6 */
 #define HCI_LMP_EXTENDED_INQUIRY	0x01
-/* reserved0x02 */
+#define HCI_LMP_LE_BR_EDR_CONTROLLER	0x02
 /* reserved0x04 */
 #define HCI_LMP_SIMPLE_PAIRING		0x08
 #define HCI_LMP_ENCAPSULATED_PDU	0x10
@@ -176,6 +180,25 @@
 /* page 1 of extended features */
 /* --- byte 0 */
 #define HCI_LMP_SSP			0x01
+#define HCI_LMP_LE_HOST			0x02
+#define HCI_LMP_LE_BR_EDR_HOST		0x04
+#define HCI_LMP_SECURE_CONN_HOST	0x08
+
+/* page 2 of extended features */
+/* --- byte 0 */
+#define HCI_LMP_CONNLESS_MASTER		0x01
+#define HCI_LMP_CONNLESS_SLAVE		0x02
+#define HCI_LMP_SYNC_TRAIN		0x04
+#define HCI_LMP_SYNC_SCAN		0x08
+#define HCI_LMP_INQ_RSP_NOTIFY		0x10
+#define HCI_LMP_INTERLACE_SCAN		0x20
+#define HCI_LMP_COARSE_CLOCK		0x40
+/* reserved0x80 */
+/* --- byte 0 */
+#define HCI_LMP_SECURE_CONN_CONTROLLER	0x01
+#define HCI_LMP_PING			0x02
+/* reserved0x04 */
+#define HCI_LMP_TRAIN_NUDGING		0x08
 
 /* Link types */
 #define HCI_LINK_SCO			0x00 /* Voice */
@@ -2334,6 +2357,7 @@ struct btreq {
 	struct {
 		uint8_t btrf_page0[HCI_FEATURES_SIZE];	/* basic */
 		uint8_t btrf_page1[HCI_FEATURES_SIZE];	/* extended */
+		uint8_t btrf_page2[HCI_FEATURES_SIZE];	/* extended */
 	} btrf;
 	struct bt_stats btrs;   /* unit stats */
 	} btru;
@@ -2352,6 +2376,7 @@ struct btreq {
 #define btr_max_sco	btru.btri.btri_max_sco
 #define btr_features0	btru.btrf.btrf_page0
 #define btr_features1	btru.btrf.btrf_page1
+#define btr_features2	btru.btrf.btrf_page2
 #define btr_stats	btru.btrs
 
 /* hci_unit & btr_flags */
@@ -2496,7 +2521,8 @@ struct hci_unit {
 	uint16_t	 hci_lmp_mask;		/* link policy capabilities */
 
 	uint8_t		 hci_feat0[HCI_FEATURES_SIZE]; /* features mask */
-	uint8_t		 hci_feat1[HCI_FEATURES_SIZE]; /* extended */
+	uint8_t		 hci_feat1[HCI_FEATURES_SIZE]; /* extended page 1 */
+	uint8_t		 hci_feat2[HCI_FEATURES_SIZE]; /* extended page 2 */
 	uint8_t		 hci_cmds[HCI_COMMANDS_SIZE]; /* opcode bitmask */
 
 	/* flow control */

Index: src/sys/netbt/hci_event.c
diff -u src/sys/netbt/hci_event.c:1.23 src/sys/netbt/hci_event.c:1.24
--- src/sys/netbt/hci_event.c:1.23	Wed Jul 27 10:25:09 2011
+++ src/sys/netbt/hci_event.c	Sat Nov 28 09:04:34 2015
@@ -1,4 +1,4 @@
-/*	

CVS commit: src/sys/dev/dkwedge

2015-11-28 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Nov 28 13:41:31 UTC 2015

Modified Files:
src/sys/dev/dkwedge: dk.c

Log Message:
sc_size is already measured in sectors.


To generate a diff of this commit:
cvs rdiff -u -r1.85 -r1.86 src/sys/dev/dkwedge/dk.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/dkwedge/dk.c
diff -u src/sys/dev/dkwedge/dk.c:1.85 src/sys/dev/dkwedge/dk.c:1.86
--- src/sys/dev/dkwedge/dk.c:1.85	Sat Oct 10 23:39:43 2015
+++ src/sys/dev/dkwedge/dk.c	Sat Nov 28 13:41:31 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: dk.c,v 1.85 2015/10/10 23:39:43 christos Exp $	*/
+/*	$NetBSD: dk.c,v 1.86 2015/11/28 13:41:31 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 2004, 2005, 2006, 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dk.c,v 1.85 2015/10/10 23:39:43 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dk.c,v 1.86 2015/11/28 13:41:31 mlelstv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_dkwedge.h"
@@ -267,7 +267,7 @@ dk_set_geometry(struct dkwedge_softc *sc
 
 	memset(dg, 0, sizeof(*dg));
 
-	dg->dg_secperunit = sc->sc_size >> pdk->dk_blkshift;
+	dg->dg_secperunit = sc->sc_size;
 	dg->dg_secsize = DEV_BSIZE << pdk->dk_blkshift;
 
 	/* fake numbers, 1 cylinder is 1 MB with default sector size */



CVS commit: src/usr.sbin/btconfig

2015-11-28 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Sat Nov 28 09:25:45 UTC 2015

Modified Files:
src/usr.sbin/btconfig: btconfig.c

Log Message:
add details of later (to v4.2) specification versions and
extended feature flags,


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/usr.sbin/btconfig/btconfig.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.sbin/btconfig/btconfig.c
diff -u src/usr.sbin/btconfig/btconfig.c:1.26 src/usr.sbin/btconfig/btconfig.c:1.27
--- src/usr.sbin/btconfig/btconfig.c:1.26	Mon Oct 17 16:37:50 2011
+++ src/usr.sbin/btconfig/btconfig.c	Sat Nov 28 09:25:45 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: btconfig.c,v 1.26 2011/10/17 16:37:50 mbalmer Exp $ */
+/* $NetBSD: btconfig.c,v 1.27 2015/11/28 09:25:45 plunky Exp $ */
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -33,7 +33,7 @@
 
 #include 
 __COPYRIGHT("@(#) Copyright (c) 2006 Itronix, Inc.  All rights reserved.");
-__RCSID("$NetBSD: btconfig.c,v 1.26 2011/10/17 16:37:50 mbalmer Exp $");
+__RCSID("$NetBSD: btconfig.c,v 1.27 2015/11/28 09:25:45 plunky Exp $");
 
 #include 
 #include 
@@ -64,6 +64,7 @@ static void print_voice(int);
 static void tag(const char *);
 static void print_features0(uint8_t *);
 static void print_features1(uint8_t *);
+static void print_features2(uint8_t *);
 static void print_result(int, struct bt_devinquiry *);
 static void do_inquiry(void);
 
@@ -659,7 +660,10 @@ print_info(int level)
 	case HCI_SPEC_V20:	printf("2.0 + EDR\n");	break;
 	case HCI_SPEC_V21:	printf("2.1 + EDR\n");	break;
 	case HCI_SPEC_V30:	printf("3.0 + HS\n");	break;
-	default:		printf("unknown\n");	break;
+	case HCI_SPEC_V40:	printf("4.0\n");	break;
+	case HCI_SPEC_V41:	printf("4.1\n");	break;
+	case HCI_SPEC_V42:	printf("4.2\n");	break;
+	default:		printf("[%d]\n", version);	break;
 	}
 
 	load_value(HCI_CMD_READ_UNIT_CLASS, buf, HCI_CLASS_SIZE);
@@ -741,6 +745,7 @@ print_info(int level)
 	width = printf("\tfeatures:");
 	print_features0(btr.btr_features0);
 	print_features1(btr.btr_features1);
+	print_features2(btr.btr_features2);
 	tag(NULL);
 }
 
@@ -802,9 +807,9 @@ print_features0(uint8_t *f)
 	if (*f & HCI_LMP_PAGISCHEME)	tag("");
 	if (*f & HCI_LMP_POWER_CONTROL)	tag("");
 	if (*f & HCI_LMP_TRANSPARENT_SCO)   tag("");
-	if (*f & HCI_LMP_FLOW_CONTROL_LAG0) tag("");
-	if (*f & HCI_LMP_FLOW_CONTROL_LAG1) tag("");
-	if (*f & HCI_LMP_FLOW_CONTROL_LAG2) tag("");
+	if (*f & HCI_LMP_FLOW_CONTROL_LAG0) tag("");
+	if (*f & HCI_LMP_FLOW_CONTROL_LAG1) tag("");
+	if (*f & HCI_LMP_FLOW_CONTROL_LAG2) tag("");
 	if (*f & HCI_LMP_BC_ENCRYPTION)	tag("");
 	f++;
 
@@ -823,6 +828,8 @@ print_features0(uint8_t *f)
 	if (*f & HCI_LMP_EV5_PKT)	tag("");
 	if (*f & HCI_LMP_AFH_CAPABLE_SLAVE) tag("");
 	if (*f & HCI_LMP_AFH_CLASS_SLAVE)   tag("");
+	if (*f & HCI_LMP_BR_EDR_UNSUPPORTED)tag("");
+	if (*f & HCI_LMP_LE_CONTROLLER) tag("");
 	if (*f & HCI_LMP_3SLOT_EDR_ACL)	tag("<3 slot EDR ACL>");
 	f++;
 
@@ -839,6 +846,7 @@ print_features0(uint8_t *f)
 
 	/* --- byte 6 */
 	if (*f & HCI_LMP_EXTENDED_INQUIRY)  tag("");
+	if (*f & HCI_LMP_LE_BR_EDR_CONTROLLER)tag("");
 	if (*f & HCI_LMP_SIMPLE_PAIRING)tag("");
 	if (*f & HCI_LMP_ENCAPSULATED_PDU)  tag("");
 	if (*f & HCI_LMP_ERRDATA_REPORTING) tag("");
@@ -857,7 +865,28 @@ print_features1(uint8_t *f)
 {
 
 	/* --- byte 0 */
-	if (*f & HCI_LMP_SSP)		tag("");
+	if (*f & HCI_LMP_SSP)		tag("");
+	if (*f & HCI_LMP_LE_HOST)	tag("");
+	if (*f & HCI_LMP_LE_BR_EDR_HOST)tag("");
+	if (*f & HCI_LMP_SECURE_CONN_HOST)  tag("");
+}
+
+static void
+print_features2(uint8_t *f)
+{
+	/* --- byte 0 */
+	if (*f & HCI_LMP_CONNLESS_MASTER)   tag("");
+	if (*f & HCI_LMP_CONNLESS_SLAVE)tag("");
+	if (*f & HCI_LMP_SYNC_TRAIN)	tag("");
+	if (*f & HCI_LMP_SYNC_SCAN)	tag("");
+	if (*f & HCI_LMP_INQ_RSP_NOTIFY)tag("");
+	if (*f & HCI_LMP_INTERLACE_SCAN)tag("");
+	if (*f & HCI_LMP_COARSE_CLOCK)	tag("");
+
+	/* --- byte 1 */
+	if (*f & HCI_LMP_SECURE_CONN_CONTROLLER)tag("");
+	if (*f & HCI_LMP_PING)		tag("");
+	if (*f & HCI_LMP_TRAIN_NUDGING)	tag("");
 }
 
 static void



CVS commit: src/sys/dev

2015-11-28 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Nov 28 14:37:50 UTC 2015

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

Log Message:
bounds check requires consistent units, i.e. DEV_BSIZE.


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/sys/dev/dksubr.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/dksubr.c
diff -u src/sys/dev/dksubr.c:1.81 src/sys/dev/dksubr.c:1.82
--- src/sys/dev/dksubr.c:1.81	Fri Oct 23 01:34:22 2015
+++ src/sys/dev/dksubr.c	Sat Nov 28 14:37:49 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: dksubr.c,v 1.81 2015/10/23 01:34:22 christos Exp $ */
+/* $NetBSD: dksubr.c,v 1.82 2015/11/28 14:37:49 mlelstv Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 1999, 2002, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dksubr.c,v 1.81 2015/10/23 01:34:22 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dksubr.c,v 1.82 2015/11/28 14:37:49 mlelstv Exp $");
 
 #include 
 #include 
@@ -246,7 +246,8 @@ dk_translate(struct dk_softc *dksc, stru
 
 	wlabel = dksc->sc_flags & (DKF_WLABEL|DKF_LABELLING);
 	if (part == RAW_PART) {
-		if (bounds_check_with_mediasize(bp, DEV_BSIZE, numsecs) <= 0)
+		uint64_t numblocks = btodb(numsecs * secsize);
+		if (bounds_check_with_mediasize(bp, DEV_BSIZE, numblocks) <= 0)
 			goto done;
 	} else {
 		if (bounds_check_with_label(>sc_dkdev, bp, wlabel) <= 0)



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

2015-11-28 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Nov 28 18:08:40 UTC 2015

Modified Files:
src/sys/arch/i386/conf: kern.ldscript

Log Message:
KNF


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

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

Modified files:

Index: src/sys/arch/i386/conf/kern.ldscript
diff -u src/sys/arch/i386/conf/kern.ldscript:1.15 src/sys/arch/i386/conf/kern.ldscript:1.16
--- src/sys/arch/i386/conf/kern.ldscript:1.15	Tue Aug 25 12:56:58 2015
+++ src/sys/arch/i386/conf/kern.ldscript	Sat Nov 28 18:08:40 2015
@@ -1,68 +1,72 @@
-/*	$NetBSD: kern.ldscript,v 1.15 2015/08/25 12:56:58 uebayasi Exp $	*/
+/*	$NetBSD: kern.ldscript,v 1.16 2015/11/28 18:08:40 maxv Exp $	*/
 
 #include "assym.h"
 
 ENTRY(_start)
 SECTIONS
 {
-  /* Read-only sections, merged into text segment: */
-  .text :
-  {
-*(.text)
-*(.text.*)
-*(.stub)
-  }
-  _etext = . ;
-  PROVIDE (etext = .) ;
-
-  .rodata :
-  {
-*(.rodata)
-*(.rodata.*)
-  }
-
-  /* Adjust the address for the data segment.  We want to adjust up to
- the same address within the page on the next page up.  */
-  . = ALIGN(0x1000) + (. & (0x1000 - 1));
-  __data_start = . ;
-  .data :
-  {
-*(.data)
-  }
-  . = ALIGN(COHERENCY_UNIT);
-  .data.cacheline_aligned :
-  {
-*(.data.cacheline_aligned)
-  }
-  . = ALIGN(COHERENCY_UNIT);
-  .data.read_mostly :
-  {
-*(.data.read_mostly)
-  }
-  . = ALIGN(COHERENCY_UNIT);
-  _edata = . ;
-  PROVIDE (edata = .) ;
-  __bss_start = . ;
-  .bss :
-  {
-*(.bss)
-*(.bss.*)
-*(COMMON)
-. = ALIGN(32 / 8);
-  }
-  . = ALIGN(32 / 8);
-  _end = . ;
-  PROVIDE (end = .) ;
-  .note.netbsd.ident :
-  {
-KEEP(*(.note.netbsd.ident));
-  }
+	/* Read-only sections, merged into text segment: */
+	.text :
+	{
+		*(.text)
+		*(.text.*)
+		*(.stub)
+	}
+	_etext = . ;
+	PROVIDE (etext = .) ;
+
+	.rodata :
+	{
+		*(.rodata)
+		*(.rodata.*)
+	}
+
+	/*
+	 * Adjust the address for the data segment.  We want to adjust up to
+	 * the same address within the page on the next page up.
+	 */
+	. = ALIGN(0x1000) + (. & (0x1000 - 1));
+	__data_start = . ;
+	.data :
+	{
+		*(.data)
+	}
+
+	. = ALIGN(COHERENCY_UNIT);
+	.data.cacheline_aligned :
+	{
+		*(.data.cacheline_aligned)
+	}
+	. = ALIGN(COHERENCY_UNIT);
+	.data.read_mostly :
+	{
+		*(.data.read_mostly)
+	}
+	. = ALIGN(COHERENCY_UNIT);
+	_edata = . ;
+	PROVIDE (edata = .) ;
+	__bss_start = . ;
+	.bss :
+	{
+		*(.bss)
+		*(.bss.*)
+		*(COMMON)
+	. = ALIGN(32 / 8);
+	}
+	. = ALIGN(32 / 8);
+	_end = . ;
+	PROVIDE (end = .) ;
+	.note.netbsd.ident :
+	{
+		KEEP(*(.note.netbsd.ident));
+	}
 }
+
 SECTIONS
 {
-  .text :
-  AT (ADDR(.text) & 0x0fff)
-  {
-*(.text)
-  } =0
+	.text :
+	AT (ADDR(.text) & 0x0fff)
+	{
+		*(.text)
+	} = 0
 }



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

2015-11-28 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Nov 28 15:06:55 UTC 2015

Modified Files:
src/sys/arch/amd64/amd64: trap.c

Log Message:
If the kernel jumps to NULL, print where it came from instead of trying
to dereference and faulting again.


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/sys/arch/amd64/amd64/trap.c

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

Modified files:

Index: src/sys/arch/amd64/amd64/trap.c
diff -u src/sys/arch/amd64/amd64/trap.c:1.81 src/sys/arch/amd64/amd64/trap.c:1.82
--- src/sys/arch/amd64/amd64/trap.c:1.81	Sun Nov 22 13:41:24 2015
+++ src/sys/arch/amd64/amd64/trap.c	Sat Nov 28 15:06:55 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.81 2015/11/22 13:41:24 maxv Exp $	*/
+/*	$NetBSD: trap.c,v 1.82 2015/11/28 15:06:55 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.81 2015/11/22 13:41:24 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.82 2015/11/28 15:06:55 dholland Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -342,6 +342,16 @@ kernelfault:
 		/* Get %rsp value before fault - there may be a pad word
 		 * below the trap frame. */
 		vframe = (void *)frame->tf_rsp;
+		if (frame->tf_rip == 0) {
+			/*
+			 * Assume that if we jumped to null we
+			 * probably did it via a null function
+			 * pointer, so print the return address.
+			 */
+			printf("kernel jumped to null; return addr was %p\n",
+			   *(void **)frame->tf_rsp);
+			goto we_re_toast;
+		}
 		switch (*(uint16_t *)frame->tf_rip) {
 		case 0xcf48:	/* iretq */
 			/*



CVS commit: src/sys/kern

2015-11-28 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Nov 28 14:36:00 UTC 2015

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

Log Message:
Handle sector sizes other than DEV_BSIZE when reading labels.


To generate a diff of this commit:
cvs rdiff -u -r1.113 -r1.114 src/sys/kern/subr_disk.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/subr_disk.c
diff -u src/sys/kern/subr_disk.c:1.113 src/sys/kern/subr_disk.c:1.114
--- src/sys/kern/subr_disk.c:1.113	Thu May 14 17:31:24 2015
+++ src/sys/kern/subr_disk.c	Sat Nov 28 14:36:00 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_disk.c,v 1.113 2015/05/14 17:31:24 chs Exp $	*/
+/*	$NetBSD: subr_disk.c,v 1.114 2015/11/28 14:36:00 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1999, 2000, 2009 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_disk.c,v 1.113 2015/05/14 17:31:24 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_disk.c,v 1.114 2015/11/28 14:36:00 mlelstv Exp $");
 
 #include 
 #include 
@@ -421,7 +421,7 @@ int
 disk_read_sectors(void (*strat)(struct buf *), const struct disklabel *lp,
 struct buf *bp, unsigned int sector, int count)
 {
-	bp->b_blkno = sector;
+	bp->b_blkno = btodb((off_t)sector * lp->d_secsize);
 	bp->b_bcount = count * lp->d_secsize;
 	bp->b_flags = (bp->b_flags & ~B_WRITE) | B_READ;
 	bp->b_oflags &= ~BO_DONE;



CVS commit: src/etc

2015-11-28 Thread D'Arcy J.M. Cain
Module Name:src
Committed By:   darcy
Date:   Sat Nov 28 14:20:32 UTC 2015

Modified Files:
src/etc: weekly

Log Message:
Of course we can always not do something.  Doesn't mean that we "can't"
(or "cannot").  In any case make the messages consistent and move the
period to inside the quotes.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/etc/weekly

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

Modified files:

Index: src/etc/weekly
diff -u src/etc/weekly:1.30 src/etc/weekly:1.31
--- src/etc/weekly:1.30	Wed Mar  4 14:54:38 2015
+++ src/etc/weekly	Sat Nov 28 14:20:32 2015
@@ -1,6 +1,6 @@
 #!/bin/sh -
 #
-#	$NetBSD: weekly,v 1.30 2015/03/04 14:54:38 christos Exp $
+#	$NetBSD: weekly,v 1.31 2015/11/28 14:20:32 darcy Exp $
 #	from: @(#)weekly	8.2 (Berkeley) 1/2/94
 #
 
@@ -31,7 +31,7 @@ WEEKLYDIR=$(mktemp -d -t _weekly) || exi
 trap "/bin/rm -rf $WEEKLYDIR ; exit 0" EXIT INT QUIT PIPE
 
 if ! cd "$WEEKLYDIR"; then
-	echo "Can not cd to $WEEKLYDIR".
+	echo "Can't cd to $WEEKLYDIR; aborting."
 	exit 1
 fi
 



CVS commit: src/sys/dev

2015-11-28 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Nov 28 14:45:24 UTC 2015

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

Log Message:
Inherit sector size from underlying disk to support disks with
sector sizes other than 512 bytes.

The CGD disk image depends on disk geometry as it encodes the block
number into each block. You cannot copy an image between disks
with different sector sizes.


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 src/sys/dev/cgd.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/cgd.c
diff -u src/sys/dev/cgd.c:1.104 src/sys/dev/cgd.c:1.105
--- src/sys/dev/cgd.c:1.104	Thu Aug 27 05:51:50 2015
+++ src/sys/dev/cgd.c	Sat Nov 28 14:45:24 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: cgd.c,v 1.104 2015/08/27 05:51:50 mlelstv Exp $ */
+/* $NetBSD: cgd.c,v 1.105 2015/11/28 14:45:24 mlelstv Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.104 2015/08/27 05:51:50 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.105 2015/11/28 14:45:24 mlelstv Exp $");
 
 #include 
 #include 
@@ -304,6 +304,8 @@ static void
 cgdstrategy(struct buf *bp)
 {
 	struct	cgd_softc *cs = getcgd_softc(bp->b_dev);
+	struct	dk_softc *dksc = >sc_dksc;
+	struct	disk_geom *dg = >sc_dkdev.dk_geom;
 
 	DPRINTF_FOLLOW(("cgdstrategy(%p): b_bcount = %ld\n", bp,
 	(long)bp->b_bcount));
@@ -314,7 +316,7 @@ cgdstrategy(struct buf *bp)
 	 * buffers to be aligned to 32-bit boundaries.
 	 */
 	if (bp->b_blkno < 0 ||
-	(bp->b_bcount % DEV_BSIZE) != 0 ||
+	(bp->b_bcount % dg->dg_secsize) != 0 ||
 	((uintptr_t)bp->b_data & 3) != 0) {
 		bp->b_error = EINVAL;
 		bp->b_resid = bp->b_bcount;
@@ -384,6 +386,7 @@ cgd_diskstart(device_t dev, struct buf *
 {
 	struct	cgd_softc *cs = device_private(dev);
 	struct	dk_softc *dksc = >sc_dksc;
+	struct	disk_geom *dg = >sc_dkdev.dk_geom;
 	struct	buf *nbp;
 	void *	addr;
 	void *	newaddr;
@@ -414,7 +417,7 @@ cgd_diskstart(device_t dev, struct buf *
 			return EAGAIN;
 		}
 		cgd_cipher(cs, newaddr, addr, bp->b_bcount, bn,
-		DEV_BSIZE, CGD_CIPHER_ENCRYPT);
+		dg->dg_secsize, CGD_CIPHER_ENCRYPT);
 	}
 
 	nbp->b_data = newaddr;
@@ -423,7 +426,7 @@ cgd_diskstart(device_t dev, struct buf *
 	nbp->b_cflags = bp->b_cflags;
 	nbp->b_iodone = cgdiodone;
 	nbp->b_proc = bp->b_proc;
-	nbp->b_blkno = bn;
+	nbp->b_blkno = btodb(bn * dg->dg_secsize);
 	nbp->b_bcount = bp->b_bcount;
 	nbp->b_private = bp;
 
@@ -446,6 +449,8 @@ cgdiodone(struct buf *nbp)
 	struct	buf *obp = nbp->b_private;
 	struct	cgd_softc *cs = getcgd_softc(obp->b_dev);
 	struct	dk_softc *dksc = >sc_dksc;
+	struct	disk_geom *dg = >sc_dkdev.dk_geom;
+	daddr_t	bn;
 
 	KDASSERT(cs);
 
@@ -467,9 +472,11 @@ cgdiodone(struct buf *nbp)
 	 *   we used to encrypt the blocks.
 	 */
 
-	if (nbp->b_flags & B_READ)
+	if (nbp->b_flags & B_READ) {
+		bn = dbtob(nbp->b_blkno) / dg->dg_secsize;
 		cgd_cipher(cs, obp->b_data, obp->b_data, obp->b_bcount,
-		nbp->b_blkno, DEV_BSIZE, CGD_CIPHER_DECRYPT);
+		bn, dg->dg_secsize, CGD_CIPHER_DECRYPT);
+	}
 
 	/* If we allocated memory, free it now... */
 	if (nbp->b_data != obp->b_data)
@@ -824,10 +831,9 @@ cgdinit(struct cgd_softc *cs, const char
 	dg = >sc_dkdev.dk_geom;
 	memset(dg, 0, sizeof(*dg));
 	dg->dg_secperunit = psize;
-	// XXX: Inherit?
-	dg->dg_secsize = DEV_BSIZE;
+	dg->dg_secsize = secsize;
 	dg->dg_ntracks = 1;
-	dg->dg_nsectors = 1024 * (1024 / dg->dg_secsize);
+	dg->dg_nsectors = 1024 * 1024 / dg->dg_secsize;
 	dg->dg_ncylinders = dg->dg_secperunit / dg->dg_nsectors;
 
 bail:
@@ -899,6 +905,7 @@ cgd_cipher(struct cgd_softc *cs, void *d
 	struct iovec	dstiov[2];
 	struct iovec	srciov[2];
 	size_t		blocksize = cs->sc_cdata.cf_blocksize;
+	size_t		todo;
 	char		sink[CGD_MAXBLOCKSIZE];
 	char		zero_iv[CGD_MAXBLOCKSIZE];
 	char		blkno_buf[CGD_MAXBLOCKSIZE];
@@ -924,12 +931,14 @@ cgd_cipher(struct cgd_softc *cs, void *d
 	dstiov[0].iov_len  = blocksize;
 	srciov[0].iov_base = blkno_buf;
 	srciov[0].iov_len  = blocksize;
-	dstiov[1].iov_len  = secsize;
-	srciov[1].iov_len  = secsize;
 
-	for (; len > 0; len -= secsize) {
+	for (; len > 0; len -= todo) {
+		todo = MIN(len, secsize);
+
 		dstiov[1].iov_base = dst;
 		srciov[1].iov_base = src;
+		dstiov[1].iov_len  = todo;
+		srciov[1].iov_len  = todo;
 
 		memset(blkno_buf, 0x0, blocksize);
 		blkno2blkno_buf(blkno_buf, blkno);
@@ -951,8 +960,8 @@ cgd_cipher(struct cgd_softc *cs, void *d
 		IFDEBUG(CGDB_CRYPTO, hexprint("step 2: sink",
 		sink, blocksize));
 
-		dst += secsize;
-		src += secsize;
+		dst += todo;
+		src += todo;
 		blkno++;
 	}
 }



CVS commit: src/sys/kern

2015-11-28 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Nov 28 15:26:29 UTC 2015

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

Log Message:
Fix kern/50841: races in sys_lseek.


To generate a diff of this commit:
cvs rdiff -u -r1.503 -r1.504 src/sys/kern/vfs_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/kern/vfs_syscalls.c
diff -u src/sys/kern/vfs_syscalls.c:1.503 src/sys/kern/vfs_syscalls.c:1.504
--- src/sys/kern/vfs_syscalls.c:1.503	Wed Oct 28 14:05:04 2015
+++ src/sys/kern/vfs_syscalls.c	Sat Nov 28 15:26:29 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_syscalls.c,v 1.503 2015/10/28 14:05:04 martin Exp $	*/
+/*	$NetBSD: vfs_syscalls.c,v 1.504 2015/11/28 15:26:29 dholland Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.503 2015/10/28 14:05:04 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.504 2015/11/28 15:26:29 dholland Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_fileassoc.h"
@@ -2761,15 +2761,16 @@ sys_lseek(struct lwp *l, const struct sy
 		goto out;
 	}
 
+	vn_lock(vp, LK_SHARED | LK_RETRY);
+
 	switch (SCARG(uap, whence)) {
 	case SEEK_CUR:
 		newoff = fp->f_offset + SCARG(uap, offset);
 		break;
 	case SEEK_END:
-		vn_lock(vp, LK_SHARED | LK_RETRY);
 		error = VOP_GETATTR(vp, , cred);
-		VOP_UNLOCK(vp);
 		if (error) {
+			VOP_UNLOCK(vp);
 			goto out;
 		}
 		newoff = SCARG(uap, offset) + vattr.va_size;
@@ -2779,8 +2780,10 @@ sys_lseek(struct lwp *l, const struct sy
 		break;
 	default:
 		error = EINVAL;
+		VOP_UNLOCK(vp);
 		goto out;
 	}
+	VOP_UNLOCK(vp);
 	if ((error = VOP_SEEK(vp, fp->f_offset, newoff, cred)) == 0) {
 		*(off_t *)retval = fp->f_offset = newoff;
 	}



CVS commit: src/sys/dev

2015-11-28 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Nov 28 21:06:31 UTC 2015

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

Log Message:
Remove bogus dk_getdisklabel call.

- there is no need to read the label in the attach routine
- passing a (dev_t)0 may cause havoc.

This fixes PR 41704.


To generate a diff of this commit:
cvs rdiff -u -r1.105 -r1.106 src/sys/dev/cgd.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/cgd.c
diff -u src/sys/dev/cgd.c:1.105 src/sys/dev/cgd.c:1.106
--- src/sys/dev/cgd.c:1.105	Sat Nov 28 14:45:24 2015
+++ src/sys/dev/cgd.c	Sat Nov 28 21:06:30 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: cgd.c,v 1.105 2015/11/28 14:45:24 mlelstv Exp $ */
+/* $NetBSD: cgd.c,v 1.106 2015/11/28 21:06:30 mlelstv Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.105 2015/11/28 14:45:24 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.106 2015/11/28 21:06:30 mlelstv Exp $");
 
 #include 
 #include 
@@ -711,9 +711,6 @@ cgd_ioctl_set(struct cgd_softc *cs, void
 
 	disk_set_info(dksc->sc_dev, >sc_dkdev, NULL);
 
-	/* Try and read the disklabel. */
-	dk_getdisklabel(dksc, 0 /* XXX ? (cause of PR 41704) */);
-
 	/* Discover wedges on this disk. */
 	dkwedge_discover(>sc_dkdev);
 



CVS commit: src/external/cddl/osnet/dev/dtrace

2015-11-28 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Nov 28 22:41:36 UTC 2015

Modified Files:
src/external/cddl/osnet/dev/dtrace: dtrace_modevent.c

Log Message:
When loading the module, if devsw_attach() fails, call dtrace_unload()
to undo the effects of dtrace_load().  And if dtrace_unload() fails,
panic (since we can't get the system back to its earlier stable state).

When unloading the module, call devsw_detach() first, to lock out any
new access.  Then call dtrace_unload().  If dgtrace_unload() fails,
reattach the devsw, and if that fails, panic.

Implements fixes described in PR kern/43032


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/cddl/osnet/dev/dtrace/dtrace_modevent.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/cddl/osnet/dev/dtrace/dtrace_modevent.c
diff -u src/external/cddl/osnet/dev/dtrace/dtrace_modevent.c:1.4 src/external/cddl/osnet/dev/dtrace/dtrace_modevent.c:1.5
--- src/external/cddl/osnet/dev/dtrace/dtrace_modevent.c:1.4	Thu Feb 26 09:10:52 2015
+++ src/external/cddl/osnet/dev/dtrace/dtrace_modevent.c	Sat Nov 28 22:41:36 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: dtrace_modevent.c,v 1.4 2015/02/26 09:10:52 ozaki-r Exp $	*/
+/*	$NetBSD: dtrace_modevent.c,v 1.5 2015/11/28 22:41:36 pgoyette Exp $	*/
 
 /*
  * CDDL HEADER START
@@ -34,13 +34,26 @@ dtrace_modcmd(modcmd_t cmd, void *data)
 	switch (cmd) {
 	case MODULE_CMD_INIT:
 		dtrace_load(NULL);
-		return devsw_attach("dtrace", NULL, ,
+		error = devsw_attach("dtrace", NULL, ,
 		_cdevsw, );
+		if (error != 0)
+			if (dtrace_unload() != 0)
+panic("failed to unload dtrace");
+		return error;
+
 	case MODULE_CMD_FINI:
-		error = dtrace_unload();
+		error = devsw_detach(NULL, _cdevsw);
 		if (error != 0)
 			return error;
-		return devsw_detach(NULL, _cdevsw);
+
+		error = dtrace_unload();
+		if (error != 0) {
+			if (devsw_attach("dtrace", NULL, ,
+	 _cdevsw, ) != 0)
+panic("failed to reattach dtrace_devsw");
+		}
+		return error;
+
 	case MODULE_CMD_AUTOUNLOAD:
 		return EBUSY;
 	default:



CVS commit: src/sys/arch/evbarm

2015-11-28 Thread Marty Fouts
Module Name:src
Committed By:   marty
Date:   Sat Nov 28 20:51:36 UTC 2015

Modified Files:
src/sys/arch/evbarm/conf: mk.odroid
src/sys/arch/evbarm/odroid: odroid_start.S

Log Message:
Exit hypervisor mode before entering supervisor

The Odroid XU4 is booted in hypervisor mode, probably because it is trust
zone enabled.  Before we can put it in supervisor we must explicitly remove
it from hypervisor.

This change is from Nick, who figured it out and adapted code from FreeBSD
to make the necessary change.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbarm/conf/mk.odroid
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/evbarm/odroid/odroid_start.S

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/mk.odroid
diff -u src/sys/arch/evbarm/conf/mk.odroid:1.1 src/sys/arch/evbarm/conf/mk.odroid:1.2
--- src/sys/arch/evbarm/conf/mk.odroid:1.1	Sun Apr 13 02:26:26 2014
+++ src/sys/arch/evbarm/conf/mk.odroid	Sat Nov 28 20:51:36 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: mk.odroid,v 1.1 2014/04/13 02:26:26 matt Exp $
+#	$NetBSD: mk.odroid,v 1.2 2015/11/28 20:51:36 marty Exp $
 
 .if !empty(MACHINE_ARCH:M*eb)
 EXTRA_LINKFLAGS+=	--be8
@@ -6,6 +6,7 @@ EXTRA_LINKFLAGS+=	--be8
 
 SYSTEM_FIRST_OBJ=	odroid_start.o
 SYSTEM_FIRST_SFILE=	${THISARM}/odroid/odroid_start.S
+AFLAGS.odroid_start.S+=-Wa,-march=armv7-a+virt
 
 GENASSYM_EXTRAS+=	${THISARM}/odroid/genassym.cf
 

Index: src/sys/arch/evbarm/odroid/odroid_start.S
diff -u src/sys/arch/evbarm/odroid/odroid_start.S:1.17 src/sys/arch/evbarm/odroid/odroid_start.S:1.18
--- src/sys/arch/evbarm/odroid/odroid_start.S:1.17	Fri Nov 27 09:45:03 2015
+++ src/sys/arch/evbarm/odroid/odroid_start.S	Sat Nov 28 20:51:36 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: odroid_start.S,v 1.17 2015/11/27 09:45:03 skrll Exp $	*/
+/*	$NetBSD: odroid_start.S,v 1.18 2015/11/28 20:51:36 marty Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -46,7 +46,7 @@
 
 #include 
 
-RCSID("$NetBSD: odroid_start.S,v 1.17 2015/11/27 09:45:03 skrll Exp $")
+RCSID("$NetBSD: odroid_start.S,v 1.18 2015/11/28 20:51:36 marty Exp $")
 
 
 #if defined(VERBOSE_INIT_ARM)
@@ -88,9 +88,26 @@ _C_LABEL(odroid_start):
 	setend	be			/* force big endian */
 #endif
 
-	/* Move into supervisor mode and disable IRQs/FIQs. */
-	cpsid	if, #PSR_SVC32_MODE
+//.arch_extension virt
+/* Leave HYP mode */
+mrsr0, cpsr
+andr0, r0, #(PSR_MODE)   /* Mode is in the low 5 bits of CPSR */
+teqr0, #(PSR_HYP32_MODE) /* Hyp Mode? */
+bne1f
+/* Ensure that IRQ, FIQ and Aborts will be disabled after eret */
+mrsr0, cpsr
+bicr0, r0, #(PSR_MODE)
+orrr0, r0, #(PSR_SVC32_MODE)
+orrr0, r0, #(I32_bit | F32_bit)
+msrspsr_cxsf, r0
+/* Exit hypervisor mode */
+adrlr, 1f
+msrelr_hyp, lr
+eret
+1:
 
+///* Move into supervisor mode and disable IRQs/FIQs. */
+//cpsidif, #PSR_SVC32_MODE
 	/*
 	 * Save any arguments passed to us.  If .start is not at
 	 * 0x8000 but .text is, we can't directly use the address that



CVS commit: src/sbin

2015-11-28 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Nov 28 23:53:48 UTC 2015

Modified Files:
src/sbin/modload: modload.8
src/sbin/modunload: modunload.8

Log Message:
Add cross-refs from modload(8) amd modunload(8) to modctl(2)


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sbin/modload/modload.8
cvs rdiff -u -r1.20 -r1.21 src/sbin/modunload/modunload.8

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

Modified files:

Index: src/sbin/modload/modload.8
diff -u src/sbin/modload/modload.8:1.42 src/sbin/modload/modload.8:1.43
--- src/sbin/modload/modload.8:1.42	Sat Aug  6 08:43:28 2011
+++ src/sbin/modload/modload.8	Sat Nov 28 23:53:48 2015
@@ -1,4 +1,4 @@
-.\" $NetBSD: modload.8,v 1.42 2011/08/06 08:43:28 wiz Exp $
+.\" $NetBSD: modload.8,v 1.43 2015/11/28 23:53:48 pgoyette Exp $
 .\"
 .\" Copyright (c) 1993 Christopher G. Demetriou
 .\" All rights reserved.
@@ -32,7 +32,7 @@
 .\"
 .\" <>
 .\"
-.Dd August 6, 2011
+.Dd November 29, 2015
 .Dt MODLOAD 8
 .Os
 .Sh NAME
@@ -128,6 +128,7 @@ The
 utility exits with a status of 0 on success
 and with a nonzero status if an error occurs.
 .Sh SEE ALSO
+.Xr modctl 2 ,
 .Xr module 7 ,
 .Xr modstat 8 ,
 .Xr modunload 8

Index: src/sbin/modunload/modunload.8
diff -u src/sbin/modunload/modunload.8:1.20 src/sbin/modunload/modunload.8:1.21
--- src/sbin/modunload/modunload.8:1.20	Tue Dec 14 16:24:00 2010
+++ src/sbin/modunload/modunload.8	Sat Nov 28 23:53:48 2015
@@ -1,4 +1,4 @@
-.\" $NetBSD: modunload.8,v 1.20 2010/12/14 16:24:00 jruoho Exp $
+.\" $NetBSD: modunload.8,v 1.21 2015/11/28 23:53:48 pgoyette Exp $
 .\"
 .\" Copyright (c) 1993 Christopher G. Demetriou
 .\" All rights reserved.
@@ -32,7 +32,7 @@
 .\"
 .\" <>
 .\"
-.Dd December 14, 2010
+.Dd November 29, 2015
 .Dt MODUNLOAD 8
 .Os
 .Sh NAME
@@ -61,6 +61,7 @@ The
 utility exits with a status of 0 on success
 and with a nonzero status if an error occurs.
 .Sh SEE ALSO
+.Xr modctl 2 ,
 .Xr module 7 ,
 .Xr modload 8 ,
 .Xr modstat 8



CVS commit: src/sbin/gpt

2015-11-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Nov 29 00:14:46 UTC 2015

Modified Files:
src/sbin/gpt: add.c backup.c biosboot.c create.c destroy.c gpt.c gpt.h
header.c label.c migrate.c recover.c remove.c resize.c resizedisk.c
restore.c set.c show.c type.c unset.c

Log Message:
merge the create errors in one place and fix them.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sbin/gpt/add.c
cvs rdiff -u -r1.8 -r1.9 src/sbin/gpt/backup.c src/sbin/gpt/restore.c
cvs rdiff -u -r1.14 -r1.15 src/sbin/gpt/biosboot.c
cvs rdiff -u -r1.12 -r1.13 src/sbin/gpt/create.c
cvs rdiff -u -r1.6 -r1.7 src/sbin/gpt/destroy.c src/sbin/gpt/recover.c \
src/sbin/gpt/resizedisk.c src/sbin/gpt/type.c
cvs rdiff -u -r1.41 -r1.42 src/sbin/gpt/gpt.c
cvs rdiff -u -r1.19 -r1.20 src/sbin/gpt/gpt.h
cvs rdiff -u -r1.2 -r1.3 src/sbin/gpt/header.c
cvs rdiff -u -r1.18 -r1.19 src/sbin/gpt/label.c
cvs rdiff -u -r1.21 -r1.22 src/sbin/gpt/migrate.c src/sbin/gpt/show.c
cvs rdiff -u -r1.16 -r1.17 src/sbin/gpt/remove.c
cvs rdiff -u -r1.11 -r1.12 src/sbin/gpt/resize.c
cvs rdiff -u -r1.5 -r1.6 src/sbin/gpt/set.c src/sbin/gpt/unset.c

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

Modified files:

Index: src/sbin/gpt/add.c
diff -u src/sbin/gpt/add.c:1.27 src/sbin/gpt/add.c:1.28
--- src/sbin/gpt/add.c:1.27	Tue Sep 30 13:59:59 2014
+++ src/sbin/gpt/add.c	Sat Nov 28 19:14:46 2015
@@ -33,7 +33,7 @@
 __FBSDID("$FreeBSD: src/sbin/gpt/add.c,v 1.14 2006/06/22 22:05:28 marcel Exp $");
 #endif
 #ifdef __RCSID
-__RCSID("$NetBSD: add.c,v 1.27 2014/09/30 17:59:59 christos Exp $");
+__RCSID("$NetBSD: add.c,v 1.28 2015/11/29 00:14:46 christos Exp $");
 #endif
 
 #include 
@@ -272,11 +272,9 @@ cmd_add(int argc, char *argv[])
 	}
 
 	while (optind < argc) {
-		fd = gpt_open(argv[optind++]);
-		if (fd == -1) {
-			warn("unable to open device '%s'", device_name);
+		fd = gpt_open(argv[optind++], 0);
+		if (fd == -1)
 			continue;
-		}
 
 		if (alignment % secsz != 0) {
 			warnx("Alignment must be a multiple of sector size;");

Index: src/sbin/gpt/backup.c
diff -u src/sbin/gpt/backup.c:1.8 src/sbin/gpt/backup.c:1.9
--- src/sbin/gpt/backup.c:1.8	Tue Sep 30 13:59:59 2014
+++ src/sbin/gpt/backup.c	Sat Nov 28 19:14:46 2015
@@ -33,7 +33,7 @@
 __FBSDID("$FreeBSD: src/sbin/gpt/show.c,v 1.14 2006/06/22 22:22:32 marcel Exp $");
 #endif
 #ifdef __RCSID
-__RCSID("$NetBSD: backup.c,v 1.8 2014/09/30 17:59:59 christos Exp $");
+__RCSID("$NetBSD: backup.c,v 1.9 2015/11/29 00:14:46 christos Exp $");
 #endif
 
 #include 
@@ -296,11 +296,9 @@ cmd_backup(int argc, char *argv[])
 		usage_backup();
 
 	while (optind < argc) {
-		fd = gpt_open(argv[optind++]);
-		if (fd == -1) {
-			warn("unable to open device '%s'", device_name);
+		fd = gpt_open(argv[optind++], 0);
+		if (fd == -1)
 			continue;
-		}
 		backup();
 
 		gpt_close(fd);
Index: src/sbin/gpt/restore.c
diff -u src/sbin/gpt/restore.c:1.8 src/sbin/gpt/restore.c:1.9
--- src/sbin/gpt/restore.c:1.8	Tue Jun 16 19:18:55 2015
+++ src/sbin/gpt/restore.c	Sat Nov 28 19:14:46 2015
@@ -33,7 +33,7 @@
 __FBSDID("$FreeBSD: src/sbin/gpt/create.c,v 1.11 2005/08/31 01:47:19 marcel Exp $");
 #endif
 #ifdef __RCSID
-__RCSID("$NetBSD: restore.c,v 1.8 2015/06/16 23:18:55 christos Exp $");
+__RCSID("$NetBSD: restore.c,v 1.9 2015/11/29 00:14:46 christos Exp $");
 #endif
 
 #include 
@@ -403,11 +403,9 @@ cmd_restore(int argc, char *argv[])
 		usage_restore();
 
 	while (optind < argc) {
-		fd = gpt_open(argv[optind++]);
-		if (fd == -1) {
-			warn("unable to open device '%s'", device_name);
+		fd = gpt_open(argv[optind++], 0);
+		if (fd == -1)
 			continue;
-		}
 
 		restore(fd);
 

Index: src/sbin/gpt/biosboot.c
diff -u src/sbin/gpt/biosboot.c:1.14 src/sbin/gpt/biosboot.c:1.15
--- src/sbin/gpt/biosboot.c:1.14	Fri Oct  3 16:30:06 2014
+++ src/sbin/gpt/biosboot.c	Sat Nov 28 19:14:46 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: biosboot.c,v 1.14 2014/10/03 20:30:06 christos Exp $ */
+/*	$NetBSD: biosboot.c,v 1.15 2015/11/29 00:14:46 christos Exp $ */
 
 /*
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 
 #include 
 #ifdef __RCSID
-__RCSID("$NetBSD: biosboot.c,v 1.14 2014/10/03 20:30:06 christos Exp $");
+__RCSID("$NetBSD: biosboot.c,v 1.15 2015/11/29 00:14:46 christos Exp $");
 #endif
 
 #include 
@@ -335,12 +335,10 @@ cmd_biosboot(int argc, char *argv[])
 	close:
 		close(fd);
 
-		fd = gpt_open(dev);
+		fd = gpt_open(dev, 0);
 	next:
-		if (fd == -1) {
-			warn("unable to open device '%s'", device_name);
+		if (fd == -1)
 			continue;
-		}
 
 		biosboot(fd);
 

Index: src/sbin/gpt/create.c
diff -u src/sbin/gpt/create.c:1.12 src/sbin/gpt/create.c:1.13
--- src/sbin/gpt/create.c:1.12	Fri Oct  3 16:30:06 2014
+++ src/sbin/gpt/create.c	Sat Nov 28 19:14:46 2015
@@ -33,7 +33,7 @@
 __FBSDID("$FreeBSD: src/sbin/gpt/create.c,v 1.11 2005/08/31 01:47:19 marcel Exp $");
 #endif
 #ifdef __RCSID
-__RCSID("$NetBSD: 

CVS commit: src/sbin/gpt

2015-11-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Nov 29 00:15:12 UTC 2015

Modified Files:
src/sbin/gpt: map.c

Log Message:
- use snprintf
- fix bogus logic on map_type


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sbin/gpt/map.c

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

Modified files:

Index: src/sbin/gpt/map.c
diff -u src/sbin/gpt/map.c:1.7 src/sbin/gpt/map.c:1.8
--- src/sbin/gpt/map.c:1.7	Mon Sep 29 16:28:57 2014
+++ src/sbin/gpt/map.c	Sat Nov 28 19:15:12 2015
@@ -33,7 +33,7 @@
 __FBSDID("$FreeBSD: src/sbin/gpt/map.c,v 1.6 2005/08/31 01:47:19 marcel Exp $");
 #endif
 #ifdef __RCSID
-__RCSID("$NetBSD: map.c,v 1.7 2014/09/29 20:28:57 christos Exp $");
+__RCSID("$NetBSD: map.c,v 1.8 2015/11/29 00:15:12 christos Exp $");
 #endif
 
 #include 
@@ -42,6 +42,7 @@ __RCSID("$NetBSD: map.c,v 1.7 2014/09/29
 #include 
 
 #include "map.h"
+#include "gpt.h"
 
 int lbawidth;
 
@@ -52,7 +53,7 @@ mkmap(off_t start, off_t size, int type)
 {
 	map_t *m;
 
-	m = malloc(sizeof(*m));
+	m = calloc(1, sizeof(*m));
 	if (m == NULL)
 		return (NULL);
 	m->map_start = start;
@@ -72,11 +73,15 @@ map_add(off_t start, off_t size, int typ
 	n = mediamap;
 	while (n != NULL && n->map_start + n->map_size <= start)
 		n = n->map_next;
-	if (n == NULL)
+	if (n == NULL) {
+		if (!quiet)
+			warnx("Can't find map");
 		return (NULL);
+	}
 
 	if (n->map_start + n->map_size < start + size) {
-		warnx("error: map entry doesn't fit media");
+		if (!quiet)
+			warnx("map entry doesn't fit media");
 		return (NULL);
 	}
 
@@ -84,8 +89,9 @@ map_add(off_t start, off_t size, int typ
 		if (n->map_type != MAP_TYPE_UNUSED) {
 			if (n->map_type != MAP_TYPE_MBR_PART ||
 			type != MAP_TYPE_GPT_PART) {
-warnx("warning: partition(%llu,%llu) mirrored",
-(long long)start, (long long)size);
+if (!quiet)
+	warnx("partition(%ju,%ju) mirrored",
+	(uintmax_t)start, (uintmax_t)size);
 			}
 		}
 		n->map_type = type;
@@ -93,13 +99,17 @@ map_add(off_t start, off_t size, int typ
 		return (n);
 	}
 
-	if (n->map_type != MAP_TYPE_UNUSED) {
-		if (n->map_type != MAP_TYPE_MBR_PART ||
-		type != MAP_TYPE_GPT_PART) {
-			warnx("error: bogus map");
-			return (0);
-		}
+	
+	switch (n->map_type) {
+	case MAP_TYPE_MBR_PART:
+	case MAP_TYPE_GPT_PART:
 		n->map_type = MAP_TYPE_UNUSED;
+		break;
+	case MAP_TYPE_UNUSED:
+		break;
+	default:
+		warnx("bogus map %#x", n->map_type);
+		return (NULL);
 	}
 
 	m = mkmap(start, size, type);
@@ -334,7 +344,7 @@ map_init(off_t size)
 	char buf[32];
 
 	mediamap = mkmap(0LL, size, MAP_TYPE_UNUSED);
-	lbawidth = sprintf(buf, "%llu", (long long)size);
+	lbawidth = snprintf(buf, sizeof(buf), "%ju", (uintmax_t)size);
 	if (lbawidth < 5)
 		lbawidth = 5;
 }



CVS commit: src

2015-11-28 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sun Nov 29 06:10:01 UTC 2015

Modified Files:
src/distrib/sets/lists/comp: mi
src/lib/libc/sys: Makefile.inc
Added Files:
src/lib/libc/sys: _ksem.2

Log Message:
Initial documentation of the internal syscalls that implement the librt
posix semaphores.  As requested in PR kern/37427

XXX Feel free to expand this page!


To generate a diff of this commit:
cvs rdiff -u -r1.2007 -r1.2008 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.227 -r1.228 src/lib/libc/sys/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/lib/libc/sys/_ksem.2

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

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2007 src/distrib/sets/lists/comp/mi:1.2008
--- src/distrib/sets/lists/comp/mi:1.2007	Tue Nov 24 23:33:46 2015
+++ src/distrib/sets/lists/comp/mi	Sun Nov 29 06:10:01 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2007 2015/11/24 23:33:46 christos Exp $
+#	$NetBSD: mi,v 1.2008 2015/11/29 06:10:01 pgoyette Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -3946,6 +3946,17 @@
 ./usr/share/man/cat2/__quotactl.0		comp-c-catman		.cat
 ./usr/share/man/cat2/__syscall.0		comp-c-catman		.cat
 ./usr/share/man/cat2/_exit.0			comp-c-catman		.cat
+./usr/share/man/cat2/_ksem.0			comp-c-catman		.cat
+./usr/share/man/cat2/_ksem_close.0		comp-c-catman		.cat
+./usr/share/man/cat2/_ksem_destroy.0		comp-c-catman		.cat
+./usr/share/man/cat2/_ksem_getvalue.0		comp-c-catman		.cat
+./usr/share/man/cat2/_ksem_init.0		comp-c-catman		.cat
+./usr/share/man/cat2/_ksem_open.0		comp-c-catman		.cat
+./usr/share/man/cat2/_ksem_post.0		comp-c-catman		.cat
+./usr/share/man/cat2/_ksem_timedwait.0		comp-c-catman		.cat
+./usr/share/man/cat2/_ksem_trywait.0		comp-c-catman		.cat
+./usr/share/man/cat2/_ksem_unlink.0		comp-c-catman		.cat
+./usr/share/man/cat2/_ksem_wait.0		comp-c-catman		.cat
 ./usr/share/man/cat2/_lwp_continue.0		comp-c-catman		.cat
 ./usr/share/man/cat2/_lwp_create.0		comp-c-catman		.cat
 ./usr/share/man/cat2/_lwp_ctl.0			comp-c-catman		.cat
@@ -10987,6 +10998,17 @@
 ./usr/share/man/html2/__quotactl.html		comp-c-htmlman		html
 ./usr/share/man/html2/__syscall.html		comp-c-htmlman		html
 ./usr/share/man/html2/_exit.html		comp-c-htmlman		html
+./usr/share/man/html2/_ksem.html		comp-c-htmlman		html
+./usr/share/man/html2/_ksem_close.html		comp-c-htmlman		html
+./usr/share/man/html2/_ksem_destroy.html	comp-c-htmlman		html
+./usr/share/man/html2/_ksem_getvalue.html	comp-c-htmlman		html
+./usr/share/man/html2/_ksem_init.html		comp-c-htmlman		html
+./usr/share/man/html2/_ksem_open.html		comp-c-htmlman		html
+./usr/share/man/html2/_ksem_post.html		comp-c-htmlman		html
+./usr/share/man/html2/_ksem_timedwait.html	comp-c-htmlman		html
+./usr/share/man/html2/_ksem_trywait.html	comp-c-htmlman		html
+./usr/share/man/html2/_ksem_unlink.html		comp-c-htmlman		html
+./usr/share/man/html2/_ksem_wait.html		comp-c-htmlman		html
 ./usr/share/man/html2/_lwp_continue.html	comp-c-htmlman		html
 ./usr/share/man/html2/_lwp_create.html		comp-c-htmlman		html
 ./usr/share/man/html2/_lwp_ctl.html		comp-c-htmlman		html
@@ -17791,6 +17813,17 @@
 ./usr/share/man/man2/__quotactl.2		comp-c-man		.man
 ./usr/share/man/man2/__syscall.2		comp-c-man		.man
 ./usr/share/man/man2/_exit.2			comp-c-man		.man
+./usr/share/man/man2/_ksem.2			comp-c-man		.man
+./usr/share/man/man2/_ksem_close.2		comp-c-man		.man
+./usr/share/man/man2/_ksem_destroy.2		comp-c-man		.man
+./usr/share/man/man2/_ksem_getvalue.2		comp-c-man		.man
+./usr/share/man/man2/_ksem_init.2		comp-c-man		.man
+./usr/share/man/man2/_ksem_open.2		comp-c-man		.man
+./usr/share/man/man2/_ksem_post.2		comp-c-man		.man
+./usr/share/man/man2/_ksem_timedwait.2		comp-c-man		.man
+./usr/share/man/man2/_ksem_trywait.2		comp-c-man		.man
+./usr/share/man/man2/_ksem_unlink.2		comp-c-man		.man
+./usr/share/man/man2/_ksem_wait.2		comp-c-man		.man
 ./usr/share/man/man2/_lwp_continue.2		comp-c-man		.man
 ./usr/share/man/man2/_lwp_create.2		comp-c-man		.man
 ./usr/share/man/man2/_lwp_ctl.2			comp-c-man		.man

Index: src/lib/libc/sys/Makefile.inc
diff -u src/lib/libc/sys/Makefile.inc:1.227 src/lib/libc/sys/Makefile.inc:1.228
--- src/lib/libc/sys/Makefile.inc:1.227	Sat Jan 31 23:10:56 2015
+++ src/lib/libc/sys/Makefile.inc	Sun Nov 29 06:10:01 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.227 2015/01/31 23:10:56 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.228 2015/11/29 06:10:01 pgoyette Exp $
 #	@(#)Makefile.inc	8.3 (Berkeley) 10/24/94
 
 # sys sources
@@ -249,7 +249,7 @@ MAN+=	accept.2 access.2 acct.2 adjtime.2
 	getitimer.2 getlogin.2 getpeername.2 getpgrp.2 getpid.2 \
 	getpriority.2 getrlimit.2 getrusage.2 getsid.2 getsockname.2 \
 	getsockopt.2 gettimeofday.2 getuid.2 intro.2 ioctl.2 issetugid.2 \
-	kill.2 kqueue.2 ktrace.2 \
+	kill.2 kqueue.2 ktrace.2 

CVS commit: src/sbin/gpt

2015-11-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Nov 29 00:34:39 UTC 2015

Modified Files:
src/sbin/gpt: map.c

Log Message:
print the current map type.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sbin/gpt/map.c

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

Modified files:

Index: src/sbin/gpt/map.c
diff -u src/sbin/gpt/map.c:1.8 src/sbin/gpt/map.c:1.9
--- src/sbin/gpt/map.c:1.8	Sat Nov 28 19:15:12 2015
+++ src/sbin/gpt/map.c	Sat Nov 28 19:34:39 2015
@@ -33,7 +33,7 @@
 __FBSDID("$FreeBSD: src/sbin/gpt/map.c,v 1.6 2005/08/31 01:47:19 marcel Exp $");
 #endif
 #ifdef __RCSID
-__RCSID("$NetBSD: map.c,v 1.8 2015/11/29 00:15:12 christos Exp $");
+__RCSID("$NetBSD: map.c,v 1.9 2015/11/29 00:34:39 christos Exp $");
 #endif
 
 #include 
@@ -65,6 +65,26 @@ mkmap(off_t start, off_t size, int type)
 	return (m);
 }
 
+static const char *maptypes[]  = {
+	"unused",
+	"mbr",
+	"mbr partition",
+	"primary gpt header",
+	"secondary gpt header",
+	"primary gpt table",
+	"secondary gpt table",
+	"gpt partition",
+	"protective mbr",
+};
+
+static const char *
+map_type(int t)
+{
+	if ((size_t)t >= __arraycount(maptypes))
+		return "*unknown*";
+	return maptypes[t];
+}
+
 map_t *
 map_add(off_t start, off_t size, int type, void *data)
 {
@@ -99,17 +119,14 @@ map_add(off_t start, off_t size, int typ
 		return (n);
 	}
 
-	
-	switch (n->map_type) {
-	case MAP_TYPE_MBR_PART:
-	case MAP_TYPE_GPT_PART:
+	if (n->map_type != MAP_TYPE_UNUSED) {
+		if (n->map_type != MAP_TYPE_MBR_PART ||
+		type != MAP_TYPE_GPT_PART) {
+			warnx("bogus map current=%s new=%s",
+			map_type(n->map_type), map_type(type));
+			return (NULL);
+		}
 		n->map_type = MAP_TYPE_UNUSED;
-		break;
-	case MAP_TYPE_UNUSED:
-		break;
-	default:
-		warnx("bogus map %#x", n->map_type);
-		return (NULL);
 	}
 
 	m = mkmap(start, size, type);



CVS commit: othersrc/external/bsd/ibbs/dist

2015-11-28 Thread Alistair G. Crooks
Module Name:othersrc
Committed By:   agc
Date:   Sun Nov 29 01:40:12 UTC 2015

Modified Files:
othersrc/external/bsd/ibbs/dist: ibbs.h

Log Message:
clean up the header file:

+ put c++ compilation guards around the function prototypes

+ use a typedef so that we're less verbose in the header file


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 othersrc/external/bsd/ibbs/dist/ibbs.h

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

Modified files:

Index: othersrc/external/bsd/ibbs/dist/ibbs.h
diff -u othersrc/external/bsd/ibbs/dist/ibbs.h:1.1.1.1 othersrc/external/bsd/ibbs/dist/ibbs.h:1.2
--- othersrc/external/bsd/ibbs/dist/ibbs.h:1.1.1.1	Mon Nov 23 05:56:00 2015
+++ othersrc/external/bsd/ibbs/dist/ibbs.h	Sun Nov 29 01:40:12 2015
@@ -28,14 +28,29 @@
 #include 
 
 struct ibbs_ctx_t;	/* opaque structure */
+typedef struct ibbs_ctx_t	ibbs_ctx_t;
 
-struct ibbs_ctx_t *ibbs_init(void);
-void ibbs_free(struct ibbs_ctx_t */*ctx*/);
+#ifndef __BEGIN_DECLS
+#  if defined(__cplusplus)
+#  define __BEGIN_DECLS   extern "C" {
+#  define __END_DECLS }
+#  else
+#  define __BEGIN_DECLS
+#  define __END_DECLS
+#  endif
+#endif
+
+__BEGIN_DECLS
 
-int ibbs_srandom(struct ibbs_ctx_t */*ctx*/, uint32_t /*seed*/);
+ibbs_ctx_t *ibbs_init(void);
+void ibbs_free(ibbs_ctx_t */*ctx*/);
+
+int ibbs_srandom(ibbs_ctx_t */*ctx*/, uint32_t /*seed*/);
 uint32_t ibbs_get_microseconds(void);
-ssize_t ibbs_rand_bytes(struct ibbs_ctx_t */*ctx*/, void */*buf*/, size_t /*size*/);
-uint32_t ibbs_get32(struct ibbs_ctx_t */*ctx*/);
-uint64_t ibbs_get64(struct ibbs_ctx_t */*ctx*/);
+ssize_t ibbs_rand_bytes(ibbs_ctx_t */*ctx*/, void */*buf*/, size_t /*size*/);
+uint32_t ibbs_get32(ibbs_ctx_t */*ctx*/);
+uint64_t ibbs_get64(ibbs_ctx_t */*ctx*/);
+
+__END_DECLS
 
 #endif