CVS commit: src/share/misc

2017-12-01 Thread Brian Ginsbach
Module Name:src
Committed By:   ginsbach
Date:   Sat Dec  2 01:36:38 UTC 2017

Modified Files:
src/share/misc: acronyms

Log Message:
Fix spelling mistake -- no el -- for previous


To generate a diff of this commit:
cvs rdiff -u -r1.263 -r1.264 src/share/misc/acronyms

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

Modified files:

Index: src/share/misc/acronyms
diff -u src/share/misc/acronyms:1.263 src/share/misc/acronyms:1.264
--- src/share/misc/acronyms:1.263	Fri Dec  1 17:19:01 2017
+++ src/share/misc/acronyms	Sat Dec  2 01:36:38 2017
@@ -1,4 +1,4 @@
-$NetBSD: acronyms,v 1.263 2017/12/01 17:19:01 ginsbach Exp $
+$NetBSD: acronyms,v 1.264 2017/12/02 01:36:38 ginsbach Exp $
 10Q	thank you
 10X	thanks
 1337	elite ("leet")
@@ -123,7 +123,7 @@ DTRT	do the right thing
 DTWT	do the wrong thing
 DWIM	do what I mean
 DYK	do you know?
-EA	eary adopter
+EA	early adopter
 ECR	electronic cash register
 EDS	eternal downward spiral
 EFT	electronic funds transfer



CVS commit: src/sys/arch/sparc

2017-12-01 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Sat Dec  2 00:48:05 UTC 2017

Modified Files:
src/sys/arch/sparc/include: cpu.h
src/sys/arch/sparc/sparc: cpu.c intr.c

Log Message:
- return early in xcall() if the function is sparc_noop() instead of triggering
  the IPI and then ignoring responses ( or lack thereof )
- write the .tag field last to avoid a race when polling for an incoming
  IPI
- add event counters for IPIs being caught with the mutex not held, and for
  messages that are already marked as completed
With this my SS20 made it through 48 hours of pkgsrc with MAKE_JOBS=3 and a
pair of SM81s.
Hypersparcs still crash but instead of craziness we get actual error messages,
apparently one CPU will occasionally do a watchdog reset, which according to
the manual is caused by catching a trap with traps disabled. Now to figure
out how that can even happen...


To generate a diff of this commit:
cvs rdiff -u -r1.98 -r1.99 src/sys/arch/sparc/include/cpu.h
cvs rdiff -u -r1.249 -r1.250 src/sys/arch/sparc/sparc/cpu.c
cvs rdiff -u -r1.118 -r1.119 src/sys/arch/sparc/sparc/intr.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/sparc/include/cpu.h
diff -u src/sys/arch/sparc/include/cpu.h:1.98 src/sys/arch/sparc/include/cpu.h:1.99
--- src/sys/arch/sparc/include/cpu.h:1.98	Fri Jun 16 18:17:42 2017
+++ src/sys/arch/sparc/include/cpu.h	Sat Dec  2 00:48:04 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.98 2017/06/16 18:17:42 jdolecek Exp $ */
+/*	$NetBSD: cpu.h,v 1.99 2017/12/02 00:48:04 macallan Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -164,7 +164,7 @@ struct cpu_info {
 	 * the pending register to avoid a hardware bug.
 	 */
 #define raise_ipi(cpi,lvl)	do {			\
-	int x;		\
+	volatile int x;		\
 	(cpi)->intreg_4m->pi_set = PINTR_SINTRLEV(lvl);	\
 	x = (cpi)->intreg_4m->pi_pend; __USE(x);	\
 } while (0)
@@ -333,6 +333,8 @@ struct cpu_info {
 	struct evcnt ci_savefpstate_null;
 	struct evcnt ci_xpmsg_mutex_fail;
 	struct evcnt ci_xpmsg_mutex_fail_call;
+	struct evcnt ci_xpmsg_mutex_not_held;
+	struct evcnt ci_xpmsg_bogus;
 	struct evcnt ci_intrcnt[16];
 	struct evcnt ci_sintrcnt[16];
 };

Index: src/sys/arch/sparc/sparc/cpu.c
diff -u src/sys/arch/sparc/sparc/cpu.c:1.249 src/sys/arch/sparc/sparc/cpu.c:1.250
--- src/sys/arch/sparc/sparc/cpu.c:1.249	Wed Jan 18 21:33:25 2017
+++ src/sys/arch/sparc/sparc/cpu.c	Sat Dec  2 00:48:05 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.249 2017/01/18 21:33:25 macallan Exp $ */
+/*	$NetBSD: cpu.c,v 1.250 2017/12/02 00:48:05 macallan Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -52,7 +52,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.249 2017/01/18 21:33:25 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.250 2017/12/02 00:48:05 macallan Exp $");
 
 #include "opt_multiprocessor.h"
 #include "opt_lockdebug.h"
@@ -183,7 +183,7 @@ int go_smp_cpus = 0;	/* non-primary CPUs
  * This must be locked around all message transactions to ensure only
  * one CPU is generating them.
  */
-static kmutex_t xpmsg_mutex;
+kmutex_t xpmsg_mutex;
 
 #endif /* MULTIPROCESSOR */
 
@@ -367,6 +367,10 @@ cpu_init_evcnt(struct cpu_info *cpi)
 			 NULL, cpu_name(cpi), "IPI mutex_trylock fail");
 	evcnt_attach_dynamic(>ci_xpmsg_mutex_fail_call, EVCNT_TYPE_MISC,
 			 NULL, cpu_name(cpi), "IPI mutex_trylock fail/call");
+	evcnt_attach_dynamic(>ci_xpmsg_mutex_not_held, EVCNT_TYPE_MISC,
+			 NULL, cpu_name(cpi), "IPI with mutex not held");
+	evcnt_attach_dynamic(>ci_xpmsg_bogus, EVCNT_TYPE_MISC,
+			 NULL, cpu_name(cpi), "bogus IPI");
 
 	/*
 	 * These are the per-cpu per-IPL hard & soft interrupt counters.
@@ -653,6 +657,8 @@ xcall(xcall_func_t func, xcall_trap_t tr
 	char *bufp = errbuf;
 	size_t bufsz = sizeof errbuf, wrsz;
 
+	if (is_noop) return;
+
 	mybit = (1 << cpuinfo.ci_cpuid);
 	callself = func && (cpuset & mybit) != 0;
 	cpuset &= ~mybit;
@@ -714,7 +720,10 @@ xcall(xcall_func_t func, xcall_trap_t tr
 		if ((cpuset & (1 << n)) == 0)
 			continue;
 
-		cpi->msg.tag = XPMSG_FUNC;
+		/*
+		 * Write msg.tag last - if another CPU is polling above it may
+		 * end up seeing an incomplete message. Not likely but still.
+		 */ 
 		cpi->msg.complete = 0;
 		p = >msg.u.xpmsg_func;
 		p->func = func;
@@ -722,6 +731,9 @@ xcall(xcall_func_t func, xcall_trap_t tr
 		p->arg0 = arg0;
 		p->arg1 = arg1;
 		p->arg2 = arg2;
+		__insn_barrier();
+		cpi->msg.tag = XPMSG_FUNC;
+		__insn_barrier();
 		/* Fast cross calls use interrupt level 14 */
 		raise_ipi(cpi,13+fasttrap);/*xcall_cookie->pil*/
 	}
@@ -737,7 +749,7 @@ xcall(xcall_func_t func, xcall_trap_t tr
 	 * have completed (bailing if it takes "too long", being loud about
 	 * this in the process).
 	 */
-	done = is_noop;
+	done = 0;
 	i = 100;	/* time-out, not too long, but still an _AGE_ */
 	while (!done) {
 		if (--i < 0) {
@@ -774,7 +786,7 @@ xcall(xcall_func_t func, xcall_trap_t tr
 
 	

CVS commit: src/external/gpl3/gdb/lib/libgdb/arch

2017-12-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Dec  2 00:00:59 UTC 2017

Modified Files:
src/external/gpl3/gdb/lib/libgdb/arch/alpha: init.c
src/external/gpl3/gdb/lib/libgdb/arch/arm: init.c
src/external/gpl3/gdb/lib/libgdb/arch/armeb: init.c
src/external/gpl3/gdb/lib/libgdb/arch/hppa: defs.mk init.c
src/external/gpl3/gdb/lib/libgdb/arch/i386: init.c
src/external/gpl3/gdb/lib/libgdb/arch/m68000: init.c
src/external/gpl3/gdb/lib/libgdb/arch/m68k: init.c
src/external/gpl3/gdb/lib/libgdb/arch/powerpc: init.c
src/external/gpl3/gdb/lib/libgdb/arch/powerpc64: init.c
src/external/gpl3/gdb/lib/libgdb/arch/sh3eb: init.c
src/external/gpl3/gdb/lib/libgdb/arch/sh3el: init.c
src/external/gpl3/gdb/lib/libgdb/arch/sparc: init.c
src/external/gpl3/gdb/lib/libgdb/arch/sparc64: init.c
src/external/gpl3/gdb/lib/libgdb/arch/vax: init.c
src/external/gpl3/gdb/lib/libgdb/arch/x86_64: init.c

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/gpl3/gdb/lib/libgdb/arch/alpha/init.c
cvs rdiff -u -r1.13 -r1.14 src/external/gpl3/gdb/lib/libgdb/arch/arm/init.c
cvs rdiff -u -r1.12 -r1.13 src/external/gpl3/gdb/lib/libgdb/arch/armeb/init.c
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gdb/lib/libgdb/arch/hppa/defs.mk
cvs rdiff -u -r1.10 -r1.11 src/external/gpl3/gdb/lib/libgdb/arch/hppa/init.c
cvs rdiff -u -r1.10 -r1.11 src/external/gpl3/gdb/lib/libgdb/arch/i386/init.c
cvs rdiff -u -r1.10 -r1.11 \
src/external/gpl3/gdb/lib/libgdb/arch/m68000/init.c
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gdb/lib/libgdb/arch/m68k/init.c
cvs rdiff -u -r1.11 -r1.12 \
src/external/gpl3/gdb/lib/libgdb/arch/powerpc/init.c
cvs rdiff -u -r1.10 -r1.11 \
src/external/gpl3/gdb/lib/libgdb/arch/powerpc64/init.c
cvs rdiff -u -r1.10 -r1.11 src/external/gpl3/gdb/lib/libgdb/arch/sh3eb/init.c
cvs rdiff -u -r1.10 -r1.11 src/external/gpl3/gdb/lib/libgdb/arch/sh3el/init.c
cvs rdiff -u -r1.10 -r1.11 src/external/gpl3/gdb/lib/libgdb/arch/sparc/init.c
cvs rdiff -u -r1.10 -r1.11 \
src/external/gpl3/gdb/lib/libgdb/arch/sparc64/init.c
cvs rdiff -u -r1.12 -r1.13 src/external/gpl3/gdb/lib/libgdb/arch/vax/init.c
cvs rdiff -u -r1.13 -r1.14 \
src/external/gpl3/gdb/lib/libgdb/arch/x86_64/init.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/gpl3/gdb/lib/libgdb/arch/alpha/init.c
diff -u src/external/gpl3/gdb/lib/libgdb/arch/alpha/init.c:1.10 src/external/gpl3/gdb/lib/libgdb/arch/alpha/init.c:1.11
--- src/external/gpl3/gdb/lib/libgdb/arch/alpha/init.c:1.10	Thu Nov 30 10:26:55 2017
+++ src/external/gpl3/gdb/lib/libgdb/arch/alpha/init.c	Fri Dec  1 19:00:57 2017
@@ -15,6 +15,7 @@ extern initialize_file_ftype _initialize
 extern initialize_file_ftype _initialize_ser_tcp;
 extern initialize_file_ftype _initialize_fork_child;
 extern initialize_file_ftype _initialize_alphabsd_nat;
+extern initialize_file_ftype _initialize_nbsd_nat;
 extern initialize_file_ftype _initialize_ax_gdb;
 extern initialize_file_ftype _initialize_ctf;
 extern initialize_file_ftype _initialize_dcache;
@@ -171,6 +172,7 @@ initialize_all_files (void)
   _initialize_ser_tcp ();
   _initialize_fork_child ();
   _initialize_alphabsd_nat ();
+  _initialize_nbsd_nat ();
   _initialize_ax_gdb ();
   _initialize_ctf ();
   _initialize_dcache ();

Index: src/external/gpl3/gdb/lib/libgdb/arch/arm/init.c
diff -u src/external/gpl3/gdb/lib/libgdb/arch/arm/init.c:1.13 src/external/gpl3/gdb/lib/libgdb/arch/arm/init.c:1.14
--- src/external/gpl3/gdb/lib/libgdb/arch/arm/init.c:1.13	Thu Nov 30 10:26:55 2017
+++ src/external/gpl3/gdb/lib/libgdb/arch/arm/init.c	Fri Dec  1 19:00:57 2017
@@ -14,6 +14,7 @@ extern initialize_file_ftype _initialize
 extern initialize_file_ftype _initialize_ser_pipe;
 extern initialize_file_ftype _initialize_ser_tcp;
 extern initialize_file_ftype _initialize_fork_child;
+extern initialize_file_ftype _initialize_nbsd_nat;
 extern initialize_file_ftype _initialize_arm_netbsd_nat;
 extern initialize_file_ftype _initialize_ax_gdb;
 extern initialize_file_ftype _initialize_ctf;
@@ -170,6 +171,7 @@ initialize_all_files (void)
   _initialize_ser_pipe ();
   _initialize_ser_tcp ();
   _initialize_fork_child ();
+  _initialize_nbsd_nat ();
   _initialize_arm_netbsd_nat ();
   _initialize_ax_gdb ();
   _initialize_ctf ();

Index: src/external/gpl3/gdb/lib/libgdb/arch/armeb/init.c
diff -u src/external/gpl3/gdb/lib/libgdb/arch/armeb/init.c:1.12 src/external/gpl3/gdb/lib/libgdb/arch/armeb/init.c:1.13
--- src/external/gpl3/gdb/lib/libgdb/arch/armeb/init.c:1.12	Thu Nov 30 10:26:55 2017
+++ src/external/gpl3/gdb/lib/libgdb/arch/armeb/init.c	Fri Dec  1 19:00:58 2017
@@ -14,6 +14,7 @@ extern initialize_file_ftype _initialize
 extern initialize_file_ftype _initialize_ser_pipe;
 extern initialize_file_ftype _initialize_ser_tcp;
 

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

2017-12-01 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Dec  1 23:14:20 UTC 2017

Modified Files:
src/sys/arch/sparc/include: pte.h

Log Message:
- normalise some tab/space issues.
- fix (debugger-only useful) struct srmmu_pte::pg_pfnum to be the
  right size.
- add SRMMU_TEPTERBO as a PTE type -- supersparc-II only feature
  of mapping pages in reverse-byte-order (eg little endian by
  default, but there's also a global RBO flag, that makes this
  flag big-endian.)  we don't use it (yet?)


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/sparc/include/pte.h

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

Modified files:

Index: src/sys/arch/sparc/include/pte.h
diff -u src/sys/arch/sparc/include/pte.h:1.31 src/sys/arch/sparc/include/pte.h:1.32
--- src/sys/arch/sparc/include/pte.h:1.31	Thu Feb 16 20:17:15 2006
+++ src/sys/arch/sparc/include/pte.h	Fri Dec  1 23:14:20 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pte.h,v 1.31 2006/02/16 20:17:15 perry Exp $ */
+/*	$NetBSD: pte.h,v 1.32 2017/12/01 23:14:20 mrg Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -187,32 +187,32 @@ typedef u_char smeg_t;		/* 8 bits needed
 #error "configuration error"
 #endif
 
-#define	NBPRG	(1 << 24)	/* bytes per region */
-#define	RGSHIFT	24		/* log2(NBPRG) */
-#define	RGOFSET	(NBPRG - 1)	/* mask for region offset */
+#define NBPRG	(1 << 24)	/* bytes per region */
+#define RGSHIFT	24		/* log2(NBPRG) */
+#define RGOFSET	(NBPRG - 1)	/* mask for region offset */
 #define NSEGRG	(NBPRG / NBPSG)	/* segments per region */
 
-#define	NBPSG	(1 << 18)	/* bytes per segment */
-#define	SGSHIFT	18		/* log2(NBPSG) */
-#define	SGOFSET	(NBPSG - 1)	/* mask for segment offset */
+#define NBPSG	(1 << 18)	/* bytes per segment */
+#define SGSHIFT	18		/* log2(NBPSG) */
+#define SGOFSET	(NBPSG - 1)	/* mask for segment offset */
 
 /* number of PTEs that map one segment (not number that fit in one segment!) */
 #if defined(SUN4) && (defined(SUN4C) || defined(SUN4M) || defined(SUN4D))
 extern int nptesg;
-#define	NPTESG	nptesg		/* (which someone will have to initialize) */
+#define NPTESG	nptesg		/* (which someone will have to initialize) */
 #else
-#define	NPTESG	(NBPSG / NBPG)
+#define NPTESG	(NBPSG / NBPG)
 #endif
 
 /* virtual address to virtual region number */
-#define	VA_VREG(va)	(((unsigned int)(va) >> RGSHIFT) & 255)
+#define VA_VREG(va)	(((unsigned int)(va) >> RGSHIFT) & 255)
 
 /* virtual address to virtual segment number */
-#define	VA_VSEG(va)	(((unsigned int)(va) >> SGSHIFT) & 63)
+#define VA_VSEG(va)	(((unsigned int)(va) >> SGSHIFT) & 63)
 
 /* virtual address to virtual page number, for Sun-4 and Sun-4c */
-#define	VA_SUN4_VPG(va)		(((int)(va) >> 13) & 31)
-#define	VA_SUN4C_VPG(va)	(((int)(va) >> 12) & 63)
+#define VA_SUN4_VPG(va)		(((int)(va) >> 13) & 31)
+#define VA_SUN4C_VPG(va)	(((int)(va) >> 12) & 63)
 #define VA_SUN4M_VPG(va)	(((int)(va) >> 12) & 63)
 #define VA_VPG(va)	\
 	(PGSHIFT==SUN4_PGSHIFT ? VA_SUN4_VPG(va) : VA_SUN4C_VPG(va))
@@ -226,16 +226,16 @@ extern int nptesg;
 
 
 /* truncate virtual address to region base */
-#define	VA_ROUNDDOWNTOREG(va)	((int)(va) & ~RGOFSET)
+#define VA_ROUNDDOWNTOREG(va)	((int)(va) & ~RGOFSET)
 
 /* truncate virtual address to segment base */
-#define	VA_ROUNDDOWNTOSEG(va)	((int)(va) & ~SGOFSET)
+#define VA_ROUNDDOWNTOSEG(va)	((int)(va) & ~SGOFSET)
 
 /* virtual segment to virtual address (must sign extend on holy MMUs!) */
-#define	VRTOVA(vr)	((CPU_HAS_SRMMU || HASSUN4_MMU3L)	\
+#define VRTOVA(vr)	((CPU_HAS_SRMMU || HASSUN4_MMU3L)	\
 	? ((int)(vr) << RGSHIFT)\
 	: (((int)(vr) << (RGSHIFT+2)) >> 2))
-#define	VSTOVA(vr,vs)	((CPU_HAS_SRMMU || HASSUN4_MMU3L)	\
+#define VSTOVA(vr,vs)	((CPU_HAS_SRMMU || HASSUN4_MMU3L)	\
 	? (((int)(vr) << RGSHIFT) + ((int)(vs) << SGSHIFT))	\
 	: int)(vr) << (RGSHIFT+2)) >> 2) + ((int)(vs) << SGSHIFT)))
 
@@ -249,38 +249,38 @@ extern int mmu_has_hole;
 #define MMU_HOLE_END	0xe000
 
 /* there is no `struct pte'; we just use `int'; this is for non-4M only */
-#define	PG_V		0x8000
-#define	PG_PROT		0x6000	/* both protection bits */
-#define	PG_W		0x4000	/* allowed to write */
-#define	PG_S		0x2000	/* supervisor only */
-#define	PG_NC		0x1000	/* non-cacheable */
-#define	PG_TYPE		0x0c00	/* both type bits */
-
-#define	PG_OBMEM	0x	/* on board memory */
-#define	PG_OBIO		0x0400	/* on board I/O (incl. Sbus on 4c) */
-#define	PG_VME16	0x0800	/* 16-bit-data VME space */
-#define	PG_VME32	0x0c00	/* 32-bit-data VME space */
+#define PG_V		0x8000
+#define PG_PROT		0x6000	/* both protection bits */
+#define PG_W		0x4000	/* allowed to write */
+#define PG_S		0x2000	/* supervisor only */
+#define PG_NC		0x1000	/* non-cacheable */
+#define PG_TYPE		0x0c00	/* both type bits */
+
+#define PG_OBMEM	0x	/* on board memory */
+#define PG_OBIO		0x0400	/* on board I/O (incl. Sbus on 4c) */
+#define PG_VME16	

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

2017-12-01 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Dec  1 22:57:07 UTC 2017

Modified Files:
src/sys/arch/sparc/sparc: cache.c

Log Message:
note some bits no longer present in SuperSPARC-II.


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/sys/arch/sparc/sparc/cache.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/sparc/sparc/cache.c
diff -u src/sys/arch/sparc/sparc/cache.c:1.97 src/sys/arch/sparc/sparc/cache.c:1.98
--- src/sys/arch/sparc/sparc/cache.c:1.97	Sun Mar  4 09:03:34 2007
+++ src/sys/arch/sparc/sparc/cache.c	Fri Dec  1 22:57:07 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: cache.c,v 1.97 2007/03/04 09:03:34 macallan Exp $ */
+/*	$NetBSD: cache.c,v 1.98 2017/12/01 22:57:07 mrg Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -59,7 +59,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cache.c,v 1.97 2007/03/04 09:03:34 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cache.c,v 1.98 2017/12/01 22:57:07 mrg Exp $");
 
 #include "opt_multiprocessor.h"
 #include "opt_sparc_arch.h"
@@ -973,8 +973,8 @@ viking_pcache_flush_page(paddr_t pa, int
 		 * +---+-+---+-+---+-+---++
 		 *
 		 * PA: bits 12-35 of the physical address
-		 * S:  line shared bit
-		 * D:  line dirty bit
+		 * S:  line shared bit (not present on SuperSPARC-II)
+		 * D:  line dirty bit (not present on SuperSPARC-II)
 		 * V:  line valid bit
 		 */
 



CVS commit: src/share/mk

2017-12-01 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Dec  1 22:48:00 UTC 2017

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
allow EXTERNAL_GCC_SUBDIR to be overriden.


To generate a diff of this commit:
cvs rdiff -u -r1.1024 -r1.1025 src/share/mk/bsd.own.mk

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

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.1024 src/share/mk/bsd.own.mk:1.1025
--- src/share/mk/bsd.own.mk:1.1024	Wed Nov 29 22:40:45 2017
+++ src/share/mk/bsd.own.mk	Fri Dec  1 22:48:00 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1024 2017/11/29 22:40:45 christos Exp $
+#	$NetBSD: bsd.own.mk,v 1.1025 2017/12/01 22:48:00 mrg Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -81,9 +81,9 @@ MKGCCCMDS?=	no
 # set to the relevant subdirectory in src/external/gpl3 for his HAVE_GCC.
 #
 .if ${HAVE_GCC} == 53
-EXTERNAL_GCC_SUBDIR=	gcc.old
+EXTERNAL_GCC_SUBDIR?=	gcc.old
 .else
-EXTERNAL_GCC_SUBDIR=	/does/not/exist
+EXTERNAL_GCC_SUBDIR=?	/does/not/exist
 .endif
 .else
 MKGCCCMDS?=	no



CVS commit: src/lib/libc/stdlib

2017-12-01 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Dec  1 22:47:06 UTC 2017

Modified Files:
src/lib/libc/stdlib: jemalloc.c

Log Message:
normalise some indentation.  NFC.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/lib/libc/stdlib/jemalloc.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/stdlib/jemalloc.c
diff -u src/lib/libc/stdlib/jemalloc.c:1.43 src/lib/libc/stdlib/jemalloc.c:1.44
--- src/lib/libc/stdlib/jemalloc.c:1.43	Thu Nov 16 13:54:00 2017
+++ src/lib/libc/stdlib/jemalloc.c	Fri Dec  1 22:47:06 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: jemalloc.c,v 1.43 2017/11/16 13:54:00 skrll Exp $	*/
+/*	$NetBSD: jemalloc.c,v 1.44 2017/12/01 22:47:06 mrg Exp $	*/
 
 /*-
  * Copyright (C) 2006,2007 Jason Evans .
@@ -118,7 +118,7 @@
 
 #include 
 /* __FBSDID("$FreeBSD: src/lib/libc/stdlib/malloc.c,v 1.147 2007/06/15 22:00:16 jasone Exp $"); */ 
-__RCSID("$NetBSD: jemalloc.c,v 1.43 2017/11/16 13:54:00 skrll Exp $");
+__RCSID("$NetBSD: jemalloc.c,v 1.44 2017/12/01 22:47:06 mrg Exp $");
 
 #ifdef __FreeBSD__
 #include "libc_private.h"
@@ -276,19 +276,19 @@ __RCSID("$NetBSD: jemalloc.c,v 1.43 2017
 #  define USE_BRK
 #endif
 #if defined(__mips__) || defined(__riscv__)
-# ifdef _LP64
-#  define SIZEOF_PTR_2POW	3
-#  define TINY_MIN_2POW		3
-# else
-#  define SIZEOF_PTR_2POW	2
-# endif
-# define QUANTUM_2POW_MIN	4
-# define USE_BRK
+#  ifdef _LP64
+#define SIZEOF_PTR_2POW	3
+#define TINY_MIN_2POW	3
+#  else
+#define SIZEOF_PTR_2POW	2
+#  endif
+#  define QUANTUM_2POW_MIN	4
+#  define USE_BRK
 #endif
 #ifdef __hppa__ 
-#  define QUANTUM_2POW_MIN 4
-#  define TINY_MIN_2POW4
-#  define SIZEOF_PTR_2POW  2
+#  define QUANTUM_2POW_MIN	4
+#  define TINY_MIN_2POW		4
+#  define SIZEOF_PTR_2POW	2
 #  define USE_BRK   
 #endif   
 



CVS commit: src/external/gpl3/gdb/dist/gdb

2017-12-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Dec  1 22:22:40 UTC 2017

Modified Files:
src/external/gpl3/gdb/dist/gdb: nbsd-nat.c

Log Message:
don't suspend other threads if we are resuming.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gdb/dist/gdb/nbsd-nat.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/gpl3/gdb/dist/gdb/nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.3 src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.4
--- src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.3	Fri Dec  1 17:20:44 2017
+++ src/external/gpl3/gdb/dist/gdb/nbsd-nat.c	Fri Dec  1 17:22:40 2017
@@ -556,7 +556,12 @@ nbsd_resume (struct target_ops *ops,
 			ptid_get_tid (ptid));
   if (ptid_lwp_p (ptid))
 {
-  /* If ptid is a specific LWP, suspend all other LWPs in the process.  */
+  /* FreeBSD: If ptid is a specific LWP, suspend all other LWPs in the
+   * process.
+   */
+  /* NetBSD, this function is about resuming so we only deal with
+   * the thread we've been asked to work with
+   */
   struct thread_info *tp;
   int request;
 
@@ -567,8 +572,10 @@ nbsd_resume (struct target_ops *ops,
 
 	  if (ptid_get_lwp (tp->ptid) == ptid_get_lwp (ptid))
 	request = PT_RESUME;
+#ifndef __NetBSD__
 	  else
 	request = PT_SUSPEND;
+#endif
 
 	  if (ptrace (request, ptid_get_pid (tp->ptid), NULL,
 	  ptid_get_lwp (tp->ptid)) == -1)



CVS commit: src/external/gpl3/gdb/dist/gdb

2017-12-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Dec  1 22:20:44 UTC 2017

Modified Files:
src/external/gpl3/gdb/dist/gdb: nbsd-nat.c

Log Message:
Remove more FreeBSD code that we don't need and change some FreeBSD -> NetBSD


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/dist/gdb/nbsd-nat.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/gpl3/gdb/dist/gdb/nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.2 src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.3
--- src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.2	Thu Nov 30 10:26:54 2017
+++ src/external/gpl3/gdb/dist/gdb/nbsd-nat.c	Fri Dec  1 17:20:44 2017
@@ -368,48 +368,6 @@ nbsd_enable_proc_events (pid_t pid)
 static void
 nbsd_add_threads (pid_t pid)
 {
-#ifdef PT_GETNUMLWPS
-  struct cleanup *cleanup;
-  lwpid_t *lwps;
-  int i, nlwps;
-
-  gdb_assert (!in_thread_list (pid_to_ptid (pid)));
-  nlwps = ptrace (PT_GETNUMLWPS, pid, NULL, 0);
-  if (nlwps == -1)
-perror_with_name (("ptrace"));
-
-  lwps = XCNEWVEC (lwpid_t, nlwps);
-  cleanup = make_cleanup (xfree, lwps);
-
-  nlwps = ptrace (PT_GETLWPLIST, pid, (caddr_t) lwps, nlwps);
-  if (nlwps == -1)
-perror_with_name (("ptrace"));
-
-  for (i = 0; i < nlwps; i++)
-{
-  ptid_t ptid = ptid_build (pid, lwps[i], 0);
-
-  if (!in_thread_list (ptid))
-	{
-#ifdef PT_LWP_EVENTS
-	  struct ptrace_lwpinfo pl;
-
-	  /* Don't add exited threads.  Note that this is only called
-	 when attaching to a multi-threaded process.  */
-	  if (ptrace (PT_LWPINFO, lwps[i], (caddr_t) , sizeof pl) == -1)
-	perror_with_name (("ptrace"));
-	  if (pl.pl_flags & PL_FLAG_EXITED)
-	continue;
-#endif
-	  if (debug_nbsd_lwp)
-	fprintf_unfiltered (gdb_stdlog,
-"FLWP: adding thread for LWP %u\n",
-lwps[i]);
-	  add_thread (ptid);
-	}
-}
-  do_cleanups (cleanup);
-#else
   int val;
   struct ptrace_lwpinfo pl;
 
@@ -422,7 +380,6 @@ nbsd_add_threads (pid_t pid)
   if (!in_thread_list (ptid))
 	add_thread (ptid);
 }
-#endif
 }
 
 /* Implement the "to_update_thread_list" target_ops method.  */
@@ -594,7 +551,7 @@ nbsd_resume (struct target_ops *ops,
 
   if (debug_nbsd_lwp)
 fprintf_unfiltered (gdb_stdlog,
-			"FLWP: nbsd_resume for ptid (%d, %ld, %ld)\n",
+			"NLWP: nbsd_resume for ptid (%d, %ld, %ld)\n",
 			ptid_get_pid (ptid), ptid_get_lwp (ptid),
 			ptid_get_tid (ptid));
   if (ptid_lwp_p (ptid))
@@ -684,7 +641,7 @@ nbsd_wait (struct target_ops *ops,
 		{
 		  if (debug_nbsd_lwp)
 		fprintf_unfiltered (gdb_stdlog,
-	"FLWP: deleting thread for LWP %u\n",
+	"NLWP: deleting thread for LWP %u\n",
 	pl.pl_lwpid);
 		  if (print_thread_events)
 		printf_unfiltered (_("[%s exited]\n"), target_pid_to_str
@@ -707,7 +664,7 @@ nbsd_wait (struct target_ops *ops,
 	{
 	  if (debug_nbsd_lwp)
 		fprintf_unfiltered (gdb_stdlog,
-"FLWP: using LWP %u for first thread\n",
+"NLWP: using LWP %u for first thread\n",
 pl.pl_lwpid);
 	  thread_change_ptid (pid_to_ptid (pid), wptid);
 	}
@@ -723,7 +680,7 @@ nbsd_wait (struct target_ops *ops,
 		{
 		  if (debug_nbsd_lwp)
 		fprintf_unfiltered (gdb_stdlog,
-	"FLWP: adding thread for LWP %u\n",
+	"NLWP: adding thread for LWP %u\n",
 	pl.pl_lwpid);
 		  add_thread (wptid);
 		}
@@ -1023,8 +980,8 @@ _initialize_nbsd_nat (void)
 #ifdef PT_LWPINFO
   add_setshow_boolean_cmd ("nbsd-lwp", class_maintenance,
 			   _nbsd_lwp, _("\
-Set debugging of FreeBSD lwp module."), _("\
-Show debugging of FreeBSD lwp module."), _("\
+Set debugging of NetBSD lwp module."), _("\
+Show debugging of NetBSD lwp module."), _("\
 Enables printf debugging output."),
 			   NULL,
 			   _nbsd_lwp_debug,



CVS commit: src/external/gpl3/gdb/dist/gdb

2017-12-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Dec  1 22:19:59 UTC 2017

Modified Files:
src/external/gpl3/gdb/dist/gdb: inf-ptrace.c

Log Message:
Back to stepping everyone.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/external/gpl3/gdb/dist/gdb/inf-ptrace.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/gpl3/gdb/dist/gdb/inf-ptrace.c
diff -u src/external/gpl3/gdb/dist/gdb/inf-ptrace.c:1.16 src/external/gpl3/gdb/dist/gdb/inf-ptrace.c:1.17
--- src/external/gpl3/gdb/dist/gdb/inf-ptrace.c:1.16	Tue Nov 28 17:04:52 2017
+++ src/external/gpl3/gdb/dist/gdb/inf-ptrace.c	Fri Dec  1 17:19:59 2017
@@ -353,7 +353,7 @@ inf_ptrace_resume (struct target_ops *op
  all possible successor instructions), so we don't have to
  worry about that here.  */
   request = PT_STEP;
-#ifdef __NetBSD__
+#if 0
   /*
* On NetBSD the data field of PT_STEP contains the thread
* to be stepped; all other threads are continued if this value is > 0



CVS commit: src/external/gpl3/gdb/dist/gdb

2017-12-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Dec  1 22:15:17 UTC 2017

Modified Files:
src/external/gpl3/gdb/dist/gdb: x86-bsd-nat.c

Log Message:
get the debugging registers for the specific thread.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/dist/gdb/x86-bsd-nat.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/gpl3/gdb/dist/gdb/x86-bsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/x86-bsd-nat.c:1.2 src/external/gpl3/gdb/dist/gdb/x86-bsd-nat.c:1.3
--- src/external/gpl3/gdb/dist/gdb/x86-bsd-nat.c:1.2	Tue Nov 28 17:04:53 2017
+++ src/external/gpl3/gdb/dist/gdb/x86-bsd-nat.c	Fri Dec  1 17:15:17 2017
@@ -82,7 +82,7 @@ x86bsd_dr_set (int regnum, unsigned long
   struct dbreg dbregs;
 
   if (ptrace (PT_GETDBREGS, get_ptrace_pid (inferior_ptid),
-  (PTRACE_TYPE_ARG3) , 0) == -1)
+  (PTRACE_TYPE_ARG3) , ptid_get_lwp (inferior_ptid)) == -1)
 perror_with_name (_("Couldn't get debug registers"));
 
   /* For some mysterious reason, some of the reserved bits in the
@@ -96,7 +96,7 @@ x86bsd_dr_set (int regnum, unsigned long
 if (thread->inf == current_inferior ())
   {
 	if (ptrace (PT_SETDBREGS, get_ptrace_pid (thread->ptid),
-		(PTRACE_TYPE_ARG3) , 0) == -1)
+		(PTRACE_TYPE_ARG3) , ptid_get_lwp (inferior_ptid)) == -1)
 	  perror_with_name (_("Couldn't write debug registers"));
   }
 }



CVS commit: src/sys/compat

2017-12-01 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Dec  1 22:14:52 UTC 2017

Modified Files:
src/sys/compat/linux/common: linux_mod.c
src/sys/compat/linux32/common: linux32_mod.c

Log Message:
Unbreak Linux emulation by default. While not loading it automatically
is somewhat sensible, breaking functionality of GENERIC is not and has
been objected to on a regular base.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/compat/linux/common/linux_mod.c
cvs rdiff -u -r1.8 -r1.9 src/sys/compat/linux32/common/linux32_mod.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/linux/common/linux_mod.c
diff -u src/sys/compat/linux/common/linux_mod.c:1.7 src/sys/compat/linux/common/linux_mod.c:1.8
--- src/sys/compat/linux/common/linux_mod.c:1.7	Fri Sep 29 17:08:00 2017
+++ src/sys/compat/linux/common/linux_mod.c	Fri Dec  1 22:14:52 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_mod.c,v 1.7 2017/09/29 17:08:00 maxv Exp $	*/
+/*	$NetBSD: linux_mod.c,v 1.8 2017/12/01 22:14:52 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_mod.c,v 1.7 2017/09/29 17:08:00 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_mod.c,v 1.8 2017/12/01 22:14:52 joerg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_execfmt.h"
@@ -119,7 +119,7 @@ static struct execsw linux_execsw[] = {
 #endif
 };
 
-int linux_enabled = 0;
+int linux_enabled = 1;
 
 int
 linux_sysctl_enable(SYSCTLFN_ARGS)

Index: src/sys/compat/linux32/common/linux32_mod.c
diff -u src/sys/compat/linux32/common/linux32_mod.c:1.8 src/sys/compat/linux32/common/linux32_mod.c:1.9
--- src/sys/compat/linux32/common/linux32_mod.c:1.8	Fri Sep 29 17:47:29 2017
+++ src/sys/compat/linux32/common/linux32_mod.c	Fri Dec  1 22:14:52 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux32_mod.c,v 1.8 2017/09/29 17:47:29 maxv Exp $	*/
+/*	$NetBSD: linux32_mod.c,v 1.9 2017/12/01 22:14:52 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux32_mod.c,v 1.8 2017/09/29 17:47:29 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux32_mod.c,v 1.9 2017/12/01 22:14:52 joerg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_execfmt.h"
@@ -78,7 +78,7 @@ static struct execsw linux32_execsw[] = 
 #endif
 };
 
-int linux32_enabled = 0;
+int linux32_enabled = 1;
 
 int
 linux32_sysctl_enable(SYSCTLFN_ARGS)



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

2017-12-01 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Dec  1 21:22:45 UTC 2017

Modified Files:
src/sys/arch/amd64/amd64: machdep.c process_machdep.c

Log Message:
Don't even bother with the trap frame, and force the default values.


To generate a diff of this commit:
cvs rdiff -u -r1.278 -r1.279 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/amd64/amd64/process_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/amd64/amd64/machdep.c
diff -u src/sys/arch/amd64/amd64/machdep.c:1.278 src/sys/arch/amd64/amd64/machdep.c:1.279
--- src/sys/arch/amd64/amd64/machdep.c:1.278	Mon Nov 27 09:18:01 2017
+++ src/sys/arch/amd64/amd64/machdep.c	Fri Dec  1 21:22:45 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.278 2017/11/27 09:18:01 maxv Exp $	*/
+/*	$NetBSD: machdep.c,v 1.279 2017/12/01 21:22:45 maxv Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008, 2011
@@ -110,7 +110,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.278 2017/11/27 09:18:01 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.279 2017/12/01 21:22:45 maxv Exp $");
 
 /* #define XENDEBUG_LOW  */
 
@@ -1892,17 +1892,17 @@ cpu_getmcontext(struct lwp *l, mcontext_
 	mcp->__gregs[_REG_RBP] = tf->tf_rbp;
 	mcp->__gregs[_REG_RBX] = tf->tf_rbx;
 	mcp->__gregs[_REG_RAX] = tf->tf_rax;
-	mcp->__gregs[_REG_GS]  = tf->tf_gs & 0x;
-	mcp->__gregs[_REG_FS]  = tf->tf_fs & 0x;
-	mcp->__gregs[_REG_ES]  = tf->tf_es & 0x;
-	mcp->__gregs[_REG_DS]  = tf->tf_ds & 0x;
+	mcp->__gregs[_REG_GS]  = 0;
+	mcp->__gregs[_REG_FS]  = 0;
+	mcp->__gregs[_REG_ES]  = GSEL(GUDATA_SEL, SEL_UPL);
+	mcp->__gregs[_REG_DS]  = GSEL(GUDATA_SEL, SEL_UPL);
 	mcp->__gregs[_REG_TRAPNO] = tf->tf_trapno;
 	mcp->__gregs[_REG_ERR] = tf->tf_err;
 	mcp->__gregs[_REG_RIP] = tf->tf_rip;
-	mcp->__gregs[_REG_CS]  = tf->tf_cs & 0x;
+	mcp->__gregs[_REG_CS]  = LSEL(LUCODE_SEL, SEL_UPL);
 	mcp->__gregs[_REG_RFLAGS] = tf->tf_rflags;
 	mcp->__gregs[_REG_RSP] = tf->tf_rsp;
-	mcp->__gregs[_REG_SS]  = tf->tf_ss & 0x;
+	mcp->__gregs[_REG_SS]  = LSEL(LUDATA_SEL, SEL_UPL);
 
 	if ((ras_rip = (__greg_t)ras_lookup(l->l_proc,
 	(void *) mcp->__gregs[_REG_RIP])) != -1)
@@ -1949,18 +1949,18 @@ cpu_setmcontext(struct lwp *l, const mco
 		tf->tf_rbp  = gr[_REG_RBP];
 		tf->tf_rbx  = gr[_REG_RBX];
 		tf->tf_rax  = gr[_REG_RAX];
-		tf->tf_gs   = gr[_REG_GS] & 0x;
-		tf->tf_fs   = gr[_REG_FS] & 0x;
-		tf->tf_es   = gr[_REG_ES] & 0x;
-		tf->tf_ds   = gr[_REG_DS] & 0x;
+		tf->tf_gs   = 0;
+		tf->tf_fs   = 0;
+		tf->tf_es   = GSEL(GUDATA_SEL, SEL_UPL);
+		tf->tf_ds   = GSEL(GUDATA_SEL, SEL_UPL);
 		/* trapno, err not touched */
 		tf->tf_rip  = gr[_REG_RIP];
-		tf->tf_cs   = gr[_REG_CS] & 0x;
+		tf->tf_cs   = LSEL(LUCODE_SEL, SEL_UPL);
 		rflags = tf->tf_rflags;
 		rflags &= ~PSL_USER;
 		tf->tf_rflags = rflags | (gr[_REG_RFLAGS] & PSL_USER);
 		tf->tf_rsp  = gr[_REG_RSP];
-		tf->tf_ss   = gr[_REG_SS] & 0x;
+		tf->tf_ss   = LSEL(LUDATA_SEL, SEL_UPL);
 
 #ifdef XEN
 		/*

Index: src/sys/arch/amd64/amd64/process_machdep.c
diff -u src/sys/arch/amd64/amd64/process_machdep.c:1.37 src/sys/arch/amd64/amd64/process_machdep.c:1.38
--- src/sys/arch/amd64/amd64/process_machdep.c:1.37	Mon Nov 27 09:18:01 2017
+++ src/sys/arch/amd64/amd64/process_machdep.c	Fri Dec  1 21:22:45 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: process_machdep.c,v 1.37 2017/11/27 09:18:01 maxv Exp $	*/
+/*	$NetBSD: process_machdep.c,v 1.38 2017/12/01 21:22:45 maxv Exp $	*/
 
 /*
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -74,7 +74,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.37 2017/11/27 09:18:01 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.38 2017/12/01 21:22:45 maxv Exp $");
 
 #include "opt_xen.h"
 #include 
@@ -125,17 +125,17 @@ process_read_regs(struct lwp *l, struct 
 	regs->regs[_REG_RBP] = tf->tf_rbp;
 	regs->regs[_REG_RBX] = tf->tf_rbx;
 	regs->regs[_REG_RAX] = tf->tf_rax;
-	regs->regs[_REG_GS]  = tf->tf_gs & 0x;
-	regs->regs[_REG_FS]  = tf->tf_fs & 0x;
-	regs->regs[_REG_ES]  = tf->tf_es & 0x;
-	regs->regs[_REG_DS]  = tf->tf_ds & 0x;
+	regs->regs[_REG_GS]  = 0;
+	regs->regs[_REG_FS]  = 0;
+	regs->regs[_REG_ES]  = GSEL(GUDATA_SEL, SEL_UPL);
+	regs->regs[_REG_DS]  = GSEL(GUDATA_SEL, SEL_UPL);
 	regs->regs[_REG_TRAPNO] = tf->tf_trapno;
 	regs->regs[_REG_ERR] = tf->tf_err;
 	regs->regs[_REG_RIP] = tf->tf_rip;
-	regs->regs[_REG_CS]  = tf->tf_cs & 0x;
+	regs->regs[_REG_CS]  = LSEL(LUCODE_SEL, SEL_UPL);
 	regs->regs[_REG_RFLAGS] = tf->tf_rflags;
 	regs->regs[_REG_RSP] = tf->tf_rsp;
-	regs->regs[_REG_SS]  = tf->tf_ss & 0x;
+	regs->regs[_REG_SS]  = LSEL(LUDATA_SEL, SEL_UPL);
 
 	return 0;
 }
@@ -204,16 +204,16 @@ process_write_regs(struct lwp *l, const 
 	tf->tf_rbp  = regs[_REG_RBP];
 	tf->tf_rbx  = regs[_REG_RBX];
 	tf->tf_rax  = regs[_REG_RAX];
-	

CVS commit: src/external/bsd/nvi/dist/ex

2017-12-01 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Dec  1 20:01:31 UTC 2017

Modified Files:
src/external/bsd/nvi/dist/ex: ex_usage.c

Log Message:
Compare ap->len wide chars, not ap->len bytes.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/nvi/dist/ex/ex_usage.c

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

Modified files:

Index: src/external/bsd/nvi/dist/ex/ex_usage.c
diff -u src/external/bsd/nvi/dist/ex/ex_usage.c:1.3 src/external/bsd/nvi/dist/ex/ex_usage.c:1.4
--- src/external/bsd/nvi/dist/ex/ex_usage.c:1.3	Sun Jan 26 21:43:45 2014
+++ src/external/bsd/nvi/dist/ex/ex_usage.c	Fri Dec  1 20:01:31 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ex_usage.c,v 1.3 2014/01/26 21:43:45 christos Exp $ */
+/*	$NetBSD: ex_usage.c,v 1.4 2017/12/01 20:01:31 rin Exp $ */
 /*-
  * Copyright (c) 1992, 1993, 1994
  *	The Regents of the University of California.  All rights reserved.
@@ -16,7 +16,7 @@
 static const char sccsid[] = "Id: ex_usage.c,v 10.15 2001/06/25 15:19:21 skimo Exp  (Berkeley) Date: 2001/06/25 15:19:21 ";
 #endif /* not lint */
 #else
-__RCSID("$NetBSD: ex_usage.c,v 1.3 2014/01/26 21:43:45 christos Exp $");
+__RCSID("$NetBSD: ex_usage.c,v 1.4 2017/12/01 20:01:31 rin Exp $");
 #endif
 
 #include 
@@ -78,7 +78,7 @@ ex_usage(SCR *sp, EXCMD *cmdp)
 		} else
 			newscreen = 0;
 		for (cp = cmds; cp->name != NULL &&
-		memcmp(ap->bp, cp->name, ap->len); ++cp);
+		MEMCMP(ap->bp, cp->name, ap->len); ++cp);
 		if (cp->name == NULL ||
 		(newscreen && !F_ISSET(cp, E_NEWSCREEN))) {
 			const char *nstr;



CVS commit: src/sys/kern

2017-12-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Dec  1 19:05:49 UTC 2017

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

Log Message:
Allow attaching for write, but return no events.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/kern/subr_cprng.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_cprng.c
diff -u src/sys/kern/subr_cprng.c:1.28 src/sys/kern/subr_cprng.c:1.29
--- src/sys/kern/subr_cprng.c:1.28	Wed Oct 25 04:12:39 2017
+++ src/sys/kern/subr_cprng.c	Fri Dec  1 14:05:49 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_cprng.c,v 1.28 2017/10/25 08:12:39 maya Exp $ */
+/*	$NetBSD: subr_cprng.c,v 1.29 2017/12/01 19:05:49 christos Exp $ */
 
 /*-
  * Copyright (c) 2011-2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_cprng.c,v 1.28 2017/10/25 08:12:39 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_cprng.c,v 1.29 2017/12/01 19:05:49 christos Exp $");
 
 #include 
 #include 
@@ -253,35 +253,6 @@ out:	mutex_exit(>cs_lock);
 	return result;
 }
 
-static void	filt_cprng_detach(struct knote *);
-static int	filt_cprng_event(struct knote *, long);
-
-static const struct filterops cprng_filtops = {
-	.f_isfd = 1,
-	.f_attach = NULL,
-	.f_detach = filt_cprng_detach,
-	.f_event = filt_cprng_event,
-};
-
-int
-cprng_strong_kqfilter(struct cprng_strong *cprng, struct knote *kn)
-{
-
-	switch (kn->kn_filter) {
-	case EVFILT_READ:
-		kn->kn_fop = _filtops;
-		kn->kn_hook = cprng;
-		mutex_enter(>cs_lock);
-		SLIST_INSERT_HEAD(>cs_selq.sel_klist, kn, kn_selnext);
-		mutex_exit(>cs_lock);
-		return 0;
-
-	case EVFILT_WRITE:
-	default:
-		return EINVAL;
-	}
-}
-
 static void
 filt_cprng_detach(struct knote *kn)
 {
@@ -293,7 +264,7 @@ filt_cprng_detach(struct knote *kn)
 }
 
 static int
-filt_cprng_event(struct knote *kn, long hint)
+filt_cprng_read_event(struct knote *kn, long hint)
 {
 	struct cprng_strong *const cprng = kn->kn_hook;
 	int ret;
@@ -316,6 +287,62 @@ filt_cprng_event(struct knote *kn, long 
 	return ret;
 }
 
+static int
+filt_cprng_write_event(struct knote *kn, long hint)
+{
+	struct cprng_strong *const cprng = kn->kn_hook;
+
+	if (hint == NOTE_SUBMIT)
+		KASSERT(mutex_owned(>cs_lock));
+	else
+		mutex_enter(>cs_lock);
+
+	kn->kn_data = 0;
+
+	if (hint == NOTE_SUBMIT)
+		KASSERT(mutex_owned(>cs_lock));
+	else
+		mutex_exit(>cs_lock);
+
+	return 0;
+}
+
+static const struct filterops cprng_read_filtops = {
+	.f_isfd = 1,
+	.f_attach = NULL,
+	.f_detach = filt_cprng_detach,
+	.f_event = filt_cprng_read_event,
+};
+
+static const struct filterops cprng_write_filtops = {
+	.f_isfd = 1,
+	.f_attach = NULL,
+	.f_detach = filt_cprng_detach,
+	.f_event = filt_cprng_write_event,
+};
+
+int
+cprng_strong_kqfilter(struct cprng_strong *cprng, struct knote *kn)
+{
+
+	switch (kn->kn_filter) {
+	case EVFILT_READ:
+		kn->kn_fop = _read_filtops;
+		break;
+	case EVFILT_WRITE:
+		kn->kn_fop = _write_filtops;
+		break;
+	default:
+		return EINVAL;
+	}
+
+	kn->kn_hook = cprng;
+	mutex_enter(>cs_lock);
+	SLIST_INSERT_HEAD(>cs_selq.sel_klist, kn, kn_selnext);
+	mutex_exit(>cs_lock);
+	return 0;
+}
+
 int
 cprng_strong_poll(struct cprng_strong *cprng, int events)
 {



CVS commit: src/sys/sys

2017-12-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Dec  1 19:04:19 UTC 2017

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

Log Message:
belated bump for fileops struct size change.


To generate a diff of this commit:
cvs rdiff -u -r1.552 -r1.553 src/sys/sys/param.h

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

Modified files:

Index: src/sys/sys/param.h
diff -u src/sys/sys/param.h:1.552 src/sys/sys/param.h:1.553
--- src/sys/sys/param.h:1.552	Thu Nov 16 05:40:29 2017
+++ src/sys/sys/param.h	Fri Dec  1 14:04:19 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.552 2017/11/16 10:40:29 ozaki-r Exp $	*/
+/*	$NetBSD: param.h,v 1.553 2017/12/01 19:04:19 christos Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -67,7 +67,7 @@
  *	2.99.9		(299000900)
  */
 
-#define	__NetBSD_Version__	899000700	/* NetBSD 8.99.7 */
+#define	__NetBSD_Version__	899000800	/* NetBSD 8.99.8 */
 
 #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \
 (m) * 100) + (p) * 100) <= __NetBSD_Version__)



CVS commit: src/sys/miscfs/procfs

2017-12-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Dec  1 19:01:34 UTC 2017

Modified Files:
src/sys/miscfs/procfs: procfs_vnops.c

Log Message:
Allow procfs_kqfilter, since we allow poll. "go" does it.


To generate a diff of this commit:
cvs rdiff -u -r1.200 -r1.201 src/sys/miscfs/procfs/procfs_vnops.c

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

Modified files:

Index: src/sys/miscfs/procfs/procfs_vnops.c
diff -u src/sys/miscfs/procfs/procfs_vnops.c:1.200 src/sys/miscfs/procfs/procfs_vnops.c:1.201
--- src/sys/miscfs/procfs/procfs_vnops.c:1.200	Tue Nov  7 19:51:47 2017
+++ src/sys/miscfs/procfs/procfs_vnops.c	Fri Dec  1 14:01:34 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: procfs_vnops.c,v 1.200 2017/11/08 00:51:47 christos Exp $	*/
+/*	$NetBSD: procfs_vnops.c,v 1.201 2017/12/01 19:01:34 christos Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -105,7 +105,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: procfs_vnops.c,v 1.200 2017/11/08 00:51:47 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_vnops.c,v 1.201 2017/12/01 19:01:34 christos Exp $");
 
 #include 
 #include 
@@ -217,7 +217,8 @@ int	procfs_setattr(void *);
 #define	procfs_fcntl	genfs_fcntl
 #define	procfs_ioctl	genfs_enoioctl
 #define	procfs_poll	genfs_poll
-#define procfs_revoke	genfs_revoke
+#define	procfs_kqfilter	genfs_kqfilter
+#define	procfs_revoke	genfs_revoke
 #define	procfs_fsync	genfs_nullop
 #define	procfs_seek	genfs_nullop
 #define	procfs_remove	genfs_eopnotsupp
@@ -265,6 +266,7 @@ const struct vnodeopv_entry_desc procfs_
 	{ _fcntl_desc, procfs_fcntl },		/* fcntl */
 	{ _ioctl_desc, procfs_ioctl },		/* ioctl */
 	{ _poll_desc, procfs_poll },		/* poll */
+	{ _kqfilter_desc, procfs_kqfilter },	/* kqfilter */
 	{ _revoke_desc, procfs_revoke },		/* revoke */
 	{ _fsync_desc, procfs_fsync },		/* fsync */
 	{ _seek_desc, procfs_seek },		/* seek */



CVS commit: src/external/bsd/nvi/dist/ex

2017-12-01 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Dec  1 18:39:49 UTC 2017

Modified Files:
src/external/bsd/nvi/dist/ex: ex_print.c

Log Message:
Check format strings for ex_printf.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/nvi/dist/ex/ex_print.c

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

Modified files:

Index: src/external/bsd/nvi/dist/ex/ex_print.c
diff -u src/external/bsd/nvi/dist/ex/ex_print.c:1.5 src/external/bsd/nvi/dist/ex/ex_print.c:1.6
--- src/external/bsd/nvi/dist/ex/ex_print.c:1.5	Sun Nov 12 15:27:53 2017
+++ src/external/bsd/nvi/dist/ex/ex_print.c	Fri Dec  1 18:39:49 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ex_print.c,v 1.5 2017/11/12 15:27:53 rin Exp $ */
+/*	$NetBSD: ex_print.c,v 1.6 2017/12/01 18:39:49 rin Exp $ */
 /*-
  * Copyright (c) 1992, 1993, 1994
  *	The Regents of the University of California.  All rights reserved.
@@ -16,7 +16,7 @@
 static const char sccsid[] = "Id: ex_print.c,v 10.24 2001/07/29 19:07:29 skimo Exp  (Berkeley) Date: 2001/07/29 19:07:29 ";
 #endif /* not lint */
 #else
-__RCSID("$NetBSD: ex_print.c,v 1.5 2017/11/12 15:27:53 rin Exp $");
+__RCSID("$NetBSD: ex_print.c,v 1.6 2017/12/01 18:39:49 rin Exp $");
 #endif
 
 #include 
@@ -264,7 +264,7 @@ intr:	*colp = col;
  * ex_printf --
  *	Ex's version of printf.
  *
- * PUBLIC: int ex_printf __P((SCR *, const char *, ...));
+ * PUBLIC: int ex_printf __P((SCR *, const char *, ...)) __printflike(2, 3);
  */
 int
 #ifdef __STDC__



CVS commit: src/external/bsd/nvi/dist/common

2017-12-01 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Dec  1 18:35:58 UTC 2017

Modified Files:
src/external/bsd/nvi/dist/common: common.h

Log Message:
Remove ex_printf duplicate with ex_extern.h.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/nvi/dist/common/common.h

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/dist/common/common.h
diff -u src/external/bsd/nvi/dist/common/common.h:1.3 src/external/bsd/nvi/dist/common/common.h:1.4
--- src/external/bsd/nvi/dist/common/common.h:1.3	Tue Jan  7 02:14:02 2014
+++ src/external/bsd/nvi/dist/common/common.h	Fri Dec  1 18:35:58 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: common.h,v 1.3 2014/01/07 02:14:02 joerg Exp $ */
+/*	$NetBSD: common.h,v 1.4 2017/12/01 18:35:58 rin Exp $ */
 /*-
  * Copyright (c) 1991, 1993, 1994
  *	The Regents of the University of California.  All rights reserved.
@@ -57,8 +57,6 @@ typedef struct _tagq		TAGQ;
 typedef struct _text		TEXT;
 typedef struct _win		WIN;
 
-int ex_printf(SCR *, const char *, ...) __printflike(2, 3);
-
 /* Autoindent state. */
 typedef enum { C_NOTSET, C_CARATSET, C_ZEROSET } carat_t;
 



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

2017-12-01 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Dec  1 17:47:51 UTC 2017

Modified Files:
src/sys/arch/arm/sunxi: sunxi_emac.c

Log Message:
More fixes for new emac bindings.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/sunxi/sunxi_emac.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/sunxi/sunxi_emac.c
diff -u src/sys/arch/arm/sunxi/sunxi_emac.c:1.10 src/sys/arch/arm/sunxi/sunxi_emac.c:1.11
--- src/sys/arch/arm/sunxi/sunxi_emac.c:1.10	Thu Nov 30 21:36:11 2017
+++ src/sys/arch/arm/sunxi/sunxi_emac.c	Fri Dec  1 17:47:51 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_emac.c,v 1.10 2017/11/30 21:36:11 jmcneill Exp $ */
+/* $NetBSD: sunxi_emac.c,v 1.11 2017/12/01 17:47:51 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2016-2017 Jared McNeill 
@@ -33,7 +33,7 @@
 #include "opt_net_mpsafe.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_emac.c,v 1.10 2017/11/30 21:36:11 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_emac.c,v 1.11 2017/12/01 17:47:51 jmcneill Exp $");
 
 #include 
 #include 
@@ -1310,15 +1310,27 @@ sunxi_emac_get_resources(struct sunxi_em
 	if (bus_space_map(sc->bst, addr, size, 0, >bsh[_RES_SYSCON]) != 0)
 		return ENXIO;
 
-	/* Get clocks and resets. "ahb" is required, "ephy" is optional. */
-
-	if ((sc->clk_ahb = fdtbus_clock_get(phandle, "ahb")) == NULL)
+	/* The "ahb"/"stmmaceth" clock and reset is required */
+	if ((sc->clk_ahb = fdtbus_clock_get(phandle, "ahb")) == NULL &&
+	(sc->clk_ahb = fdtbus_clock_get(phandle, "stmmaceth")) == NULL)
 		return ENXIO;
-	sc->clk_ephy = fdtbus_clock_get(phandle, "ephy");
-
-	if ((sc->rst_ahb = fdtbus_reset_get(phandle, "ahb")) == NULL)
+	if ((sc->rst_ahb = fdtbus_reset_get(phandle, "ahb")) == NULL &&
+	(sc->rst_ahb = fdtbus_reset_get(phandle, "stmmaceth")) == NULL)
 		return ENXIO;
+
+	/* Internal PHY clock and reset are optional properties. */
+	sc->clk_ephy = fdtbus_clock_get(phandle, "ephy");
+	if (sc->clk_ephy == NULL) {
+		int phy_phandle = fdtbus_get_phandle(phandle, "phy-handle");
+		if (phy_phandle != -1)
+			sc->clk_ephy = fdtbus_clock_get_index(phy_phandle, 0);
+	}
 	sc->rst_ephy = fdtbus_reset_get(phandle, "ephy");
+	if (sc->rst_ephy == NULL) {
+		int phy_phandle = fdtbus_get_phandle(phandle, "phy-phandle");
+		if (phy_phandle != -1)
+			sc->rst_ephy = fdtbus_reset_get_index(phy_phandle, 0);
+	}
 
 	/* Regulator is optional */
 	sc->reg_phy = fdtbus_regulator_acquire(phandle, "phy-supply");
@@ -1334,8 +1346,11 @@ static int
 sunxi_emac_get_phyid(struct sunxi_emac_softc *sc)
 {
 	bus_addr_t addr;
+	int phy_phandle;
 
-	const int phy_phandle = fdtbus_get_phandle(sc->phandle, "phy");
+	phy_phandle = fdtbus_get_phandle(sc->phandle, "phy");
+	if (phy_phandle == -1)
+		phy_phandle = fdtbus_get_phandle(sc->phandle, "phy-handle");
 	if (phy_phandle == -1)
 		return MII_PHY_ANY;
 



CVS commit: src/share/misc

2017-12-01 Thread Brian Ginsbach
Module Name:src
Committed By:   ginsbach
Date:   Fri Dec  1 17:19:01 UTC 2017

Modified Files:
src/share/misc: acronyms

Log Message:
PR misc/52776: Nikolai Lifanov: add definitions for EA, MVP


To generate a diff of this commit:
cvs rdiff -u -r1.262 -r1.263 src/share/misc/acronyms

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

Modified files:

Index: src/share/misc/acronyms
diff -u src/share/misc/acronyms:1.262 src/share/misc/acronyms:1.263
--- src/share/misc/acronyms:1.262	Wed Nov  1 15:34:28 2017
+++ src/share/misc/acronyms	Fri Dec  1 17:19:01 2017
@@ -1,4 +1,4 @@
-$NetBSD: acronyms,v 1.262 2017/11/01 15:34:28 khorben Exp $
+$NetBSD: acronyms,v 1.263 2017/12/01 17:19:01 ginsbach Exp $
 10Q	thank you
 10X	thanks
 1337	elite ("leet")
@@ -123,6 +123,7 @@ DTRT	do the right thing
 DTWT	do the wrong thing
 DWIM	do what I mean
 DYK	do you know?
+EA	eary adopter
 ECR	electronic cash register
 EDS	eternal downward spiral
 EFT	electronic funds transfer
@@ -334,6 +335,8 @@ MOTAS	member of the appropriate sex
 MOTOS	member of the opposite sex
 MOTSS	member of the same sex
 MTF	more to follow
+MVP	minimum viable product
+MVP	most valuable player
 MYOB	mind your own business
 N/A	not {applicable,available}
 N/M	never mind



CVS commit: src/tests/lib/libpthread

2017-12-01 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Dec  1 13:25:30 UTC 2017

Modified Files:
src/tests/lib/libpthread: t_mutex.c

Log Message:
Since there has been no objection (or even comment) in response
to my message on tech-userlevel ...

Subject: tests/lib/libpthread/t_mutex:mutex6
Date: Thu, 23 Nov 2017 17:34:54 +0700
Message-ID: <28385.1511433...@andromeda.noi.kre.to>

which can be found at:
http://mail-index.netbsd.org/tech-userlevel/2017/11/23/msg011010.html

which analysed the mutex6 test case of this test, and concluded
that it was useless, nonsense, and broken (the whole test is just a
race - not even really using or testing mutexes), let it be henceforth
forever gone.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/tests/lib/libpthread/t_mutex.c

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

Modified files:

Index: src/tests/lib/libpthread/t_mutex.c
diff -u src/tests/lib/libpthread/t_mutex.c:1.18 src/tests/lib/libpthread/t_mutex.c:1.19
--- src/tests/lib/libpthread/t_mutex.c:1.18	Sat Apr  1 17:19:40 2017
+++ src/tests/lib/libpthread/t_mutex.c	Fri Dec  1 13:25:29 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: t_mutex.c,v 1.18 2017/04/01 17:19:40 martin Exp $ */
+/* $NetBSD: t_mutex.c,v 1.19 2017/12/01 13:25:29 kre Exp $ */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
 #include 
 __COPYRIGHT("@(#) Copyright (c) 2008\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_mutex.c,v 1.18 2017/04/01 17:19:40 martin Exp $");
+__RCSID("$NetBSD: t_mutex.c,v 1.19 2017/12/01 13:25:29 kre Exp $");
 
 #include  /* For timespecadd */
 #include  /* For UINT16_MAX */
@@ -371,131 +371,6 @@ ATF_TC_BODY(mutex5, tc)
 	PTHREAD_REQUIRE(pthread_join(child, NULL));
 }
 
-static int start = 0;
-static uintmax_t high_cnt = 0, low_cnt = 0, MAX_LOOP = 1;
-
-static void *
-high_prio(void* arg)
-{
-	struct sched_param param;
-	int policy;
-	param.sched_priority = min_fifo_prio + 10;
-	pthread_t childid = pthread_self();
-
-	PTHREAD_REQUIRE(pthread_setschedparam(childid, 1, ));
-	PTHREAD_REQUIRE(pthread_getschedparam(childid, , ));
-	printf("high protect = %d, prio = %d\n",
-	_sched_protect(-2), param.sched_priority);
-	ATF_REQUIRE_EQ(policy, 1);
-	printf("high prio = %d\n", param.sched_priority);
-	sleep(1);
-	long tmp = 0;
-	for (int i = 0; i < 20; i++) {
-		while (high_cnt < MAX_LOOP) {
-			tmp += (123456789 % 1234) * (987654321 % 54321);
-			high_cnt += 1;
-		}
-		high_cnt = 0;
-		sleep(1);
-	}
-	PTHREAD_REQUIRE(mutex_lock(, _lengthy));
-	if (start == 0) start = 2;
-	PTHREAD_REQUIRE(pthread_mutex_unlock());
-
-	return 0;
-}
-
-static void *
-low_prio(void* arg)
-{
-	struct sched_param param;
-	int policy;
-	param.sched_priority = min_fifo_prio;
-	pthread_t childid = pthread_self();
-	int res = _sched_protect(max_fifo_prio);
-	ATF_REQUIRE_EQ(res, 0);
-	PTHREAD_REQUIRE(pthread_setschedparam(childid, 1, ));
-	PTHREAD_REQUIRE(pthread_getschedparam(childid, , ));
-	printf("low protect = %d, prio = %d\n", _sched_protect(-2),
-	param.sched_priority);
-	ATF_REQUIRE_EQ(policy, 1);
-	printf("low prio = %d\n", param.sched_priority);
-	sleep(1);
-	long tmp = 0;
-	for (int i = 0; i < 20; i++) {
-		while (low_cnt < MAX_LOOP) {
-			tmp += (123456789 % 1234) * (987654321 % 54321);
-			low_cnt += 1;
-		}
-		low_cnt = 0;
-		sleep(1);
-	}
-	PTHREAD_REQUIRE(mutex_lock(, _lengthy));
-	if (start == 0)
-		start = 1;
-	PTHREAD_REQUIRE(pthread_mutex_unlock());
-
-	return 0;
-}
-
-ATF_TC(mutex6);
-ATF_TC_HEAD(mutex6, tc)
-{
-	atf_tc_set_md_var(tc, "descr",
-	"Checks scheduling for priority ceiling");
-	atf_tc_set_md_var(tc, "require.user", "root");
-}
-
-/*
- * 1. main thread sets itself to be a realtime task and launched two tasks,
- *one has higher priority and the other has lower priority.
- * 2. each child thread(low and high priority thread) sets its scheduler and
- *priority.
- * 3. each child thread did several rounds of computation, after each round it
- *sleep 1 second.
- * 4. the child thread with low priority will call _sched_protect to increase
- *its protect priority.
- * 5. We verify the thread with low priority runs first.
- *
- * Why does it work? From the main thread, we launched the high
- * priority thread first. This gives this thread the benefit of
- * starting first. The low priority thread did not call _sched_protect(2).
- * The high priority thread should finish the task first. After each
- * round of computation, we call sleep, to put the task into the
- * sleep queue, and wake up again after the timer expires. This
- * gives the scheduler the chance to decide which task to run. So,
- * the thread with real high priority will always block the thread
- * with real low priority.
- * 
- */
-ATF_TC_BODY(mutex6, tc)
-{
-	struct sched_param param;
-	int res;
-	pthread_t high, low;
-
-	min_fifo_prio = 

CVS commit: [netbsd-8] src/doc

2017-12-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Dec  1 09:50:35 UTC 2017

Modified Files:
src/doc [netbsd-8]: CHANGES-8.0

Log Message:
Tickets #414 and #415


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.86 -r1.1.2.87 src/doc/CHANGES-8.0

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

Modified files:

Index: src/doc/CHANGES-8.0
diff -u src/doc/CHANGES-8.0:1.1.2.86 src/doc/CHANGES-8.0:1.1.2.87
--- src/doc/CHANGES-8.0:1.1.2.86	Thu Nov 30 16:13:35 2017
+++ src/doc/CHANGES-8.0	Fri Dec  1 09:50:35 2017
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.0,v 1.1.2.86 2017/11/30 16:13:35 martin Exp $
+# $NetBSD: CHANGES-8.0,v 1.1.2.87 2017/12/01 09:50:35 martin Exp $
 
 A complete list of changes from the initial NetBSD 8.0 branch on 2017-06-04
 until the 8.0 release:
@@ -8033,3 +8033,57 @@ lib/libc/gen/vis.c1.74
 	can result in 4 bytes of 4 characters ("\ooo") each.
 	[maya, ticket #411]
 
+sys/netipsec/key.c1.244-1.245
+
+	Make a mutex_ownable assertion DEBUG only, it is not cheap.
+	Fix a deadlock happening if !NET_MPSAFE.
+	[christos, ticket #415]
+
+xsrc/external/mit/libXfont/dist/ChangeLog 1.1.1.11
+xsrc/external/mit/libXfont/dist/Makefile.in 1.1.1.10
+xsrc/external/mit/libXfont/dist/aclocal.m4 1.1.1.11
+xsrc/external/mit/libXfont/dist/config.guess 1.1.1.9
+xsrc/external/mit/libXfont/dist/config.sub 1.1.1.9
+xsrc/external/mit/libXfont/dist/configure 1.1.1.11
+xsrc/external/mit/libXfont/dist/configure.ac 1.1.1.11
+xsrc/external/mit/libXfont/dist/install-sh 1.1.1.7
+xsrc/external/mit/libXfont/dist/ltmain.sh 1.1.1.8
+xsrc/external/mit/libXfont/dist/doc/Makefile.in 1.1.1.6
+xsrc/external/mit/libXfont/dist/src/Makefile.in 1.1.1.10
+xsrc/external/mit/libXfont/dist/src/FreeType/Makefile.in 1.1.1.10
+xsrc/external/mit/libXfont/dist/src/bitmap/Makefile.in 1.1.1.10
+xsrc/external/mit/libXfont/dist/src/bitmap/pcfread.c 1.5
+xsrc/external/mit/libXfont/dist/src/builtins/Makefile.in 1.1.1.10
+xsrc/external/mit/libXfont/dist/src/fc/Makefile.in 1.1.1.10
+xsrc/external/mit/libXfont/dist/src/fontfile/Makefile.in 1.1.1.10
+xsrc/external/mit/libXfont/dist/src/fontfile/dirfile.c 1.5
+xsrc/external/mit/libXfont/dist/src/fontfile/fileio.c 1.3
+xsrc/external/mit/libXfont/dist/src/fontfile/fontdir.c 1.1.1.7
+xsrc/external/mit/libXfont/dist/src/stubs/Makefile.in 1.1.1.10
+xsrc/external/mit/libXfont/dist/src/util/Makefile.in 1.1.1.10
+xsrc/external/mit/libXfont/include/config.h 1.9
+xsrc/external/mit/libXcursor/dist/compile 1.1.1.1
+xsrc/external/mit/libXcursor/dist/ChangeLog 1.1.1.6
+xsrc/external/mit/libXcursor/dist/INSTALL 1.1.1.3
+xsrc/external/mit/libXcursor/dist/Makefile.in 1.1.1.6
+xsrc/external/mit/libXcursor/dist/aclocal.m4 1.1.1.6
+xsrc/external/mit/libXcursor/dist/config.guess 1.1.1.5
+xsrc/external/mit/libXcursor/dist/config.h.in 1.1.1.5
+xsrc/external/mit/libXcursor/dist/config.sub 1.1.1.5
+xsrc/external/mit/libXcursor/dist/configure 1.1.1.6
+xsrc/external/mit/libXcursor/dist/configure.ac 1.1.1.6
+xsrc/external/mit/libXcursor/dist/depcomp 1.1.1.5
+xsrc/external/mit/libXcursor/dist/install-sh 1.1.1.5
+xsrc/external/mit/libXcursor/dist/ltmain.sh 1.1.1.6
+xsrc/external/mit/libXcursor/dist/missing 1.1.1.4
+xsrc/external/mit/libXcursor/dist/include/X11/Xcursor/Xcursor.h 1.1.1.3
+xsrc/external/mit/libXcursor/dist/man/Makefile.in 1.1.1.6
+xsrc/external/mit/libXcursor/dist/src/Makefile.in 1.1.1.6
+xsrc/external/mit/libXcursor/dist/src/cursor.c 1.1.1.5
+xsrc/external/mit/libXcursor/dist/src/display.c 1.1.1.5
+xsrc/external/mit/libXcursor/dist/src/file.c 1.1.1.5
+xsrc/external/mit/libXcursor/dist/src/library.c 1.1.1.4
+xsrc/external/mit/libXcursor/include/config.h 1.4
+
+	Fixes for CVEs 2017-13722, 2017-13720, 2017-16611, and 2017-16612.
+	[mrg, #414]



CVS commit: [netbsd-8] xsrc/external/mit

2017-12-01 Thread Martin Husemann
Module Name:xsrc
Committed By:   martin
Date:   Fri Dec  1 09:47:57 UTC 2017

Modified Files:
xsrc/external/mit/libXcursor/dist [netbsd-8]: ChangeLog INSTALL
Makefile.in aclocal.m4 config.guess config.h.in config.sub
configure configure.ac depcomp install-sh ltmain.sh missing
xsrc/external/mit/libXcursor/dist/include/X11/Xcursor [netbsd-8]:
Xcursor.h
xsrc/external/mit/libXcursor/dist/man [netbsd-8]: Makefile.in
xsrc/external/mit/libXcursor/dist/src [netbsd-8]: Makefile.in cursor.c
display.c file.c library.c
xsrc/external/mit/libXcursor/include [netbsd-8]: config.h
xsrc/external/mit/libXfont/dist [netbsd-8]: ChangeLog Makefile.in
aclocal.m4 config.guess config.sub configure configure.ac
install-sh ltmain.sh
xsrc/external/mit/libXfont/dist/doc [netbsd-8]: Makefile.in
xsrc/external/mit/libXfont/dist/src [netbsd-8]: Makefile.in
xsrc/external/mit/libXfont/dist/src/FreeType [netbsd-8]: Makefile.in
xsrc/external/mit/libXfont/dist/src/bitmap [netbsd-8]: Makefile.in
pcfread.c
xsrc/external/mit/libXfont/dist/src/builtins [netbsd-8]: Makefile.in
xsrc/external/mit/libXfont/dist/src/fc [netbsd-8]: Makefile.in
xsrc/external/mit/libXfont/dist/src/fontfile [netbsd-8]: Makefile.in
dirfile.c fileio.c fontdir.c
xsrc/external/mit/libXfont/dist/src/stubs [netbsd-8]: Makefile.in
xsrc/external/mit/libXfont/dist/src/util [netbsd-8]: Makefile.in
xsrc/external/mit/libXfont/include [netbsd-8]: config.h
Added Files:
xsrc/external/mit/libXcursor/dist [netbsd-8]: compile

Log Message:
Sync xsrc/external/mit/libXfont and xsrc/external/mit/libXcursor with
HEAD: Fixes for CVEs 2017-13722, 2017-13720, 2017-16611, and 2017-16612.

Requested by mrg in #414.

xsrc/external/mit/libXfont/dist/ChangeLog 1.1.1.11
xsrc/external/mit/libXfont/dist/Makefile.in 1.1.1.10
xsrc/external/mit/libXfont/dist/aclocal.m4 1.1.1.11
xsrc/external/mit/libXfont/dist/config.guess 1.1.1.9
xsrc/external/mit/libXfont/dist/config.sub 1.1.1.9
xsrc/external/mit/libXfont/dist/configure 1.1.1.11
xsrc/external/mit/libXfont/dist/configure.ac 1.1.1.11
xsrc/external/mit/libXfont/dist/install-sh 1.1.1.7
xsrc/external/mit/libXfont/dist/ltmain.sh 1.1.1.8
xsrc/external/mit/libXfont/dist/doc/Makefile.in 1.1.1.6
xsrc/external/mit/libXfont/dist/src/Makefile.in 1.1.1.10
xsrc/external/mit/libXfont/dist/src/FreeType/Makefile.in 1.1.1.10
xsrc/external/mit/libXfont/dist/src/bitmap/Makefile.in 1.1.1.10
xsrc/external/mit/libXfont/dist/src/bitmap/pcfread.c 1.5
xsrc/external/mit/libXfont/dist/src/builtins/Makefile.in 1.1.1.10
xsrc/external/mit/libXfont/dist/src/fc/Makefile.in 1.1.1.10
xsrc/external/mit/libXfont/dist/src/fontfile/Makefile.in 1.1.1.10
xsrc/external/mit/libXfont/dist/src/fontfile/dirfile.c 1.5
xsrc/external/mit/libXfont/dist/src/fontfile/fileio.c 1.3
xsrc/external/mit/libXfont/dist/src/fontfile/fontdir.c 1.1.1.7
xsrc/external/mit/libXfont/dist/src/stubs/Makefile.in 1.1.1.10
xsrc/external/mit/libXfont/dist/src/util/Makefile.in 1.1.1.10
xsrc/external/mit/libXfont/include/config.h 1.9
xsrc/external/mit/libXcursor/dist/compile 1.1.1.1
xsrc/external/mit/libXcursor/dist/ChangeLog 1.1.1.6
xsrc/external/mit/libXcursor/dist/INSTALL 1.1.1.3
xsrc/external/mit/libXcursor/dist/Makefile.in 1.1.1.6
xsrc/external/mit/libXcursor/dist/aclocal.m4 1.1.1.6
xsrc/external/mit/libXcursor/dist/config.guess 1.1.1.5
xsrc/external/mit/libXcursor/dist/config.h.in 1.1.1.5
xsrc/external/mit/libXcursor/dist/config.sub 1.1.1.5
xsrc/external/mit/libXcursor/dist/configure 1.1.1.6
xsrc/external/mit/libXcursor/dist/configure.ac 1.1.1.6
xsrc/external/mit/libXcursor/dist/depcomp 1.1.1.5
xsrc/external/mit/libXcursor/dist/install-sh 1.1.1.5
xsrc/external/mit/libXcursor/dist/ltmain.sh 1.1.1.6
xsrc/external/mit/libXcursor/dist/missing 1.1.1.4
xsrc/external/mit/libXcursor/dist/include/X11/Xcursor/Xcursor.h 1.1.1.3
xsrc/external/mit/libXcursor/dist/man/Makefile.in 1.1.1.6
xsrc/external/mit/libXcursor/dist/src/Makefile.in 1.1.1.6
xsrc/external/mit/libXcursor/dist/src/cursor.c 1.1.1.5
xsrc/external/mit/libXcursor/dist/src/display.c 1.1.1.5
xsrc/external/mit/libXcursor/dist/src/file.c 1.1.1.5
xsrc/external/mit/libXcursor/dist/src/library.c 1.1.1.4
xsrc/external/mit/libXcursor/include/config.h 1.4


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.5 -r1.1.1.5.10.1 \
xsrc/external/mit/libXcursor/dist/ChangeLog \
xsrc/external/mit/libXcursor/dist/Makefile.in \
xsrc/external/mit/libXcursor/dist/aclocal.m4 \
xsrc/external/mit/libXcursor/dist/configure \
xsrc/external/mit/libXcursor/dist/configure.ac \
xsrc/external/mit/libXcursor/dist/ltmain.sh
cvs rdiff -u -r1.1.1.2 -r1.1.1.2.16.1 \
xsrc/external/mit/libXcursor/dist/INSTALL
cvs rdiff -u -r0 -r1.1.1.1.2.2 xsrc/external/mit/libXcursor/dist/compile
cvs rdiff -u -r1.1.1.4 -r1.1.1.4.10.1 \

CVS commit: [netbsd-8] src/sys/netipsec

2017-12-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Dec  1 09:21:15 UTC 2017

Modified Files:
src/sys/netipsec [netbsd-8]: key.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #415):
sys/netipsec/key.c: revision 1.244
sys/netipsec/key.c: revision 1.245
Use KDASSERT for mutex_ownable
Because mutex_ownable is not cheap.
Fix a deadlock happening if !NET_MPSAFE
If NET_MPSAFE isn't set, key_timehandler_work is executed with holding
softnet_lock. This means that localcount_drain can be called with holding
softnet_lock resulting in a deadlock that localcount_drain waits for packet
processing to release a reference to SP/SA while network processing is prevented
by softnet_lock.
Fix the deadlock by not taking softnet_lock in key_timehandler_work. It's okay
because IPsec is MP-safe even if !NET_MPSAFE. Note that the change also needs
to enable pserialize_perform because the IPsec code can be run in parallel now.
Reported by christos@


To generate a diff of this commit:
cvs rdiff -u -r1.163.2.4 -r1.163.2.5 src/sys/netipsec/key.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/netipsec/key.c
diff -u src/sys/netipsec/key.c:1.163.2.4 src/sys/netipsec/key.c:1.163.2.5
--- src/sys/netipsec/key.c:1.163.2.4	Thu Nov 30 15:57:37 2017
+++ src/sys/netipsec/key.c	Fri Dec  1 09:21:15 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: key.c,v 1.163.2.4 2017/11/30 15:57:37 martin Exp $	*/
+/*	$NetBSD: key.c,v 1.163.2.5 2017/12/01 09:21:15 martin Exp $	*/
 /*	$FreeBSD: src/sys/netipsec/key.c,v 1.3.2.3 2004/02/14 22:23:23 bms Exp $	*/
 /*	$KAME: key.c,v 1.191 2001/06/27 10:46:49 sakane Exp $	*/
 
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.163.2.4 2017/11/30 15:57:37 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.163.2.5 2017/12/01 09:21:15 martin Exp $");
 
 /*
  * This code is referred to RFC 2367
@@ -800,7 +800,6 @@ key_sp_refcnt(const struct secpolicy *sp
 	return 0;
 }
 
-#ifdef NET_MPSAFE
 static void
 key_spd_pserialize_perform(void)
 {
@@ -818,7 +817,6 @@ key_spd_pserialize_perform(void)
 	key_spd.psz_performing = false;
 	cv_broadcast(_spd.cv_psz);
 }
-#endif
 
 /*
  * Remove the sp from the key_spd.splist and wait for references to the sp
@@ -836,10 +834,8 @@ key_unlink_sp(struct secpolicy *sp)
 	/* Invalidate all cached SPD pointers in the PCBs. */
 	ipsec_invalpcbcacheall();
 
-#ifdef NET_MPSAFE
-	KASSERT(mutex_ownable(softnet_lock));
+	KDASSERT(mutex_ownable(softnet_lock));
 	key_spd_pserialize_perform();
-#endif
 
 	localcount_drain(>localcount, _spd.cv_lc, _spd.lock);
 }
@@ -1493,7 +1489,6 @@ key_freesp_so(struct secpolicy **sp)
 }
 #endif
 
-#ifdef NET_MPSAFE
 static void
 key_sad_pserialize_perform(void)
 {
@@ -1511,7 +1506,6 @@ key_sad_pserialize_perform(void)
 	key_sad.psz_performing = false;
 	cv_broadcast(_sad.cv_psz);
 }
-#endif
 
 /*
  * Remove the sav from the savlist of its sah and wait for references to the sav
@@ -1525,10 +1519,8 @@ key_unlink_sav(struct secasvar *sav)
 
 	SAVLIST_WRITER_REMOVE(sav);
 
-#ifdef NET_MPSAFE
-	KASSERT(mutex_ownable(softnet_lock));
+	KDASSERT(mutex_ownable(softnet_lock));
 	key_sad_pserialize_perform();
-#endif
 
 	localcount_drain(>localcount, _sad.cv_lc, _sad.lock);
 }
@@ -1567,10 +1559,8 @@ key_destroy_sav_with_ref(struct secasvar
 	KEY_SA_UNREF();
 
 	mutex_enter(_sad.lock);
-#ifdef NET_MPSAFE
-	KASSERT(mutex_ownable(softnet_lock));
+	KDASSERT(mutex_ownable(softnet_lock));
 	key_sad_pserialize_perform();
-#endif
 	localcount_drain(>localcount, _sad.cv_lc, _sad.lock);
 	mutex_exit(_sad.lock);
 
@@ -3048,10 +3038,8 @@ key_unlink_sah(struct secashead *sah)
 	/* Remove from the sah list */
 	SAHLIST_WRITER_REMOVE(sah);
 
-#ifdef NET_MPSAFE
-	KASSERT(mutex_ownable(softnet_lock));
+	KDASSERT(mutex_ownable(softnet_lock));
 	key_sad_pserialize_perform();
-#endif
 
 	localcount_drain(>localcount, _sad.cv_lc, _sad.lock);
 }
@@ -4862,13 +4850,10 @@ static void
 key_timehandler_work(struct work *wk, void *arg)
 {
 	time_t now = time_uptime;
-	IPSEC_DECLARE_LOCK_VARIABLE;
 
 	/* We can allow enqueuing another work at this point */
 	atomic_swap_uint(_timehandler_work_enqueued, 0);
 
-	IPSEC_ACQUIRE_GLOBAL_LOCKS();
-
 	key_timehandler_spd(now);
 	key_timehandler_sad(now);
 	key_timehandler_acq(now);
@@ -4879,7 +4864,6 @@ key_timehandler_work(struct work *wk, vo
 	/* do exchange to tick time !! */
 	callout_reset(_timehandler_ch, hz, key_timehandler, NULL);
 
-	IPSEC_RELEASE_GLOBAL_LOCKS();
 	return;
 }