CVS commit: src/sbin/swapctl

2012-12-26 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Wed Dec 26 10:15:29 UTC 2012

Modified Files:
src/sbin/swapctl: swapctl.c

Log Message:
Allow named wedges to be used on command line, also fix name lookup
for the dump device.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sbin/swapctl/swapctl.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/swapctl/swapctl.c
diff -u src/sbin/swapctl/swapctl.c:1.37 src/sbin/swapctl/swapctl.c:1.38
--- src/sbin/swapctl/swapctl.c:1.37	Sat Apr  7 04:52:20 2012
+++ src/sbin/swapctl/swapctl.c	Wed Dec 26 10:15:28 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: swapctl.c,v 1.37 2012/04/07 04:52:20 christos Exp $	*/
+/*	$NetBSD: swapctl.c,v 1.38 2012/12/26 10:15:28 mlelstv Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1999 Matthew R. Green
@@ -64,7 +64,7 @@
 #include sys/cdefs.h
 
 #ifndef lint
-__RCSID($NetBSD: swapctl.c,v 1.37 2012/04/07 04:52:20 christos Exp $);
+__RCSID($NetBSD: swapctl.c,v 1.38 2012/12/26 10:15:28 mlelstv Exp $);
 #endif
 
 
@@ -150,6 +150,7 @@ static int	pri;		/* uses 0 as default pr
 static	void change_priority(char *);
 static	int  add_swap(char *, int);
 static	int  delete_swap(char *);
+static	void set_dumpdev1(char *);
 static	void set_dumpdev(char *);
 static	int get_dumpdev(void);
 __dead static	void do_fstab(int);
@@ -445,8 +446,14 @@ static int
 add_swap(char *path, int priority)
 {
 	struct stat sb;
+	char buf[MAXPATHLEN];
+	char *spec;
 
-	if (stat(path, sb)  0)
+	if (getfsspecname(buf, sizeof(buf), path) == NULL)
+		goto oops;
+	spec = buf;
+
+	if (stat(spec, sb)  0)
 		goto oops;
 
 	if (sb.st_mode  S_IROTH) 
@@ -455,7 +462,7 @@ add_swap(char *path, int priority)
 		warnx(WARNING: %s is writable by the world, path);
 
 	if (fflag || oflag) {
-		set_dumpdev(path);
+		set_dumpdev1(spec);
 		if (oflag)
 			exit(0);
 		else
@@ -465,7 +472,7 @@ add_swap(char *path, int priority)
 	if (nflag)
 		return 1;
 
-	if (swapctl(SWAP_ON, path, priority)  0) {
+	if (swapctl(SWAP_ON, spec, priority)  0) {
 oops:
 		err(1, %s, path);
 	}
@@ -478,31 +485,50 @@ oops:
 static int
 delete_swap(char *path)
 {
+	char buf[MAXPATHLEN];
+	char *spec;
+
+	if (getfsspecname(buf, sizeof(buf), path) == NULL)
+		err(1, %s, path);
+	spec = buf;
 
 	if (nflag)
 		return 1;
 
-	if (swapctl(SWAP_OFF, path, pri)  0) 
+	if (swapctl(SWAP_OFF, spec, pri)  0) 
 		err(1, %s, path);
 	return (1);
 }
 
 static void
-set_dumpdev(char *path)
+set_dumpdev1(char *spec)
 {
 	int rv = 0;
 
 	if (!nflag) {
-		if (strcmp(path, none) == 0) 
+		if (strcmp(spec, none) == 0) 
 			rv = swapctl(SWAP_DUMPOFF, NULL, 0);
 		else
-			rv = swapctl(SWAP_DUMPDEV, path, 0);
+			rv = swapctl(SWAP_DUMPDEV, spec, 0);
 	}
 
 	if (rv == -1)
-		err(1, could not set dump device to %s, path);
+		err(1, could not set dump device to %s, spec);
 	else
-		printf(%s: setting dump device to %s\n, getprogname(), path);
+		printf(%s: setting dump device to %s\n, getprogname(), spec);
+}
+
+static void
+set_dumpdev(char *path)
+{
+	char buf[MAXPATHLEN];
+	char *spec;
+
+	if (getfsspecname(buf, sizeof(buf), path) == NULL)
+		err(1, %s, path);
+	spec = buf;
+
+	return set_dumpdev1(spec);
 }
 
 static int
@@ -706,7 +732,7 @@ do_fstab(int add)
 		cmd[0] = '\0';
 
 		if (strcmp(fp-fs_type, dp) == 0  add) {
-			set_dumpdev(spec);
+			set_dumpdev1(spec);
 			continue;
 		}
 
@@ -715,7 +741,7 @@ do_fstab(int add)
 
 		/* handle dp as mnt option */
 		if (strstr(fp-fs_mntops, dp)  add)
-			set_dumpdev(spec);
+			set_dumpdev1(spec);
 
 		isblk = 0;
 



CVS commit: src/usr.sbin/btdevctl

2012-12-26 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Wed Dec 26 17:33:09 UTC 2012

Modified Files:
src/usr.sbin/btdevctl: btdevctl.8

Log Message:
add a comment pointing out that the link-mode may need to be
changed manually, for devices which cannot authenticate

for PR/47286


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/btdevctl/btdevctl.8

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/btdevctl/btdevctl.8
diff -u src/usr.sbin/btdevctl/btdevctl.8:1.7 src/usr.sbin/btdevctl/btdevctl.8:1.8
--- src/usr.sbin/btdevctl/btdevctl.8:1.7	Tue Oct 12 21:49:08 2010
+++ src/usr.sbin/btdevctl/btdevctl.8	Wed Dec 26 17:33:09 2012
@@ -1,4 +1,4 @@
-.\ $NetBSD: btdevctl.8,v 1.7 2010/10/12 21:49:08 wiz Exp $
+.\ $NetBSD: btdevctl.8,v 1.8 2012/12/26 17:33:09 plunky Exp $
 .\
 .\ Copyright (c) 2006 Itronix Inc.
 .\ All rights reserved.
@@ -51,7 +51,7 @@
 .\ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\ SUCH DAMAGE.
 .\
-.Dd October 11, 2010
+.Dd December 26, 2012
 .Dt BTDEVCTL 8
 .Os
 .Sh NAME
@@ -101,7 +101,7 @@ May be given as BDADDR or device name.
 Connection link mode.
 The following modes are supported:
 .Pp
-.Bl -tag -compact
+.Bl -tag -width encrypt -compact
 .It none
 clear previously set mode.
 .It auth
@@ -120,6 +120,8 @@ will set
 by default, or
 .Sq encrypt
 for keyboard devices.
+If the device cannot handle authentication, then the mode will need
+to be cleared manually.
 .It Fl q
 Ignore any cached data and perform a SDP query for the given
 .Ar service .



CVS commit: src/usr.sbin/btdevctl

2012-12-26 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Wed Dec 26 17:57:49 UTC 2012

Modified Files:
src/usr.sbin/btdevctl: btdevctl.8

Log Message:
whitespace '  ' - ' '


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/btdevctl/btdevctl.8

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/btdevctl/btdevctl.8
diff -u src/usr.sbin/btdevctl/btdevctl.8:1.8 src/usr.sbin/btdevctl/btdevctl.8:1.9
--- src/usr.sbin/btdevctl/btdevctl.8:1.8	Wed Dec 26 17:33:09 2012
+++ src/usr.sbin/btdevctl/btdevctl.8	Wed Dec 26 17:57:49 2012
@@ -1,4 +1,4 @@
-.\ $NetBSD: btdevctl.8,v 1.8 2012/12/26 17:33:09 plunky Exp $
+.\ $NetBSD: btdevctl.8,v 1.9 2012/12/26 17:57:49 plunky Exp $
 .\
 .\ Copyright (c) 2006 Itronix Inc.
 .\ All rights reserved.
@@ -71,7 +71,7 @@ The
 utility is used to configure bluetooth devices in the system.
 Normally,
 .Nm
-will perform  an SDP query to the remote device as needed, and
+will perform an SDP query to the remote device as needed, and
 cache the results in the
 .Pa /var/db/btdevctl.plist
 file for later use.



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

2012-12-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 26 18:28:09 UTC 2012

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

Log Message:
Bump SYMTAB_SPACE


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/evbarm/conf/TISDP2430

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/TISDP2430
diff -u src/sys/arch/evbarm/conf/TISDP2430:1.22 src/sys/arch/evbarm/conf/TISDP2430:1.23
--- src/sys/arch/evbarm/conf/TISDP2430:1.22	Wed Oct 17 14:48:11 2012
+++ src/sys/arch/evbarm/conf/TISDP2430	Wed Dec 26 18:28:09 2012
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: TISDP2430,v 1.22 2012/10/17 14:48:11 apb Exp $
+#	$NetBSD: TISDP2430,v 1.23 2012/12/26 18:28:09 matt Exp $
 #
 #	TISDP2430 -- TI OMAP 2430 Eval Board Kernel
 #
@@ -139,7 +139,7 @@ options		DDB_ONPANIC=1
 options 	DDB_HISTORY_SIZE=100	# Enable history editing in DDB
 #options 	KGDB
 makeoptions	DEBUG=-g	# compile full symbol table
-options 	SYMTAB_SPACE=50
+options 	SYMTAB_SPACE=52
 
 ## USB Debugging options
 options USB_DEBUG
@@ -228,11 +228,11 @@ omapwdt32k*	at obio? addr 0x48026000 siz
 sm0		at gpmc? addr 0x08000300 intr 245
 
 # On-board USB
-##ohci*		at obio? addr 0x4805e000 size 0x1000 intr 75
-##usb*		at ohci?
-##uhub*		at usb?
-##umass*		at uhub? port ? configuration ? interface ?
-##wd*		at umass?
+ohci*		at obio? addr 0x4805e000 size 0x1000 intr 75
+usb*		at ohci?
+uhub*		at usb?
+umass*		at uhub? port ? configuration ? interface ?
+wd*		at umass?
 
 # Hardware clocking and power management
 



CVS commit: src/sys

2012-12-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 26 18:30:23 UTC 2012

Modified Files:
src/sys/kern: subr_pcu.c
src/sys/sys: lwp.h pcu.h

Log Message:
Add support for kernel-based code to use a PCU.  (for memory to memory
copies or in_cksum or ...)


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/kern/subr_pcu.c
cvs rdiff -u -r1.165 -r1.166 src/sys/sys/lwp.h
cvs rdiff -u -r1.9 -r1.10 src/sys/sys/pcu.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/kern/subr_pcu.c
diff -u src/sys/kern/subr_pcu.c:1.12 src/sys/kern/subr_pcu.c:1.13
--- src/sys/kern/subr_pcu.c:1.12	Thu Aug 30 02:24:48 2012
+++ src/sys/kern/subr_pcu.c	Wed Dec 26 18:30:23 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_pcu.c,v 1.12 2012/08/30 02:24:48 matt Exp $	*/
+/*	$NetBSD: subr_pcu.c,v 1.13 2012/12/26 18:30:23 matt Exp $	*/
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: subr_pcu.c,v 1.12 2012/08/30 02:24:48 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: subr_pcu.c,v 1.13 2012/12/26 18:30:23 matt Exp $);
 
 #include sys/param.h
 #include sys/cpu.h
@@ -67,10 +67,15 @@ __KERNEL_RCSID(0, $NetBSD: subr_pcu.c,v
 
 #if PCU_UNIT_COUNT  0
 
-static void pcu_lwp_op(const pcu_ops_t *, lwp_t *, int);
-
-#define	PCU_SAVE		0x01	/* Save PCU state to the LWP. */
-#define	PCU_RELEASE		0x02	/* Release PCU state on the CPU. */
+static inline void pcu_do_op(const pcu_ops_t *, lwp_t * const, const int);
+static void pcu_cpu_op(const pcu_ops_t *, const int);
+static void pcu_lwp_op(const pcu_ops_t *, lwp_t *, const int);
+
+__CTASSERT(PCU_KERNEL == 1);
+
+#define	PCU_SAVE	(PCU_LOADED  1) /* Save PCU state to the LWP. */
+#define	PCU_RELEASE	(PCU_SAVE  1)	/* Release PCU state on the CPU. */
+#define	PCU_CLAIM	(PCU_RELEASE  1)	/* CLAIM a PCU for a LWP. */
 
 /* XXX */
 extern const pcu_ops_t * const	pcu_ops_md_defs[];
@@ -85,20 +90,40 @@ extern const pcu_ops_t * const	pcu_ops_m
 void
 pcu_switchpoint(lwp_t *l)
 {
-	const uint32_t pcu_inuse = l-l_pcu_used;
-	u_int id;
+	const uint32_t pcu_kernel_inuse = l-l_pcu_used[PCU_KERNEL];
+	uint32_t pcu_user_inuse = l-l_pcu_used[PCU_USER];
 	/* int s; */
 
 	KASSERTMSG(l == curlwp, l %p != curlwp %p, l, curlwp);
 
-	if (__predict_true(pcu_inuse == 0)) {
+	if (__predict_false(pcu_kernel_inuse != 0)) {
+		for (u_int id = 0; id  PCU_UNIT_COUNT; id++) {
+			if ((pcu_kernel_inuse  (1  id)) == 0) {
+continue;
+			}
+			struct cpu_info * const pcu_ci = l-l_pcu_cpu[id];
+			if (pcu_ci == NULL || pcu_ci == l-l_cpu) {
+continue;
+			}
+			const pcu_ops_t * const pcu = pcu_ops_md_defs[id];
+			/*
+			 * Steal the PCU away from the current owner and
+			 * take ownership of it.
+			 */
+			pcu_cpu_op(pcu, PCU_SAVE | PCU_RELEASE);
+			pcu_do_op(pcu, l, PCU_KERNEL | PCU_CLAIM | PCU_RELOAD);
+			pcu_user_inuse = ~(1  id);
+		}
+	}
+
+	if (__predict_true(pcu_user_inuse == 0)) {
 		/* PCUs are not in use. */
 		return;
 	}
 	/* commented out as we know we are already at IPL_SCHED */
 	/* s = splsoftclock(); */
-	for (id = 0; id  PCU_UNIT_COUNT; id++) {
-		if ((pcu_inuse  (1  id)) == 0) {
+	for (u_int id = 0; id  PCU_UNIT_COUNT; id++) {
+		if ((pcu_user_inuse  (1  id)) == 0) {
 			continue;
 		}
 		struct cpu_info * const pcu_ci = l-l_pcu_cpu[id];
@@ -106,7 +131,7 @@ pcu_switchpoint(lwp_t *l)
 			continue;
 		}
 		const pcu_ops_t * const pcu = pcu_ops_md_defs[id];
-		pcu-pcu_state_release(l);
+		pcu-pcu_state_release(l, 0);
 	}
 	/* splx(s); */
 }
@@ -120,9 +145,10 @@ pcu_switchpoint(lwp_t *l)
 void
 pcu_discard_all(lwp_t *l)
 {
-	const uint32_t pcu_inuse = l-l_pcu_used;
+	const uint32_t pcu_inuse = l-l_pcu_used[PCU_USER];
 
 	KASSERT(l == curlwp || ((l-l_flag  LW_SYSTEM)  pcu_inuse == 0));
+	KASSERT(l-l_pcu_used[PCU_KERNEL] == 0);
 
 	if (__predict_true(pcu_inuse == 0)) {
 		/* PCUs are not in use. */
@@ -143,7 +169,7 @@ pcu_discard_all(lwp_t *l)
 		 */
 		pcu_lwp_op(pcu, l, PCU_RELEASE);
 	}
-	l-l_pcu_used = 0;
+	l-l_pcu_used[PCU_USER] = 0;
 	splx(s);
 }
 
@@ -155,7 +181,7 @@ pcu_discard_all(lwp_t *l)
 void
 pcu_save_all(lwp_t *l)
 {
-	const uint32_t pcu_inuse = l-l_pcu_used;
+	const uint32_t pcu_inuse = l-l_pcu_used[PCU_USER];
 	/*
 	 * Unless LW_WCORE, we aren't releasing since this LWP isn't giving
 	 * up PCU, just saving it.
@@ -171,6 +197,7 @@ pcu_save_all(lwp_t *l)
 	|| (((l-l_flag  LW_SYSTEM)
 		 || (curlwp-l_proc == l-l_proc  l-l_stat == LSSUSPENDED))
 	 pcu_inuse == 0));
+	KASSERT(l-l_pcu_used[PCU_KERNEL] == 0);
 
 	if (__predict_true(pcu_inuse == 0)) {
 		/* PCUs are not in use. */
@@ -200,17 +227,36 @@ pcu_do_op(const pcu_ops_t *pcu, lwp_t * 
 {
 	struct cpu_info * const ci = curcpu();
 	const u_int id = pcu-pcu_id;
+	u_int state_flags = flags  (PCU_KERNEL|PCU_RELOAD|PCU_ENABLE);
+	uint32_t id_mask = 1  id;
+	const bool kernel_p = (l-l_pcu_used[PCU_KERNEL]  id_mask) != 0;
 
-	

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

2012-12-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 26 18:32:01 UTC 2012

Modified Files:
src/sys/arch/arm/include: pcb.h

Log Message:
Remove pcb_fpstate.
Add pcb_kernel_vfp.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/arm/include/pcb.h

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

Modified files:

Index: src/sys/arch/arm/include/pcb.h
diff -u src/sys/arch/arm/include/pcb.h:1.25 src/sys/arch/arm/include/pcb.h:1.26
--- src/sys/arch/arm/include/pcb.h:1.25	Mon Dec 10 01:37:30 2012
+++ src/sys/arch/arm/include/pcb.h	Wed Dec 26 18:32:01 2012
@@ -92,10 +92,9 @@ struct pcb {
 		struct	pcb_arm26 un_26;
 	} pcb_un;
 	void *	pcb_onfault;			/* On fault handler */
-	struct	fpe_sp_state pcb_fpstate;	/* FPA Floating Point state */
 	struct	vfpreg pcb_vfp;			/* VFP registers */
+	struct	vfpreg pcb_kernel_vfp;		/* kernel VFP state */
 };
-#define	pcb_ff	pcb_fpstate			/* for arm26 */
 
 /*
  * No additional data for core dumps.



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

2012-12-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 26 18:32:41 UTC 2012

Modified Files:
src/sys/arch/arm/include: cpu.h

Log Message:
Add vfp_kernel_acquire and vfp_kernel_release prototypes.


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/arch/arm/include/cpu.h

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

Modified files:

Index: src/sys/arch/arm/include/cpu.h
diff -u src/sys/arch/arm/include/cpu.h:1.73 src/sys/arch/arm/include/cpu.h:1.74
--- src/sys/arch/arm/include/cpu.h:1.73	Fri Sep  7 11:48:59 2012
+++ src/sys/arch/arm/include/cpu.h	Wed Dec 26 18:32:41 2012
@@ -408,6 +408,8 @@ void ucas_ras_check(trapframe_t *);
 void vfp_attach(void);
 void vfp_discardcontext(void);
 void vfp_savecontext(void);
+void vfp_kernel_acquire(void);
+void vfp_kernel_release(void);
 extern const pcu_ops_t arm_vfp_ops;
 
 #endif	/* !_LOCORE */



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

2012-12-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 26 18:34:57 UTC 2012

Modified Files:
src/sys/arch/arm/vfp: vfp_init.c

Log Message:
Add support for PCU_KERNEL and vfp_kernel_acquire/vfp_kernel_release.
Add an undefined handler to catch NEON instructions.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/arm/vfp/vfp_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/sys/arch/arm/vfp/vfp_init.c
diff -u src/sys/arch/arm/vfp/vfp_init.c:1.12 src/sys/arch/arm/vfp/vfp_init.c:1.13
--- src/sys/arch/arm/vfp/vfp_init.c:1.12	Tue Dec 11 01:52:30 2012
+++ src/sys/arch/arm/vfp/vfp_init.c	Wed Dec 26 18:34:56 2012
@@ -1,4 +1,4 @@
-/*  $NetBSD: vfp_init.c,v 1.12 2012/12/11 01:52:30 matt Exp $ */
+/*  $NetBSD: vfp_init.c,v 1.13 2012/12/26 18:34:56 matt Exp $ */
 
 /*
  * Copyright (c) 2008 ARM Ltd
@@ -109,7 +109,7 @@ read_fpinst2(void)
 
 /* FLDMD X, {d0-d15} */
 static inline void
-load_vfpregs_lo(uint64_t *p)
+load_vfpregs_lo(const uint64_t *p)
 {
 	/* vldmia rN, {d0-d15} */
 	__asm __volatile(ldc\tp11, c0, [%0], {32} :: r (p) : memory);
@@ -125,7 +125,7 @@ save_vfpregs_lo(uint64_t *p)
 #ifdef CPU_CORTEX
 /* FLDMD X, {d16-d31} */
 static inline void
-load_vfpregs_hi(uint64_t *p)
+load_vfpregs_hi(const uint64_t *p)
 {
 	__asm __volatile(ldcl\tp11, c0, [%0], {32} :: r (p[16]) : memory);
 }
@@ -138,18 +138,60 @@ save_vfpregs_hi(uint64_t *p)
 }
 #endif
 
+static inline void
+load_vfpregs(const struct vfpreg *fregs)
+{
+	load_vfpregs_lo(fregs-vfp_regs);
+#ifdef CPU_CORTEX
+#ifdef CPU_ARM11
+	switch (curcpu()-ci_vfp_id) {
+	case FPU_VFP_CORTEXA5:
+	case FPU_VFP_CORTEXA7:
+	case FPU_VFP_CORTEXA8:
+	case FPU_VFP_CORTEXA9:
+#endif
+		load_vfpregs_hi(fregs-vfp_regs);
+#ifdef CPU_ARM11
+		break;
+	}
+#endif
+#endif
+}
+
+static inline void
+save_vfpregs(struct vfpreg *fregs)
+{
+	save_vfpregs_lo(fregs-vfp_regs);
+#ifdef CPU_CORTEX
+#ifdef CPU_ARM11
+	switch (curcpu()-ci_vfp_id) {
+	case FPU_VFP_CORTEXA5:
+	case FPU_VFP_CORTEXA7:
+	case FPU_VFP_CORTEXA8:
+	case FPU_VFP_CORTEXA9:
+#endif
+		save_vfpregs_hi(fregs-vfp_regs);
+#ifdef CPU_ARM11
+		break;
+	}
+#endif
+#endif
+}
+
 /* The real handler for VFP bounces.  */
 static int vfp_handler(u_int, u_int, trapframe_t *, int);
-static int vfp_handler(u_int, u_int, trapframe_t *, int);
+#ifdef CPU_CORTEX
+static int neon_handler(u_int, u_int, trapframe_t *, int);
+#endif
 
-static void vfp_state_load(lwp_t *, bool);
-static void vfp_state_save(lwp_t *);
-static void vfp_state_release(lwp_t *);
+static void vfp_state_load(lwp_t *, u_int);
+static void vfp_state_save(lwp_t *, u_int);
+static void vfp_state_release(lwp_t *, u_int);
 
 const pcu_ops_t arm_vfp_ops = {
 	.pcu_id = PCU_FPU,
-	.pcu_state_load = vfp_state_load,
 	.pcu_state_save = vfp_state_save,
+	.pcu_state_load = vfp_state_load,
 	.pcu_state_release = vfp_state_release,
 };
 
@@ -349,6 +391,9 @@ vfp_attach(void)
 	VFP, coproc re-use);
 	install_coproc_handler(VFP_COPROC, vfp_handler);
 	install_coproc_handler(VFP_COPROC2, vfp_handler);
+#ifdef CPU_CORTEX
+	install_coproc_handler(CORE_UNKNOWN_HANDLER, neon_handler);
+#endif
 
 	vfp_patch_branch((uintptr_t)pmap_copy_page_generic,
 	   (uintptr_t)bcopy_page, (uintptr_t)bcopy_page_vfp);
@@ -384,10 +429,57 @@ vfp_handler(u_int address, u_int insn, t
 	return 0;
 }
 
+#ifdef CPU_CORTEX
+/* The real handler for NEON bounces.  */
+static int
+neon_handler(u_int address, u_int insn, trapframe_t *frame,
+int fault_code)
+{
+	struct cpu_info * const ci = curcpu();
+
+	if (ci-ci_vfp_id == 0)
+		/* No VFP detected, just fault.  */
+		return 1;
+
+	if ((insn  0xfe00) != 0xf200
+	 (insn  0xfe00) != 0xf400)
+		/* Not NEON instruction, just fault.  */
+		return 1;
+
+	/* This shouldn't ever happen.  */
+	if (fault_code != FAULT_USER)
+		panic(NEON fault in non-user mode);
+
+	pcu_load(arm_vfp_ops);
+
+	/* Need to restart the faulted instruction.  */
+//	frame-tf_pc -= INSN_SIZE;
+	return 0;
+}
+#endif
+
 static void
-vfp_state_load(lwp_t *l, bool used)
+vfp_state_load(lwp_t *l, u_int flags)
 {
 	struct pcb * const pcb = lwp_getpcb(l);
+
+	KASSERT(flags  PCU_ENABLE);
+
+	if (flags  PCU_KERNEL) {
+		if ((flags  PCU_LOADED) == 0) {
+			pcb-pcb_kernel_vfp.vfp_fpexc = pcb-pcb_vfp.vfp_fpexc;
+			pcb-pcb_vfp.vfp_fpexc = VFP_FPEXC_EN;
+		}
+		write_fpexc(pcb-pcb_vfp.vfp_fpexc);
+		/*
+		 * Load the kernel registers (just the first 16) if they've
+		 * been used..
+		 */
+		if (flags  PCU_LOADED) {
+			load_vfpregs_lo(pcb-pcb_kernel_vfp.vfp_regs);
+		}
+		return;
+	}
 	struct vfpreg * const fregs = pcb-pcb_vfp;
 
 	/*
@@ -417,44 +509,32 @@ vfp_state_load(lwp_t *l, bool used)
 		return;
 	}
 
-	/* Enable the VFP (so that we can write the registers).  */
-	uint32_t fpexc = read_fpexc();
-	KDASSERT((fpexc  VFP_FPEXC_EX) == 0);
-	write_fpexc(fpexc | VFP_FPEXC_EN);
-
-	load_vfpregs_lo(fregs-vfp_regs);
-#ifdef CPU_CORTEX

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

2012-12-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 26 18:35:47 UTC 2012

Modified Files:
src/sys/arch/arm/vfp: pmap_vfp.S

Log Message:
Add not-yet-enabled code to use vfp_kernel_{acquire,release}


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/vfp/pmap_vfp.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/arm/vfp/pmap_vfp.S
diff -u src/sys/arch/arm/vfp/pmap_vfp.S:1.4 src/sys/arch/arm/vfp/pmap_vfp.S:1.5
--- src/sys/arch/arm/vfp/pmap_vfp.S:1.4	Tue Dec 11 23:59:18 2012
+++ src/sys/arch/arm/vfp/pmap_vfp.S	Wed Dec 26 18:35:47 2012
@@ -32,7 +32,7 @@
 #include machine/asm.h
 #include assym.h
 
-RCSID($NetBSD: pmap_vfp.S,v 1.4 2012/12/11 23:59:18 matt Exp $)
+RCSID($NetBSD: pmap_vfp.S,v 1.5 2012/12/26 18:35:47 matt Exp $)
 
 /*
  * This zeroes a page 64-bytes at a time.  64 was chosen over 32 since
@@ -40,11 +40,16 @@ RCSID($NetBSD: pmap_vfp.S,v 1.4 2012/12
  */
 /* LINTSTUB: void bzero_page_vfp(vaddr_t); */
 ENTRY(bzero_page_vfp)
+#if 0
+	str	lr, [sp, #-8]!
+	bl	_C_LABEL(vfp_kernel_acquire)
+#else
 	mrc	p10, 7, r3, c8, c0, 0
 	tst	r3, #VFP_FPEXC_EN
 	orreq	r2, r3, #VFP_FPEXC_EN
 	mcreq	p10, 7, r2, c8, c0, 0
 	vpush	{d0-d7}
+#endif
 #if (CPU_CORTEX == 0)
 	mov	ip, #0
 	vmov	s0, ip
@@ -69,9 +74,14 @@ ENTRY(bzero_page_vfp)
 	vstmia	r0!, {d0-d7}
 	cmp	r0, r2
 	blt	1b
+#if 0
+	ldr	lr, [sp], #8		/* fetch LR */
+	b	_C_LABEL(vfp_kernel_release)	/* tailcall the vfp release */
+#else
 	vpop	{d0-d7}
 	mcr	p10, 7, r3, c8, c0, 0
 	RET
+#endif
 END(bzero_page_vfp)
 
 /*
@@ -86,12 +96,17 @@ ENTRY(bcopy_page_vfp)
 	pld	[r0, #64]
 	pld	[r0, #96]
 #endif
+#if 0
+	str	lr, [sp, #-8]!
+	bl	_C_LABEL(vfp_kernel_acquire)
+#else
 	mrc	p10, 7, r3, c8, c0, 0
 	tst	r3, #VFP_FPEXC_EN
 	orreq	r2, r3, #VFP_FPEXC_EN
 	mcreq	p10, 7, r2, c8, c0, 0
 	vpush	{d0-d7}
 	add	r2, r0, #PAGE_SIZE-128
+#endif
 1:	
 #ifdef _ARM_ARCH_DWORD_OK
 	pld	[r0, #128]		@ preload the next 128
@@ -106,7 +121,12 @@ ENTRY(bcopy_page_vfp)
 	cmp	r0, r2
 	blt	1b
 	beq	2b
+#if 0
+	ldr	lr, [sp], #8		/* fetch LR */
+	b	_C_LABEL(vfp_kernel_release)	/* tailcall the vfp release */
+#else
 	vpop	{d0-d7}
 	mcr	p10, 7, r3, c8, c0, 0
 	RET
+#endif
 END(bcopy_page_vfp)



CVS commit: src/sys/arch/powerpc

2012-12-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 26 19:05:04 UTC 2012

Modified Files:
src/sys/arch/powerpc/booke: spe.c
src/sys/arch/powerpc/oea: altivec.c
src/sys/arch/powerpc/powerpc: fpu.c

Log Message:
Update to new pcu_state_{load,state,release} definitions


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/powerpc/booke/spe.c
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/powerpc/oea/altivec.c
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/powerpc/powerpc/fpu.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/powerpc/booke/spe.c
diff -u src/sys/arch/powerpc/booke/spe.c:1.5 src/sys/arch/powerpc/booke/spe.c:1.6
--- src/sys/arch/powerpc/booke/spe.c:1.5	Tue Jun  7 01:01:42 2011
+++ src/sys/arch/powerpc/booke/spe.c	Wed Dec 26 19:05:04 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: spe.c,v 1.5 2011/06/07 01:01:42 matt Exp $	*/
+/*	$NetBSD: spe.c,v 1.6 2012/12/26 19:05:04 matt Exp $	*/
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: spe.c,v 1.5 2011/06/07 01:01:42 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: spe.c,v 1.6 2012/12/26 19:05:04 matt Exp $);
 
 #include opt_altivec.h
 
@@ -49,9 +49,9 @@ __KERNEL_RCSID(0, $NetBSD: spe.c,v 1.5 
 #include powerpc/psl.h
 #include powerpc/pcb.h
 
-static void vec_state_load(lwp_t *, bool);
-static void vec_state_save(lwp_t *);
-static void vec_state_release(lwp_t *);
+static void vec_state_load(lwp_t *, u_int);
+static void vec_state_save(lwp_t *, u_int);
+static void vec_state_release(lwp_t *, u_int);
 
 const pcu_ops_t vec_ops = {
 	.pcu_id = PCU_VEC,
@@ -73,7 +73,7 @@ vec_mark_used(lwp_t *l)
 }
 
 void
-vec_state_load(lwp_t *l, bool used)
+vec_state_load(lwp_t *l, u_int flags)
 {
 	struct pcb * const pcb = lwp_getpcb(l);
 
@@ -110,7 +110,7 @@ vec_state_load(lwp_t *l, bool used)
 }
 
 void
-vec_state_save(lwp_t *l)
+vec_state_save(lwp_t *l, u_int flags)
 {
 	struct pcb * const pcb = lwp_getpcb(l);
 
@@ -135,7 +135,7 @@ vec_state_save(lwp_t *l)
 }
 
 void
-vec_state_release(lwp_t *l)
+vec_state_release(lwp_t *l, u_int flags)
 {
 	/*
 	 * Turn off SPV so the next SPE instruction will cause a

Index: src/sys/arch/powerpc/oea/altivec.c
diff -u src/sys/arch/powerpc/oea/altivec.c:1.25 src/sys/arch/powerpc/oea/altivec.c:1.26
--- src/sys/arch/powerpc/oea/altivec.c:1.25	Tue Jun  7 01:01:43 2011
+++ src/sys/arch/powerpc/oea/altivec.c	Wed Dec 26 19:05:03 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: altivec.c,v 1.25 2011/06/07 01:01:43 matt Exp $	*/
+/*	$NetBSD: altivec.c,v 1.26 2012/12/26 19:05:03 matt Exp $	*/
 
 /*
  * Copyright (C) 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: altivec.c,v 1.25 2011/06/07 01:01:43 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: altivec.c,v 1.26 2012/12/26 19:05:03 matt Exp $);
 
 #include opt_multiprocessor.h
 
@@ -49,9 +49,9 @@ __KERNEL_RCSID(0, $NetBSD: altivec.c,v 
 #include powerpc/oea/spr.h
 #include powerpc/psl.h
 
-static void vec_state_load(lwp_t *, bool);
-static void vec_state_save(lwp_t *);
-static void vec_state_release(lwp_t *);
+static void vec_state_load(lwp_t *, u_int);
+static void vec_state_save(lwp_t *, u_int);
+static void vec_state_release(lwp_t *, u_int);
 
 const pcu_ops_t vec_ops = {
 	.pcu_id = PCU_VEC,
@@ -73,7 +73,7 @@ vec_mark_used(lwp_t *l)
 }
 
 void
-vec_state_load(lwp_t *l, bool used)
+vec_state_load(lwp_t *l, u_int flags)
 {
 	struct pcb * const pcb = lwp_getpcb(l);
 
@@ -114,7 +114,7 @@ vec_state_load(lwp_t *l, bool used)
 }
 
 void
-vec_state_save(lwp_t *l)
+vec_state_save(lwp_t *l, u_int flags)
 {
 	struct pcb * const pcb = lwp_getpcb(l);
 
@@ -149,7 +149,7 @@ vec_state_save(lwp_t *l)
 }
 
 void
-vec_state_release(lwp_t *l)
+vec_state_release(lwp_t *l, u_int flags)
 {
 	__asm volatile(dssall;sync);
 	l-l_md.md_utf-tf_srr1 = ~PSL_VEC;

Index: src/sys/arch/powerpc/powerpc/fpu.c
diff -u src/sys/arch/powerpc/powerpc/fpu.c:1.31 src/sys/arch/powerpc/powerpc/fpu.c:1.32
--- src/sys/arch/powerpc/powerpc/fpu.c:1.31	Tue Jun  7 01:01:43 2011
+++ src/sys/arch/powerpc/powerpc/fpu.c	Wed Dec 26 19:05:03 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpu.c,v 1.31 2011/06/07 01:01:43 matt Exp $	*/
+/*	$NetBSD: fpu.c,v 1.32 2012/12/26 19:05:03 matt Exp $	*/
 
 /*
  * Copyright (C) 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: fpu.c,v 1.31 2011/06/07 01:01:43 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: fpu.c,v 1.32 2012/12/26 19:05:03 matt Exp $);
 
 #include opt_multiprocessor.h
 
@@ -48,9 +48,9 @@ __KERNEL_RCSID(0, $NetBSD: fpu.c,v 1.31
 #include machine/psl.h
 
 #ifdef PPC_HAVE_FPU
-static void fpu_state_load(lwp_t *, bool);
-static void fpu_state_save(lwp_t *);
-static void fpu_state_release(lwp_t *);
+static void fpu_state_load(lwp_t *, u_int);
+static void fpu_state_save(lwp_t *, u_int);
+static void fpu_state_release(lwp_t *, 

CVS commit: src/sys/arch/mips/mips

2012-12-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 26 19:09:07 UTC 2012

Modified Files:
src/sys/arch/mips/mips: mips_fpu.c

Log Message:
Update to use new pcu_state_{load,save,release} definitions.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/mips/mips/mips_fpu.c

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

Modified files:

Index: src/sys/arch/mips/mips/mips_fpu.c
diff -u src/sys/arch/mips/mips/mips_fpu.c:1.8 src/sys/arch/mips/mips/mips_fpu.c:1.9
--- src/sys/arch/mips/mips/mips_fpu.c:1.8	Mon Feb 27 15:57:21 2012
+++ src/sys/arch/mips/mips/mips_fpu.c	Wed Dec 26 19:09:07 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips_fpu.c,v 1.8 2012/02/27 15:57:21 matt Exp $	*/
+/*	$NetBSD: mips_fpu.c,v 1.9 2012/12/26 19:09:07 matt Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: mips_fpu.c,v 1.8 2012/02/27 15:57:21 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: mips_fpu.c,v 1.9 2012/12/26 19:09:07 matt Exp $);
 
 #include opt_multiprocessor.h
 
@@ -46,9 +46,9 @@ __KERNEL_RCSID(0, $NetBSD: mips_fpu.c,v
 #include mips/regnum.h
 #include mips/pcb.h
 
-static void mips_fpu_state_save(lwp_t *);
-static void mips_fpu_state_load(lwp_t *, bool);
-static void mips_fpu_state_release(lwp_t *);
+static void mips_fpu_state_save(lwp_t *, u_int);
+static void mips_fpu_state_load(lwp_t *, u_int);
+static void mips_fpu_state_release(lwp_t *, u_int);
 
 const pcu_ops_t mips_fpu_ops = {
 	.pcu_id = PCU_FPU,
@@ -82,7 +82,7 @@ fpu_used_p(void)
 }
 
 void
-mips_fpu_state_save(lwp_t *l)
+mips_fpu_state_save(lwp_t *l, u_int flags)
 {
 	struct trapframe * const tf = l-l_md.md_utf;
 	struct pcb * const pcb = lwp_getpcb(l);
@@ -205,7 +205,7 @@ mips_fpu_state_save(lwp_t *l)
 }
 
 void
-mips_fpu_state_load(lwp_t *l, bool used)
+mips_fpu_state_load(lwp_t *l, u_int flags)
 {
 	struct trapframe * const tf = l-l_md.md_utf;
 	struct pcb * const pcb = lwp_getpcb(l);
@@ -218,7 +218,7 @@ mips_fpu_state_load(lwp_t *l, bool used)
 	/*
 	 * If this is the first time the state is being loaded, zero it first.
 	 */
-	if (__predict_false(!used)) {
+	if (__predict_false(!(flags  PCU_LOADED) == 0)) {
 		memset(pcb-pcb_fpregs, 0, sizeof(pcb-pcb_fpregs));
 	}
 
@@ -343,7 +343,7 @@ mips_fpu_state_load(lwp_t *l, bool used)
 }
 
 void
-mips_fpu_state_release(lwp_t *l)
+mips_fpu_state_release(lwp_t *l, u_int flags)
 {
 
 	l-l_md.md_utf-tf_regs[_R_SR] = ~MIPS_SR_COP_1_BIT;



CVS commit: src/tools/gcc

2012-12-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Dec 26 19:11:27 UTC 2012

Modified Files:
src/tools/gcc: README.mknative

Log Message:
Note MKRUMP=no and the need to specify HAVE_GCC= explicitly when using
MKGCC=no. Also point at but number 47353.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/tools/gcc/README.mknative

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

Modified files:

Index: src/tools/gcc/README.mknative
diff -u src/tools/gcc/README.mknative:1.13 src/tools/gcc/README.mknative:1.14
--- src/tools/gcc/README.mknative:1.13	Thu Sep 27 11:29:49 2012
+++ src/tools/gcc/README.mknative	Wed Dec 26 19:11:27 2012
@@ -1,4 +1,4 @@
-$NetBSD: README.mknative,v 1.13 2012/09/27 11:29:49 skrll Exp $
+$NetBSD: README.mknative,v 1.14 2012/12/26 19:11:27 martin Exp $
 
 This file describes how to bootstrap the native toolchain on a new NetBSD
 platform (and how to update the new toolchain files, if needed).  These
@@ -22,6 +22,9 @@ work.
gets built, eliciting proper HAVE_*GETTEXT* defns in config.h files.)
 
 2. Build and install a cross toolchain (via build.sh -m MACHINE tools).
+   Note that while PR #47353 is not fixed, you can not use the -O option
+   to build.sh. Use -M instead. (The difference is only a minor layout/
+   pathname prefixe in the object directory pointed to bei either option.)
 
 3. In src/tools/gcc, do nbmake-MACHINE bootstrap-libgcc.
 
@@ -33,8 +36,11 @@ work.
will regenerate the proper libgcc config files.
 
 4. At top level, do
-   nbmake-MACHINE obj do-distrib-dirs MKGCC=no MKBINUTILS=no, and
-   nbmake-MACHINE includes HAVE_GCC= MKGCC=no MKBINUTILS=no.
+   nbmake-MACHINE obj do-distrib-dirs MKGCC=no MKBINUTILS=no HAVE_GCC=45, and
+   nbmake-MACHINE includes HAVE_GCC= MKGCC=no MKBINUTILS=no HAVE_GCC=45.
+   (Note: replace 45 [for gcc 4.5.x] with the appropriate version you are
+   going to mknative-for, the MKGCC=no prevents the standard makefiles from
+   picking up any gcc version info automatically)
 
 5. In src/lib/csu, do
nbmake-MACHINE dependall. and nbmake-MACHINE install.
@@ -55,7 +61,7 @@ work.
installs a header file that is not part of standard build.
 
 9. In src/lib, do
-   nbmake-MACHINE dependall install MKGCC=no.
+   nbmake-MACHINE dependall install MKGCC=no HAVE_GCC=45.
 
Optionally, all of the following may be set in the environment to reduce
the amount of code needed to build at this step.  Basically, it must be
@@ -67,6 +73,7 @@ work.
MKLINT=no
MKPROFILE=no
MKSHARE=no
+   MKRUMP=no
 
 10. In src/tools/gcc, do nbmake-MACHINE native-gcc.
 



CVS commit: src/sys/arch/alpha

2012-12-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 26 19:13:19 UTC 2012

Modified Files:
src/sys/arch/alpha/alpha: fp_complete.c
src/sys/arch/alpha/include: alpha.h

Log Message:
Update to new pcu_state_{load,save,release} definitions


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/alpha/alpha/fp_complete.c
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/alpha/include/alpha.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/alpha/alpha/fp_complete.c
diff -u src/sys/arch/alpha/alpha/fp_complete.c:1.14 src/sys/arch/alpha/alpha/fp_complete.c:1.15
--- src/sys/arch/alpha/alpha/fp_complete.c:1.14	Mon Feb  6 02:14:11 2012
+++ src/sys/arch/alpha/alpha/fp_complete.c	Wed Dec 26 19:13:19 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: fp_complete.c,v 1.14 2012/02/06 02:14:11 matt Exp $ */
+/* $NetBSD: fp_complete.c,v 1.15 2012/12/26 19:13:19 matt Exp $ */
 
 /*-
  * Copyright (c) 2001 Ross Harvey
@@ -35,7 +35,7 @@
 
 #include sys/cdefs.h			/* RCS ID  Copyright macro defns */
 
-__KERNEL_RCSID(0, $NetBSD: fp_complete.c,v 1.14 2012/02/06 02:14:11 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: fp_complete.c,v 1.15 2012/12/26 19:13:19 matt Exp $);
 
 #include opt_compat_osf1.h
 
@@ -719,7 +719,7 @@ done:
  * Load the float-point context for the current lwp.
  */
 void
-fpu_state_load(struct lwp *l, bool used)
+fpu_state_load(struct lwp *l, u_int flags)
 {
 	struct pcb * const pcb = lwp_getpcb(l);
 
@@ -749,7 +749,7 @@ fpu_state_load(struct lwp *l, bool used)
  */
 
 void
-fpu_state_save(struct lwp *l)
+fpu_state_save(struct lwp *l, u_int flags)
 {
 	struct pcb * const pcb = lwp_getpcb(l);
 
@@ -762,7 +762,7 @@ fpu_state_save(struct lwp *l)
  * Release the FPU.
  */
 void
-fpu_state_release(struct lwp *l)
+fpu_state_release(struct lwp *l, u_int flags)
 {
 	l-l_md.md_flags = ~MDLWP_FPACTIVE;
 }

Index: src/sys/arch/alpha/include/alpha.h
diff -u src/sys/arch/alpha/include/alpha.h:1.30 src/sys/arch/alpha/include/alpha.h:1.31
--- src/sys/arch/alpha/include/alpha.h:1.30	Mon Feb  6 02:14:13 2012
+++ src/sys/arch/alpha/include/alpha.h	Wed Dec 26 19:13:19 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: alpha.h,v 1.30 2012/02/06 02:14:13 matt Exp $ */
+/* $NetBSD: alpha.h,v 1.31 2012/12/26 19:13:19 matt Exp $ */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -109,9 +109,9 @@ char *	dot_conv(unsigned long);
 
 extern const pcu_ops_t fpu_ops;
 
-voidfpu_state_load(struct lwp *, bool);
-voidfpu_state_save(struct lwp *);
-voidfpu_state_release(struct lwp *);
+voidfpu_state_load(struct lwp *, u_int);
+voidfpu_state_save(struct lwp *, u_int);
+voidfpu_state_release(struct lwp *, u_int);
 
 static inline void
 fpu_load(void)



CVS commit: src/sys/arch/mips/mips

2012-12-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 26 19:15:16 UTC 2012

Modified Files:
src/sys/arch/mips/mips: mips_fpu.c

Log Message:
Fix typo


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/mips/mips/mips_fpu.c

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

Modified files:

Index: src/sys/arch/mips/mips/mips_fpu.c
diff -u src/sys/arch/mips/mips/mips_fpu.c:1.9 src/sys/arch/mips/mips/mips_fpu.c:1.10
--- src/sys/arch/mips/mips/mips_fpu.c:1.9	Wed Dec 26 19:09:07 2012
+++ src/sys/arch/mips/mips/mips_fpu.c	Wed Dec 26 19:15:16 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips_fpu.c,v 1.9 2012/12/26 19:09:07 matt Exp $	*/
+/*	$NetBSD: mips_fpu.c,v 1.10 2012/12/26 19:15:16 matt Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: mips_fpu.c,v 1.9 2012/12/26 19:09:07 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: mips_fpu.c,v 1.10 2012/12/26 19:15:16 matt Exp $);
 
 #include opt_multiprocessor.h
 
@@ -218,7 +218,7 @@ mips_fpu_state_load(lwp_t *l, u_int flag
 	/*
 	 * If this is the first time the state is being loaded, zero it first.
 	 */
-	if (__predict_false(!(flags  PCU_LOADED) == 0)) {
+	if (__predict_false((flags  PCU_LOADED) == 0)) {
 		memset(pcb-pcb_fpregs, 0, sizeof(pcb-pcb_fpregs));
 	}
 



CVS commit: src/sys/arch/mips/mips

2012-12-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 26 19:17:48 UTC 2012

Modified Files:
src/sys/arch/mips/mips: mips_dsp.c

Log Message:
Update to use new pcu_state_{load,save,release} definitions


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/mips/mips/mips_dsp.c

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

Modified files:

Index: src/sys/arch/mips/mips/mips_dsp.c
diff -u src/sys/arch/mips/mips/mips_dsp.c:1.1 src/sys/arch/mips/mips/mips_dsp.c:1.2
--- src/sys/arch/mips/mips/mips_dsp.c:1.1	Tue Aug 16 06:58:15 2011
+++ src/sys/arch/mips/mips/mips_dsp.c	Wed Dec 26 19:17:48 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips_dsp.c,v 1.1 2011/08/16 06:58:15 matt Exp $	*/
+/*	$NetBSD: mips_dsp.c,v 1.2 2012/12/26 19:17:48 matt Exp $	*/
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: mips_dsp.c,v 1.1 2011/08/16 06:58:15 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: mips_dsp.c,v 1.2 2012/12/26 19:17:48 matt Exp $);
 
 #include opt_multiprocessor.h
 
@@ -46,9 +46,9 @@ __KERNEL_RCSID(0, $NetBSD: mips_dsp.c,v
 #include mips/regnum.h
 #include mips/pcb.h
 
-static void mips_dsp_state_save(lwp_t *);
-static void mips_dsp_state_load(lwp_t *, bool);
-static void mips_dsp_state_release(lwp_t *);
+static void mips_dsp_state_save(lwp_t *, u_int);
+static void mips_dsp_state_load(lwp_t *, u_int);
+static void mips_dsp_state_release(lwp_t *, u_int);
 
 const pcu_ops_t mips_dsp_ops = {
 	.pcu_id = PCU_DSP,
@@ -82,7 +82,7 @@ dsp_used_p(void)
 }
 
 void
-mips_dsp_state_save(lwp_t *l)
+mips_dsp_state_save(lwp_t *l, u_int flags)
 {
 	struct trapframe * const tf = l-l_md.md_utf;
 	struct pcb * const pcb = lwp_getpcb(l);
@@ -134,7 +134,7 @@ mips_dsp_state_save(lwp_t *l)
 }
 
 void
-mips_dsp_state_load(lwp_t *l, bool used)
+mips_dsp_state_load(lwp_t *l, u_int flags)
 {
 	struct trapframe * const tf = l-l_md.md_utf;
 	struct pcb * const pcb = lwp_getpcb(l);
@@ -146,7 +146,7 @@ mips_dsp_state_load(lwp_t *l, bool used)
 	/*
 	 * If this is the first time the state is being loaded, zero it first.
 	 */
-	if (__predict_false(!used)) {
+	if (__predict_false((flags  PCU_LOADED) == 0)) {
 		memset(pcb-pcb_dspregs, 0, sizeof(pcb-pcb_dspregs));
 	}
 
@@ -192,7 +192,7 @@ mips_dsp_state_load(lwp_t *l, bool used)
 }
 
 void
-mips_dsp_state_release(lwp_t *l)
+mips_dsp_state_release(lwp_t *l, u_int flags)
 {
 
 	KASSERT(l == curlwp);



CVS commit: src/doc

2012-12-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 26 19:20:30 UTC 2012

Modified Files:
src/doc: CHANGES

Log Message:
Note NEON works on arm now.
Note new PCU changes.


To generate a diff of this commit:
cvs rdiff -u -r1.1772 -r1.1773 src/doc/CHANGES

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
diff -u src/doc/CHANGES:1.1772 src/doc/CHANGES:1.1773
--- src/doc/CHANGES:1.1772	Wed Dec 19 09:46:16 2012
+++ src/doc/CHANGES	Wed Dec 26 19:20:30 2012
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1772 $
+# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1773 $
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -160,3 +160,5 @@ Changes from NetBSD 6.0 to NetBSD 7.0:
 		[mbalmer 20121217]
 	postfix(1): Import version 2.8.13 [tron 20121218]
 	dhcpcd(8): Import dhcpcd-5.6.6 [roy 20121219]
+	arm: support NEON in userland [matt 20121226]
+	kernel: allow MD kernel code to use PCUs [matt 20121226]



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

2012-12-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Dec 26 19:43:10 UTC 2012

Modified Files:
src/sys/arch/ia64/include: Makefile mcontext.h types.h
Added Files:
src/sys/arch/ia64/include: ieee.h ieeefp.h math.h profile.h

Log Message:
Install headers needed for userland build.
Add missing accessors for pthread and TLS support - just dummies for now.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/ia64/include/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/arch/ia64/include/ieee.h \
src/sys/arch/ia64/include/ieeefp.h src/sys/arch/ia64/include/math.h \
src/sys/arch/ia64/include/profile.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/ia64/include/mcontext.h
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/ia64/include/types.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/ia64/include/Makefile
diff -u src/sys/arch/ia64/include/Makefile:1.4 src/sys/arch/ia64/include/Makefile:1.5
--- src/sys/arch/ia64/include/Makefile:1.4	Sun Jul 17 20:54:42 2011
+++ src/sys/arch/ia64/include/Makefile	Wed Dec 26 19:43:09 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.4 2011/07/17 20:54:42 joerg Exp $
+#	$NetBSD: Makefile,v 1.5 2012/12/26 19:43:09 martin Exp $
 
 INCSDIR= /usr/include/ia64
 
@@ -6,11 +6,11 @@ INCS=	_regset.h acpi_func.h acpi_machdep
 	aout_machdep.h asm.h atomic.h bootinfo.h bswap.h cdefs.h \
 	cpu.h cpufunc.h dig64.h disklabel.h efi.h \
 	elf_machdep.h endian.h endian_machdep.h float.h fpu.h frame.h \
-	ia64_cpu.h int_const.h int_fmtio.h int_limits.h \
+	ia64_cpu.h ieee.h ieeefp.h int_const.h int_fmtio.h int_limits.h \
 	int_mwgwtypes.h int_types.h intr.h intrcnt.h limits.h \
-	loadfile_machdep.h lock.h mca_machdep.h mcontext.h md_var.h \
-	pal.h param.h pcb.h pmap.h proc.h pte.h ptrace.h reg.h sal.h \
-	setjmp.h signal.h smp.h ssc.h types.h \
+	loadfile_machdep.h lock.h math.h mca_machdep.h mcontext.h md_var.h \
+	mutex.h pal.h param.h pcb.h pmap.h proc.h profile.h pte.h ptrace.h \
+	reg.h sal.h rwlock.h setjmp.h signal.h smp.h ssc.h types.h \
 	vmparam.h wchar_limits.h
 
 .include bsd.kinc.mk

Index: src/sys/arch/ia64/include/mcontext.h
diff -u src/sys/arch/ia64/include/mcontext.h:1.2 src/sys/arch/ia64/include/mcontext.h:1.3
--- src/sys/arch/ia64/include/mcontext.h:1.2	Mon Apr 28 20:23:25 2008
+++ src/sys/arch/ia64/include/mcontext.h	Wed Dec 26 19:43:10 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: mcontext.h,v 1.2 2008/04/28 20:23:25 martin Exp $	*/
+/*	$NetBSD: mcontext.h,v 1.3 2012/12/26 19:43:10 martin Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -95,4 +95,10 @@ typedef struct __mcontext {
 #define _UC_MACHINE_SP(uc)	((uc)-uc_mcontext.mc_special.sp)
 #endif
 
+static __inline void *
+__lwp_getprivate_fast(void)
+{
+	return (void*)0;
+}
+
 #endif	/* !_IA64_MCONTEXT_H_ */

Index: src/sys/arch/ia64/include/types.h
diff -u src/sys/arch/ia64/include/types.h:1.6 src/sys/arch/ia64/include/types.h:1.7
--- src/sys/arch/ia64/include/types.h:1.6	Sat Oct  1 15:59:28 2011
+++ src/sys/arch/ia64/include/types.h	Wed Dec 26 19:43:10 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.6 2011/10/01 15:59:28 chs Exp $	*/
+/*	$NetBSD: types.h,v 1.7 2012/12/26 19:43:10 martin Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -75,6 +75,7 @@ typedef	__volatile int		__cpu_simple_loc
 #define	__HAVE_OLD_DISKLABEL
 #define	__HAVE_ATOMIC64_OPS
 /* XXX: #define	__HAVE_CPU_MAXPROC */
+#define	__HAVE_TLS_VARIANT_I
 
 #if defined(_KERNEL)
 #define __HAVE_RAS

Added files:

Index: src/sys/arch/ia64/include/ieee.h
diff -u /dev/null src/sys/arch/ia64/include/ieee.h:1.1
--- /dev/null	Wed Dec 26 19:43:10 2012
+++ src/sys/arch/ia64/include/ieee.h	Wed Dec 26 19:43:10 2012
@@ -0,0 +1,3 @@
+/* $NetBSD: ieee.h,v 1.1 2012/12/26 19:43:10 martin Exp $ */
+
+#include sys/ieee754.h
Index: src/sys/arch/ia64/include/ieeefp.h
diff -u /dev/null src/sys/arch/ia64/include/ieeefp.h:1.1
--- /dev/null	Wed Dec 26 19:43:10 2012
+++ src/sys/arch/ia64/include/ieeefp.h	Wed Dec 26 19:43:10 2012
@@ -0,0 +1,73 @@
+/* $NetBSD: ieeefp.h,v 1.1 2012/12/26 19:43:10 martin Exp $ */
+
+/*
+ * Written by J.T. Conklin, Apr 28, 1995
+ * Public domain.
+ */
+
+#ifndef _IA64_IEEEFP_H_
+#define _IA64_IEEEFP_H_
+
+#include sys/featuretest.h
+
+#if defined(_NETBSD_SOURCE) || defined(_ISOC99_SOURCE)
+
+typedef int fenv_t;
+typedef int fexcept_t;
+
+#define	FE_INVALID	0x01	/* invalid operation exception */
+#define	FE_DIVBYZERO	0x02	/* divide-by-zero exception */
+#define	FE_OVERFLOW	0x04	/* overflow exception */
+#define	FE_UNDERFLOW	0x08	/* underflow exception */
+#define	FE_INEXACT	0x10	/* imprecise (loss of precision; inexact) */
+#define	FE_IOVERFLOW	0x20/* integer overflow */
+
+#define	FE_ALL_EXCEPT	0x3f
+
+/*
+ * These bits match the fpcr as well as bits 12:11
+ * in fp operate instructions
+ */
+#define	FE_TOWARDZERO	0	/* round to zero (truncate) */
+#define	FE_DOWNWARD	1	/* round toward 

CVS commit: src/sys/dev/usb

2012-12-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec 27 01:11:14 UTC 2012

Modified Files:
src/sys/dev/usb: if_otus.c

Log Message:
prevent double free on error.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/usb/if_otus.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/usb/if_otus.c
diff -u src/sys/dev/usb/if_otus.c:1.14 src/sys/dev/usb/if_otus.c:1.15
--- src/sys/dev/usb/if_otus.c:1.14	Sat Dec  8 21:59:16 2012
+++ src/sys/dev/usb/if_otus.c	Wed Dec 26 20:11:13 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_otus.c,v 1.14 2012/12/09 02:59:16 christos Exp $	*/
+/*	$NetBSD: if_otus.c,v 1.15 2012/12/27 01:11:13 christos Exp $	*/
 /*	$OpenBSD: if_otus.c,v 1.18 2010/08/27 17:08:00 jsg Exp $	*/
 
 /*-
@@ -18,7 +18,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_otus.c,v 1.14 2012/12/09 02:59:16 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_otus.c,v 1.15 2012/12/27 01:11:13 christos Exp $);
 /*-
  * Driver for Atheros AR9001U chipset.
  * http://www.atheros.com/pt/bulletins/AR9001USBBulletin.pdf
@@ -1876,7 +1876,6 @@ otus_tx(struct otus_softc *sc, struct mb
 	xferlen = sizeof(*head) + m-m_pkthdr.len;
 	m_copydata(m, 0, m-m_pkthdr.len, (void *)head[1]);
 	m_freem(m);
-	ieee80211_free_node(ni);
 
 	DPRINTFN(5, tx queued=%d len=%d mac=0x%04x phy=0x%08x rate=%d\n,
 	sc-sc_tx_queued, head-len, head-macctl, head-phyctl,
@@ -1887,6 +1886,7 @@ otus_tx(struct otus_softc *sc, struct mb
 	if (__predict_false(error != USBD_IN_PROGRESS  error != 0))
 		return error;
 
+	ieee80211_free_node(ni);
 	sc-sc_tx_queued++;
 	sc-sc_tx_cur = (sc-sc_tx_cur + 1) % OTUS_TX_DATA_LIST_COUNT;
 



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

2012-12-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Dec 27 06:29:50 UTC 2012

Modified Files:
src/sys/arch/ia64/include: asm.h

Log Message:
Add support for WARN_REFERENCESE and __KERNEL_RCSID for assembler files.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/ia64/include/asm.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/ia64/include/asm.h
diff -u src/sys/arch/ia64/include/asm.h:1.4 src/sys/arch/ia64/include/asm.h:1.5
--- src/sys/arch/ia64/include/asm.h:1.4	Wed Aug 30 11:14:23 2006
+++ src/sys/arch/ia64/include/asm.h	Thu Dec 27 06:29:50 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: asm.h,v 1.4 2006/08/30 11:14:23 cherry Exp $	*/
+/*	$NetBSD: asm.h,v 1.5 2012/12/27 06:29:50 martin Exp $	*/
 
 /* -
  * Copyright (c) 1991,1990,1989,1994,1995,1996 Carnegie Mellon University
@@ -183,3 +183,38 @@ label:	ASCIZ msg;\
 #define STRONG_ALIAS(alias,sym)	\
 	.globl alias;		\
 	alias = sym
+
+/*
+ * WARN_REFERENCES: create a warning if the specified symbol is referenced.
+ */
+#ifdef __STDC__
+#define	WARN_REFERENCES(sym,msg)	\
+	.pushsection .gnu.warning. ## sym;\
+	.ascii msg;			\
+	.popsection
+#else
+#define	WARN_REFERENCES(sym,msg)	\
+	.pushsection .gnu.warning./**/sym;\
+	.ascii msg;			\
+	.popsection
+#endif /* __STDC__ */
+
+
+/*
+ * Kernel RCS ID tag and copyright macros
+ */
+
+#ifdef _KERNEL
+
+#define	__KERNEL_SECTIONSTRING(_sec, _str)\
+	.pushsection _sec ; .asciz _str ; .popsection
+
+#define	__KERNEL_RCSID(_n, _s)		__KERNEL_SECTIONSTRING(.ident, _s)
+#define	__KERNEL_COPYRIGHT(_n, _s)	__KERNEL_SECTIONSTRING(.copyright, _s)
+
+#ifdef NO_KERNEL_RCSIDS
+#undef __KERNEL_RCSID
+#define	__KERNEL_RCSID(_n, _s)		/* nothing */
+#endif
+
+#endif /* _KERNEL */



CVS commit: src/sys/arch/xen

2012-12-26 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Thu Dec 27 06:42:14 UTC 2012

Modified Files:
src/sys/arch/xen/include: intr.h
src/sys/arch/xen/x86: xen_ipi.c

Log Message:
Remove unused header evtchn.h from intr.h


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/xen/include/intr.h
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/xen/x86/xen_ipi.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/xen/include/intr.h
diff -u src/sys/arch/xen/include/intr.h:1.34 src/sys/arch/xen/include/intr.h:1.35
--- src/sys/arch/xen/include/intr.h:1.34	Fri Feb 17 18:40:19 2012
+++ src/sys/arch/xen/include/intr.h	Thu Dec 27 06:42:14 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.h,v 1.34 2012/02/17 18:40:19 bouyer Exp $	*/
+/*	$NetBSD: intr.h,v 1.35 2012/12/27 06:42:14 cherry Exp $	*/
 /*	NetBSD intr.h,v 1.15 2004/10/31 10:39:34 yamt Exp	*/
 
 /*-
@@ -38,7 +38,6 @@
 #ifndef _LOCORE
 #include xen/xen.h
 #include xen/hypervisor.h
-#include xen/evtchn.h
 #include machine/pic.h
 #include sys/evcnt.h
 

Index: src/sys/arch/xen/x86/xen_ipi.c
diff -u src/sys/arch/xen/x86/xen_ipi.c:1.10 src/sys/arch/xen/x86/xen_ipi.c:1.11
--- src/sys/arch/xen/x86/xen_ipi.c:1.10	Fri Feb 17 18:40:20 2012
+++ src/sys/arch/xen/x86/xen_ipi.c	Thu Dec 27 06:42:14 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: xen_ipi.c,v 1.10 2012/02/17 18:40:20 bouyer Exp $ */
+/* $NetBSD: xen_ipi.c,v 1.11 2012/12/27 06:42:14 cherry Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -33,10 +33,10 @@
 
 /* 
  * Based on: x86/ipi.c
- * __KERNEL_RCSID(0, $NetBSD: xen_ipi.c,v 1.10 2012/02/17 18:40:20 bouyer Exp $); 
+ * __KERNEL_RCSID(0, $NetBSD: xen_ipi.c,v 1.11 2012/12/27 06:42:14 cherry Exp $); 
  */
 
-__KERNEL_RCSID(0, $NetBSD: xen_ipi.c,v 1.10 2012/02/17 18:40:20 bouyer Exp $);
+__KERNEL_RCSID(0, $NetBSD: xen_ipi.c,v 1.11 2012/12/27 06:42:14 cherry Exp $);
 
 #include sys/types.h
 
@@ -56,6 +56,7 @@ __KERNEL_RCSID(0, $NetBSD: xen_ipi.c,v 
 #include machine/frame.h
 #include machine/segments.h
 
+#include xen/evtchn.h
 #include xen/intr.h
 #include xen/intrdefs.h
 #include xen/hypervisor.h



CVS commit: src/sys/sys

2012-12-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Dec 27 06:55:49 UTC 2012

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

Log Message:
Add a MID for IA64 (also it never used a.out, we need it for kernel crash
dumps)


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/sys/aout_mids.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/aout_mids.h
diff -u src/sys/sys/aout_mids.h:1.1 src/sys/sys/aout_mids.h:1.2
--- src/sys/sys/aout_mids.h:1.1	Thu Aug 20 22:07:49 2009
+++ src/sys/sys/aout_mids.h	Thu Dec 27 06:55:49 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: aout_mids.h,v 1.1 2009/08/20 22:07:49 he Exp $ */
+/* $NetBSD: aout_mids.h,v 1.2 2012/12/27 06:55:49 martin Exp $ */
 
 /*
  * Copyright (c) 2009, The NetBSD Foundation, Inc.
@@ -60,6 +60,7 @@
 #define	MID_SPARC64	156	/* LP64 sparc */
 #define	MID_X86_64	157	/* AMD x86-64 */
 #define	MID_SH5_32	158	/* ILP32 SH5 */
+#define	MID_IA64	159	/* Itanium */
 #define	MID_HP200	200	/* hp200 (68010) BSD binary */
 #define	MID_HP300	300	/* hp300 (68020+68881) BSD binary */
 #define	MID_HPUX	0x20C	/* hp200/300 HP-UX binary */



CVS commit: src/lib/libc/net

2012-12-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Dec 27 07:08:59 UTC 2012

Modified Files:
src/lib/libc/net: Makefile.inc

Log Message:
Avoid gcc 4.5.3 compiler bug on ia64 by compiling hesiod.c with -O1 only.


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/lib/libc/net/Makefile.inc

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/net/Makefile.inc
diff -u src/lib/libc/net/Makefile.inc:1.81 src/lib/libc/net/Makefile.inc:1.82
--- src/lib/libc/net/Makefile.inc:1.81	Fri Jan 20 14:08:05 2012
+++ src/lib/libc/net/Makefile.inc	Thu Dec 27 07:08:59 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.81 2012/01/20 14:08:05 joerg Exp $
+#	$NetBSD: Makefile.inc,v 1.82 2012/12/27 07:08:59 martin Exp $
 #	@(#)Makefile.inc	8.2 (Berkeley) 9/5/93
 
 # net sources
@@ -17,6 +17,9 @@ SRCS+=	base64.c ethers.c gethnamaddr.c g
 
 .if (${MKHESIOD} != no)
 SRCS+=	hesiod.c
+.if ${HAVE_GCC:U} == 45  ${MACHINE_CPU} == ia64
+COPTS.hesiod.c+=	${${ACTIVE_CC} == gcc :? -O1 :}
+.endif
 .endif
 
 SRCS+=	getaddrinfo.c getnameinfo.c



CVS commit: src/doc

2012-12-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Dec 27 07:09:46 UTC 2012

Modified Files:
src/doc: HACKS

Log Message:
Document libc hesiod.c compiler workaround on ia64


To generate a diff of this commit:
cvs rdiff -u -r1.124 -r1.125 src/doc/HACKS

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

Modified files:

Index: src/doc/HACKS
diff -u src/doc/HACKS:1.124 src/doc/HACKS:1.125
--- src/doc/HACKS:1.124	Wed Nov 14 04:13:44 2012
+++ src/doc/HACKS	Thu Dec 27 07:09:45 2012
@@ -1,4 +1,4 @@
-# $NetBSD: HACKS,v 1.124 2012/11/14 04:13:44 msaitoh Exp $
+# $NetBSD: HACKS,v 1.125 2012/12/27 07:09:45 martin Exp $
 #
 # This file is intended to document workarounds for currently unsolved
 # (mostly) compiler bugs.
@@ -739,3 +739,19 @@ port	emips
 		Assertion failure in append_insn at /usr/src/external/gpl3/\
 		binutils/dist/gas/config/tc-mips.c line 2910.
 	kcah
+
+port	ia64
+
+	hack	libc hesiod.c file does not compile with -O2 (internal
+		compiler error in gcc 4.5.3)
+	cdate	Thu Dec 27 08:05:43 CET 2012
+	who	martin
+	file	src/lib/libc/net/Makefile.inc: 1.82
+	descr
+		workaround for:
+		{standard input}: Assembler messages:
+		{standard input}:1507: Warning: Use of 'mov' may violate WAW dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 15
+		{standard input}:1506: Warning: This is the location of the conflicting usage
+		{standard input}: Error: 2 warnings, treating warnings as errors
+	kcah
+



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

2012-12-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Dec 27 07:14:25 UTC 2012

Modified Files:
src/sys/arch/ia64/include: wchar_limits.h

Log Message:
Add WCHAR_MIN and WCHAR_MAX.
Why don't we use the compiler supplied __WCHAR_MIN__ and __WCHAR_MAX__ for
this?


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/ia64/include/wchar_limits.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/ia64/include/wchar_limits.h
diff -u src/sys/arch/ia64/include/wchar_limits.h:1.2 src/sys/arch/ia64/include/wchar_limits.h:1.3
--- src/sys/arch/ia64/include/wchar_limits.h:1.2	Mon Apr 28 20:23:25 2008
+++ src/sys/arch/ia64/include/wchar_limits.h	Thu Dec 27 07:14:24 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: wchar_limits.h,v 1.2 2008/04/28 20:23:25 martin Exp $	*/
+/*	$NetBSD: wchar_limits.h,v 1.3 2012/12/27 07:14:24 martin Exp $	*/
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -32,4 +32,16 @@
 #ifndef _IA64_WCHAR_LIMITS_H_
 #define _IA64_WCHAR_LIMITS_H_
 
+/*
+ * 7.18.3 Limits of other integer types
+ */
+
+/* limits of wchar_t */
+#define	WCHAR_MIN	(-0x7fff-1)			/* wchar_t	  */
+#define	WCHAR_MAX	0x7fff			/* wchar_t	  */
+
+/* limits of wint_t */
+#define	WINT_MIN	(-0x7fff-1)			/* wint_t	  */
+#define	WINT_MAX	0x7fff			/* wint_t	  */
+
 #endif /* !_IA64_WCHAR_LIMITS_H_ */



CVS commit: src/sbin/swapctl

2012-12-26 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Wed Dec 26 10:15:29 UTC 2012

Modified Files:
src/sbin/swapctl: swapctl.c

Log Message:
Allow named wedges to be used on command line, also fix name lookup
for the dump device.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sbin/swapctl/swapctl.c

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



CVS commit: src/usr.sbin/btdevctl

2012-12-26 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Wed Dec 26 17:33:09 UTC 2012

Modified Files:
src/usr.sbin/btdevctl: btdevctl.8

Log Message:
add a comment pointing out that the link-mode may need to be
changed manually, for devices which cannot authenticate

for PR/47286


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/btdevctl/btdevctl.8

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



CVS commit: src/usr.sbin/btdevctl

2012-12-26 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Wed Dec 26 17:57:49 UTC 2012

Modified Files:
src/usr.sbin/btdevctl: btdevctl.8

Log Message:
whitespace '  ' - ' '


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/btdevctl/btdevctl.8

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



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

2012-12-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 26 18:28:09 UTC 2012

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

Log Message:
Bump SYMTAB_SPACE


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/evbarm/conf/TISDP2430

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



CVS commit: src/sys

2012-12-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 26 18:30:23 UTC 2012

Modified Files:
src/sys/kern: subr_pcu.c
src/sys/sys: lwp.h pcu.h

Log Message:
Add support for kernel-based code to use a PCU.  (for memory to memory
copies or in_cksum or ...)


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/kern/subr_pcu.c
cvs rdiff -u -r1.165 -r1.166 src/sys/sys/lwp.h
cvs rdiff -u -r1.9 -r1.10 src/sys/sys/pcu.h

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



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

2012-12-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 26 18:32:01 UTC 2012

Modified Files:
src/sys/arch/arm/include: pcb.h

Log Message:
Remove pcb_fpstate.
Add pcb_kernel_vfp.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/arm/include/pcb.h

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



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

2012-12-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 26 18:32:41 UTC 2012

Modified Files:
src/sys/arch/arm/include: cpu.h

Log Message:
Add vfp_kernel_acquire and vfp_kernel_release prototypes.


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/arch/arm/include/cpu.h

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



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

2012-12-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 26 18:34:57 UTC 2012

Modified Files:
src/sys/arch/arm/vfp: vfp_init.c

Log Message:
Add support for PCU_KERNEL and vfp_kernel_acquire/vfp_kernel_release.
Add an undefined handler to catch NEON instructions.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/arm/vfp/vfp_init.c

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



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

2012-12-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 26 18:35:47 UTC 2012

Modified Files:
src/sys/arch/arm/vfp: pmap_vfp.S

Log Message:
Add not-yet-enabled code to use vfp_kernel_{acquire,release}


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/vfp/pmap_vfp.S

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



CVS commit: src/sys/arch/powerpc

2012-12-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 26 19:05:04 UTC 2012

Modified Files:
src/sys/arch/powerpc/booke: spe.c
src/sys/arch/powerpc/oea: altivec.c
src/sys/arch/powerpc/powerpc: fpu.c

Log Message:
Update to new pcu_state_{load,state,release} definitions


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/powerpc/booke/spe.c
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/powerpc/oea/altivec.c
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/powerpc/powerpc/fpu.c

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



CVS commit: src/sys/arch/mips/mips

2012-12-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 26 19:09:07 UTC 2012

Modified Files:
src/sys/arch/mips/mips: mips_fpu.c

Log Message:
Update to use new pcu_state_{load,save,release} definitions.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/mips/mips/mips_fpu.c

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



CVS commit: src/tools/gcc

2012-12-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Dec 26 19:11:27 UTC 2012

Modified Files:
src/tools/gcc: README.mknative

Log Message:
Note MKRUMP=no and the need to specify HAVE_GCC= explicitly when using
MKGCC=no. Also point at but number 47353.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/tools/gcc/README.mknative

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



CVS commit: src/sys/arch/alpha

2012-12-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 26 19:13:19 UTC 2012

Modified Files:
src/sys/arch/alpha/alpha: fp_complete.c
src/sys/arch/alpha/include: alpha.h

Log Message:
Update to new pcu_state_{load,save,release} definitions


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/alpha/alpha/fp_complete.c
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/alpha/include/alpha.h

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



CVS commit: src/sys/arch/mips/mips

2012-12-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 26 19:15:16 UTC 2012

Modified Files:
src/sys/arch/mips/mips: mips_fpu.c

Log Message:
Fix typo


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/mips/mips/mips_fpu.c

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



CVS commit: src/sys/arch/mips/mips

2012-12-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 26 19:17:48 UTC 2012

Modified Files:
src/sys/arch/mips/mips: mips_dsp.c

Log Message:
Update to use new pcu_state_{load,save,release} definitions


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/mips/mips/mips_dsp.c

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



CVS commit: src/doc

2012-12-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 26 19:20:30 UTC 2012

Modified Files:
src/doc: CHANGES

Log Message:
Note NEON works on arm now.
Note new PCU changes.


To generate a diff of this commit:
cvs rdiff -u -r1.1772 -r1.1773 src/doc/CHANGES

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



CVS commit: src/external/lgpl3/gmp/lib/libgmp/arch/ia64

2012-12-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Dec 26 19:39:26 UTC 2012

Added Files:
src/external/lgpl3/gmp/lib/libgmp/arch/ia64: Makefile.inc config.h
config.m4 gmp-mparam.h gmp.h mp.h

Log Message:
Build glue for ia64


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 \
src/external/lgpl3/gmp/lib/libgmp/arch/ia64/Makefile.inc \
src/external/lgpl3/gmp/lib/libgmp/arch/ia64/config.h \
src/external/lgpl3/gmp/lib/libgmp/arch/ia64/config.m4 \
src/external/lgpl3/gmp/lib/libgmp/arch/ia64/gmp-mparam.h \
src/external/lgpl3/gmp/lib/libgmp/arch/ia64/gmp.h \
src/external/lgpl3/gmp/lib/libgmp/arch/ia64/mp.h

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



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

2012-12-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Dec 26 19:43:10 UTC 2012

Modified Files:
src/sys/arch/ia64/include: Makefile mcontext.h types.h
Added Files:
src/sys/arch/ia64/include: ieee.h ieeefp.h math.h profile.h

Log Message:
Install headers needed for userland build.
Add missing accessors for pthread and TLS support - just dummies for now.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/ia64/include/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/arch/ia64/include/ieee.h \
src/sys/arch/ia64/include/ieeefp.h src/sys/arch/ia64/include/math.h \
src/sys/arch/ia64/include/profile.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/ia64/include/mcontext.h
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/ia64/include/types.h

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



CVS commit: src/sys/dev/usb

2012-12-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec 27 01:11:14 UTC 2012

Modified Files:
src/sys/dev/usb: if_otus.c

Log Message:
prevent double free on error.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/usb/if_otus.c

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



CVS commit: src/sys/arch/xen

2012-12-26 Thread Cherry G. Mathew
Module Name:src
Committed By:   cherry
Date:   Thu Dec 27 06:42:14 UTC 2012

Modified Files:
src/sys/arch/xen/include: intr.h
src/sys/arch/xen/x86: xen_ipi.c

Log Message:
Remove unused header evtchn.h from intr.h


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/xen/include/intr.h
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/xen/x86/xen_ipi.c

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



CVS commit: src/sys/sys

2012-12-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Dec 27 06:55:49 UTC 2012

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

Log Message:
Add a MID for IA64 (also it never used a.out, we need it for kernel crash
dumps)


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/sys/aout_mids.h

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



CVS commit: src/lib/libc/net

2012-12-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Dec 27 07:08:59 UTC 2012

Modified Files:
src/lib/libc/net: Makefile.inc

Log Message:
Avoid gcc 4.5.3 compiler bug on ia64 by compiling hesiod.c with -O1 only.


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/lib/libc/net/Makefile.inc

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



CVS commit: src/doc

2012-12-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Dec 27 07:09:46 UTC 2012

Modified Files:
src/doc: HACKS

Log Message:
Document libc hesiod.c compiler workaround on ia64


To generate a diff of this commit:
cvs rdiff -u -r1.124 -r1.125 src/doc/HACKS

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



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

2012-12-26 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Dec 27 07:14:25 UTC 2012

Modified Files:
src/sys/arch/ia64/include: wchar_limits.h

Log Message:
Add WCHAR_MIN and WCHAR_MAX.
Why don't we use the compiler supplied __WCHAR_MIN__ and __WCHAR_MAX__ for
this?


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/ia64/include/wchar_limits.h

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