CVS commit: [matt-nb5-mips64] src/sys/arch/arm/arm32

2015-08-12 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Aug 13 00:07:15 UTC 2015

Modified Files:
src/sys/arch/arm/arm32 [matt-nb5-mips64]: arm32_kvminit.c

Log Message:
Make sure the amount of direct mapped memory doesn't cross over into the
mappable KVA range.


To generate a diff of this commit:
cvs rdiff -u -r1.22.2.3 -r1.22.2.4 src/sys/arch/arm/arm32/arm32_kvminit.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/arm32/arm32_kvminit.c
diff -u src/sys/arch/arm/arm32/arm32_kvminit.c:1.22.2.3 src/sys/arch/arm/arm32/arm32_kvminit.c:1.22.2.4
--- src/sys/arch/arm/arm32/arm32_kvminit.c:1.22.2.3	Mon Mar 24 07:37:39 2014
+++ src/sys/arch/arm/arm32/arm32_kvminit.c	Thu Aug 13 00:07:15 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: arm32_kvminit.c,v 1.22.2.3 2014/03/24 07:37:39 matt Exp $	*/
+/*	$NetBSD: arm32_kvminit.c,v 1.22.2.4 2015/08/13 00:07:15 matt Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003, 2005  Genetec Corporation.  All rights reserved.
@@ -122,7 +122,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: arm32_kvminit.c,v 1.22.2.3 2014/03/24 07:37:39 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arm32_kvminit.c,v 1.22.2.4 2015/08/13 00:07:15 matt Exp $");
 
 #include 
 #include 
@@ -773,6 +773,14 @@ arm32_kernel_vm_init(vaddr_t kernel_vm_b
 		}
 	}
 
+	// The amount we can direct is limited by the start of the
+	// virtual part of the kernel address space.  Don't overrun
+	// into it. 
+	if (mapallmem_p && cur_pv.pv_va + cur_pv.pv_size > kernel_vm_base) {
+		cur_pv.pv_size = kernel_vm_base - cur_pv.pv_va;
+	}
+
+
 	/*
 	 * Now we map the final chunk.
 	 */



CVS commit: [matt-nb5-mips64] src/sys/arch/evbarm/bcm53xx

2015-07-17 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jul 17 20:32:27 UTC 2015

Modified Files:
src/sys/arch/evbarm/bcm53xx [matt-nb5-mips64]: bcm53xx_machdep.c

Log Message:
Deal with > 1GB of memory.


To generate a diff of this commit:
cvs rdiff -u -r1.7.4.3 -r1.7.4.4 \
src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c

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

Modified files:

Index: src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c
diff -u src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c:1.7.4.3 src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c:1.7.4.4
--- src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c:1.7.4.3	Wed Mar 26 02:15:02 2014
+++ src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c	Fri Jul 17 20:32:27 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm53xx_machdep.c,v 1.7.4.3 2014/03/26 02:15:02 matt Exp $	*/
+/*	$NetBSD: bcm53xx_machdep.c,v 1.7.4.4 2015/07/17 20:32:27 matt Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #define IDM_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bcm53xx_machdep.c,v 1.7.4.3 2014/03/26 02:15:02 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm53xx_machdep.c,v 1.7.4.4 2015/07/17 20:32:27 matt Exp $");
 
 #include "opt_evbarm_boardtype.h"
 #include "opt_broadcom.h"
@@ -258,6 +258,20 @@ initarm(void *arg)
 #endif
 	const bool bigmem_p = (memsize >> PGSHIFT) > bp_first256.bp_pages;
 
+#ifdef __HAVE_MM_MD_DIRECT_MAPPED_PHYS
+	const bool mapallmem_p = true;
+#ifndef PMAP_NEED_ALLOC_POOLPAGE
+	if (memsize > KERNEL_VM_BASE - KERNEL_BASE) {
+		printf("%s: dropping RAM size from %luMB to %uMB\n",
+		   __func__, (unsigned long) (ram_size >> 20),
+		   (KERNEL_VM_BASE - KERNEL_BASE) >> 20);
+		memsize = KERNEL_VM_BASE - KERNEL_BASE;
+	}
+#endif
+#else
+	const bool mapallmem_p = false;
+#endif
+	KASSERT((armreg_pfr1_read() & ARM_PFR1_SEC_MASK) != 0);
 	arm32_bootmem_init(KERN_VTOPHYS(KERNEL_BASE), memsize,
 	(paddr_t)KERNEL_BASE_phys);
 
@@ -273,7 +287,8 @@ initarm(void *arg)
 	 * abtstack, undstack, kernelstack, msgbufphys will be set to point to
 	 * the memory that was allocated for them.
 	 */
-	arm32_kernel_vm_init(KERNEL_VM_BASE, ARM_VECTORS_HIGH, 0, devmap, true);
+	arm32_kernel_vm_init(KERNEL_VM_BASE, ARM_VECTORS_HIGH, 0, devmap,
+	mapallmem_p);
 
 	cpu_reset_address = bcm53xx_system_reset;
 	/* we've a specific device_register routine */



CVS commit: [matt-nb5-mips64] src/sys/arch/arm/arm

2014-06-09 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Jun  9 21:03:20 UTC 2014

Modified Files:
src/sys/arch/arm/arm [matt-nb5-mips64]: cpufunc.c

Log Message:
Fix tpyo.


To generate a diff of this commit:
cvs rdiff -u -r1.89.10.2 -r1.89.10.3 src/sys/arch/arm/arm/cpufunc.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/arm/cpufunc.c
diff -u src/sys/arch/arm/arm/cpufunc.c:1.89.10.2 src/sys/arch/arm/arm/cpufunc.c:1.89.10.3
--- src/sys/arch/arm/arm/cpufunc.c:1.89.10.2	Wed Mar 26 02:00:45 2014
+++ src/sys/arch/arm/arm/cpufunc.c	Mon Jun  9 21:03:19 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpufunc.c,v 1.89.10.2 2014/03/26 02:00:45 matt Exp $	*/
+/*	$NetBSD: cpufunc.c,v 1.89.10.3 2014/06/09 21:03:19 matt Exp $	*/
 
 /*
  * arm7tdmi support code Copyright (c) 2001 John Fremlin
@@ -49,7 +49,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.89.10.2 2014/03/26 02:00:45 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.89.10.3 2014/06/09 21:03:19 matt Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_cpuoptions.h"
@@ -3057,7 +3057,7 @@ armv7_setup(char *args)
 #ifdef __ARMEB__
 	| CPU_CONTROL_EX_BEND
 #endif
-#ifdef ARM32_DISABLE_ALIGNMENT_FAULTS
+#ifndef ARM32_DISABLE_ALIGNMENT_FAULTS
 	| CPU_CONTROL_AFLT_ENABLE
 #endif
 	| CPU_CONTROL_UNAL_ENABLE;



CVS commit: [matt-nb5-mips64] src/gnu/dist/binutils/bfd

2014-04-05 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Apr  5 07:19:34 UTC 2014

Modified Files:
src/gnu/dist/binutils/bfd [matt-nb5-mips64]: elf32-arm.c

Log Message:
When writing BE8 executables, make the PLTs are written as little endian.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.1.1.1.32.1 src/gnu/dist/binutils/bfd/elf32-arm.c

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

Modified files:

Index: src/gnu/dist/binutils/bfd/elf32-arm.c
diff -u src/gnu/dist/binutils/bfd/elf32-arm.c:1.1.1.1 src/gnu/dist/binutils/bfd/elf32-arm.c:1.1.1.1.32.1
--- src/gnu/dist/binutils/bfd/elf32-arm.c:1.1.1.1	Thu Feb  2 20:45:20 2006
+++ src/gnu/dist/binutils/bfd/elf32-arm.c	Sat Apr  5 07:19:34 2014
@@ -2012,6 +2012,35 @@ insert_thumb_branch (insn32 br_insn, int
   return br_insn;
 }
 
+
+/* Store an Arm insn into an output section not processed by
+   elf32_arm_write_section.  */
+
+static void
+put_arm_insn(struct elf32_arm_link_hash_table *htab,
+	 bfd * output_bfd, bfd_vma val, void * ptr)
+{
+if (htab->byteswap_code != bfd_little_endian (output_bfd))
+  bfd_putl32(val, ptr);
+else
+  bfd_putb32(val, ptr);
+}
+
+
+/* Store a 16-bit Thumb insn into an output section not processed by
+   elf32_arm_write_section.  */
+
+static void
+put_thumb_insn(struct elf32_arm_link_hash_table *htab,
+	   bfd * output_bfd, bfd_vma val, void * ptr)
+{
+if (htab->byteswap_code != bfd_little_endian (output_bfd))
+  bfd_putl16(val, ptr);
+else
+  bfd_putb16(val, ptr);
+}
+
+
 /* Thumb code calling an ARM function.  */
 
 static int
@@ -2068,11 +2097,11 @@ elf32_thumb_to_arm_stub (struct bfd_link
   --my_offset;
   myh->root.u.def.value = my_offset;
 
-  bfd_put_16 (output_bfd, (bfd_vma) t2a1_bx_pc_insn,
-		  s->contents + my_offset);
+  put_thumb_insn (globals, output_bfd, (bfd_vma) t2a1_bx_pc_insn,
+		  s->contents + my_offset);
 
-  bfd_put_16 (output_bfd, (bfd_vma) t2a2_noop_insn,
-		  s->contents + my_offset + 2);
+  put_thumb_insn (globals, output_bfd, (bfd_vma) t2a2_noop_insn,
+		  s->contents + my_offset + 2);
 
   ret_offset =
 	/* Address of destination of the stub.  */
@@ -2090,9 +2119,9 @@ elf32_thumb_to_arm_stub (struct bfd_link
 	   /* ARM branches work from the pc of the instruction + 8.  */
 	   + 8);
 
-  bfd_put_32 (output_bfd,
-		  (bfd_vma) t2a3_b_insn | ((ret_offset >> 2) & 0x00FF),
-		  s->contents + my_offset + 4);
+  put_arm_insn (globals, output_bfd,
+		(bfd_vma) t2a3_b_insn | ((ret_offset >> 2) & 0x00FF),
+		s->contents + my_offset + 4);
 }
 
   BFD_ASSERT (my_offset <= globals->thumb_glue_size);
@@ -2171,11 +2200,11 @@ elf32_arm_to_thumb_stub (struct bfd_link
   --my_offset;
   myh->root.u.def.value = my_offset;
 
-  bfd_put_32 (output_bfd, (bfd_vma) a2t1_ldr_insn,
-		  s->contents + my_offset);
+  put_arm_insn (globals, output_bfd, (bfd_vma) a2t1_ldr_insn,
+		s->contents + my_offset);
 
-  bfd_put_32 (output_bfd, (bfd_vma) a2t2_bx_r12_insn,
-		  s->contents + my_offset + 4);
+  put_arm_insn (globals, output_bfd, (bfd_vma) a2t2_bx_r12_insn,
+		s->contents + my_offset + 4);
 
   /* It's a thumb address.  Add the low order bit.  */
   bfd_put_32 (output_bfd, val | a2t3_func_addr_insn,
@@ -4959,16 +4988,17 @@ elf32_arm_finish_dynamic_symbol (bfd * o
   /* Fill in the entry in the procedure linkage table.  */
   if (htab->symbian_p)
 	{
-	  unsigned i;
-	  for (i = 0; i < htab->plt_entry_size / 4; ++i)
-	bfd_put_32 (output_bfd, 
-			elf32_arm_symbian_plt_entry[i],
-			splt->contents + h->plt.offset + 4 * i);
+	  put_arm_insn (htab, output_bfd, 
+		elf32_arm_symbian_plt_entry[0],
+		splt->contents + h->plt.offset);
+	  put_arm_insn (htab, output_bfd, 
+		elf32_arm_symbian_plt_entry[1],
+		splt->contents + h->plt.offset + 4);
 	  
 	  /* Fill in the entry in the .rel.plt section.  */
 	  rel.r_offset = (splt->output_section->vma
 			  + splt->output_offset
-			  + h->plt.offset + 4 * (i - 1));
+			  + h->plt.offset + 4);
 	  rel.r_info = ELF32_R_INFO (h->dynindx, R_ARM_GLOB_DAT);
 
 	  /* Get the index in the procedure linkage table which
@@ -5014,20 +5044,23 @@ elf32_arm_finish_dynamic_symbol (bfd * o
 
 	  if (eh->plt_thumb_refcount > 0)
 	{
-	  bfd_put_16 (output_bfd, elf32_arm_plt_thumb_stub[0],
-			  splt->contents + h->plt.offset - 4);
-	  bfd_put_16 (output_bfd, elf32_arm_plt_thumb_stub[1],
-			  splt->contents + h->plt.offset - 2);
+	  put_thumb_insn (htab, output_bfd, elf32_arm_plt_thumb_stub[0],
+			  splt->contents + h->plt.offset - 4);
+	  put_thumb_insn (htab, output_bfd, elf32_arm_plt_thumb_stub[1],
+			  splt->contents + h->plt.offset - 2);
 	}
 
-	  bfd_put_32 (output_bfd, elf32_arm_plt_entry[0] | ((got_displacement & 0x0ff0) >> 20),
-		  splt->contents + h->plt.offset + 0);
-	  bfd_

CVS commit: [matt-nb5-mips64] src/share/mk

2014-04-03 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Apr  4 05:07:14 UTC 2014

Modified Files:
src/share/mk [matt-nb5-mips64]: bsd.lib.mk

Log Message:
Using -Wl,-x breaks build ARM BE8 shared libraries by striping the $a/$d/$t
symbols before the linker can use them.  Instead do ${OBJCOPY} -x ${.TARGET}
afterwards.


To generate a diff of this commit:
cvs rdiff -u -r1.289.2.2.2.1.2.2 -r1.289.2.2.2.1.2.3 src/share/mk/bsd.lib.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.lib.mk
diff -u src/share/mk/bsd.lib.mk:1.289.2.2.2.1.2.2 src/share/mk/bsd.lib.mk:1.289.2.2.2.1.2.3
--- src/share/mk/bsd.lib.mk:1.289.2.2.2.1.2.2	Wed Dec 18 18:39:05 2013
+++ src/share/mk/bsd.lib.mk	Fri Apr  4 05:07:14 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.lib.mk,v 1.289.2.2.2.1.2.2 2013/12/18 18:39:05 matt Exp $
+#	$NetBSD: bsd.lib.mk,v 1.289.2.2.2.1.2.3 2014/04/04 05:07:14 matt Exp $
 #	@(#)bsd.lib.mk	8.3 (Berkeley) 4/22/94
 
 .include 
@@ -506,15 +506,16 @@ lib${LIB}.so.${SHLIB_FULLVERSION}: ${SOL
 .if defined(DESTDIR)
 	${LIBCC} ${LDLIBC} -Wl,-nostdlib -B${_GCC_CRTDIR}/ -B${DESTDIR}${SHLIBDIR}/ \
 	${_LIBLDOPTS} \
-	-Wl,-x -shared ${SHLIB_SHFLAGS} ${LDFLAGS} -o ${.TARGET} \
+	-shared ${SHLIB_SHFLAGS} ${LDFLAGS} -o ${.TARGET} \
 	-Wl,--whole-archive ${SOLIB} \
 	-Wl,--no-whole-archive ${LDADD} \
 	-L${_GCC_LIBGCCDIR}
 .else
-	${LIBCC} ${LDLIBC} -Wl,-x -shared ${SHLIB_SHFLAGS} ${LDFLAGS} \
+	${LIBCC} ${LDLIBC} -shared ${SHLIB_SHFLAGS} ${LDFLAGS} \
 	-o ${.TARGET} ${_LIBLDOPTS} \
 	-Wl,--whole-archive ${SOLIB} -Wl,--no-whole-archive ${LDADD}
 .endif
+	${OBJCOPY} -x ${.TARGET}
 .if ${OBJECT_FMT} == "ELF"
 #  We don't use INSTALL_SYMLINK here because this is just
 #  happening inside the build directory/objdir. XXX Why does



CVS commit: [matt-nb5-mips64] src/sys

2014-04-02 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Apr  2 17:34:51 UTC 2014

Modified Files:
src/sys/kern [matt-nb5-mips64]: core_elf32.c
src/sys/sys [matt-nb5-mips64]: exec_elf.h

Log Message:
Support coredumps with >= 65535 psections.


To generate a diff of this commit:
cvs rdiff -u -r1.32.16.2 -r1.32.16.3 src/sys/kern/core_elf32.c
cvs rdiff -u -r1.95 -r1.95.14.1 src/sys/sys/exec_elf.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/core_elf32.c
diff -u src/sys/kern/core_elf32.c:1.32.16.2 src/sys/kern/core_elf32.c:1.32.16.3
--- src/sys/kern/core_elf32.c:1.32.16.2	Sun Aug 23 03:38:19 2009
+++ src/sys/kern/core_elf32.c	Wed Apr  2 17:34:51 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: core_elf32.c,v 1.32.16.2 2009/08/23 03:38:19 matt Exp $	*/
+/*	$NetBSD: core_elf32.c,v 1.32.16.3 2014/04/02 17:34:51 matt Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -40,7 +40,11 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: core_elf32.c,v 1.32.16.2 2009/08/23 03:38:19 matt Exp $");
+__KERNEL_RCSID(1, "$NetBSD: core_elf32.c,v 1.32.16.3 2014/04/02 17:34:51 matt Exp $");
+
+#ifdef _KERNEL_OPT
+#include "opt_coredump.h"
+#endif
 
 /* If not included by core_elf64.c, ELFSIZE won't be defined. */
 #ifndef ELFSIZE
@@ -98,7 +102,8 @@ ELFNAMEEND(coredump)(struct lwp *l, void
 {
 	struct proc *p;
 	Elf_Ehdr ehdr;
-	Elf_Phdr phdr, *psections;
+	Elf_Shdr shdr;
+	Elf_Phdr *psections;
 	struct countsegs_state cs;
 	struct writesegs_state ws;
 	off_t notestart, secstart, offset;
@@ -151,14 +156,22 @@ ELFNAMEEND(coredump)(struct lwp *l, void
 	ehdr.e_machine = ELFDEFNNAME(MACHDEP_ID);
 	ehdr.e_version = EV_CURRENT;
 	ehdr.e_entry = 0;
-	ehdr.e_phoff = sizeof(ehdr);
-	ehdr.e_shoff = 0;
 	ehdr.e_flags = 0;
 	ehdr.e_ehsize = sizeof(ehdr);
 	ehdr.e_phentsize = sizeof(Elf_Phdr);
-	ehdr.e_phnum = cs.npsections;
-	ehdr.e_shentsize = 0;
-	ehdr.e_shnum = 0;
+	if (cs.npsections < PN_XNUM) {
+		ehdr.e_phnum = cs.npsections;
+		ehdr.e_shentsize = 0;
+		ehdr.e_shnum = 0;
+		ehdr.e_shoff = 0;
+		ehdr.e_phoff = sizeof(ehdr);
+	} else {
+		ehdr.e_phnum = PN_XNUM;
+		ehdr.e_shentsize = sizeof(Elf_Shdr);
+		ehdr.e_shnum = 1;
+		ehdr.e_shoff = sizeof(ehdr);
+		ehdr.e_phoff = sizeof(ehdr) + sizeof(shdr);
+	}
 	ehdr.e_shstrndx = 0;
 
 #ifdef ELF_MD_COREDUMP_SETUP
@@ -170,9 +183,20 @@ ELFNAMEEND(coredump)(struct lwp *l, void
 	if (error)
 		goto out;
 
-	offset = sizeof(ehdr);
+	/* Write out sections, if needed */
+	if (cs.npsections >= PN_XNUM) {
+		memset(&shdr, 0, sizeof(shdr));
+		shdr.sh_type = SHT_NULL;
+		shdr.sh_info = cs.npsections;
+		error = coredump_write(cookie, UIO_SYSSPACE, &shdr,
+		sizeof(shdr));
+		if (error)
+			goto out;
+	}
+
+	offset = ehdr.e_phoff;
 
-	notestart = offset + sizeof(phdr) * cs.npsections;
+	notestart = offset + sizeof(Elf_Phdr) * cs.npsections;
 	secstart = notestart + notesize;
 
 	psections = malloc(cs.npsections * sizeof(Elf_Phdr),

Index: src/sys/sys/exec_elf.h
diff -u src/sys/sys/exec_elf.h:1.95 src/sys/sys/exec_elf.h:1.95.14.1
--- src/sys/sys/exec_elf.h:1.95	Mon Apr 28 20:24:10 2008
+++ src/sys/sys/exec_elf.h	Wed Apr  2 17:34:51 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: exec_elf.h,v 1.95 2008/04/28 20:24:10 martin Exp $	*/
+/*	$NetBSD: exec_elf.h,v 1.95.14.1 2014/04/02 17:34:51 matt Exp $	*/
 
 /*-
  * Copyright (c) 1994 The NetBSD Foundation, Inc.
@@ -343,6 +343,9 @@ typedef struct {
 #define	PF_MASKOS	0x0ff0	/* Operating system specific values */
 #define	PF_MASKPROC	0xf000	/* Processor-specific values */
 
+/* Extended program header index. */
+#define	PN_XNUM		0x
+
 /*
  * Section Headers
  */



CVS commit: [matt-nb5-mips64] src/sys/arch/arm/cortex

2014-03-27 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Mar 27 23:21:36 UTC 2014

Modified Files:
src/sys/arch/arm/cortex [matt-nb5-mips64]: a9_mpsubr.S

Log Message:
Don't = since that isn't BE8 friendly


To generate a diff of this commit:
cvs rdiff -u -r1.12.2.5 -r1.12.2.6 src/sys/arch/arm/cortex/a9_mpsubr.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/cortex/a9_mpsubr.S
diff -u src/sys/arch/arm/cortex/a9_mpsubr.S:1.12.2.5 src/sys/arch/arm/cortex/a9_mpsubr.S:1.12.2.6
--- src/sys/arch/arm/cortex/a9_mpsubr.S:1.12.2.5	Wed Mar 26 02:13:54 2014
+++ src/sys/arch/arm/cortex/a9_mpsubr.S	Thu Mar 27 23:21:36 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: a9_mpsubr.S,v 1.12.2.5 2014/03/26 02:13:54 matt Exp $	*/
+/*	$NetBSD: a9_mpsubr.S,v 1.12.2.6 2014/03/27 23:21:36 matt Exp $	*/
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -341,7 +341,7 @@ cortex_init:
 	bl	_C_LABEL(armv7_icache_inv_all)	@ invalidate i-cache
 #else
 	adr	ip, cortex_init
-	ldr	r0, =armv7_icache_inv_all
+	ldr	r0, .Larmv7_icache_inv_all
 	bfi	ip, r0, #0, #28
 	blx	ip
 #endif
@@ -370,7 +370,7 @@ cortex_init:
 	bl	_C_LABEL(armv7_dcache_wbinv_all)	@ writeback/invalidate d-cache
 #else
 	adr	ip, cortex_init
-	ldr	r0, =armv7_dcache_wbinv_all
+	ldr	r0, .Larmv7_dcache_wbinv_all
 	bfi	ip, r0, #0, #28
 	blx	ip
 #endif
@@ -401,7 +401,7 @@ cortex_init:
 	bl	_C_LABEL(armv7_icache_inv_all)	@ invalidate i-cache
 #else
 	adr	ip, cortex_init
-	ldr	r0, =armv7_icache_inv_all
+	ldr	r0, .Larmv7_icache_inv_all
 	bfi	ip, r0, #0, #28
 	blx	ip
 #endif
@@ -432,6 +432,13 @@ cortex_init:
 #endif
 
 	bx	r10
+
+#ifndef KERNEL_BASES_EQUAL
+.Larmv7_icache_inv_all:
+	.word	armv7_icache_inv_all
+.Larmv7_dcache_wbinv_all:
+	.word	armv7_dcache_wbinv_all
+#endif
 ASEND(a9_start)
 
 /*



CVS commit: [matt-nb5-mips64] src/sys/arch/arm/include

2014-03-27 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Mar 27 21:11:11 UTC 2014

Modified Files:
src/sys/arch/arm/include [matt-nb5-mips64]: param.h

Log Message:
#define ALIGNBYTES __ALIGNBYTES


To generate a diff of this commit:
cvs rdiff -u -r1.12.12.3 -r1.12.12.4 src/sys/arch/arm/include/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/arch/arm/include/param.h
diff -u src/sys/arch/arm/include/param.h:1.12.12.3 src/sys/arch/arm/include/param.h:1.12.12.4
--- src/sys/arch/arm/include/param.h:1.12.12.3	Thu Mar 27 01:04:39 2014
+++ src/sys/arch/arm/include/param.h	Thu Mar 27 21:11:11 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.12.12.3 2014/03/27 01:04:39 matt Exp $	*/
+/*	$NetBSD: param.h,v 1.12.12.4 2014/03/27 21:11:11 matt Exp $	*/
 
 /*
  * Copyright (c) 1994,1995 Mark Brinicombe.
@@ -148,7 +148,7 @@
 #define	MID_MACHINE	MID_ARM6
 
 /* ARM-specific macro to align a stack pointer (downwards). */
-#define ALIGNBYTES		(__ALIGNBYTES + 1)
+#define ALIGNBYTES		__ALIGNBYTES
 #define ALIGN(p)		(((uintptr_t)(p) + ALIGNBYTES) & ~ALIGNBYTES)
 #define ALIGNED_POINTER(p,t)	(((uintptr_t)(p) % sizeof(t)) == 0)
 #define STACKALIGNBYTES		(8 - 1)



CVS commit: [matt-nb5-mips64] src/sys/arch/arm/include

2014-03-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Mar 27 01:04:39 UTC 2014

Modified Files:
src/sys/arch/arm/include [matt-nb5-mips64]: param.h

Log Message:
Make ALIGNBYTES use __ALIGNBYTES


To generate a diff of this commit:
cvs rdiff -u -r1.12.12.2 -r1.12.12.3 src/sys/arch/arm/include/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/arch/arm/include/param.h
diff -u src/sys/arch/arm/include/param.h:1.12.12.2 src/sys/arch/arm/include/param.h:1.12.12.3
--- src/sys/arch/arm/include/param.h:1.12.12.2	Sat Feb 15 16:30:23 2014
+++ src/sys/arch/arm/include/param.h	Thu Mar 27 01:04:39 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.12.12.2 2014/02/15 16:30:23 matt Exp $	*/
+/*	$NetBSD: param.h,v 1.12.12.3 2014/03/27 01:04:39 matt Exp $	*/
 
 /*
  * Copyright (c) 1994,1995 Mark Brinicombe.
@@ -148,7 +148,7 @@
 #define	MID_MACHINE	MID_ARM6
 
 /* ARM-specific macro to align a stack pointer (downwards). */
-#define ALIGNBYTES		3
+#define ALIGNBYTES		(__ALIGNBYTES + 1)
 #define ALIGN(p)		(((uintptr_t)(p) + ALIGNBYTES) & ~ALIGNBYTES)
 #define ALIGNED_POINTER(p,t)	(((uintptr_t)(p) % sizeof(t)) == 0)
 #define STACKALIGNBYTES		(8 - 1)



CVS commit: [matt-nb5-mips64] src/sys/arch/evbarm/conf

2014-03-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Mar 27 00:28:48 UTC 2014

Modified Files:
src/sys/arch/evbarm/conf [matt-nb5-mips64]: std.bcm53xx

Log Message:
Add ARM_HAS_VBAR


To generate a diff of this commit:
cvs rdiff -u -r1.13.2.3 -r1.13.2.4 src/sys/arch/evbarm/conf/std.bcm53xx

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/std.bcm53xx
diff -u src/sys/arch/evbarm/conf/std.bcm53xx:1.13.2.3 src/sys/arch/evbarm/conf/std.bcm53xx:1.13.2.4
--- src/sys/arch/evbarm/conf/std.bcm53xx:1.13.2.3	Sat Feb 15 17:50:02 2014
+++ src/sys/arch/evbarm/conf/std.bcm53xx	Thu Mar 27 00:28:48 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: std.bcm53xx,v 1.13.2.3 2014/02/15 17:50:02 matt Exp $
+#	$NetBSD: std.bcm53xx,v 1.13.2.4 2014/03/27 00:28:48 matt Exp $
 #
 # standard NetBSD/evbarm for BCM5301X options
 
@@ -14,6 +14,7 @@ options 	CORTEX_PMC
 options 	_ARM32_NEED_BUS_DMA_BOUNCE
 options 	PMAP_NEED_ALLOC_POOLPAGE
 options 	__HAVE_FAST_SOFTINTS		# should be in types.h
+options 	ARM_HAS_VBAR
 options 	__HAVE_CPU_UAREA_ALLOC_IDLELWP
 options 	__HAVE_CPU_COUNTER
 options 	__HAVE_PCI_CONF_HOOK



CVS commit: [matt-nb5-mips64] src/sys/arch/arm/broadcom

2014-03-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Mar 26 23:43:45 UTC 2014

Modified Files:
src/sys/arch/arm/broadcom [matt-nb5-mips64]: bcm53xx_cca.c

Log Message:
Only 5301X has GPIO via CCA


To generate a diff of this commit:
cvs rdiff -u -r1.1.16.3 -r1.1.16.4 src/sys/arch/arm/broadcom/bcm53xx_cca.c

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

Modified files:

Index: src/sys/arch/arm/broadcom/bcm53xx_cca.c
diff -u src/sys/arch/arm/broadcom/bcm53xx_cca.c:1.1.16.3 src/sys/arch/arm/broadcom/bcm53xx_cca.c:1.1.16.4
--- src/sys/arch/arm/broadcom/bcm53xx_cca.c:1.1.16.3	Wed Mar 26 02:02:29 2014
+++ src/sys/arch/arm/broadcom/bcm53xx_cca.c	Wed Mar 26 23:43:45 2014
@@ -43,7 +43,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: bcm53xx_cca.c,v 1.1.16.3 2014/03/26 02:02:29 matt Exp $");
+__KERNEL_RCSID(1, "$NetBSD: bcm53xx_cca.c,v 1.1.16.4 2014/03/26 23:43:45 matt Exp $");
 
 #include 
 #include 
@@ -177,7 +177,7 @@ bcmcca_mainbus_attach(device_t parent, d
 	aprint_normal_dev(sc->sc_dev, "interrupting at irq %d\n", IRQ_CCA);
 
 	bcmcca_uart_attach(sc);
-#if NGPIO > 0
+#if NGPIO > 0 && defined(BCM5301X)
 	bcmcca_gpio_attach(sc);
 #endif
 }



CVS commit: [matt-nb5-mips64] src/sys/arch/arm/include

2014-03-26 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Mar 26 22:44:42 UTC 2014

Modified Files:
src/sys/arch/arm/include [matt-nb5-mips64]: cdefs.h

Log Message:
Make the minimal alignment 8 if EABI or ldrd/strd are supported.


To generate a diff of this commit:
cvs rdiff -u -r1.3.38.1 -r1.3.38.2 src/sys/arch/arm/include/cdefs.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/cdefs.h
diff -u src/sys/arch/arm/include/cdefs.h:1.3.38.1 src/sys/arch/arm/include/cdefs.h:1.3.38.2
--- src/sys/arch/arm/include/cdefs.h:1.3.38.1	Thu Dec 19 01:17:06 2013
+++ src/sys/arch/arm/include/cdefs.h	Wed Mar 26 22:44:41 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: cdefs.h,v 1.3.38.1 2013/12/19 01:17:06 matt Exp $	*/
+/*	$NetBSD: cdefs.h,v 1.3.38.2 2014/03/26 22:44:41 matt Exp $	*/
 
 #ifndef	_ARM_CDEFS_H_
 #define	_ARM_CDEFS_H_
@@ -40,8 +40,8 @@
 #define	_ARM_ARCH_DWORD_OK
 #endif
 
-#ifdef __ARM_EABI__
-#define __ALIGNBYTES		(8 - 1)
+#if defined(__ARM_EABI__) || defined(_ARM_ARCH_DWORD_OK)
+#define __ALIGNBYTES		(sizeof(long long) - 1)
 #else
 #define __ALIGNBYTES		(sizeof(int) - 1)
 #endif



CVS commit: [matt-nb5-mips64] src/sys/arch/arm/broadcom

2014-03-25 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Mar 26 03:20:18 UTC 2014

Modified Files:
src/sys/arch/arm/broadcom [matt-nb5-mips64]: bcm53xx_reg.h

Log Message:
Sync with HEAD.


To generate a diff of this commit:
cvs rdiff -u -r1.14.2.2 -r1.14.2.3 src/sys/arch/arm/broadcom/bcm53xx_reg.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/broadcom/bcm53xx_reg.h
diff -u src/sys/arch/arm/broadcom/bcm53xx_reg.h:1.14.2.2 src/sys/arch/arm/broadcom/bcm53xx_reg.h:1.14.2.3
--- src/sys/arch/arm/broadcom/bcm53xx_reg.h:1.14.2.2	Sat Feb 15 16:18:36 2014
+++ src/sys/arch/arm/broadcom/bcm53xx_reg.h	Wed Mar 26 03:20:18 2014
@@ -45,183 +45,196 @@
  * 0x_..0x_043f	1088B	Internal SKU ROM Region
  * 0x_1000..0x_1fff	   4KB	Enumeration ROM Register Region
  */
-#define	BCM53XX_PCIE0_OWIN_PBASE 0x0800
-#define	BCM53XX_PCIE0_OWIN_SIZE	0x0400
-#define	BCM53XX_PCIE0_OWIN_MAX	0x0800
+#define BCM53XX_PCIE0_OWIN_PBASE 0x0800
+#define BCM53XX_PCIE0_OWIN_SIZE	0x0400
+#define BCM53XX_PCIE0_OWIN_MAX	0x0800
 
-#define	BCM53XX_IOREG_PBASE	0x1800
-#define	BCM53XX_IOREG_SIZE	0x0020
+#define BCM53XX_IOREG_PBASE	0x1800
+#define BCM53XX_IOREG_SIZE	0x0020
 
-#define	BCM53XX_ARMCORE_PBASE	0x1900
-#define	BCM53XX_ARMCORE_SIZE	0x0010
+#define BCM53XX_ARMCORE_PBASE	0x1900
+#define BCM53XX_ARMCORE_SIZE	0x0010
 
-#define	BCM53XX_NAND_PBASE	0x1c00
-#define	BCM53XX_NAND_SIZE	0x0100
+#define BCM53XX_NAND_PBASE	0x1c00
+#define BCM53XX_NAND_SIZE	0x0100
 
-#define	BCM53XX_SPIFLASH_PBASE	0x1d00
-#define	BCM53XX_SPIFLASH_SIZE	0x0100
+#define BCM53XX_SPIFLASH_PBASE	0x1d00
+#define BCM53XX_SPIFLASH_SIZE	0x0100
 
-#define	BCM53XX_PCIE1_OWIN_PBASE 0x4000
-#define	BCM53XX_PCIE1_OWIN_SIZE	0x0400
-#define	BCM53XX_PCIE1_OWIN_MAX	0x0800
+#define BCM53XX_PCIE1_OWIN_PBASE 0x4000
+#define BCM53XX_PCIE1_OWIN_SIZE	0x0400
+#define BCM53XX_PCIE1_OWIN_MAX	0x0800
 
-#define	BCM53XX_PCIE2_OWIN_PBASE 0x4800
-#define	BCM53XX_PCIE2_OWIN_SIZE	0x0400
-#define	BCM53XX_PCIE2_OWIN_MAX	0x0800
+#define BCM53XX_PCIE2_OWIN_PBASE 0x4800
+#define BCM53XX_PCIE2_OWIN_SIZE	0x0400
+#define BCM53XX_PCIE2_OWIN_MAX	0x0800
 
-#define	BCM53XX_IO_SIZE		(BCM53XX_IOREG_SIZE		\
+#define BCM53XX_IO_SIZE		(BCM53XX_IOREG_SIZE		\
  + BCM53XX_ARMCORE_SIZE		\
  + BCM53XX_PCIE0_OWIN_SIZE	\
  + BCM53XX_PCIE1_OWIN_SIZE	\
  + BCM53XX_PCIE2_OWIN_SIZE)
 
-#define	BCM53XX_REF_CLK		(25*1000*1000)
+#define BCM53XX_REF_CLK		(25*1000*1000)
 
-#define	CCA_UART_FREQ		BCM53XX_REF_CLK
+#define CCA_UART_FREQ		BCM53XX_REF_CLK
 
 /* Chip Common A */
-#define	CCA_MISC_BASE		0x00
-#define	CCA_MISC_SIZE		0x001000
-#define	CCA_UART0_BASE		0x000300
-#define	CCA_UART1_BASE		0x000400
+#define CCA_MISC_BASE		0x00
+#define CCA_MISC_SIZE		0x001000
+#define CCA_UART0_BASE		0x000300
+#define CCA_UART1_BASE		0x000400
 
 /* Chip Common B */
-#define	CCB_BASE		0x00
-#define	CCB_SIZE		0x03
-#define	PWM_BASE		0x002000
-#define	MII_BASE		0x003000
-#define	RNG_BASE		0x004000
-#define	TIMER0_BASE		0x005000
-#define	TIMER1_BASE		0x006000
-#define	SRAB_BASE		0x007000
+#define CCB_BASE		0x00
+#ifdef BCM5301X
+#define CCB_SIZE		0x03
+#define PWM_BASE		0x002000
+#define MII_BASE		0x003000
+#define RNG_BASE		0x004000
+#define TIMER0_BASE		0x005000
+#define TIMER1_BASE		0x006000
+#define SRAB_BASE		0x007000
+#define UART2_BASE		0x008000
+#define SMBUS1_BASE		0x009000
+
+#define CRU_BASE		0x00b000
+#define DMU_BASE		0x00c000
+#elif defined(BCM563XX)
+#define CCB_SIZE		0x04
+#define GPIO_BASE		0x03
+#define PWM_BASE		0x031000
+#define MII_BASE		0x032000
+#define RNG_BASE		0x033000
+#define TIMER0_BASE		0x034000
+#define TIMER1_BASE		0x035000
+#define UART2_BASE		0x037000
+#define SMBUS0_BASE		0x038000
+#define WDT_BASE		0x039000
+#define PKA_BASE		0x03a000
+#define SMBUS1_BASE		0x03b000
 
-#define	CRU_BASE		0x00b000
-#define	DMU_BASE		0x00c000
+#define CRU_BASE		0x03e000
+#define DMU_BASE		0x03f000
+#endif
 
-#define	DDR_BASE		0x01
+#define DDR_BASE		0x01
 
-#define	PCIE0_BASE		0x012000
-#define	PCIE1_BASE		0x013000
+#define PCIE0_BASE		0x012000
+#define PCIE1_BASE		0x013000
 
 #ifdef BCM5301X
-#define	UART2_BASE		0x008000
-#define	SMBUS1_BASE		0x009000
-#define	PCIE2_BASE		0x014000
+#define PCIE2_BASE		0x014000
 #define SDIO_BASE		0x02
-#define	EHCI_BASE		0x021000
-#define	OHCI_BASE		0x022000
-#define	GMAC0_BASE		0x024000
-#define	GMAC1_BASE		0x025000
-#define	GMAC2_BASE		0x026000
-#define	GMAC3_BASE		0x027000
-#define	NAND_BASE		0x028000
+#define EHCI_BASE		0x021000
+#define OHCI_BASE		0x022000
+#define GMAC0_BASE		0x024000
+#define GMAC1_BASE		0x025000
+#define GMAC2_BASE		0x026000
+#define GMAC3_BASE		0x027000
+#define NAND_BASE		0x028000
 #define QSPI_BASE		0x029000
 #define I2S_BASE		0x02A000
 #define DMAC_BASE		0x

CVS commit: [matt-nb5-mips64] src/sys/arch/arm/broadcom

2014-03-25 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Mar 26 03:19:32 UTC 2014

Modified Files:
src/sys/arch/arm/broadcom [matt-nb5-mips64]: bcm53xx_board.c
bcm53xx_ccb.c

Log Message:
Allow SRAB to be optional


To generate a diff of this commit:
cvs rdiff -u -r1.17.2.3 -r1.17.2.4 src/sys/arch/arm/broadcom/bcm53xx_board.c
cvs rdiff -u -r1.5.2.2 -r1.5.2.3 src/sys/arch/arm/broadcom/bcm53xx_ccb.c

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

Modified files:

Index: src/sys/arch/arm/broadcom/bcm53xx_board.c
diff -u src/sys/arch/arm/broadcom/bcm53xx_board.c:1.17.2.3 src/sys/arch/arm/broadcom/bcm53xx_board.c:1.17.2.4
--- src/sys/arch/arm/broadcom/bcm53xx_board.c:1.17.2.3	Wed Feb 19 23:19:57 2014
+++ src/sys/arch/arm/broadcom/bcm53xx_board.c	Wed Mar 26 03:19:32 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm53xx_board.c,v 1.17.2.3 2014/02/19 23:19:57 matt Exp $	*/
+/*	$NetBSD: bcm53xx_board.c,v 1.17.2.4 2014/03/26 03:19:32 matt Exp $	*/
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -35,7 +35,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: bcm53xx_board.c,v 1.17.2.3 2014/02/19 23:19:57 matt Exp $");
+__KERNEL_RCSID(1, "$NetBSD: bcm53xx_board.c,v 1.17.2.4 2014/03/26 03:19:32 matt Exp $");
 
 #include 
 #include 
@@ -640,6 +640,7 @@ bcm53xx_device_register(device_t self, v
 	}
 }
 
+#ifdef SRAB_BASE
 static kmutex_t srab_lock __cacheline_aligned;
 
 void
@@ -742,3 +743,4 @@ bcm53xx_srab_write_8(u_int pageoffset, u
 	bcm53xx_srab_busywait(bst, bsh);
 	mutex_spin_exit(&srab_lock);
 }
+#endif /* SRAB_BASE */

Index: src/sys/arch/arm/broadcom/bcm53xx_ccb.c
diff -u src/sys/arch/arm/broadcom/bcm53xx_ccb.c:1.5.2.2 src/sys/arch/arm/broadcom/bcm53xx_ccb.c:1.5.2.3
--- src/sys/arch/arm/broadcom/bcm53xx_ccb.c:1.5.2.2	Sat Feb 15 16:18:36 2014
+++ src/sys/arch/arm/broadcom/bcm53xx_ccb.c	Wed Mar 26 03:19:32 2014
@@ -34,7 +34,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: bcm53xx_ccb.c,v 1.5.2.2 2014/02/15 16:18:36 matt Exp $");
+__KERNEL_RCSID(1, "$NetBSD: bcm53xx_ccb.c,v 1.5.2.3 2014/03/26 03:19:32 matt Exp $");
 
 #include 
 #include 
@@ -99,7 +99,9 @@ static const struct bcm_locators bcmccb_
 	{ "bcmrng", RNG_BASE, 0x1000, BCMCCBCF_PORT_DEFAULT, 1, { IRQ_RNG } },
 	{ "bcmtmr", TIMER0_BASE, 0x1000, BCMCCBCF_PORT_DEFAULT, 2, { IRQ_TIMER0_1, IRQ_TIMER0_2 } },
 	{ "bcmtmr", TIMER1_BASE, 0x1000, BCMCCBCF_PORT_DEFAULT, 2, { IRQ_TIMER1_1, IRQ_TIMER1_2 } },
+#ifdef SRAB_BASE
 	{ "bcmsw", SRAB_BASE, 0x1000, BCMCCBCF_PORT_DEFAULT, },
+#endif
 	{ "bcmcom", UART2_BASE, 0x1000, BCMCCBCF_PORT_DEFAULT, 1, { IRQ_UART2 } },
 #ifdef BCM5301X
 	{ "bcmi2c", SMBUS1_BASE, 0x1000, BCMCCBCF_PORT_DEFAULT, 1, { IRQ_SMBUS1 } },



CVS commit: [matt-nb5-mips64] src/sys/arch/evbarm/bcm53xx

2014-03-25 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Mar 26 02:16:05 UTC 2014

Modified Files:
src/sys/arch/evbarm/bcm53xx [matt-nb5-mips64]: bcm53xx_start.S

Log Message:
Use adr/bfi to access kernel variables.


To generate a diff of this commit:
cvs rdiff -u -r1.10.2.2 -r1.10.2.3 \
src/sys/arch/evbarm/bcm53xx/bcm53xx_start.S

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

Modified files:

Index: src/sys/arch/evbarm/bcm53xx/bcm53xx_start.S
diff -u src/sys/arch/evbarm/bcm53xx/bcm53xx_start.S:1.10.2.2 src/sys/arch/evbarm/bcm53xx/bcm53xx_start.S:1.10.2.3
--- src/sys/arch/evbarm/bcm53xx/bcm53xx_start.S:1.10.2.2	Sat Feb 15 16:18:37 2014
+++ src/sys/arch/evbarm/bcm53xx/bcm53xx_start.S	Wed Mar 26 02:16:05 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm53xx_start.S,v 1.10.2.2 2014/02/15 16:18:37 matt Exp $	*/
+/*	$NetBSD: bcm53xx_start.S,v 1.10.2.3 2014/03/26 02:16:05 matt Exp $	*/
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -45,7 +45,7 @@
 #define	CONADDR		0x18000300
 #endif
 
-RCSID("$NetBSD: bcm53xx_start.S,v 1.10.2.2 2014/02/15 16:18:37 matt Exp $")
+RCSID("$NetBSD: bcm53xx_start.S,v 1.10.2.3 2014/03/26 02:16:05 matt Exp $")
 
 #undef VERBOSE_INIT_ARM
 #define VERBOSE_INIT_ARM
@@ -74,10 +74,14 @@ _C_LABEL(bcm53xx_start):
 	/*
 	 * Save any arguments u-boot passed us.
 	 */
-	ldr	r4, .Luboot_args_pic0
-	add	r4, r4, pc
+#ifdef KERNEL_BASES_EQUAL
+	ldr	r4, .Luboot_args
+#else
+	adr	r4, bcm53xx_start
+	ldr	r5, .Luboot_args
+	bfi	r4, r5, #0, #28
+#endif
 	stmia	r4, {r0-r3}
-.LPIC0:
 
 	/*
 	 * Let's turn on the CCA watchdog in case something goes horribly wrong.
@@ -121,15 +125,6 @@ _C_LABEL(bcm53xx_start):
 
 	XPUTC(#89)
 
-	ldr	r0, .Luboot_args
-	ldr	r2, [r0]
-	ldr	r1, .Luboot_args_pic1
-	add	r1, r1, pc
-	ldr	r1, [r1]
-.LPIC1:
-	cmp	r1, r2
-1:	bne	1b
-
 	XPUTC(#90)
 
 	/*
@@ -153,10 +148,6 @@ _C_LABEL(bcm53xx_start):
 	nop
 
 	/* NOTREACHED */
-.Luboot_args_pic0:
-	.word	uboot_args - .LPIC0
-.Luboot_args_pic1:
-	.word	uboot_args - .LPIC0
 .Luboot_args:
 	.word	uboot_args
 .Lstart:



CVS commit: [matt-nb5-mips64] src/sys/arch/evbarm/bcm53xx

2014-03-25 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Mar 26 02:15:02 UTC 2014

Modified Files:
src/sys/arch/evbarm/bcm53xx [matt-nb5-mips64]: bcm53xx_machdep.c

Log Message:
Use apb/4 for the com freq on !BCM5301X


To generate a diff of this commit:
cvs rdiff -u -r1.7.4.2 -r1.7.4.3 \
src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c

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

Modified files:

Index: src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c
diff -u src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c:1.7.4.2 src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c:1.7.4.3
--- src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c:1.7.4.2	Sat Feb 15 16:18:37 2014
+++ src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c	Wed Mar 26 02:15:02 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm53xx_machdep.c,v 1.7.4.2 2014/02/15 16:18:37 matt Exp $	*/
+/*	$NetBSD: bcm53xx_machdep.c,v 1.7.4.3 2014/03/26 02:15:02 matt Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #define IDM_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bcm53xx_machdep.c,v 1.7.4.2 2014/02/15 16:18:37 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm53xx_machdep.c,v 1.7.4.3 2014/03/26 02:15:02 matt Exp $");
 
 #include "opt_evbarm_boardtype.h"
 #include "opt_broadcom.h"
@@ -330,14 +330,20 @@ consinit(void)
 	/*
 	 * Switch to the reference clock
 	 */
+#ifdef BCM5301X
+	const int comfreq = BCM53XX_REF_CLK;
 	v = bus_space_read_4(bcm53xx_ioreg_bst, bcm53xx_ioreg_bsh,
 	CCA_MISC_BASE + MISC_CORECTL);
 	v &= ~CORECTL_UART_CLK_OVERRIDE;
 	bus_space_write_4(bcm53xx_ioreg_bst, bcm53xx_ioreg_bsh,
 	CCA_MISC_BASE + MISC_CORECTL, v);
+#else
+	const struct cpu_softc * const cpu = curcpu()->ci_softc;
+	const int comfreq = cpu->cpu_clk.clk_apb / 4;
+#endif
 
 if (comcnattach(bcm53xx_ioreg_bst, comcnaddr, comcnspeed,
-BCM53XX_REF_CLK, COM_TYPE_NORMAL, comcnmode))
+comfreq, COM_TYPE_NORMAL, comcnmode))
 panic("Serial console can not be initialized.");
 }
 



CVS commit: [matt-nb5-mips64] src/sys/arch/arm/cortex

2014-03-25 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Mar 26 02:13:54 UTC 2014

Modified Files:
src/sys/arch/arm/cortex [matt-nb5-mips64]: a9_mpsubr.S

Log Message:
flush the icache after enabling the SCU


To generate a diff of this commit:
cvs rdiff -u -r1.12.2.4 -r1.12.2.5 src/sys/arch/arm/cortex/a9_mpsubr.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/cortex/a9_mpsubr.S
diff -u src/sys/arch/arm/cortex/a9_mpsubr.S:1.12.2.4 src/sys/arch/arm/cortex/a9_mpsubr.S:1.12.2.5
--- src/sys/arch/arm/cortex/a9_mpsubr.S:1.12.2.4	Mon Mar 24 18:44:13 2014
+++ src/sys/arch/arm/cortex/a9_mpsubr.S	Wed Mar 26 02:13:54 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: a9_mpsubr.S,v 1.12.2.4 2014/03/24 18:44:13 matt Exp $	*/
+/*	$NetBSD: a9_mpsubr.S,v 1.12.2.5 2014/03/26 02:13:54 matt Exp $	*/
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -397,13 +397,23 @@ cortex_init:
 	isb
 	XPUTC(#50)
 
+#ifdef KERNEL_BASES_EQUAL
+	bl	_C_LABEL(armv7_icache_inv_all)	@ invalidate i-cache
+#else
+	adr	ip, cortex_init
+	ldr	r0, =armv7_icache_inv_all
+	bfi	ip, r0, #0, #28
+	blx	ip
+#endif
+	XPUTC(#51)
+
 	/*
 	 * Step 4a, enable the data cache
 	 */
 	orr	r2, r2, #CPU_CONTROL_DC_ENABLE	@ set data cache enable
 	mcr	p15, 0, r2, c1, c0, 0		@ reenable caches
 	isb
-	XPUTC(#51)
+	XPUTC(#52)
 #endif
 
 	/*



CVS commit: [matt-nb5-mips64] src/sys/arch/arm/broadcom

2014-03-25 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Mar 26 02:02:29 UTC 2014

Modified Files:
src/sys/arch/arm/broadcom [matt-nb5-mips64]: bcm53xx_cca.c

Log Message:
For non-BCM5301X, set frequency to 1/4 of the apb clock.


To generate a diff of this commit:
cvs rdiff -u -r1.1.16.2 -r1.1.16.3 src/sys/arch/arm/broadcom/bcm53xx_cca.c

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

Modified files:

Index: src/sys/arch/arm/broadcom/bcm53xx_cca.c
diff -u src/sys/arch/arm/broadcom/bcm53xx_cca.c:1.1.16.2 src/sys/arch/arm/broadcom/bcm53xx_cca.c:1.1.16.3
--- src/sys/arch/arm/broadcom/bcm53xx_cca.c:1.1.16.2	Sat Feb 15 16:18:36 2014
+++ src/sys/arch/arm/broadcom/bcm53xx_cca.c	Wed Mar 26 02:02:29 2014
@@ -43,7 +43,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: bcm53xx_cca.c,v 1.1.16.2 2014/02/15 16:18:36 matt Exp $");
+__KERNEL_RCSID(1, "$NetBSD: bcm53xx_cca.c,v 1.1.16.3 2014/03/26 02:02:29 matt Exp $");
 
 #include 
 #include 
@@ -279,7 +279,13 @@ com_cca_attach(device_t parent, device_t
 	bus_space_handle_t bsh;
 
 	sc->sc_dev = self;
+
+#ifdef BCM5301X
 	sc->sc_frequency = BCM53XX_REF_CLK;
+#else
+	const struct cpu_softc * const cpu = curcpu()->ci_softc;
+	sc->sc_frequency = cpu->cpu_clk.clk_apb / 4; 
+#endif  
 	sc->sc_type = COM_TYPE_NORMAL;
 
 	if (com_is_console(ccaaa->ccaaa_bst, addr, &bsh) == 0 &&



CVS commit: [matt-nb5-mips64] src/sys/arch/arm/arm

2014-03-25 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Mar 26 02:01:10 UTC 2014

Modified Files:
src/sys/arch/arm/arm [matt-nb5-mips64]: arm_machdep.c

Log Message:
If BE on armv7, set PSR_E_BIT


To generate a diff of this commit:
cvs rdiff -u -r1.21.8.1 -r1.21.8.2 src/sys/arch/arm/arm/arm_machdep.c

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

Modified files:

Index: src/sys/arch/arm/arm/arm_machdep.c
diff -u src/sys/arch/arm/arm/arm_machdep.c:1.21.8.1 src/sys/arch/arm/arm/arm_machdep.c:1.21.8.2
--- src/sys/arch/arm/arm/arm_machdep.c:1.21.8.1	Sat Feb 15 16:18:35 2014
+++ src/sys/arch/arm/arm/arm_machdep.c	Wed Mar 26 02:01:10 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: arm_machdep.c,v 1.21.8.1 2014/02/15 16:18:35 matt Exp $	*/
+/*	$NetBSD: arm_machdep.c,v 1.21.8.2 2014/03/26 02:01:10 matt Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -79,7 +79,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: arm_machdep.c,v 1.21.8.1 2014/02/15 16:18:35 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arm_machdep.c,v 1.21.8.2 2014/03/26 02:01:10 matt Exp $");
 
 #include 
 #include 
@@ -173,12 +173,20 @@ setregs(struct lwp *l, struct exec_packa
 	tf->tf_svc_lr = 0x;		/* Something we can see */
 	tf->tf_pc = pack->ep_entry;
 #ifdef __PROG32
+#if defined(__ARMEB__)
+	/*
+	 * If we are running on ARMv7, we need to set the E bit to force
+	 * programs to start as big endian.
+	 */
+	tf->tf_spsr = PSR_USR32_MODE | (CPU_IS_ARMV7_P() ? PSR_E_BIT : 0);
+#else
 	tf->tf_spsr = PSR_USR32_MODE;
+#endif /* __ARMEB__ */ 
 #ifdef THUMB_CODE
 	if (pack->ep_entry & 1)
 		tf->tf_spsr |= PSR_T_bit;
 #endif
-#endif
+#endif /* __PROG32 */
 
 	l->l_md.md_flags = 0;
 #ifdef EXEC_AOUT



CVS commit: [matt-nb5-mips64] src/sys/arch/arm/arm

2014-03-25 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Mar 26 02:00:46 UTC 2014

Modified Files:
src/sys/arch/arm/arm [matt-nb5-mips64]: cpufunc.c

Log Message:
For armv7, enable BE properly.  Make sure UNAL is always set.


To generate a diff of this commit:
cvs rdiff -u -r1.89.10.1 -r1.89.10.2 src/sys/arch/arm/arm/cpufunc.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/arm/cpufunc.c
diff -u src/sys/arch/arm/arm/cpufunc.c:1.89.10.1 src/sys/arch/arm/arm/cpufunc.c:1.89.10.2
--- src/sys/arch/arm/arm/cpufunc.c:1.89.10.1	Sat Feb 15 16:18:35 2014
+++ src/sys/arch/arm/arm/cpufunc.c	Wed Mar 26 02:00:45 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpufunc.c,v 1.89.10.1 2014/02/15 16:18:35 matt Exp $	*/
+/*	$NetBSD: cpufunc.c,v 1.89.10.2 2014/03/26 02:00:45 matt Exp $	*/
 
 /*
  * arm7tdmi support code Copyright (c) 2001 John Fremlin
@@ -49,7 +49,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.89.10.1 2014/02/15 16:18:35 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.89.10.2 2014/03/26 02:00:45 matt Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_cpuoptions.h"
@@ -3053,20 +3053,15 @@ armv7_setup(char *args)
 	int cpuctrl;
 
 	cpuctrl = CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_IC_ENABLE
-	| CPU_CONTROL_DC_ENABLE | CPU_CONTROL_BPRD_ENABLE ;
-#if 0
-	int cpuctrlmask = CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_SYST_ENABLE
-	| CPU_CONTROL_IC_ENABLE | CPU_CONTROL_DC_ENABLE
-	| CPU_CONTROL_ROM_ENABLE | CPU_CONTROL_BPRD_ENABLE
-	| CPU_CONTROL_BEND_ENABLE | CPU_CONTROL_AFLT_ENABLE
-	| CPU_CONTROL_ROUNDROBIN | CPU_CONTROL_CPCLK;
+	| CPU_CONTROL_DC_ENABLE | CPU_CONTROL_BPRD_ENABLE
+#ifdef __ARMEB__
+	| CPU_CONTROL_EX_BEND
 #endif
-
 #ifdef ARM32_DISABLE_ALIGNMENT_FAULTS
-	cpuctrl |= CPU_CONTROL_UNAL_ENABLE;
-#else
-	cpuctrl |= CPU_CONTROL_AFLT_ENABLE;
+	| CPU_CONTROL_AFLT_ENABLE
 #endif
+	| CPU_CONTROL_UNAL_ENABLE;
+	const int cpuctrlmask = cpuctrl | CPU_CONTROL_AFLT_ENABLE;
 
 	cpuctrl = parse_cpu_options(args, armv7_options, cpuctrl);
 
@@ -3080,7 +3075,7 @@ armv7_setup(char *args)
 
 	/* Set the control register */
 	curcpu()->ci_ctrl = cpuctrl;
-	cpu_control(0x, cpuctrl);
+	cpu_control(cpuctrlmask, cpuctrl);
 }
 #endif /* CPU_CORTEX */
 



CVS commit: [matt-nb5-mips64] src/sys/arch/arm/cortex

2014-03-25 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Mar 26 01:59:08 UTC 2014

Modified Files:
src/sys/arch/arm/cortex [matt-nb5-mips64]: gic.c

Log Message:
Let bus_space so the endian conversion if needed


To generate a diff of this commit:
cvs rdiff -u -r1.5.2.2 -r1.5.2.3 src/sys/arch/arm/cortex/gic.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/cortex/gic.c
diff -u src/sys/arch/arm/cortex/gic.c:1.5.2.2 src/sys/arch/arm/cortex/gic.c:1.5.2.3
--- src/sys/arch/arm/cortex/gic.c:1.5.2.2	Sat Feb 15 16:18:36 2014
+++ src/sys/arch/arm/cortex/gic.c	Wed Mar 26 01:59:08 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: gic.c,v 1.5.2.2 2014/02/15 16:18:36 matt Exp $	*/
+/*	$NetBSD: gic.c,v 1.5.2.3 2014/03/26 01:59:08 matt Exp $	*/
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -31,7 +31,7 @@
 #define _INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gic.c,v 1.5.2.2 2014/02/15 16:18:36 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gic.c,v 1.5.2.3 2014/03/26 01:59:08 matt Exp $");
 
 #include 
 #include 
@@ -109,28 +109,24 @@ __CTASSERT(NIPL == 8);
 static inline uint32_t
 gicc_read(struct armgic_softc *sc, bus_size_t o)
 {
-	uint32_t v = bus_space_read_4(sc->sc_memt, sc->sc_gicch, o);
-	return le32toh(v);
+	return bus_space_read_4(sc->sc_memt, sc->sc_gicch, o);
 }
 
 static inline void
 gicc_write(struct armgic_softc *sc, bus_size_t o, uint32_t v)
 {
-	v = htole32(v);
 	bus_space_write_4(sc->sc_memt, sc->sc_gicch, o, v);
 }
 
 static inline uint32_t
 gicd_read(struct armgic_softc *sc, bus_size_t o)
 {
-	uint32_t v = bus_space_read_4(sc->sc_memt, sc->sc_gicdh, o);
-	return le32toh(v);
+	return bus_space_read_4(sc->sc_memt, sc->sc_gicdh, o);
 }
 
 static inline void
 gicd_write(struct armgic_softc *sc, bus_size_t o, uint32_t v)
 {
-	v = htole32(v);
 	bus_space_write_4(sc->sc_memt, sc->sc_gicdh, o, v);
 }
 



CVS commit: [matt-nb5-mips64] src/sys/dev/pci

2014-03-25 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Mar 26 01:57:04 UTC 2014

Modified Files:
src/sys/dev/pci [matt-nb5-mips64]: ahcisata_pci.c

Log Message:
Use ahci_resume


To generate a diff of this commit:
cvs rdiff -u -r1.12.4.2.4.1 -r1.12.4.2.4.2 src/sys/dev/pci/ahcisata_pci.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/pci/ahcisata_pci.c
diff -u src/sys/dev/pci/ahcisata_pci.c:1.12.4.2.4.1 src/sys/dev/pci/ahcisata_pci.c:1.12.4.2.4.2
--- src/sys/dev/pci/ahcisata_pci.c:1.12.4.2.4.1	Tue Nov  5 18:32:45 2013
+++ src/sys/dev/pci/ahcisata_pci.c	Wed Mar 26 01:57:03 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisata_pci.c,v 1.12.4.2.4.1 2013/11/05 18:32:45 matt Exp $	*/
+/*	$NetBSD: ahcisata_pci.c,v 1.12.4.2.4.2 2014/03/26 01:57:03 matt Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_pci.c,v 1.12.4.2.4.1 2013/11/05 18:32:45 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_pci.c,v 1.12.4.2.4.2 2014/03/26 01:57:03 matt Exp $");
 
 #include 
 #include 
@@ -211,10 +211,7 @@ ahci_pci_resume(device_t dv PMF_FN_ARGS)
 	int s;
 
 	s = splbio();
-	ahci_reset(sc);
-	ahci_setup_ports(sc);
-	ahci_reprobe_drives(sc);
-	ahci_enable_intrs(sc);
+	ahci_resume(sc);
 	splx(s);
 
 	return true;



CVS commit: [matt-nb5-mips64] src/sys/arch/arm/include

2014-03-25 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Mar 26 01:15:48 UTC 2014

Modified Files:
src/sys/arch/arm/include [matt-nb5-mips64]: armreg.h

Log Message:
sync with HEAD


To generate a diff of this commit:
cvs rdiff -u -r1.41.12.2 -r1.41.12.3 src/sys/arch/arm/include/armreg.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/armreg.h
diff -u src/sys/arch/arm/include/armreg.h:1.41.12.2 src/sys/arch/arm/include/armreg.h:1.41.12.3
--- src/sys/arch/arm/include/armreg.h:1.41.12.2	Mon Mar 24 18:43:40 2014
+++ src/sys/arch/arm/include/armreg.h	Wed Mar 26 01:15:48 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: armreg.h,v 1.41.12.2 2014/03/24 18:43:40 matt Exp $	*/
+/*	$NetBSD: armreg.h,v 1.41.12.3 2014/03/26 01:15:48 matt Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Ben Harris
@@ -58,13 +58,24 @@
 #define PSR_V_bit (1 << 28)	/* overflow */
 
 #define PSR_Q_bit (1 << 27)	/* saturation */
+#define PSR_IT1_bit (1 << 26)
+#define PSR_IT0_bit (1 << 25)
+#define PSR_J_bit (1 << 24)	/* Jazelle mode */
+#define PSR_GE_bits (15 << 16)	/* SIMD GE bits */
+#define PSR_IT7_bit (1 << 15)
+#define PSR_IT6_bit (1 << 14)
+#define PSR_IT5_bit (1 << 13)
+#define PSR_IT4_bit (1 << 12)
+#define PSR_IT3_bit (1 << 11)
+#define PSR_IT2_bit (1 << 10)
+#define PSR_E_BIT (1 << 9)	/* Endian state */
+#define PSR_A_BIT (1 << 8)	/* Async abort disable */
 
 #define I32_bit (1 << 7)	/* IRQ disable */
 #define F32_bit (1 << 6)	/* FIQ disable */
-#define	IF32_bits (3 << 6)	/* IRQ/FIQ disable */
+#define IF32_bits (3 << 6)	/* IRQ/FIQ disable */
 
 #define PSR_T_bit (1 << 5)	/* Thumb state */
-#define PSR_J_bit (1 << 24)	/* Java mode */
 
 #define PSR_MODE	0x001f	/* mode mask */
 #define PSR_USR26_MODE	0x
@@ -258,6 +269,11 @@
 #define CPU_ID_ARM_88SV584X_V6	0x410fb020 /* Marvell Sheeva 88SV584x v6 Core */
 
 /* CPUID registers */
+#define ARM_ISA3_SYNCHPRIM_MASK	0xf000
+#define ARM_ISA4_SYNCHPRIM_MASK	0x00f0
+#define ARM_ISA3_SYNCHPRIM_LDREX	0x10	// LDREX
+#define ARM_ISA3_SYNCHPRIM_LDREXPLUS	0x13	// +CLREX/LDREXB/LDREXH
+#define ARM_ISA3_SYNCHPRIM_LDREXD	0x20	// +LDREXD
 #define ARM_PFR0_THUMBEE_MASK	0xf000
 #define ARM_PFR1_GTIMER_MASK	0x000f
 #define ARM_PFR1_VIRT_MASK	0xf000
@@ -347,6 +363,9 @@
 #define CPU_CONTROL_VECRELOC	0x2000 /* V: Vector relocation */
 #define CPU_CONTROL_ROUNDROBIN	0x4000 /* RR: Predictable replacement */
 #define CPU_CONTROL_V4COMPAT	0x8000 /* L4: ARMv4 compat LDR R15 etc */
+#define CPU_CONTROL_HA_ENABLE	0x0002 /* HA: Hardware Access flag enable */
+#define CPU_CONTROL_WXN_ENABLE	0x0008 /* WXN: Write Execute Never */
+#define CPU_CONTROL_UWXN_ENABLE	0x0010 /* UWXN: User Write eXecute Never */
 #define CPU_CONTROL_FI_ENABLE	0x0020 /* FI: Low interrupt latency */
 #define CPU_CONTROL_UNAL_ENABLE	0x0040 /* U: unaligned data access */
 #define CPU_CONTROL_XP_ENABLE	0x0080 /* XP: extended page table */
@@ -368,6 +387,13 @@
 #define	CPACR_RESERVED		2
 #define	CPACR_ALL		3 /* Privileged and User mode access */
 
+/* ARMv6/ARMv7 Non-Secure Access Control Register (CP15, 0, c1, c1, 2) */
+#define NSACR_SMP		0x0004 /* ACTRL.SMP is writeable (!A8) */
+#define NSACR_L2ERR		0x0002 /* L2ECTRL is writeable (!A8) */
+#define NSACR_ASEDIS		0x8000 /* Deny Advanced SIMD Ext. */
+#define NSACR_D32DIS		0x4000 /* Deny VFP regs 15-31 */
+#define NSACR_CPn(n)		(1 << (n)) /* NonSecure access allowed */
+
 /* ARM11x6 Auxiliary Control Register (CP15 register 1, opcode2 1) */
 #define	ARM11X6_AUXCTL_RS	0x0001 /* return stack */
 #define	ARM11X6_AUXCTL_DB	0x0002 /* dynamic branch prediction */
@@ -521,7 +547,11 @@
 #define FAULT_PERM_S0x0d /* Permission -- Section */
 #define FAULT_PERM_P0x0f /* Permission -- Page */
 
-#define	FAULT_IMPRECISE	0x400	/* Imprecise exception (XSCALE) */
+#define FAULT_LPAE	0x0200	/* (SW) used long descriptors */
+#define FAULT_IMPRECISE	0x0400	/* Imprecise exception (XSCALE) */
+#define FAULT_WRITE	0x0800	/* fault was due to write (ARMv6+) */
+#define FAULT_EXT	0x1000	/* fault was due to external abort (ARMv6+) */
+#define FAULT_CM	0x2000	/* fault was due to cache maintenance (ARMv7+) */
 
 /*
  * Address of the vector page, low and high versions.
@@ -542,7 +572,21 @@
 
 #define INSN_SIZE		4		/* Always 4 bytes */
 #define INSN_COND_MASK		0xf000	/* Condition mask */
-#define INSN_COND_AL		0xe000	/* Always condition */
+#define INSN_COND_EQ		0		/* Z == 1 */
+#define INSN_COND_NE		1		/* Z == 0 */
+#define INSN_COND_CS		2		/* C == 1 */
+#define INSN_COND_CC		3		/* C == 0 */
+#define INSN_COND_MI		4		/* N == 1 */
+#define INSN_COND_PL		5		/* N == 0 */
+#define INSN_COND_VS		6		/* V == 1 */
+#define INSN_COND_VC		7		/* V == 0 */
+#define INSN_COND_HI		8		/* C == 1 && Z == 0 */
+#define INSN_COND_LS		9		/* C == 0 || Z == 1 */
+#define INSN_COND_GE		10		/* N == V */
+#define INSN_COND_LT		11		/* N

CVS commit: [matt-nb5-mips64] src/common/lib/libc/arch/arm/atomic

2014-03-24 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Mar 24 18:53:34 UTC 2014

Modified Files:
src/common/lib/libc/arch/arm/atomic [matt-nb5-mips64]: atomic_swap.S

Log Message:
Use ldrex/strex instead of swp when possible.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.12.1 \
src/common/lib/libc/arch/arm/atomic/atomic_swap.S

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

Modified files:

Index: src/common/lib/libc/arch/arm/atomic/atomic_swap.S
diff -u src/common/lib/libc/arch/arm/atomic/atomic_swap.S:1.2 src/common/lib/libc/arch/arm/atomic/atomic_swap.S:1.2.12.1
--- src/common/lib/libc/arch/arm/atomic/atomic_swap.S:1.2	Sat Aug 16 07:12:40 2008
+++ src/common/lib/libc/arch/arm/atomic/atomic_swap.S	Mon Mar 24 18:53:34 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: atomic_swap.S,v 1.2 2008/08/16 07:12:40 matt Exp $	*/
+/*	$NetBSD: atomic_swap.S,v 1.2.12.1 2014/03/24 18:53:34 matt Exp $	*/
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -39,7 +39,15 @@
 #include "atomic_op_asm.h"
 
 ENTRY_NP(_atomic_swap_32)
+#ifdef _ARM_ARCH_6
+	mov	ip, r0
+1:	ldrex	r0, [ip]
+	strex	r2, r1, ip
+	cmp	r2, #0
+	bne	1b
+#else
 	swp	r0, r1, [r0]
+#endif
 	RET
 	END(_atomic_swap_32)
 ATOMIC_OP_ALIAS(atomic_swap_32,_atomic_swap_32)
@@ -51,7 +59,15 @@ STRONG_ALIAS(_atomic_swap_ulong,_atomic_
 STRONG_ALIAS(_atomic_swap_ptr,_atomic_swap_32)
 
 ENTRY_NP(_atomic_swap_8)
+#ifdef _ARM_ARCH_6
+	mov	ip, r0
+1:	ldrexb	r0, [ip]
+	strexb	r2, r1, ip
+	cmp	r2, #0
+	bne	1b
+#else
 	swpb	r0, r1, [r0]
+#endif
 	RET
 	END(_atomic_swap_8)
 ATOMIC_OP_ALIAS(atomic_swap_8,_atomic_swap_8)



CVS commit: [matt-nb5-mips64] src

2014-03-24 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Mar 24 18:58:00 UTC 2014

Modified Files:
src/libexec/ld.aout_so [matt-nb5-mips64]: Makefile
src/sbin/ldconfig [matt-nb5-mips64]: Makefile

Log Message:
Make these work with a machine_arch of armv7


To generate a diff of this commit:
cvs rdiff -u -r1.45.38.1 -r1.45.38.1.4.1 src/libexec/ld.aout_so/Makefile
cvs rdiff -u -r1.21.40.1 -r1.21.40.1.4.1 src/sbin/ldconfig/Makefile

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

Modified files:

Index: src/libexec/ld.aout_so/Makefile
diff -u src/libexec/ld.aout_so/Makefile:1.45.38.1 src/libexec/ld.aout_so/Makefile:1.45.38.1.4.1
--- src/libexec/ld.aout_so/Makefile:1.45.38.1	Thu Nov  6 23:51:27 2008
+++ src/libexec/ld.aout_so/Makefile	Mon Mar 24 18:58:00 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.45.38.1 2008/11/06 23:51:27 snj Exp $
+#	$NetBSD: Makefile,v 1.45.38.1.4.1 2014/03/24 18:58:00 matt Exp $
 
 .include 			# for OBJECT_FMT definition
 .include 			# for SHLINKINSTALLDIR definition
@@ -41,6 +41,7 @@ SYMLINKS+=	${SHLINKINSTALLDIR}/${PROG} /
 
 .elif (${OBJECT_FMT} == "ELF" && \
(${MACHINE_ARCH} == "arm" || \
+${MACHINE_ARCH} == "armv7" || \
 ${MACHINE_ARCH} == "i386" || \
 ${MACHINE_ARCH} == "m68k" || \
 ${MACHINE_ARCH} == "sparc" || \
@@ -49,12 +50,12 @@ SYMLINKS+=	${SHLINKINSTALLDIR}/${PROG} /
 FILES=		ld.so
 FILESDIR=	/usr/libexec
 FILESMODE=	${BINMODE}
-UUDECODE_FILES=	ld.so.${MACHINE_ARCH}
+UUDECODE_FILES=	ld.so.${MACHINE_CPU}
 UUDECODE_FILES_RENAME_${UUDECODE_FILES}= ld.so
 
 all dependall: ${FILES}
 
-ld.so:	ld.so.${MACHINE_ARCH}
+ld.so:	ld.so.${MACHINE_CPU}
 
 .endif
 .endif

Index: src/sbin/ldconfig/Makefile
diff -u src/sbin/ldconfig/Makefile:1.21.40.1 src/sbin/ldconfig/Makefile:1.21.40.1.4.1
--- src/sbin/ldconfig/Makefile:1.21.40.1	Thu Nov  6 23:51:27 2008
+++ src/sbin/ldconfig/Makefile	Mon Mar 24 18:58:00 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.21.40.1 2008/11/06 23:51:27 snj Exp $
+#	$NetBSD: Makefile,v 1.21.40.1.4.1 2014/03/24 18:58:00 matt Exp $
 
 .include# For OBJECT_FMT
 .include 
@@ -7,6 +7,7 @@
 (${OBJECT_FMT} == "a.out" ||	\
 (${OBJECT_FMT} == "ELF" &&		\
 (${MACHINE_ARCH} == "arm" ||	\
+ ${MACHINE_ARCH} == "armv7" ||	\
  ${MACHINE_ARCH} == "i386" ||	\
  ${MACHINE_ARCH} == "m68k" ||	\
  ${MACHINE_ARCH} == "sparc" ||	\



CVS commit: [matt-nb5-mips64] src/sys/conf

2014-03-24 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Mar 24 18:50:51 UTC 2014

Modified Files:
src/sys/conf [matt-nb5-mips64]: files

Log Message:
Add sata_fis to ahcisata


To generate a diff of this commit:
cvs rdiff -u -r1.924.4.1.4.4 -r1.924.4.1.4.5 src/sys/conf/files

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

Modified files:

Index: src/sys/conf/files
diff -u src/sys/conf/files:1.924.4.1.4.4 src/sys/conf/files:1.924.4.1.4.5
--- src/sys/conf/files:1.924.4.1.4.4	Fri Feb 14 18:35:15 2014
+++ src/sys/conf/files	Mon Mar 24 18:50:51 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: files,v 1.924.4.1.4.4 2014/02/14 18:35:15 matt Exp $
+#	$NetBSD: files,v 1.924.4.1.4.5 2014/03/24 18:50:51 matt Exp $
 #	@(#)files.newconf	7.5 (Berkeley) 5/10/93
 
 version 	20080610
@@ -930,7 +930,7 @@ file	dev/ic/lpt_upc.c		lpt_upc
 # AHCI-compatible SATA controllers
 define ahcisata_core
 file dev/ic/ahcisata_core.c ahcisata_core
-device ahcisata: ata, ata_dma, ata_udma, sata, ahcisata_core
+device ahcisata: ata, ata_dma, ata_udma, sata, sata_fis, ahcisata_core
 
 # Silicon Image SteelVine SATA-II controllers
 define	siisata



CVS commit: [matt-nb5-mips64] src/sys/kern

2014-03-24 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Mar 24 18:51:45 UTC 2014

Modified Files:
src/sys/kern [matt-nb5-mips64]: kern_runq.c

Log Message:
Use the cpu_name in ci_data


To generate a diff of this commit:
cvs rdiff -u -r1.22.4.3.4.2 -r1.22.4.3.4.3 src/sys/kern/kern_runq.c

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

Modified files:

Index: src/sys/kern/kern_runq.c
diff -u src/sys/kern/kern_runq.c:1.22.4.3.4.2 src/sys/kern/kern_runq.c:1.22.4.3.4.3
--- src/sys/kern/kern_runq.c:1.22.4.3.4.2	Sat Feb  5 06:00:14 2011
+++ src/sys/kern/kern_runq.c	Mon Mar 24 18:51:45 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_runq.c,v 1.22.4.3.4.2 2011/02/05 06:00:14 cliff Exp $	*/
+/*	$NetBSD: kern_runq.c,v 1.22.4.3.4.3 2014/03/24 18:51:45 matt Exp $	*/
 
 /*
  * Copyright (c) 2007, 2008 Mindaugas Rasiukevicius 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_runq.c,v 1.22.4.3.4.2 2011/02/05 06:00:14 cliff Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_runq.c,v 1.22.4.3.4.3 2014/03/24 18:51:45 matt Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -145,7 +145,6 @@ sched_cpuattach(struct cpu_info *ci)
 	runqueue_t *ci_rq;
 	void *rq_ptr;
 	u_int i, size;
-	char *cpuname;
 
 	if (ci->ci_schedstate.spc_lwplock == NULL) {
 		ci->ci_schedstate.spc_lwplock =
@@ -178,17 +177,14 @@ sched_cpuattach(struct cpu_info *ci)
 
 	ci->ci_schedstate.spc_sched_info = ci_rq;
 
-	cpuname = kmem_alloc(8, KM_SLEEP);
-	snprintf(cpuname, 8, "cpu%d", cpu_index(ci));
-
 	evcnt_attach_dynamic(&ci_rq->r_ev_pull, EVCNT_TYPE_MISC, NULL,
-	   cpuname, "runqueue pull");
+	ci->ci_data.cpu_name, "runqueue pull");
 	evcnt_attach_dynamic(&ci_rq->r_ev_push, EVCNT_TYPE_MISC, NULL,
-	   cpuname, "runqueue push");
+	ci->ci_data.cpu_name, "runqueue push");
 	evcnt_attach_dynamic(&ci_rq->r_ev_stay, EVCNT_TYPE_MISC, NULL,
-	   cpuname, "runqueue stay");
+	ci->ci_data.cpu_name, "runqueue stay");
 	evcnt_attach_dynamic(&ci_rq->r_ev_localize, EVCNT_TYPE_MISC, NULL,
-	   cpuname, "runqueue localize");
+	ci->ci_data.cpu_name, "runqueue localize");
 }
 
 /*



CVS commit: [matt-nb5-mips64] src/sys/dev/ic

2014-03-24 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Mar 24 18:47:17 UTC 2014

Modified Files:
src/sys/dev/ic [matt-nb5-mips64]: ahcisata_core.c ahcisatareg.h
ahcisatavar.h

Log Message:
Merge needed changes from HEAD for cubie


To generate a diff of this commit:
cvs rdiff -u -r1.18.4.1.4.1 -r1.18.4.1.4.2 src/sys/dev/ic/ahcisata_core.c
cvs rdiff -u -r1.4 -r1.4.28.1 src/sys/dev/ic/ahcisatareg.h
cvs rdiff -u -r1.4 -r1.4.22.1 src/sys/dev/ic/ahcisatavar.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/dev/ic/ahcisata_core.c
diff -u src/sys/dev/ic/ahcisata_core.c:1.18.4.1.4.1 src/sys/dev/ic/ahcisata_core.c:1.18.4.1.4.2
--- src/sys/dev/ic/ahcisata_core.c:1.18.4.1.4.1	Wed Apr 21 00:27:35 2010
+++ src/sys/dev/ic/ahcisata_core.c	Mon Mar 24 18:47:17 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisata_core.c,v 1.18.4.1.4.1 2010/04/21 00:27:35 matt Exp $	*/
+/*	$NetBSD: ahcisata_core.c,v 1.18.4.1.4.2 2014/03/24 18:47:17 matt Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -11,11 +11,6 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *must display the following acknowledgement:
- *	This product includes software developed by Manuel Bouyer.
- * 4. The name of the author may not be used to endorse or promote products
- *derived from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
@@ -31,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.18.4.1.4.1 2010/04/21 00:27:35 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.18.4.1.4.2 2014/03/24 18:47:17 matt Exp $");
 
 #include 
 #include 
@@ -44,10 +39,11 @@ __KERNEL_RCSID(0, "$NetBSD: ahcisata_cor
 
 #include 
 
-#include 
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 
 #include  /* for SCSI status */
@@ -58,39 +54,39 @@ __KERNEL_RCSID(0, "$NetBSD: ahcisata_cor
 int ahcidebug_mask = 0x0;
 #endif
 
-void ahci_probe_drive(struct ata_channel *);
-void ahci_setup_channel(struct ata_channel *);
+static void ahci_probe_drive(struct ata_channel *);
+static void ahci_setup_channel(struct ata_channel *);
 
-int  ahci_ata_bio(struct ata_drive_datas *, struct ata_bio *);
-void ahci_reset_drive(struct ata_drive_datas *, int);
-void ahci_reset_channel(struct ata_channel *, int);
-int  ahci_exec_command(struct ata_drive_datas *, struct ata_command *);
-int  ahci_ata_addref(struct ata_drive_datas *);
-void ahci_ata_delref(struct ata_drive_datas *);
-void ahci_killpending(struct ata_drive_datas *);
-
-void ahci_cmd_start(struct ata_channel *, struct ata_xfer *);
-int  ahci_cmd_complete(struct ata_channel *, struct ata_xfer *, int);
-void ahci_cmd_done(struct ata_channel *, struct ata_xfer *, int);
-void ahci_cmd_kill_xfer(struct ata_channel *, struct ata_xfer *, int) ;
-void ahci_bio_start(struct ata_channel *, struct ata_xfer *);
-int  ahci_bio_complete(struct ata_channel *, struct ata_xfer *, int);
-void ahci_bio_kill_xfer(struct ata_channel *, struct ata_xfer *, int) ;
-void ahci_channel_stop(struct ahci_softc *, struct ata_channel *, int);
-void ahci_channel_start(struct ahci_softc *, struct ata_channel *);
-void ahci_timeout(void *);
-int  ahci_dma_setup(struct ata_channel *, int, void *, size_t, int);
+static int  ahci_ata_bio(struct ata_drive_datas *, struct ata_bio *);
+static void ahci_reset_drive(struct ata_drive_datas *, int);
+static void ahci_reset_channel(struct ata_channel *, int);
+static int  ahci_exec_command(struct ata_drive_datas *, struct ata_command *);
+static int  ahci_ata_addref(struct ata_drive_datas *);
+static void ahci_ata_delref(struct ata_drive_datas *);
+static void ahci_killpending(struct ata_drive_datas *);
+
+static void ahci_cmd_start(struct ata_channel *, struct ata_xfer *);
+static int  ahci_cmd_complete(struct ata_channel *, struct ata_xfer *, int);
+static void ahci_cmd_done(struct ata_channel *, struct ata_xfer *, int);
+static void ahci_cmd_kill_xfer(struct ata_channel *, struct ata_xfer *, int) ;
+static void ahci_bio_start(struct ata_channel *, struct ata_xfer *);
+static int  ahci_bio_complete(struct ata_channel *, struct ata_xfer *, int);
+static void ahci_bio_kill_xfer(struct ata_channel *, struct ata_xfer *, int) ;
+static void ahci_channel_stop(struct ahci_softc *, struct ata_channel *, int);
+static void ahci_channel_start(struct ahci_softc *, struct ata_channel *);
+static void ahci_timeout(void *);
+static int  ahci_dma_setup(struct ata_channel *, int, void *, size_t, int);
 
 #if NATAPIBUS > 0
-void ahci_atapibus_attach(struct atabus_

CVS commit: [matt-nb5-mips64] src/sys/dev/ata

2014-03-24 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Mar 24 18:49:53 UTC 2014

Modified Files:
src/sys/dev/ata [matt-nb5-mips64]: satafis_subr.c satafisreg.h
satafisvar.h

Log Message:
Merge satafis changes from HEAD for ahcisata


To generate a diff of this commit:
cvs rdiff -u -r1.5.2.2 -r1.5.2.3 src/sys/dev/ata/satafis_subr.c
cvs rdiff -u -r1.2.2.2 -r1.2.2.3 src/sys/dev/ata/satafisreg.h
cvs rdiff -u -r1.3.2.2 -r1.3.2.3 src/sys/dev/ata/satafisvar.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/dev/ata/satafis_subr.c
diff -u src/sys/dev/ata/satafis_subr.c:1.5.2.2 src/sys/dev/ata/satafis_subr.c:1.5.2.3
--- src/sys/dev/ata/satafis_subr.c:1.5.2.2	Wed Apr 21 00:27:34 2010
+++ src/sys/dev/ata/satafis_subr.c	Mon Mar 24 18:49:53 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: satafis_subr.c,v 1.5.2.2 2010/04/21 00:27:34 matt Exp $ */
+/* $NetBSD: satafis_subr.c,v 1.5.2.3 2014/03/24 18:49:53 matt Exp $ */
 
 /*-
  * Copyright (c) 2009 Jonathan A. Kollasch.
@@ -56,7 +56,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: satafis_subr.c,v 1.5.2.2 2010/04/21 00:27:34 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: satafis_subr.c,v 1.5.2.3 2014/03/24 18:49:53 matt Exp $");
 
 #include 
 #include 
@@ -69,8 +69,6 @@ __KERNEL_RCSID(0, "$NetBSD: satafis_subr
 #include 
 #include 
 
-#include  /* for WDCTL_4BIT */
-
 #include "atapibus.h"
 
 void
@@ -79,7 +77,7 @@ satafis_rhd_construct_cmd(struct ata_com
 	memset(fis, 0, RHD_FISLEN);
 
 	fis[fis_type] = RHD_FISTYPE;
-	fis[rhd_cdpmp] = 0x80; /* xxx magic */
+	fis[rhd_c] = RHD_C;
 	fis[rhd_command] = ata_c->r_command;
 	fis[rhd_features] = ata_c->r_features;
 	fis[rhd_sector] = ata_c->r_sector;
@@ -87,9 +85,6 @@ satafis_rhd_construct_cmd(struct ata_com
 	fis[rhd_cyl_hi] = (ata_c->r_cyl >> 8) & 0xff;
 	fis[rhd_dh] = ata_c->r_head & 0x0f;
 	fis[rhd_seccnt] = ata_c->r_count;
-	fis[rhd_control] = WDCTL_4BIT;
-
-	return;
 }
 
 void
@@ -103,7 +98,7 @@ satafis_rhd_construct_bio(struct ata_xfe
 	memset(fis, 0, RHD_FISLEN);
 
 	fis[fis_type] = RHD_FISTYPE;
-	fis[rhd_cdpmp] = 0x80; /* xxx magic */
+	fis[rhd_c] = RHD_C;
 	if (ata_bio->flags & ATA_LBA48) {
 		fis[rhd_command] = (ata_bio->flags & ATA_READ) ?
 		WDCC_READDMA_EXT : WDCC_WRITEDMA_EXT;
@@ -125,8 +120,6 @@ satafis_rhd_construct_bio(struct ata_xfe
 	fis[rhd_seccnt] = nblks & 0xff;
 	fis[rhd_seccnt_exp] = (ata_bio->flags & ATA_LBA48) ?
 	((nblks >> 8) & 0xff) : 0;
-	fis[rhd_control] = WDCTL_4BIT;
-	return;
 }
 
 #if NATAPIBUS > 0
@@ -136,26 +129,30 @@ satafis_rhd_construct_atapi(struct ata_x
 	memset(fis, 0, RHD_FISLEN);
 
 	fis[fis_type] = RHD_FISTYPE;
-	fis[rhd_cdpmp] = 0x80; /* xxx magic */
+	fis[rhd_c] = RHD_C;
 	fis[rhd_command] = ATAPI_PKT_CMD;
 	fis[rhd_features] = (xfer->c_flags & C_DMA) ?
 	ATAPI_PKT_CMD_FTRE_DMA : 0;
-	fis[rhd_dh] = WDSD_IBM; /* XXX or WDSD_LBA? */
-	fis[rhd_control] = WDCTL_4BIT;
 
 	return;
 }
 #endif /* NATAPIBUS */
 
 void
-satafis_rdh_parse(struct ata_channel *chp, uint8_t *fis)
+satafis_rdh_parse(struct ata_channel *chp, const uint8_t *fis)
 {
-#if 0
-	/* siisata doesn't do enough for this to work */
-	KASSERT(fis[fis_type] == RDH_FISTYPE);
-#endif
 	chp->ch_status = fis[rdh_status];
 	chp->ch_error = fis[rdh_error];
+}
 
-	return;
+void
+satafis_rdh_cmd_readreg(struct ata_command *ata_c, const uint8_t *fis)
+{
+	ata_c->r_command = fis[rdh_status];
+	ata_c->r_features = fis[rdh_error];
+	ata_c->r_error = fis[rdh_error];
+	ata_c->r_sector = fis[rdh_sector];
+	ata_c->r_cyl = fis[rdh_cyl_hi] << 8 | fis[rdh_cyl_lo];
+	ata_c->r_head = fis[rdh_dh];
+	ata_c->r_count = fis[rdh_seccnt];
 }

Index: src/sys/dev/ata/satafisreg.h
diff -u src/sys/dev/ata/satafisreg.h:1.2.2.2 src/sys/dev/ata/satafisreg.h:1.2.2.3
--- src/sys/dev/ata/satafisreg.h:1.2.2.2	Wed Apr 21 00:27:34 2010
+++ src/sys/dev/ata/satafisreg.h	Mon Mar 24 18:49:53 2014
@@ -1,7 +1,7 @@
-/* $NetBSD: satafisreg.h,v 1.2.2.2 2010/04/21 00:27:34 matt Exp $ */
+/* $NetBSD: satafisreg.h,v 1.2.2.3 2014/03/24 18:49:53 matt Exp $ */
 
-/*-
- * Copyright (c) 2009 Jonathan A. Kollasch.
+/*
+ * Copyright (c) 2009, 2010 Jonathan A. Kollasch.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -32,7 +32,8 @@
 
 #define RHD_FISTYPE 0x27
 #define RHD_FISLEN 20
-#define rhd_cdpmp 1 /* Command bit and PM port */
+#define rhd_c 1 /* Command bit and PM port */
+#define RHD_C 0x80
 #define rhd_command 2 /* wd_command */
 #define rhd_features 3 /* wd_precomp */
 #define rhd_sector 4 /* wd_sector */
@@ -50,17 +51,18 @@
 #define RDH_FISTYPE 0x34
 #define RDH_FISLEN 20
 #define rdh_i 1
+#define RDH_I 0x40
 #define rdh_status 2
 #define rdh_error 3
 #define rdh_sector 4 /* wd_sector */
 #define rdh_cyl_lo 5 /* wd_cyl_lo */
 #define rdh_cyl_hi 6 /* wd_cyl_hi */
 #define rdh_dh 7 /* wd_sdh */
-#define rhd_sector_exp 8
-#define rhd_cyl_lo_exp 9
-#define rhd_cyl_hi_exp 10
-#define rhd_seccnt 12
-#define rhd_

CVS commit: [matt-nb5-mips64] src/sys/dev/i2c

2014-03-24 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Mar 24 18:48:52 UTC 2014

Modified Files:
src/sys/dev/i2c [matt-nb5-mips64]: files.i2c
Added Files:
src/sys/dev/i2c [matt-nb5-mips64]: gttwsi_core.c gttwsireg.h
gttwsivar.h

Log Message:
Merge mvi2c from HEAD


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.23.10.1 src/sys/dev/i2c/files.i2c
cvs rdiff -u -r0 -r1.1.2.2 src/sys/dev/i2c/gttwsi_core.c \
src/sys/dev/i2c/gttwsireg.h src/sys/dev/i2c/gttwsivar.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/dev/i2c/files.i2c
diff -u src/sys/dev/i2c/files.i2c:1.23 src/sys/dev/i2c/files.i2c:1.23.10.1
--- src/sys/dev/i2c/files.i2c:1.23	Thu Oct 30 12:52:46 2008
+++ src/sys/dev/i2c/files.i2c	Mon Mar 24 18:48:52 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: files.i2c,v 1.23 2008/10/30 12:52:46 nakayama Exp $
+#	$NetBSD: files.i2c,v 1.23.10.1 2014/03/24 18:48:52 matt Exp $
 
 defflag	opt_i2cbus.hI2C_SCAN
 define	i2cbus { }
@@ -14,6 +14,12 @@ define	i2c_bitbang
 file	dev/i2c/i2c_bitbang.c			i2c_bitbang
 
 #
+# I2C master devices
+#
+define	mvi2c
+file	dev/i2c/gttwsi_core.c			mvi2c
+
+#
 # I2C client devices
 #
 

Added files:

Index: src/sys/dev/i2c/gttwsi_core.c
diff -u /dev/null src/sys/dev/i2c/gttwsi_core.c:1.1.2.2
--- /dev/null	Mon Mar 24 18:48:52 2014
+++ src/sys/dev/i2c/gttwsi_core.c	Mon Mar 24 18:48:52 2014
@@ -0,0 +1,353 @@
+/*	$NetBSD: gttwsi_core.c,v 1.1.2.2 2014/03/24 18:48:52 matt Exp $	*/
+/*
+ * Copyright (c) 2008 Eiji Kawauchi.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *must display the following acknowledgement:
+ *  This product includes software developed for the NetBSD Project by
+ *  Eiji Kawauchi.
+ * 4. The name of the author may not be used to endorse or promote products
+ *derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+/*
+ * Copyright (c) 2005 Brocade Communcations, inc.
+ * All rights reserved.
+ *
+ * Written by Matt Thomas for Brocade Communcations, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ * 3. The name of Brocade Communications, Inc. may not be used to endorse
+ *or promote products derived from this software without specific prior
+ *written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY BROCADE COMMUNICATIONS, INC. ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL EITHER BROCADE COMMUNICATIONS, INC. BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+//#define TWSI_DEBUG
+
+/*
+ * Marvell Two-Wire Serial Interface (aka I2C) mas

CVS commit: [matt-nb5-mips64] src/sys/arch/arm/cortex

2014-03-24 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Mar 24 18:44:13 UTC 2014

Modified Files:
src/sys/arch/arm/cortex [matt-nb5-mips64]: a9_mpsubr.S

Log Message:
Allow A7 to use this.


To generate a diff of this commit:
cvs rdiff -u -r1.12.2.3 -r1.12.2.4 src/sys/arch/arm/cortex/a9_mpsubr.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/cortex/a9_mpsubr.S
diff -u src/sys/arch/arm/cortex/a9_mpsubr.S:1.12.2.3 src/sys/arch/arm/cortex/a9_mpsubr.S:1.12.2.4
--- src/sys/arch/arm/cortex/a9_mpsubr.S:1.12.2.3	Thu Feb 20 20:36:29 2014
+++ src/sys/arch/arm/cortex/a9_mpsubr.S	Mon Mar 24 18:44:13 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: a9_mpsubr.S,v 1.12.2.3 2014/02/20 20:36:29 matt Exp $	*/
+/*	$NetBSD: a9_mpsubr.S,v 1.12.2.4 2014/03/24 18:44:13 matt Exp $	*/
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -330,15 +330,23 @@ comlock:
 #endif /* MULTIPROCESSOR */
 #endif /* VERBOSE_INIT_ARM */
 
-#ifdef CPU_CORTEXA9
 a9_start:
+cortex_init:
 	mov	r10, lr@ save lr
 
 	cpsid	if, #PSR_SVC32_MODE
 
 	XPUTC(#64)
+#ifdef KERNEL_BASES_EQUAL
 	bl	_C_LABEL(armv7_icache_inv_all)	@ invalidate i-cache
+#else
+	adr	ip, cortex_init
+	ldr	r0, =armv7_icache_inv_all
+	bfi	ip, r0, #0, #28
+	blx	ip
+#endif
 
+#ifdef CPU_CORTEXA9
 	/*
 	 * Step 1a, invalidate the all cache tags in all ways on the SCU.
 	 */
@@ -352,14 +360,23 @@ a9_start:
 	str	r1, [r3, #SCU_INV_ALL_REG]	@ write scu invalidate all
 	dsb
 	isb
+#endif
 
 	/*
 	 * Step 1b, invalidate the data cache
 	 */
 	XPUTC(#66)
+#ifdef KERNEL_BASES_EQUAL
 	bl	_C_LABEL(armv7_dcache_wbinv_all)	@ writeback/invalidate d-cache
+#else
+	adr	ip, cortex_init
+	ldr	r0, =armv7_dcache_wbinv_all
+	bfi	ip, r0, #0, #28
+	blx	ip
+#endif
 	XPUTC(#67)
 
+#ifdef CPU_CORTEXA9
 	/*
 	 * Step 2, disable the data cache
 	 */
@@ -387,8 +404,8 @@ a9_start:
 	mcr	p15, 0, r2, c1, c0, 0		@ reenable caches
 	isb
 	XPUTC(#51)
+#endif
 
-#ifdef MULTIPROCESSOR
 	/*
 	 * Step 4b, set ACTLR.SMP=1 (and ACTRL.FX=1)
 	 */
@@ -396,6 +413,8 @@ a9_start:
 	orr	r0, r0, #CORTEXA9_AUXCTL_SMP	@ enable SMP
 	mcr	p15, 0, r0, c1, c0, 1		@ write aux ctl
 	isb
+#ifdef CPU_CORTEXA9
+	mrc	p15, 0, r0, c1, c0, 1		@ read aux ctl
 	orr	r0, r0, #CORTEXA9_AUXCTL_FW	@ enable cache/tlb/coherency
 	mcr	p15, 0, r0, c1, c0, 1		@ write aux ctl
 	isb
@@ -526,4 +545,3 @@ ASEND(a9_mpstart)
 .Lbcm53xx_cpu_hatch:
 	.word	_C_LABEL(bcm53xx_cpu_hatch)
 #endif /* MULTIPROCESSOR */
-#endif /* CPU_CORTEXA9 */



CVS commit: [matt-nb5-mips64] src/sys/arch/evbarm

2014-03-24 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Mar 24 18:46:38 UTC 2014

Modified Files:
src/sys/arch/evbarm/conf [matt-nb5-mips64]: Makefile.evbarm.inc
Added Files:
src/sys/arch/evbarm/conf [matt-nb5-mips64]: CUBIEBOARD
CUBIEBOARD_INSTALL files.cubie mk.cubie std.cubie
src/sys/arch/evbarm/cubie [matt-nb5-mips64]: cubie_machdep.c
cubie_start.S genassym.cf platform.h

Log Message:
Add cubie from HEAD


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.10.2.2 src/sys/arch/evbarm/conf/CUBIEBOARD
cvs rdiff -u -r0 -r1.1.2.2 src/sys/arch/evbarm/conf/CUBIEBOARD_INSTALL \
src/sys/arch/evbarm/conf/files.cubie
cvs rdiff -u -r1.19.12.1 -r1.19.12.2 \
src/sys/arch/evbarm/conf/Makefile.evbarm.inc
cvs rdiff -u -r0 -r1.3.2.2 src/sys/arch/evbarm/conf/mk.cubie \
src/sys/arch/evbarm/conf/std.cubie
cvs rdiff -u -r0 -r1.14.2.2 src/sys/arch/evbarm/cubie/cubie_machdep.c
cvs rdiff -u -r0 -r1.6.2.2 src/sys/arch/evbarm/cubie/cubie_start.S
cvs rdiff -u -r0 -r1.1.2.2 src/sys/arch/evbarm/cubie/genassym.cf
cvs rdiff -u -r0 -r1.2.2.2 src/sys/arch/evbarm/cubie/platform.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/evbarm/conf/Makefile.evbarm.inc
diff -u src/sys/arch/evbarm/conf/Makefile.evbarm.inc:1.19.12.1 src/sys/arch/evbarm/conf/Makefile.evbarm.inc:1.19.12.2
--- src/sys/arch/evbarm/conf/Makefile.evbarm.inc:1.19.12.1	Sat Feb 15 16:18:37 2014
+++ src/sys/arch/evbarm/conf/Makefile.evbarm.inc	Mon Mar 24 18:46:38 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.evbarm.inc,v 1.19.12.1 2014/02/15 16:18:37 matt Exp $
+#	$NetBSD: Makefile.evbarm.inc,v 1.19.12.2 2014/03/24 18:46:38 matt Exp $
 
 #
 # If this is a install kernel and the ramdisk image exists in the object
@@ -22,6 +22,11 @@ SYSTEM_LD_TAIL_EXTRA+=; \
 
 EXTRA_CLEAN+= ldscript tmp ${KERNELS:=.map}
 
+.if defined(KERNEL_BASE_PHYS) && defined(KERNEL_BASE_VIRT) \
+&& ${KERNEL_BASE_PHYS} == ${KERNEL_BASE_VIRT}
+CPPFLAGS+=-DKERNEL_BASES_EQUAL
+.endif
+
 .if defined(KERNEL_BASE_PHYS)
 LINKTEXT=
 KERNLDSCRIPT=	ldscript

Added files:

Index: src/sys/arch/evbarm/conf/CUBIEBOARD
diff -u /dev/null src/sys/arch/evbarm/conf/CUBIEBOARD:1.10.2.2
--- /dev/null	Mon Mar 24 18:46:38 2014
+++ src/sys/arch/evbarm/conf/CUBIEBOARD	Mon Mar 24 18:46:38 2014
@@ -0,0 +1,297 @@
+#
+#	$NetBSD: CUBIEBOARD,v 1.10.2.2 2014/03/24 18:46:38 matt Exp $
+#
+#	CUBIEBOARD -- Allwinner A10/A20 Eval Board Kernel
+#
+
+include	"arch/evbarm/conf/std.cubie"
+
+# estimated number of users
+
+maxusers	32
+
+# Standard system options
+
+options 	RTC_OFFSET=0	# hardware clock is this many mins. west of GMT
+#options 	NTP		# NTP phase/frequency locked loop
+
+# CPU options
+
+#options 	UVMHIST,UVMHIST_PRINT
+options 	CPU_CORTEXA8
+options 	CPU_CORTEXA7
+options 	ALLWINNER_A10
+options 	ALLWINNER_A20
+options 	PMAPCOUNTERS
+options 	AWIN_CONSOLE_EARLY
+
+# Architecture options
+
+# File systems
+
+file-system	FFS		# UFS
+#file-system	LFS		# log-structured file system
+file-system	MFS		# memory file system
+file-system	NFS		# Network file system
+#file-system 	ADOSFS		# AmigaDOS-compatible file system
+#file-system 	EXT2FS		# second extended file system (linux)
+#file-system	CD9660		# ISO 9660 + Rock Ridge file system
+file-system	MSDOSFS		# MS-DOS file system
+#file-system	FDESC		# /dev/fd
+file-system	KERNFS		# /kern
+#file-system	NULLFS		# loopback file system
+file-system	PROCFS		# /proc
+#file-system	PUFFS		# Userspace file systems (e.g. ntfs-3g & sshfs)
+#file-system	UMAPFS		# NULLFS + uid and gid remapping
+#file-system	UNION		# union file system
+file-system	TMPFS		# memory file system
+file-system	PTYFS		# /dev/pts/N support
+
+# File system options
+#options 	QUOTA		# legacy UFS quotas
+#options 	QUOTA2		# new, in-filesystem UFS quotas
+#options 	FFS_EI		# FFS Endian Independent support
+#options 	NFSSERVER
+options 	WAPBL		# File system journaling support
+#options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
+
+# Networking options
+
+#options 	GATEWAY		# packet forwarding
+options 	INET		# IP + ICMP + TCP + UDP
+options 	INET6		# IPV6
+#options 	IPSEC		# IP security
+#options 	IPSEC_DEBUG	# debug for IP security
+#options 	MROUTING	# IP multicast routing
+#options 	PIM		# Protocol Independent Multicast
+#options 	NETATALK	# AppleTalk networking
+#options 	PPP_BSDCOMP	# BSD-Compress compression support for PPP
+#options 	PPP_DEFLATE	# Deflate compression support for PPP
+#options 	PPP_FILTER	# Active filter support for PPP (requires bpf)
+#options 	TCP_DEBUG	# Record last TCP_NDEBUG packets with SO_DEBUG
+
+options 	NFS_BOOT_BOOTP
+options 	NFS_BOOT_DHCP
+#options		NFS_BOOT_BOOTSTATIC
+#options		NFS_BOOTSTATIC_MYIP="\"192.168.1.4\""
+#options		NFS_BOOTSTATIC_GWIP="\"192.168.1.1\""
+#options		NFS_BOOTSTATIC_MASK="\"255.255.255.0\""
+#options		NFS_BOOTSTATIC_SERVADDR="\"192.168.1.1\""
+#options		NFS_BOOTSTATIC_SERVER="\"192.168.1.1:/nfs/sdp2430

CVS commit: [matt-nb5-mips64] src/sys/arch/arm/arm32

2014-03-24 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Mar 24 18:45:16 UTC 2014

Modified Files:
src/sys/arch/arm/arm32 [matt-nb5-mips64]: exception.S

Log Message:
Use the improved undefined method from HEAD


To generate a diff of this commit:
cvs rdiff -u -r1.16.18.1 -r1.16.18.2 src/sys/arch/arm/arm32/exception.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/arm32/exception.S
diff -u src/sys/arch/arm/arm32/exception.S:1.16.18.1 src/sys/arch/arm/arm32/exception.S:1.16.18.2
--- src/sys/arch/arm/arm32/exception.S:1.16.18.1	Sat Feb 15 16:18:36 2014
+++ src/sys/arch/arm/arm32/exception.S	Mon Mar 24 18:45:16 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: exception.S,v 1.16.18.1 2014/02/15 16:18:36 matt Exp $	*/
+/*	$NetBSD: exception.S,v 1.16.18.2 2014/03/24 18:45:16 matt Exp $	*/
 
 /*
  * Copyright (c) 1994-1997 Mark Brinicombe.
@@ -51,7 +51,7 @@
 
 #include 
 
-	RCSID("$NetBSD: exception.S,v 1.16.18.1 2014/02/15 16:18:36 matt Exp $")
+	RCSID("$NetBSD: exception.S,v 1.16.18.2 2014/03/24 18:45:16 matt Exp $")
 
 	.text	
 	.align	0
@@ -218,13 +218,11 @@ ASEND(address_exception_entry)
  *	look like direct entry from the vector.
  */
 ASENTRY_NP(undefined_entry)
-	stmfd	sp!, {r0, r1}
+	str	r0, [sp, #-8]!
 	GET_CURCPU(r0)
-	ldr	r1, [sp], #0x0004
-	str	r1, [r0, #CI_UNDEFSAVE]!
-	ldr	r1, [sp], #0x0004
-	str	r1, [r0, #0x0004]
-	ldmia	r0, {r0, r1, pc}
+	ldr	r0, [r0, #CI_UNDEFSAVE+8]
+	str	r0, [sp, #4]
+	pop	{r0, pc}
 ASEND(undefined_entry)
 
 /*



CVS commit: [matt-nb5-mips64] src/sys/arch/arm/arm32

2014-03-24 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Mar 24 18:44:44 UTC 2014

Modified Files:
src/sys/arch/arm/arm32 [matt-nb5-mips64]: arm32_boot.c

Log Message:
Need to deal with proc0paddr.


To generate a diff of this commit:
cvs rdiff -u -r1.5.2.2 -r1.5.2.3 src/sys/arch/arm/arm32/arm32_boot.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/arm32/arm32_boot.c
diff -u src/sys/arch/arm/arm32/arm32_boot.c:1.5.2.2 src/sys/arch/arm/arm32/arm32_boot.c:1.5.2.3
--- src/sys/arch/arm/arm32/arm32_boot.c:1.5.2.2	Sat Feb 15 16:18:36 2014
+++ src/sys/arch/arm/arm32/arm32_boot.c	Mon Mar 24 18:44:43 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: arm32_boot.c,v 1.5.2.2 2014/02/15 16:18:36 matt Exp $	*/
+/*	$NetBSD: arm32_boot.c,v 1.5.2.3 2014/03/24 18:44:43 matt Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003, 2005  Genetec Corporation.  All rights reserved.
@@ -123,7 +123,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: arm32_boot.c,v 1.5.2.2 2014/02/15 16:18:36 matt Exp $");
+__KERNEL_RCSID(1, "$NetBSD: arm32_boot.c,v 1.5.2.3 2014/03/24 18:44:43 matt Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -165,7 +165,8 @@ initarm_common(vaddr_t kvm_base, vsize_t
 	 * this during uvm init.
 	 */
 	//uvm_lwp_setuarea(&lwp0, kernelstack.pv_va);
-	lwp0.l_addr = (void *)kernelstack.pv_va;
+	extern struct user *proc0paddr;
+	lwp0.l_addr = proc0paddr = (void *)kernelstack.pv_va;
 
 #ifdef VERBOSE_INIT_ARM
 	printf("bootstrap done.\n");



CVS commit: [matt-nb5-mips64] src/sys/arch/arm/include

2014-03-24 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Mar 24 18:43:40 UTC 2014

Modified Files:
src/sys/arch/arm/include [matt-nb5-mips64]: armreg.h

Log Message:
merge l2ctrl from head


To generate a diff of this commit:
cvs rdiff -u -r1.41.12.1 -r1.41.12.2 src/sys/arch/arm/include/armreg.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/armreg.h
diff -u src/sys/arch/arm/include/armreg.h:1.41.12.1 src/sys/arch/arm/include/armreg.h:1.41.12.2
--- src/sys/arch/arm/include/armreg.h:1.41.12.1	Sat Feb 15 16:18:36 2014
+++ src/sys/arch/arm/include/armreg.h	Mon Mar 24 18:43:40 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: armreg.h,v 1.41.12.1 2014/02/15 16:18:36 matt Exp $	*/
+/*	$NetBSD: armreg.h,v 1.41.12.2 2014/03/24 18:43:40 matt Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Ben Harris
@@ -597,6 +597,10 @@
 #define CORTEX_CNTENC_C __BIT(31)	/* Disables the cycle counter */
 #define CORTEX_CNTOFL_C __BIT(31)	/* Cycle counter overflow flag */
 
+/* Defines for ARM Cortex A7/A15 L2CTRL */
+#define L2CTRL_NUMCPU	__BITS(25,24)	// numcpus - 1
+#define L2CTRL_ICPRES	__BIT(23)	// Interrupt Controller is present
+
 /* Translate Table Base Control Register */
 #define TTBCR_S_EAE	__BIT(31)	// Extended Address Extension
 #define TTBCR_S_PD1	__BIT(5)	// Don't use TTBR1
@@ -765,6 +769,8 @@ ARMREG_WRITE_INLINE(tlbimva, "p15,0,%0,c
 ARMREG_WRITE_INLINE(tlbiasid, "p15,0,%0,c8,c7,2") /* Invalidate unified TLB by ASID */
 ARMREG_WRITE_INLINE(tlbimvaa, "p15,0,%0,c8,c7,3") /* Invalidate unified TLB by MVA, all ASID */
 /* cp15 c9 registers */
+ARMREG_READ_INLINE(l2ctrl, "p15,1,%0,c9,c0,2") /* A7/A15 L2 Control Register */
+ARMREG_WRITE_INLINE(l2ctrl, "p15,1,%0,c9,c0,2") /* A7/A15 L2 Control Register */
 ARMREG_READ_INLINE(pmcr, "p15,0,%0,c9,c12,0") /* PMC Control Register */
 ARMREG_WRITE_INLINE(pmcr, "p15,0,%0,c9,c12,0") /* PMC Control Register */
 ARMREG_READ_INLINE(pmcntenset, "p15,0,%0,c9,c12,1") /* PMC Count Enable Set */



CVS commit: [matt-nb5-mips64] src/sys/arch/arm/include/arm32

2014-03-24 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Mar 24 18:42:50 UTC 2014

Modified Files:
src/sys/arch/arm/include/arm32 [matt-nb5-mips64]: vmparam.h

Log Message:
Deal with those arms who only need one type of freelist.


To generate a diff of this commit:
cvs rdiff -u -r1.23.12.1 -r1.23.12.2 src/sys/arch/arm/include/arm32/vmparam.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/arm32/vmparam.h
diff -u src/sys/arch/arm/include/arm32/vmparam.h:1.23.12.1 src/sys/arch/arm/include/arm32/vmparam.h:1.23.12.2
--- src/sys/arch/arm/include/arm32/vmparam.h:1.23.12.1	Sat Feb 15 16:18:36 2014
+++ src/sys/arch/arm/include/arm32/vmparam.h	Mon Mar 24 18:42:50 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.23.12.1 2014/02/15 16:18:36 matt Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.23.12.2 2014/03/24 18:42:50 matt Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -112,8 +112,12 @@ extern vaddr_t virtual_end;
 	(VM_NFREELIST == 1 \
 	? VM_PGCOLOR_BUCKET(pg) : (*arm_page_to_pggroup)((pg), (ncolors)))
 
+#ifdef PMAP_NEED_ALLOC_POOLPAGE
 #define VM_FREELIST_NORMALOK_P(lcv) \
 	((lcv) == VM_FREELIST_DEFAULT || (lcv) != arm_poolpage_vmfreelist)
+#else
+#define VM_FREELIST_NORMALOK_P(lcv)	true
+#endif
 
 struct vm_page;
 extern size_t	(*arm_page_to_pggroup)(struct vm_page *, size_t);



CVS commit: [matt-nb5-mips64] src/sys/arch/arm/include/arm32

2014-03-24 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Mar 24 16:50:57 UTC 2014

Modified Files:
src/sys/arch/arm/include/arm32 [matt-nb5-mips64]: pmap.h

Log Message:
Define PMAP_KMPAGE


To generate a diff of this commit:
cvs rdiff -u -r1.88.10.1 -r1.88.10.2 src/sys/arch/arm/include/arm32/pmap.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/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.88.10.1 src/sys/arch/arm/include/arm32/pmap.h:1.88.10.2
--- src/sys/arch/arm/include/arm32/pmap.h:1.88.10.1	Sat Feb 15 16:18:36 2014
+++ src/sys/arch/arm/include/arm32/pmap.h	Mon Mar 24 16:50:56 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.88.10.1 2014/02/15 16:18:36 matt Exp $	*/
+/*	$NetBSD: pmap.h,v 1.88.10.2 2014/03/24 16:50:56 matt Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -305,8 +305,8 @@ void	pmap_remove_all(struct pmap *);
 bool	pmap_extract(struct pmap *, vaddr_t, paddr_t *);
 
 #define	PMAP_NEED_PROCWR
-#define PMAP_GROWKERNEL		/* turn on pmap_growkernel interface */
-#define	PMAP_ENABLE_PMAP_KMPAGE	/* enable the PMAP_KMPAGE flag */
+#define PMAP_GROWKERNEL			/* turn on pmap_growkernel interface */
+#define	PMAP_KMPAGE	0x0800	/* enable the PMAP_KMPAGE flag */
 
 #if (ARM_MMU_V6 + ARM_MMU_V7) > 0
 #define	PMAP_PREFER(hint, vap, sz, td)	pmap_prefer((hint), (vap), (td))



CVS commit: [matt-nb5-mips64] src/share/mk

2014-03-24 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Mar 24 07:38:23 UTC 2014

Modified Files:
src/share/mk [matt-nb5-mips64]: bsd.endian.mk

Log Message:
Add armv7


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.15.16.1 src/share/mk/bsd.endian.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.endian.mk
diff -u src/share/mk/bsd.endian.mk:1.15 src/share/mk/bsd.endian.mk:1.15.16.1
--- src/share/mk/bsd.endian.mk:1.15	Wed Jan  9 11:26:14 2008
+++ src/share/mk/bsd.endian.mk	Mon Mar 24 07:38:23 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.endian.mk,v 1.15 2008/01/09 11:26:14 simonb Exp $
+#	$NetBSD: bsd.endian.mk,v 1.15.16.1 2014/03/24 07:38:23 matt Exp $
 
 .if !defined(_BSD_ENDIAN_MK_)
 _BSD_ENDIAN_MK_=1
@@ -7,6 +7,7 @@ _BSD_ENDIAN_MK_=1
 
 .if ${MACHINE_ARCH} == "alpha" || \
 ${MACHINE_ARCH} == "arm" || \
+${MACHINE_ARCH} == "armv7" || \
 ${MACHINE_ARCH} == "i386" || \
 ${MACHINE_ARCH} == "ia64" || \
 ${MACHINE_ARCH} == "vax" || \



CVS commit: [matt-nb5-mips64] src/sys/arch/arm/arm32

2014-03-24 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Mar 24 07:37:39 UTC 2014

Modified Files:
src/sys/arch/arm/arm32 [matt-nb5-mips64]: arm32_kvminit.c

Log Message:
Make sure kernel starts on a page boundary.


To generate a diff of this commit:
cvs rdiff -u -r1.22.2.2 -r1.22.2.3 src/sys/arch/arm/arm32/arm32_kvminit.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/arm32/arm32_kvminit.c
diff -u src/sys/arch/arm/arm32/arm32_kvminit.c:1.22.2.2 src/sys/arch/arm/arm32/arm32_kvminit.c:1.22.2.3
--- src/sys/arch/arm/arm32/arm32_kvminit.c:1.22.2.2	Sat Feb 15 16:18:36 2014
+++ src/sys/arch/arm/arm32/arm32_kvminit.c	Mon Mar 24 07:37:39 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: arm32_kvminit.c,v 1.22.2.2 2014/02/15 16:18:36 matt Exp $	*/
+/*	$NetBSD: arm32_kvminit.c,v 1.22.2.3 2014/03/24 07:37:39 matt Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003, 2005  Genetec Corporation.  All rights reserved.
@@ -122,7 +122,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: arm32_kvminit.c,v 1.22.2.2 2014/02/15 16:18:36 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arm32_kvminit.c,v 1.22.2.3 2014/03/24 07:37:39 matt Exp $");
 
 #include 
 #include 
@@ -182,7 +182,7 @@ arm32_bootmem_init(paddr_t memstart, psi
 	/*
 	 * Let's record where the kernel lives.
 	 */
-	bmi->bmi_kernelstart = kernelstart;
+	bmi->bmi_kernelstart = trunc_page(kernelstart);
 	bmi->bmi_kernelend = KERN_VTOPHYS(bmi, round_page((vaddr_t)_end));
 
 #ifdef VERBOSE_INIT_ARM



CVS commit: [matt-nb5-mips64] src/sys/uvm

2014-03-24 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Mar 24 07:37:14 UTC 2014

Modified Files:
src/sys/uvm [matt-nb5-mips64]: uvm_page.c

Log Message:
Make sure the hint is initialized to NULL.


To generate a diff of this commit:
cvs rdiff -u -r1.140.6.3.4.11 -r1.140.6.3.4.12 src/sys/uvm/uvm_page.c

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

Modified files:

Index: src/sys/uvm/uvm_page.c
diff -u src/sys/uvm/uvm_page.c:1.140.6.3.4.11 src/sys/uvm/uvm_page.c:1.140.6.3.4.12
--- src/sys/uvm/uvm_page.c:1.140.6.3.4.11	Sat Feb 15 10:19:14 2014
+++ src/sys/uvm/uvm_page.c	Mon Mar 24 07:37:14 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.c,v 1.140.6.3.4.11 2014/02/15 10:19:14 matt Exp $	*/
+/*	$NetBSD: uvm_page.c,v 1.140.6.3.4.12 2014/03/24 07:37:14 matt Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -71,7 +71,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.140.6.3.4.11 2014/02/15 10:19:14 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.140.6.3.4.12 2014/03/24 07:37:14 matt Exp $");
 
 #include "opt_uvmhist.h"
 #include "opt_readahead.h"
@@ -328,6 +328,7 @@ uvm_page_init_freelist(struct pgfreelist
 		for (size_t queue = 0; queue < PGFL_NQUEUES; queue++) {
 			LIST_INIT(&pgfl->pgfl_queues[free_list][queue]);
 		}
+		pgfl->pgfl_hint = NULL;
 		pgfl->pgfl_pggroups[free_list] =
 		&pggroups[free_list * uvmexp.ncolors + color];
 		pgfl->pgfl_pggroups[free_list]->pgrp_free_list = free_list;



CVS commit: [matt-nb5-mips64] src/sys/kern

2014-03-24 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Mar 24 07:36:48 UTC 2014

Modified Files:
src/sys/kern [matt-nb5-mips64]: subr_evcnt.c

Log Message:
Fix infinite recursion.


To generate a diff of this commit:
cvs rdiff -u -r1.4.94.3 -r1.4.94.4 src/sys/kern/subr_evcnt.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_evcnt.c
diff -u src/sys/kern/subr_evcnt.c:1.4.94.3 src/sys/kern/subr_evcnt.c:1.4.94.4
--- src/sys/kern/subr_evcnt.c:1.4.94.3	Sat Feb 15 10:13:24 2014
+++ src/sys/kern/subr_evcnt.c	Mon Mar 24 07:36:48 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_evcnt.c,v 1.4.94.3 2014/02/15 10:13:24 matt Exp $ */
+/* $NetBSD: subr_evcnt.c,v 1.4.94.4 2014/03/24 07:36:48 matt Exp $ */
 
 /*
  * Copyright (c) 1996, 2000 Christopher G. Demetriou
@@ -77,7 +77,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_evcnt.c,v 1.4.94.3 2014/02/15 10:13:24 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_evcnt.c,v 1.4.94.4 2014/03/24 07:36:48 matt Exp $");
 
 #include "opt_ddb.h"
 
@@ -153,7 +153,7 @@ evcnt_attach_dynamic(struct evcnt *ev, i
 const char *group, const char *name)
 {
 	memset(ev, 0, sizeof *ev);
-	evcnt_attach_dynamic(ev, type, parent, group, name);
+	evcnt_attach_dynamic_nozero(ev, type, parent, group, name);
 }
 
 void



CVS commit: [matt-nb5-mips64] src/sys/kern

2014-03-14 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Mar 14 22:34:35 UTC 2014

Modified Files:
src/sys/kern [matt-nb5-mips64]: kern_malloc.c

Log Message:
Deal with the issue that VM_MAP_INTRSAFE km_suballoc returns more than asked
for so the space needs for kmemusage accounting has to needs adjusted as well.


To generate a diff of this commit:
cvs rdiff -u -r1.121.10.2 -r1.121.10.3 src/sys/kern/kern_malloc.c

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

Modified files:

Index: src/sys/kern/kern_malloc.c
diff -u src/sys/kern/kern_malloc.c:1.121.10.2 src/sys/kern/kern_malloc.c:1.121.10.3
--- src/sys/kern/kern_malloc.c:1.121.10.2	Fri Mar 14 21:45:41 2014
+++ src/sys/kern/kern_malloc.c	Fri Mar 14 22:34:35 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_malloc.c,v 1.121.10.2 2014/03/14 21:45:41 matt Exp $	*/
+/*	$NetBSD: kern_malloc.c,v 1.121.10.3 2014/03/14 22:34:35 matt Exp $	*/
 
 /*
  * Copyright (c) 1987, 1991, 1993
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_malloc.c,v 1.121.10.2 2014/03/14 21:45:41 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_malloc.c,v 1.121.10.3 2014/03/14 22:34:35 matt Exp $");
 
 #include 
 #include 
@@ -926,7 +926,12 @@ kmeminit(void)
 	kmembase = (char *)kmb;
 	kmemlimit = (char *)kml;
 
-	KASSERT(((kmemlimit - kmembase) >> PAGE_SHIFT) == nkmempages);
+	/*
+	 * Since the suballoc was VM_MAP_INTRSAFE, the allocated size
+	 * may be larger than was we asked for.  Recompute nkmempages
+	 * to cover the additional space allocated.  
+	 */
+	nkmempages = (kmemlimit - kmembase) >> PAGE_SHIFT;
 
 	kmemusage = (struct kmemusage *) uvm_km_alloc(kernel_map,
 	(vsize_t)(nkmempages * sizeof(struct kmemusage)), 0,



CVS commit: [matt-nb5-mips64] src/sys/kern

2014-03-14 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Mar 14 21:45:42 UTC 2014

Modified Files:
src/sys/kern [matt-nb5-mips64]: kern_malloc.c

Log Message:
Make sure uvm_km_suballoc returned the correctly sized submap.


To generate a diff of this commit:
cvs rdiff -u -r1.121.10.1 -r1.121.10.2 src/sys/kern/kern_malloc.c

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

Modified files:

Index: src/sys/kern/kern_malloc.c
diff -u src/sys/kern/kern_malloc.c:1.121.10.1 src/sys/kern/kern_malloc.c:1.121.10.2
--- src/sys/kern/kern_malloc.c:1.121.10.1	Wed Apr 21 00:28:16 2010
+++ src/sys/kern/kern_malloc.c	Fri Mar 14 21:45:41 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_malloc.c,v 1.121.10.1 2010/04/21 00:28:16 matt Exp $	*/
+/*	$NetBSD: kern_malloc.c,v 1.121.10.2 2014/03/14 21:45:41 matt Exp $	*/
 
 /*
  * Copyright (c) 1987, 1991, 1993
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_malloc.c,v 1.121.10.1 2010/04/21 00:28:16 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_malloc.c,v 1.121.10.2 2014/03/14 21:45:41 matt Exp $");
 
 #include 
 #include 
@@ -918,9 +918,6 @@ kmeminit(void)
 	 */
 	kmeminit_nkmempages();
 
-	kmemusage = (struct kmemusage *) uvm_km_alloc(kernel_map,
-	(vsize_t)(nkmempages * sizeof(struct kmemusage)), 0,
-	UVM_KMF_WIRED|UVM_KMF_ZERO);
 	kmb = 0;
 	kmem_map = uvm_km_suballoc(kernel_map, &kmb,
 	&kml, ((vsize_t)nkmempages << PAGE_SHIFT),
@@ -928,6 +925,12 @@ kmeminit(void)
 	uvm_km_vacache_init(kmem_map, "kvakmem", 0);
 	kmembase = (char *)kmb;
 	kmemlimit = (char *)kml;
+
+	KASSERT(((kmemlimit - kmembase) >> PAGE_SHIFT) == nkmempages);
+
+	kmemusage = (struct kmemusage *) uvm_km_alloc(kernel_map,
+	(vsize_t)(nkmempages * sizeof(struct kmemusage)), 0,
+	UVM_KMF_WIRED|UVM_KMF_ZERO);
 #ifdef KMEMSTATS
 	for (indx = 0; indx < MINBUCKET + 16; indx++) {
 		if (1 << indx >= PAGE_SIZE)



CVS commit: [matt-nb5-mips64] src/sys/arch/arm/include

2014-02-25 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Feb 26 00:59:27 UTC 2014

Modified Files:
src/sys/arch/arm/include [matt-nb5-mips64]: elf_machdep.h

Log Message:
Use right name


To generate a diff of this commit:
cvs rdiff -u -r1.7.78.2 -r1.7.78.3 src/sys/arch/arm/include/elf_machdep.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/elf_machdep.h
diff -u src/sys/arch/arm/include/elf_machdep.h:1.7.78.2 src/sys/arch/arm/include/elf_machdep.h:1.7.78.3
--- src/sys/arch/arm/include/elf_machdep.h:1.7.78.2	Tue Feb 25 00:05:49 2014
+++ src/sys/arch/arm/include/elf_machdep.h	Wed Feb 26 00:59:27 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: elf_machdep.h,v 1.7.78.2 2014/02/25 00:05:49 matt Exp $	*/
+/*	$NetBSD: elf_machdep.h,v 1.7.78.3 2014/02/26 00:59:27 matt Exp $	*/
 
 #ifndef _ARM_ELF_MACHDEP_H_
 #define _ARM_ELF_MACHDEP_H_
@@ -146,7 +146,7 @@
 
 #ifdef _KERNEL
 #ifdef ELFSIZE
-#define	ELF_MD_COREDUMP_FUNC	ELFNAME2(arm_netbsd,coredump_setup)
+#define	ELF_MD_COREDUMP_SETUP	ELFNAME2(arm_netbsd,coredump_setup)
 #endif
 
 struct exec_package;



CVS commit: [matt-nb5-mips64] src/sys/arch/arm

2014-02-24 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Feb 25 00:05:49 UTC 2014

Modified Files:
src/sys/arch/arm/arm [matt-nb5-mips64]: core_machdep.c
src/sys/arch/arm/include [matt-nb5-mips64]: elf_machdep.h

Log Message:
Tag BE8 coredumps properly.


To generate a diff of this commit:
cvs rdiff -u -r1.4.2.2 -r1.4.2.3 src/sys/arch/arm/arm/core_machdep.c
cvs rdiff -u -r1.7.78.1 -r1.7.78.2 src/sys/arch/arm/include/elf_machdep.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/arm/core_machdep.c
diff -u src/sys/arch/arm/arm/core_machdep.c:1.4.2.2 src/sys/arch/arm/arm/core_machdep.c:1.4.2.3
--- src/sys/arch/arm/arm/core_machdep.c:1.4.2.2	Sat Feb 15 16:18:35 2014
+++ src/sys/arch/arm/arm/core_machdep.c	Tue Feb 25 00:05:49 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: core_machdep.c,v 1.4.2.2 2014/02/15 16:18:35 matt Exp $	*/
+/*	$NetBSD: core_machdep.c,v 1.4.2.3 2014/02/25 00:05:49 matt Exp $	*/
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -37,7 +37,10 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: core_machdep.c,v 1.4.2.2 2014/02/15 16:18:35 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: core_machdep.c,v 1.4.2.3 2014/02/25 00:05:49 matt Exp $");
+
+#include "opt_execfmt.h"
+#include "opt_compat_netbsd32.h"
 
 #include 
 #include 
@@ -49,6 +52,12 @@ __KERNEL_RCSID(0, "$NetBSD: core_machdep
 
 #include 	/* for MID_* */
 
+#ifdef EXEC_ELF32
+#include 
+#endif
+
+#include 
+
 #include 
 
 
@@ -95,3 +104,19 @@ cpu_coredump(struct lwp *l, void *iocook
 	return coredump_write(iocookie, UIO_SYSSPACE,
 	&cpustate, sizeof(cpustate));
 }
+
+#ifdef EXEC_ELF32
+void
+arm_netbsd_elf32_coredump_setup(struct lwp *l, void *arg)
+{
+#if defined(__ARMEB__)
+	Elf32_Ehdr * const eh = arg;
+
+if (CPU_IS_ARMV7_P()
+	|| (CPU_IS_ARMV6_P()
+		&& (armreg_sctrl_read() & CPU_CONTROL_BEND_ENABLE) == 0)) {
+		eh->e_flags |= EF_ARM_BE8;
+	}
+#endif
+}
+#endif

Index: src/sys/arch/arm/include/elf_machdep.h
diff -u src/sys/arch/arm/include/elf_machdep.h:1.7.78.1 src/sys/arch/arm/include/elf_machdep.h:1.7.78.2
--- src/sys/arch/arm/include/elf_machdep.h:1.7.78.1	Sat Feb 15 16:18:36 2014
+++ src/sys/arch/arm/include/elf_machdep.h	Tue Feb 25 00:05:49 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: elf_machdep.h,v 1.7.78.1 2014/02/15 16:18:36 matt Exp $	*/
+/*	$NetBSD: elf_machdep.h,v 1.7.78.2 2014/02/25 00:05:49 matt Exp $	*/
 
 #ifndef _ARM_ELF_MACHDEP_H_
 #define _ARM_ELF_MACHDEP_H_
@@ -144,4 +144,14 @@
 /* Processor specific symbol types */
 #define STT_ARM_TFUNC		STT_LOPROC
 
+#ifdef _KERNEL
+#ifdef ELFSIZE
+#define	ELF_MD_COREDUMP_FUNC	ELFNAME2(arm_netbsd,coredump_setup)
+#endif
+
+struct exec_package;
+
+void arm_netbsd_elf32_coredump_setup(struct lwp *, void *);
+#endif
+
 #endif /* _ARM_ELF_MACHDEP_H_ */



CVS commit: [matt-nb5-mips64] src/sys/arch/arm/arm

2014-02-24 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Tue Feb 25 00:05:11 UTC 2014

Modified Files:
src/sys/arch/arm/arm [matt-nb5-mips64]: cpu_exec.c

Log Message:
fix typo


To generate a diff of this commit:
cvs rdiff -u -r1.8.2.2 -r1.8.2.3 src/sys/arch/arm/arm/cpu_exec.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/arm/cpu_exec.c
diff -u src/sys/arch/arm/arm/cpu_exec.c:1.8.2.2 src/sys/arch/arm/arm/cpu_exec.c:1.8.2.3
--- src/sys/arch/arm/arm/cpu_exec.c:1.8.2.2	Sat Feb 15 16:18:35 2014
+++ src/sys/arch/arm/arm/cpu_exec.c	Tue Feb 25 00:05:11 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu_exec.c,v 1.8.2.2 2014/02/15 16:18:35 matt Exp $	*/
+/*	$NetBSD: cpu_exec.c,v 1.8.2.3 2014/02/25 00:05:11 matt Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu_exec.c,v 1.8.2.2 2014/02/15 16:18:35 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_exec.c,v 1.8.2.3 2014/02/25 00:05:11 matt Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_compat_netbsd32.h"
@@ -51,7 +51,7 @@ __KERNEL_RCSID(0, "$NetBSD: cpu_exec.c,v
 
 #include 
 
-#if EXEC_ELF32
+#ifdef EXEC_ELF32
 int
 arm_netbsd_elf32_probe(struct lwp *l, struct exec_package *epp, void *eh0,
 	char *itp, vaddr_t *start_p)



CVS commit: [matt-nb5-mips64] src/sys/arch/arm/cortex

2014-02-20 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Feb 20 20:36:29 UTC 2014

Modified Files:
src/sys/arch/arm/cortex [matt-nb5-mips64]: a9_mpsubr.S

Log Message:
Use right register when setting ttbr


To generate a diff of this commit:
cvs rdiff -u -r1.12.2.2 -r1.12.2.3 src/sys/arch/arm/cortex/a9_mpsubr.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/cortex/a9_mpsubr.S
diff -u src/sys/arch/arm/cortex/a9_mpsubr.S:1.12.2.2 src/sys/arch/arm/cortex/a9_mpsubr.S:1.12.2.3
--- src/sys/arch/arm/cortex/a9_mpsubr.S:1.12.2.2	Sat Feb 15 16:18:36 2014
+++ src/sys/arch/arm/cortex/a9_mpsubr.S	Thu Feb 20 20:36:29 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: a9_mpsubr.S,v 1.12.2.2 2014/02/15 16:18:36 matt Exp $	*/
+/*	$NetBSD: a9_mpsubr.S,v 1.12.2.3 2014/02/20 20:36:29 matt Exp $	*/
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -178,7 +178,7 @@ arm_cpuinit:
 	cmp	r1, #0
 	orrlt	r10, r10, #0x5b		/* MP, cachable (Normal WB) */
 	orrge	r10, r10, #0x1b		/* Non-MP, cacheable, normal WB */
-	mcr	p15, 0, r1, c2, c0, 0	/* Set Translation Table Base */
+	mcr	p15, 0, r10, c2, c0, 0	/* Set Translation Table Base */
 
 	XPUTC(#49)
 	mov	r1, #0



CVS commit: [matt-nb5-mips64] src/sys/arch/arm/broadcom

2014-02-19 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Feb 19 23:19:57 UTC 2014

Modified Files:
src/sys/arch/arm/broadcom [matt-nb5-mips64]: bcm53xx_board.c

Log Message:
Fix dmaranges for BCM563XX
Conditionalize call to arml2cc_init


To generate a diff of this commit:
cvs rdiff -u -r1.17.2.2 -r1.17.2.3 src/sys/arch/arm/broadcom/bcm53xx_board.c

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

Modified files:

Index: src/sys/arch/arm/broadcom/bcm53xx_board.c
diff -u src/sys/arch/arm/broadcom/bcm53xx_board.c:1.17.2.2 src/sys/arch/arm/broadcom/bcm53xx_board.c:1.17.2.3
--- src/sys/arch/arm/broadcom/bcm53xx_board.c:1.17.2.2	Sat Feb 15 16:18:36 2014
+++ src/sys/arch/arm/broadcom/bcm53xx_board.c	Wed Feb 19 23:19:57 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm53xx_board.c,v 1.17.2.2 2014/02/15 16:18:36 matt Exp $	*/
+/*	$NetBSD: bcm53xx_board.c,v 1.17.2.3 2014/02/19 23:19:57 matt Exp $	*/
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,12 +29,13 @@
  */
 
 #include "opt_broadcom.h"
+#include "arml2cc.h"
 
 #define	_ARM32_BUS_DMA_PRIVATE
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: bcm53xx_board.c,v 1.17.2.2 2014/02/15 16:18:36 matt Exp $");
+__KERNEL_RCSID(1, "$NetBSD: bcm53xx_board.c,v 1.17.2.3 2014/02/19 23:19:57 matt Exp $");
 
 #include 
 #include 
@@ -83,8 +84,8 @@ struct arm32_dma_range bcm53xx_dma_range
 		.dr_busbase = 0x6000,
 		.dr_len = 0x2000,
 	}, [1] = {
-		.dr_sysbase = 0xa000,
-		.dr_busbase = 0xa000,
+		.dr_sysbase = 0x8000,
+		.dr_busbase = 0x8000,
 	},
 #endif
 };
@@ -115,8 +116,8 @@ struct arm32_dma_range bcm53xx_coherent_
 		.dr_len = 0x2000,
 		.dr_flags = _BUS_DMAMAP_COHERENT,
 	}, [1] = {
-		.dr_sysbase = 0xa000,
-		.dr_busbase = 0xa000,
+		.dr_sysbase = 0x8000,
+		.dr_busbase = 0x8000,
 	},
 #endif
 };
@@ -554,8 +555,10 @@ bcm53xx_bootstrap(vaddr_t iobase)
 
 	curcpu()->ci_data.cpu_cc_freq = clk->clk_cpu;
 
+#if NARML2CC > 0
 	arml2cc_init(bcm53xx_armcore_bst, bcm53xx_armcore_bsh,
 	ARMCORE_L2C_BASE);
+#endif
 }
 
 void



CVS commit: [matt-nb5-mips64] src/sys/arch/arm/cortex

2014-02-19 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Feb 19 23:18:40 UTC 2014

Modified Files:
src/sys/arch/arm/cortex [matt-nb5-mips64]: files.cortex

Log Message:
arml2cc -> needs-flag


To generate a diff of this commit:
cvs rdiff -u -r1.4.6.2 -r1.4.6.3 src/sys/arch/arm/cortex/files.cortex

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/cortex/files.cortex
diff -u src/sys/arch/arm/cortex/files.cortex:1.4.6.2 src/sys/arch/arm/cortex/files.cortex:1.4.6.3
--- src/sys/arch/arm/cortex/files.cortex:1.4.6.2	Sat Feb 15 16:18:36 2014
+++ src/sys/arch/arm/cortex/files.cortex	Wed Feb 19 23:18:40 2014
@@ -1,4 +1,4 @@
-# $NetBSD: files.cortex,v 1.4.6.2 2014/02/15 16:18:36 matt Exp $
+# $NetBSD: files.cortex,v 1.4.6.3 2014/02/19 23:18:40 matt Exp $
 
 defflag opt_cpu_in_cksum.h			NEON_IN_CKSUM
 
@@ -17,7 +17,7 @@ file	arch/arm/cortex/gic.c			armgic
 # ARM PL310 L2 Cache Controller(initially on Cortex-A9)
 device	arml2cc
 attach	arml2cc at armperiph
-file	arch/arm/cortex/pl310.c			arml2cc
+file	arch/arm/cortex/pl310.c			arml2cc	needs-flag
 
 # ARMv7 Generic Timer
 device	armgtmr



CVS commit: [matt-nb5-mips64] src/etc/etc.evbarm

2014-02-15 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Feb 15 19:10:29 UTC 2014

Modified Files:
src/etc/etc.evbarm [matt-nb5-mips64]: Makefile.inc

Log Message:
Fix KERNEL_SETS


To generate a diff of this commit:
cvs rdiff -u -r1.23.8.1 -r1.23.8.2 src/etc/etc.evbarm/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/etc/etc.evbarm/Makefile.inc
diff -u src/etc/etc.evbarm/Makefile.inc:1.23.8.1 src/etc/etc.evbarm/Makefile.inc:1.23.8.2
--- src/etc/etc.evbarm/Makefile.inc:1.23.8.1	Sat Feb 15 17:49:12 2014
+++ src/etc/etc.evbarm/Makefile.inc	Sat Feb 15 19:10:29 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.23.8.1 2014/02/15 17:49:12 matt Exp $
+#	$NetBSD: Makefile.inc,v 1.23.8.2 2014/02/15 19:10:29 matt Exp $
 #
 #	etc.evbarm/Makefile.inc -- evbarm-specific etc Makefile targets
 #
@@ -27,7 +27,7 @@ BUILD_KERNELS+=		${board}_INSTALL
 .if ${MACHINE_ARCH} == "arm"
 # Little endian platforms.
 KERNEL_SETS+=		IXM1200 HDL_G
-.else
+.elif ${MACHINE_ARCH} == "armeb"
 # Big endian platforms.
 KERNEL_SETS+=		IXM1200 NSLU2
 .endif



CVS commit: [matt-nb5-mips64] src/sys/arch/arm/arm

2014-02-15 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Feb 15 19:09:56 UTC 2014

Modified Files:
src/sys/arch/arm/arm [matt-nb5-mips64]: sig_machdep.c

Log Message:
Use STACKALIGNBYTES


To generate a diff of this commit:
cvs rdiff -u -r1.35.16.1 -r1.35.16.2 src/sys/arch/arm/arm/sig_machdep.c

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

Modified files:

Index: src/sys/arch/arm/arm/sig_machdep.c
diff -u src/sys/arch/arm/arm/sig_machdep.c:1.35.16.1 src/sys/arch/arm/arm/sig_machdep.c:1.35.16.2
--- src/sys/arch/arm/arm/sig_machdep.c:1.35.16.1	Sat Feb 15 16:18:36 2014
+++ src/sys/arch/arm/arm/sig_machdep.c	Sat Feb 15 19:09:56 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: sig_machdep.c,v 1.35.16.1 2014/02/15 16:18:36 matt Exp $	*/
+/*	$NetBSD: sig_machdep.c,v 1.35.16.2 2014/02/15 19:09:56 matt Exp $	*/
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -44,7 +44,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.35.16.1 2014/02/15 16:18:36 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.35.16.2 2014/02/15 19:09:56 matt Exp $");
 
 #include 		/* XXX only needed by syscallargs.h */
 #include 
@@ -104,7 +104,7 @@ sendsig_siginfo(const ksiginfo_t *ksi, c
 	fp--;
 	
 	/* make the stack aligned */
-	fp = (struct sigframe_siginfo *)STACK_ALIGN(fp, STACK_ALIGNBYTES);
+	fp = (struct sigframe_siginfo *)STACK_ALIGN(fp, STACKALIGNBYTES);
 
 	/* populate the siginfo frame */
 	frame.sf_si._info = ksi->ksi_info;



CVS commit: [matt-nb5-mips64] src/sys/arch/evbarm/conf

2014-02-15 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Feb 15 17:50:02 UTC 2014

Modified Files:
src/sys/arch/evbarm/conf [matt-nb5-mips64]: std.bcm53xx

Log Message:
remove __HAVE_ATOMIC64_OPS (it's in types.h now)


To generate a diff of this commit:
cvs rdiff -u -r1.13.2.2 -r1.13.2.3 src/sys/arch/evbarm/conf/std.bcm53xx

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/std.bcm53xx
diff -u src/sys/arch/evbarm/conf/std.bcm53xx:1.13.2.2 src/sys/arch/evbarm/conf/std.bcm53xx:1.13.2.3
--- src/sys/arch/evbarm/conf/std.bcm53xx:1.13.2.2	Sat Feb 15 16:18:37 2014
+++ src/sys/arch/evbarm/conf/std.bcm53xx	Sat Feb 15 17:50:02 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: std.bcm53xx,v 1.13.2.2 2014/02/15 16:18:37 matt Exp $
+#	$NetBSD: std.bcm53xx,v 1.13.2.3 2014/02/15 17:50:02 matt Exp $
 #
 # standard NetBSD/evbarm for BCM5301X options
 
@@ -16,7 +16,6 @@ options 	PMAP_NEED_ALLOC_POOLPAGE
 options 	__HAVE_FAST_SOFTINTS		# should be in types.h
 options 	__HAVE_CPU_UAREA_ALLOC_IDLELWP
 options 	__HAVE_CPU_COUNTER
-options 	__HAVE_ATOMIC64_OPS
 options 	__HAVE_PCI_CONF_HOOK
 options 	TPIDRPRW_IS_CURCPU
 options 	KERNEL_BASE_EXT=0x8000



CVS commit: [matt-nb5-mips64] src/sys/arch/evbarm/include

2014-02-15 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Feb 15 17:50:31 UTC 2014

Modified Files:
src/sys/arch/evbarm/include [matt-nb5-mips64]: vmparam.h

Log Message:
Export VM_*FREELIST


To generate a diff of this commit:
cvs rdiff -u -r1.25.18.2 -r1.25.18.3 src/sys/arch/evbarm/include/vmparam.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/evbarm/include/vmparam.h
diff -u src/sys/arch/evbarm/include/vmparam.h:1.25.18.2 src/sys/arch/evbarm/include/vmparam.h:1.25.18.3
--- src/sys/arch/evbarm/include/vmparam.h:1.25.18.2	Sat Feb 15 16:18:37 2014
+++ src/sys/arch/evbarm/include/vmparam.h	Sat Feb 15 17:50:31 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.25.18.2 2014/02/15 16:18:37 matt Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.25.18.3 2014/02/15 17:50:31 matt Exp $	*/
 
 /*
  * Copyright (c) 1988 The Regents of the University of California.
@@ -64,6 +64,7 @@
 /* virtual sizes (bytes) for various kernel submaps */
 
 #define VM_PHYS_SIZE		(USRIOSIZE*PAGE_SIZE)
+#endif /* _KERNEL || _KMEMUSER */
 
 /*
  * max number of non-contig chunks of physical RAM you can have
@@ -90,6 +91,5 @@
 #define	VM_FREELIST_DEFAULT	0
 #define	VM_FREELIST_ISADMA	1
 
-#endif /* _KERNEL || _KMEMUSER */
 
 #endif	/* _EVBARM_VMPARAM_H_ */



CVS commit: [matt-nb5-mips64] src/etc/etc.evbarm

2014-02-15 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Feb 15 17:49:12 UTC 2014

Modified Files:
src/etc/etc.evbarm [matt-nb5-mips64]: Makefile.inc

Log Message:
Deal with armv7{,eb} MACHINE_ARCH


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.23.8.1 src/etc/etc.evbarm/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/etc/etc.evbarm/Makefile.inc
diff -u src/etc/etc.evbarm/Makefile.inc:1.23 src/etc/etc.evbarm/Makefile.inc:1.23.8.1
--- src/etc/etc.evbarm/Makefile.inc:1.23	Thu Oct 30 15:41:33 2008
+++ src/etc/etc.evbarm/Makefile.inc	Sat Feb 15 17:49:12 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.23 2008/10/30 15:41:33 cliff Exp $
+#	$NetBSD: Makefile.inc,v 1.23.8.1 2014/02/15 17:49:12 matt Exp $
 #
 #	etc.evbarm/Makefile.inc -- evbarm-specific etc Makefile targets
 #
@@ -11,6 +11,9 @@
 EVBARM_BOARDS=		ADI_BRH CP3100 GEMINI GUMSTIX INTEGRATOR \
 			IQ80310 IQ80321 SMDK2410 SMDK2800 \
 			TEAMASA_NPWR TISDP2420 TS7200 TWINTAIL
+EVBARM_BOARDS+=		BCM5301X BCM56340
+.elif ${MACHINE_ARCH:Marmv7*} != ""
+EVBARM_BOARDS=		BCM5301X BCM56340
 .else
 # Big endian platforms
 EVBARM_BOARDS=		ADI_BRH



CVS commit: [matt-nb5-mips64] src/sys/rump/librump/rumpkern

2014-02-15 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Feb 15 17:48:09 UTC 2014

Modified Files:
src/sys/rump/librump/rumpkern [matt-nb5-mips64]: emul.c

Log Message:
Add vpanic


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.53.8.1 src/sys/rump/librump/rumpkern/emul.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/rump/librump/rumpkern/emul.c
diff -u src/sys/rump/librump/rumpkern/emul.c:1.53 src/sys/rump/librump/rumpkern/emul.c:1.53.8.1
--- src/sys/rump/librump/rumpkern/emul.c:1.53	Tue Oct 14 10:42:27 2008
+++ src/sys/rump/librump/rumpkern/emul.c	Sat Feb 15 17:48:09 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: emul.c,v 1.53 2008/10/14 10:42:27 pooka Exp $	*/
+/*	$NetBSD: emul.c,v 1.53.8.1 2014/02/15 17:48:09 matt Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -92,6 +92,16 @@ int domainnamelen;
 const struct filterops seltrue_filtops;
 
 void
+vpanic(const char *fmt, va_list ap)
+{
+
+	printf("panic: ");
+	vprintf(fmt, ap);
+	printf("\n");
+	abort();
+}
+
+void
 panic(const char *fmt, ...)
 {
 	va_list ap;



CVS commit: [matt-nb5-mips64] src/share/mk

2014-02-15 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Feb 15 17:48:37 UTC 2014

Modified Files:
src/share/mk [matt-nb5-mips64]: bsd.kmod.mk bsd.kmodule.mk

Log Message:
kernel uses -std=gnu99


To generate a diff of this commit:
cvs rdiff -u -r1.89.6.2 -r1.89.6.3 src/share/mk/bsd.kmod.mk
cvs rdiff -u -r1.13.2.1.2.1.2.2 -r1.13.2.1.2.1.2.3 \
src/share/mk/bsd.kmodule.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.kmod.mk
diff -u src/share/mk/bsd.kmod.mk:1.89.6.2 src/share/mk/bsd.kmod.mk:1.89.6.3
--- src/share/mk/bsd.kmod.mk:1.89.6.2	Tue Dec 22 04:47:25 2009
+++ src/share/mk/bsd.kmod.mk	Sat Feb 15 17:48:37 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.kmod.mk,v 1.89.6.2 2009/12/22 04:47:25 mrg Exp $
+#	$NetBSD: bsd.kmod.mk,v 1.89.6.3 2014/02/15 17:48:37 matt Exp $
 
 .include 
 .include 
@@ -13,6 +13,7 @@ CFLAGS+=	-ffreestanding ${COPTS}
 CPPFLAGS+=	-nostdinc -I. -I${.CURDIR} -isystem $S -isystem $S/arch
 CPPFLAGS+=	-isystem ${S}/../common/include
 CPPFLAGS+=	-D_KERNEL -D_LKM
+CPPFLAGS+=	-std=gnu99
 
 # XXX until the kernel is fixed again...
 .if (defined(HAVE_GCC) && ${HAVE_GCC} == 4) || defined(HAVE_PCC)

Index: src/share/mk/bsd.kmodule.mk
diff -u src/share/mk/bsd.kmodule.mk:1.13.2.1.2.1.2.2 src/share/mk/bsd.kmodule.mk:1.13.2.1.2.1.2.3
--- src/share/mk/bsd.kmodule.mk:1.13.2.1.2.1.2.2	Tue Dec 22 04:47:25 2009
+++ src/share/mk/bsd.kmodule.mk	Sat Feb 15 17:48:37 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.kmodule.mk,v 1.13.2.1.2.1.2.2 2009/12/22 04:47:25 mrg Exp $
+#	$NetBSD: bsd.kmodule.mk,v 1.13.2.1.2.1.2.3 2014/02/15 17:48:37 matt Exp $
 
 .include 
 .include 
@@ -14,6 +14,7 @@ CFLAGS+=	-ffreestanding ${COPTS}
 CPPFLAGS+=	-nostdinc -I. -I${.CURDIR} -isystem $S -isystem $S/arch
 CPPFLAGS+=	-isystem ${S}/../common/include
 CPPFLAGS+=	-D_KERNEL -D_LKM -D_MODULE
+CPPFLAGS+=	-std=gnu99
 
 # XXX until the kernel is fixed again...
 .if (defined(HAVE_GCC) && ${HAVE_GCC} == 4) || defined(HAVE_PCC)



CVS commit: [matt-nb5-mips64] src/sys/arch/arm/include

2014-02-15 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Feb 15 16:30:24 UTC 2014

Modified Files:
src/sys/arch/arm/include [matt-nb5-mips64]: param.h

Log Message:
Fix typo STACK_ALIGNBYTES -> STACKALIGNBYTES


To generate a diff of this commit:
cvs rdiff -u -r1.12.12.1 -r1.12.12.2 src/sys/arch/arm/include/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/arch/arm/include/param.h
diff -u src/sys/arch/arm/include/param.h:1.12.12.1 src/sys/arch/arm/include/param.h:1.12.12.2
--- src/sys/arch/arm/include/param.h:1.12.12.1	Sat Feb 15 16:18:36 2014
+++ src/sys/arch/arm/include/param.h	Sat Feb 15 16:30:23 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.12.12.1 2014/02/15 16:18:36 matt Exp $	*/
+/*	$NetBSD: param.h,v 1.12.12.2 2014/02/15 16:30:23 matt Exp $	*/
 
 /*
  * Copyright (c) 1994,1995 Mark Brinicombe.
@@ -151,7 +151,7 @@
 #define ALIGNBYTES		3
 #define ALIGN(p)		(((uintptr_t)(p) + ALIGNBYTES) & ~ALIGNBYTES)
 #define ALIGNED_POINTER(p,t)	(((uintptr_t)(p) % sizeof(t)) == 0)
-#define STACK_ALIGNBYTES	(8 - 1)
+#define STACKALIGNBYTES		(8 - 1)
 #define STACKALIGN(p)		((uintptr_t)(p) & ~STACKALIGNBYTES)
 
 #define	DEV_BSHIFT	9		/* log2(DEV_BSIZE) */



CVS commit: [matt-nb5-mips64] src/lib/csu/arm_elf

2014-02-15 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Feb 15 16:29:55 UTC 2014

Modified Files:
src/lib/csu/arm_elf [matt-nb5-mips64]: crt0.c dot_init.h

Log Message:
 is not for C files.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.7.10.1 src/lib/csu/arm_elf/crt0.c
cvs rdiff -u -r1.6 -r1.6.10.1 src/lib/csu/arm_elf/dot_init.h

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

Modified files:

Index: src/lib/csu/arm_elf/crt0.c
diff -u src/lib/csu/arm_elf/crt0.c:1.7 src/lib/csu/arm_elf/crt0.c:1.7.10.1
--- src/lib/csu/arm_elf/crt0.c:1.7	Sat Jun 21 00:52:52 2008
+++ src/lib/csu/arm_elf/crt0.c	Sat Feb 15 16:29:55 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: crt0.c,v 1.7 2008/06/21 00:52:52 gmcgarry Exp $	*/
+/*	$NetBSD: crt0.c,v 1.7.10.1 2014/02/15 16:29:55 matt Exp $	*/
 
 /*
  * Copyright (C) 1997 Mark Brinicombe
@@ -35,7 +35,6 @@
 #include 
 #include 
 
-#include 
 #include 
 
 #include "common.h"
@@ -68,7 +67,7 @@ __asm("	.text			\n"
 "	b	" ___STRING(_C_LABEL(___start)) " ");
 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: crt0.c,v 1.7 2008/06/21 00:52:52 gmcgarry Exp $");
+__RCSID("$NetBSD: crt0.c,v 1.7.10.1 2014/02/15 16:29:55 matt Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 void

Index: src/lib/csu/arm_elf/dot_init.h
diff -u src/lib/csu/arm_elf/dot_init.h:1.6 src/lib/csu/arm_elf/dot_init.h:1.6.10.1
--- src/lib/csu/arm_elf/dot_init.h:1.6	Sat May 10 15:31:03 2008
+++ src/lib/csu/arm_elf/dot_init.h	Sat Feb 15 16:29:55 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: dot_init.h,v 1.6 2008/05/10 15:31:03 martin Exp $ */
+/* $NetBSD: dot_init.h,v 1.6.10.1 2014/02/15 16:29:55 matt Exp $ */
 
 /*-
  * Copyright (c) 2001 Ross Harvey
@@ -34,7 +34,6 @@
  */
 
 #include 			/* RCS ID & Copyright macro defns */
-#include 
 
 #define	MD_SECTION_PROLOGUE(sect, entry_pt)		\
 		__asm (	\



CVS commit: [matt-nb5-mips64] src/sys/arch

2014-02-15 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Feb 15 16:18:37 UTC 2014

Modified Files:
src/sys/arch/arm/arm [matt-nb5-mips64]: arm_machdep.c ast.c
bcopyinout.S bcopyinout_xscale.S blockio.S bootconfig.c
bus_space_asm_generic.S bus_space_notimpl.S compat_13_machdep.c
compat_16_machdep.c copystr.S cpu_in_cksum.S cpufunc.c
cpufunc_asm.S cpufunc_asm_arm10.S cpufunc_asm_arm11.S
cpufunc_asm_arm1136.S cpufunc_asm_arm3.S cpufunc_asm_arm67.S
cpufunc_asm_arm7tdmi.S cpufunc_asm_arm8.S cpufunc_asm_arm9.S
cpufunc_asm_armv4.S cpufunc_asm_armv5.S cpufunc_asm_armv5_ec.S
cpufunc_asm_armv6.S cpufunc_asm_fa526.S cpufunc_asm_ixp12x0.S
cpufunc_asm_sa1.S cpufunc_asm_sa11x0.S cpufunc_asm_xscale.S
db_trace.c disassem.c disksubr.c disksubr_acorn.c disksubr_mbr.c
fiq.c fiq_subr.S idle_machdep.c linux_syscall.c linux_trap.c
lock_cas.S process_machdep.c sig_machdep.c syscall.c undefined.c
vectors.S
src/sys/arch/arm/arm32 [matt-nb5-mips64]: arm11_pmc.c arm32_machdep.c
bcopy_page.S bus_dma.c cpu.c cpuswitch.S db_interface.c
db_machdep.c exception.S fault.c genassym.cf intr.c irq_dispatch.S
kgdb_machdep.c kobj_machdep.c locore.S mem.c pmap.c setcpsr.S
setstack.S spl.S stubs.c sys_machdep.c vm_machdep.c
src/sys/arch/arm/conf [matt-nb5-mips64]: Makefile.arm files.arm
kern.ldscript.head kern.ldscript.tail majors.arm32
src/sys/arch/arm/include [matt-nb5-mips64]: armreg.h asm.h bootconfig.h
bus.h byte_swap.h cpu.h cpuconf.h cpufunc.h elf_machdep.h frame.h
lock.h mutex.h param.h pcb.h pci_machdep.h proc.h sysarch.h types.h
src/sys/arch/arm/include/arm32 [matt-nb5-mips64]: db_machdep.h frame.h
machdep.h pmap.h psl.h pte.h vmparam.h
src/sys/arch/arm/mainbus [matt-nb5-mips64]: cpu_mainbus.c mainbus.c
mainbus.h mainbus_io.c mainbus_io_asm.S
src/sys/arch/arm/pic [matt-nb5-mips64]: files.pic pic.c picvar.h
src/sys/arch/evbarm/conf [matt-nb5-mips64]: Makefile.evbarm.inc
files.evbarm
src/sys/arch/evbarm/include [matt-nb5-mips64]: autoconf.h intr.h
vmparam.h
Added Files:
src/sys/arch/arm/arm [matt-nb5-mips64]: bus_space_a2x.S bus_space_a4x.S
core_machdep.c cpu_exec.c cpu_in_cksum_buffer.S cpu_in_cksum_fold.S
cpu_in_cksum_v4hdr.S cpufunc_asm_arm11x6.S cpufunc_asm_armv7.S
cpufunc_asm_pj4b.S cpufunc_asm_sheeva.S fusu.S
src/sys/arch/arm/arm32 [matt-nb5-mips64]: arm32_boot.c arm32_kvminit.c
arm32_reboot.c cortex_pmc.c netbsd32_machdep.c
src/sys/arch/arm/broadcom [matt-nb5-mips64]: bcm53xx_board.c
bcm53xx_cca.c bcm53xx_ccb.c bcm53xx_eth.c bcm53xx_i2c.c
bcm53xx_idm.c bcm53xx_intr.h bcm53xx_mdio.c bcm53xx_nand.c
bcm53xx_pax.c bcm53xx_reg.h bcm53xx_rng.c bcm53xx_sdhc.c
bcm53xx_usb.c bcm53xx_var.h bcmgen_space.c files.bcm53xx
src/sys/arch/arm/cortex [matt-nb5-mips64]: a9_mpsubr.S a9tmr.c
a9tmr_intr.h a9tmr_reg.h a9tmr_var.h a9wdt.c armperiph.c
cpu_in_cksum_asm_neon.S cpu_in_cksum_neon.c files.cortex gic.c
gic_intr.h gic_reg.h gtmr.c gtmr_intr.h gtmr_var.h mpcore_var.h
pl310.c pl310_reg.h pl310_var.h scu_reg.h
src/sys/arch/arm/include [matt-nb5-mips64]: cpu_counter.h locore.h
src/sys/arch/arm/include/arm32 [matt-nb5-mips64]: vmpagemd.h
src/sys/arch/arm/pic [matt-nb5-mips64]: pic_splfuncs.c
src/sys/arch/evbarm/bcm53xx [matt-nb5-mips64]: bcm53xx_machdep.c
bcm53xx_start.S genassym.cf platform.h
src/sys/arch/evbarm/conf [matt-nb5-mips64]: BCM5301X BCM5301X_INSTALL
BCM56340 BCM56340_INSTALL files.bcm53xx mk.bcm53xx std.bcm53xx
std.evbarm
src/sys/arch/evbarm/include [matt-nb5-mips64]: cpu_counter.h
Removed Files:
src/sys/arch/arm/arm [matt-nb5-mips64]: vm_machdep_arm.c
src/sys/arch/arm/arm32 [matt-nb5-mips64]: atomic.S fusu.S

Log Message:
Merge armv7 support from HEAD, specifically support for the BCM5301X
and BCM56340 evbarm kernels.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.21.8.1 src/sys/arch/arm/arm/arm_machdep.c
cvs rdiff -u -r1.15 -r1.15.8.1 src/sys/arch/arm/arm/ast.c
cvs rdiff -u -r1.15 -r1.15.16.1 src/sys/arch/arm/arm/bcopyinout.S
cvs rdiff -u -r1.5 -r1.5.16.1 src/sys/arch/arm/arm/bcopyinout_xscale.S \
src/sys/arch/arm/arm/lock_cas.S
cvs rdiff -u -r1.5 -r1.5.134.1 src/sys/arch/arm/arm/blockio.S \
src/sys/arch/arm/arm/fiq.c
cvs rdiff -u -r1.5 -r1.5.76.1 src/sys/arch/arm/arm/bootconfig.c
cvs rdiff -u -r0 -r1.4.2.2 src/sys/arch/arm/arm/bus_space_a2x.S \
src/sys/arch/arm/arm/bus_space_a4x.S src/sys/arch/arm/arm/core_machdep.c \
src/sys/arch/arm/arm/cpufunc_asm_sheeva.S
cvs rdiff -u -r1.5 -

CVS commit: [matt-nb5-mips64] src/gnu/dist/binutils

2014-02-15 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Feb 15 16:16:39 UTC 2014

Modified Files:
src/gnu/dist/binutils/gas/config [matt-nb5-mips64]: tc-arm.c
src/gnu/dist/binutils/opcodes [matt-nb5-mips64]: arm-dis.c

Log Message:
Add pli support


To generate a diff of this commit:
cvs rdiff -u -r1.5.32.1 -r1.5.32.2 src/gnu/dist/binutils/gas/config/tc-arm.c
cvs rdiff -u -r1.1.1.3.32.1 -r1.1.1.3.32.2 \
src/gnu/dist/binutils/opcodes/arm-dis.c

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

Modified files:

Index: src/gnu/dist/binutils/gas/config/tc-arm.c
diff -u src/gnu/dist/binutils/gas/config/tc-arm.c:1.5.32.1 src/gnu/dist/binutils/gas/config/tc-arm.c:1.5.32.2
--- src/gnu/dist/binutils/gas/config/tc-arm.c:1.5.32.1	Wed Dec 18 14:07:30 2013
+++ src/gnu/dist/binutils/gas/config/tc-arm.c	Sat Feb 15 16:16:39 2014
@@ -5521,7 +5521,7 @@ do_pld (char * str)
 	  ++str;
 	}
   else /* [Rn] */
-	inst.instruction |= INDEX_UP | PRE_INDEX;
+	inst.instruction |= INDEX_UP;
 }
   else /* [Rn, ...] */
 {
@@ -5550,8 +5550,6 @@ do_pld (char * str)
 	  inst.error = _("writeback used in preload instruction");
 	  ++ str;
 	}
-
-  inst.instruction |= PRE_INDEX;
 }
 
   end_of_line (str);
@@ -10124,7 +10122,7 @@ static const struct asm_opcode insns[] =
   {"qdsub",  0xe1600050, 5,  ARM_EXT_V5ExP,do_qadd},
 
   /*  ARM Architecture 5TE.  */
-  {"pld",0xf450f000, 0,  ARM_EXT_V5E,  do_pld},
+  {"pld",0xf550f000, 0,  ARM_EXT_V5E,  do_pld},
   {"ldrd",   0xe0d0, 3,  ARM_EXT_V5E,  do_ldrd},
   {"strd",   0xe0f0, 3,  ARM_EXT_V5E,  do_ldrd},
 
@@ -10261,6 +10259,7 @@ static const struct asm_opcode insns[] =
   { "movt",	 0xe340, 2,  ARM_EXT_V7A,  do_movwt},
   { "sbfx",  0xe7a00050, 4,  ARM_EXT_V7A,  do_bfx},
   { "ubfx",  0xe7e00050, 4,  ARM_EXT_V7A,  do_bfx},
+  { "pli",   0xf450f000, 0,  ARM_EXT_V7A,  do_pld},
 
   /* Core FPA instruction set (V1).  */
   {"wfs",0xee200110, 3,  FPU_FPA_EXT_V1,   do_fpa_ctrl},

Index: src/gnu/dist/binutils/opcodes/arm-dis.c
diff -u src/gnu/dist/binutils/opcodes/arm-dis.c:1.1.1.3.32.1 src/gnu/dist/binutils/opcodes/arm-dis.c:1.1.1.3.32.2
--- src/gnu/dist/binutils/opcodes/arm-dis.c:1.1.1.3.32.1	Wed Dec 18 18:31:22 2013
+++ src/gnu/dist/binutils/opcodes/arm-dis.c	Sat Feb 15 16:16:39 2014
@@ -82,6 +82,7 @@
%C			print the PSR sub type.
%E			print the LSB and WIDTH fields of a BFI or BFC instruction.
%F			print the COUNT field of a LFM/SFM instruction.
+   %Y			print address for pli instruction.
 IWMMXT specific format options:
%g print as an iWMMXt 64-bit register
%G print as an iWMMXt general purpose or control register
@@ -130,6 +131,7 @@ static const struct arm_opcode arm_opcod
   {ARM_EXT_V7A, 0xf57ff050, 0xfff0, "dsb\t%#0-3d"},
   {ARM_EXT_V7A, 0xf57ff06f, 0x, "isb"},
   {ARM_EXT_V7A, 0xf57ff060, 0xfff0, "isb\t%#0-3d"},
+  {ARM_EXT_V7A, 0xf450f000, 0xff70f000, "pli\t%Y"},
 
   /* ARM V6Z instructions.  */
   {ARM_EXT_V6Z, 0x01600070, 0x0ff000f0, "smi%c\t%e"},
@@ -353,7 +355,7 @@ static const struct arm_opcode arm_opcod
   /* V5E "El Segundo" Instructions.  */
   {ARM_EXT_V5E, 0x00d0, 0x0e1000f0, "ldr%cd\t%12-15r, %s"},
   {ARM_EXT_V5E, 0x00f0, 0x0e1000f0, "str%cd\t%12-15r, %s"},
-  {ARM_EXT_V5E, 0xf450f000, 0xfc70f000, "pld\t%a"},
+  {ARM_EXT_V5E, 0xf550f000, 0xff70f000, "pld\t%a"},
   {ARM_EXT_V5ExP, 0x0180, 0x0ff000f0, "smlabb%c\t%16-19r, %0-3r, %8-11r, %12-15r"},
   {ARM_EXT_V5ExP, 0x01a0, 0x0ff000f0, "smlatb%c\t%16-19r, %0-3r, %8-11r, %12-15r"},
   {ARM_EXT_V5ExP, 0x01c0, 0x0ff000f0, "smlabt%c\t%16-19r, %0-3r, %8-11r, %12-15r"},
@@ -957,6 +959,9 @@ print_insn_arm (pc, info, given)
 		  func (stream, "%%");
 		  break;
 
+		case 'Y':
+		  given |= 0x0100;
+		  /*FALLTHROUGH*/
 		case 'a':
 		  if (((given & 0x000f) == 0x000f)
 			  && ((given & 0x0200) == 0))



CVS commit: [matt-nb5-mips64] src/common/lib/libc/arch/arm/atomic

2014-02-15 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Feb 15 10:27:44 UTC 2014

Modified Files:
src/common/lib/libc/arch/arm/atomic [matt-nb5-mips64]: Makefile.inc
atomic_op_asm.h
Added Files:
src/common/lib/libc/arch/arm/atomic [matt-nb5-mips64]: atomic_add_64.S
atomic_and_64.S atomic_cas_64.S atomic_dec_64.S atomic_inc_64.S
atomic_or_64.S

Log Message:
Add 64-bit atomic ops if ARMv6+


To generate a diff of this commit:
cvs rdiff -u -r1.7.8.1 -r1.7.8.2 \
src/common/lib/libc/arch/arm/atomic/Makefile.inc
cvs rdiff -u -r0 -r1.10.2.2 \
src/common/lib/libc/arch/arm/atomic/atomic_add_64.S
cvs rdiff -u -r0 -r1.9.2.2 \
src/common/lib/libc/arch/arm/atomic/atomic_and_64.S \
src/common/lib/libc/arch/arm/atomic/atomic_inc_64.S \
src/common/lib/libc/arch/arm/atomic/atomic_or_64.S
cvs rdiff -u -r0 -r1.5.2.2 \
src/common/lib/libc/arch/arm/atomic/atomic_cas_64.S
cvs rdiff -u -r0 -r1.7.2.2 \
src/common/lib/libc/arch/arm/atomic/atomic_dec_64.S
cvs rdiff -u -r1.2 -r1.2.12.1 \
src/common/lib/libc/arch/arm/atomic/atomic_op_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/common/lib/libc/arch/arm/atomic/Makefile.inc
diff -u src/common/lib/libc/arch/arm/atomic/Makefile.inc:1.7.8.1 src/common/lib/libc/arch/arm/atomic/Makefile.inc:1.7.8.2
--- src/common/lib/libc/arch/arm/atomic/Makefile.inc:1.7.8.1	Thu Dec 19 01:12:39 2013
+++ src/common/lib/libc/arch/arm/atomic/Makefile.inc	Sat Feb 15 10:27:44 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.7.8.1 2013/12/19 01:12:39 matt Exp $
+#	$NetBSD: Makefile.inc,v 1.7.8.2 2014/02/15 10:27:44 matt Exp $
 
 ARMV6= ${CPUFLAGS:M-march=armv7*} ${CPUFLAGS:M-mcpu=cortex*}
 ARMV6+= ${CPUFLAGS:M-march=armv6*} ${CPUFLAGS:M-mcpu=arm11*}
@@ -19,6 +19,8 @@ SRCS+=	atomic_add_32_cas.c atomic_add_32
 .else
 SRCS+=	atomic_add_32.S atomic_and_32.S atomic_cas_32.S
 SRCS+=	atomic_dec_32.S atomic_inc_32.S atomic_or_32.S
+SRCS+=	atomic_add_64.S atomic_and_64.S atomic_cas_64.S
+SRCS+=	atomic_dec_64.S atomic_inc_64.S atomic_or_64.S
 SRCS+=	atomic_swap.S membar_ops.S
 .endif
 .endif

Index: src/common/lib/libc/arch/arm/atomic/atomic_op_asm.h
diff -u src/common/lib/libc/arch/arm/atomic/atomic_op_asm.h:1.2 src/common/lib/libc/arch/arm/atomic/atomic_op_asm.h:1.2.12.1
--- src/common/lib/libc/arch/arm/atomic/atomic_op_asm.h:1.2	Sat Aug 16 07:12:39 2008
+++ src/common/lib/libc/arch/arm/atomic/atomic_op_asm.h	Sat Feb 15 10:27:44 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: atomic_op_asm.h,v 1.2 2008/08/16 07:12:39 matt Exp $	*/
+/*	$NetBSD: atomic_op_asm.h,v 1.2.12.1 2014/02/15 10:27:44 matt Exp $	*/
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -51,4 +51,20 @@
 
 #endif /* _KERNEL */
 
+#ifdef __ARMEB__
+#define HI	r0
+#define LO	r1
+#define NHI	r2
+#define NLO	r3
+#define THI	r4
+#define TLO	r5
+#else
+#define LO	r0
+#define HI	r1
+#define NLO	r2
+#define NHI	r3
+#define TLO	r4
+#define THI	r5
+#endif
+
 #endif /* _ATOMIC_OP_ASM_H_ */

Added files:

Index: src/common/lib/libc/arch/arm/atomic/atomic_add_64.S
diff -u /dev/null src/common/lib/libc/arch/arm/atomic/atomic_add_64.S:1.10.2.2
--- /dev/null	Sat Feb 15 10:27:45 2014
+++ src/common/lib/libc/arch/arm/atomic/atomic_add_64.S	Sat Feb 15 10:27:44 2014
@@ -0,0 +1,54 @@
+/*	$NetBSD: atomic_add_64.S,v 1.10.2.2 2014/02/15 10:27:44 matt Exp $	*/
+
+/*-
+ * Copyright (c) 2008 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Matt Thomas 
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "atomic_op_asm.h"
+
+#ifdef _ARM_ARC

CVS commit: [matt-nb5-mips64] src/sys/uvm

2014-02-15 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Feb 15 10:19:14 UTC 2014

Modified Files:
src/sys/uvm [matt-nb5-mips64]: uvm_page.c uvm_pglist.c

Log Message:
Adapt to K{,D}ASSERTMSG changes


To generate a diff of this commit:
cvs rdiff -u -r1.140.6.3.4.10 -r1.140.6.3.4.11 src/sys/uvm/uvm_page.c
cvs rdiff -u -r1.42.16.13 -r1.42.16.14 src/sys/uvm/uvm_pglist.c

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

Modified files:

Index: src/sys/uvm/uvm_page.c
diff -u src/sys/uvm/uvm_page.c:1.140.6.3.4.10 src/sys/uvm/uvm_page.c:1.140.6.3.4.11
--- src/sys/uvm/uvm_page.c:1.140.6.3.4.10	Wed Feb 29 18:03:39 2012
+++ src/sys/uvm/uvm_page.c	Sat Feb 15 10:19:14 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.c,v 1.140.6.3.4.10 2012/02/29 18:03:39 matt Exp $	*/
+/*	$NetBSD: uvm_page.c,v 1.140.6.3.4.11 2014/02/15 10:19:14 matt Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -71,7 +71,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.140.6.3.4.10 2012/02/29 18:03:39 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.140.6.3.4.11 2014/02/15 10:19:14 matt Exp $");
 
 #include "opt_uvmhist.h"
 #include "opt_readahead.h"
@@ -843,7 +843,6 @@ uvm_page_physload(paddr_t start, paddr_t
 		for (lcv = 0, paddr = ptoa(start) ;
  lcv < npages ; lcv++, paddr += PAGE_SIZE) {
 			pgs[lcv].phys_addr = paddr;
-			pgs[lcv].free_list = free_list;
 			if (atop(paddr) >= avail_start &&
 			atop(paddr) <= avail_end)
 uvm_pagefree(&pgs[lcv]);
@@ -1176,8 +1175,8 @@ uvm_pagealloc_pgfl(struct uvm_cpu *ucpu,
 		/* global, try2 */
 		if ((pg = LIST_FIRST(&gfreeq[try2])) != NULL) {
 			KASSERTMSG(pg->pqflags & PQ_FREE,
-			("%s: pg %p in q %p not free!",
-			 __func__, pg, &gfreeq[try2]));
+			"%s: pg %p in q %p not free!",
+			 __func__, pg, &gfreeq[try2]);
 			KASSERT(gpgfl->pgfl_pages[try2] > 0);
 			ucpu = VM_FREE_PAGE_TO_CPU(pg);
 #ifndef MULTIPROCESSOR
@@ -1205,18 +1204,18 @@ uvm_pagealloc_pgfl(struct uvm_cpu *ucpu,
 		u_int i = 0;
 		do {
 			KASSERTMSG(LIST_NEXT(xpg, pageq.list) == LIST_NEXT(xpg, listq.list),
-			("%s: color %d free_list %d pg %p (%u): next %p/%p",
+			"%s: color %d free_list %d pg %p (%u): next %p/%p",
 			  __func__, color, free_list, xpg, i,
 			 LIST_NEXT(xpg, pageq.list),
-			 LIST_NEXT(xpg, listq.list)));
+			 LIST_NEXT(xpg, listq.list));
 		} while (++i < 500 && (xpg = LIST_NEXT(xpg, pageq.list)) != NULL);
 	}
 #else
 	KASSERTMSG(LIST_NEXT(pg, pageq.list) == LIST_NEXT(pg, listq.list),
-	("%s: color %d free_list %d pg %p: next %p/%p",
+	"%s: color %d free_list %d pg %p: next %p/%p",
 	  __func__, color, free_list, pg,
 	 LIST_NEXT(pg, pageq.list),
-	 LIST_NEXT(pg, listq.list)));
+	 LIST_NEXT(pg, listq.list));
 #endif
 #endif
 	LIST_REMOVE(pg, pageq.list);	/* global list */

Index: src/sys/uvm/uvm_pglist.c
diff -u src/sys/uvm/uvm_pglist.c:1.42.16.13 src/sys/uvm/uvm_pglist.c:1.42.16.14
--- src/sys/uvm/uvm_pglist.c:1.42.16.13	Wed Feb 29 18:03:40 2012
+++ src/sys/uvm/uvm_pglist.c	Sat Feb 15 10:19:14 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_pglist.c,v 1.42.16.13 2012/02/29 18:03:40 matt Exp $	*/
+/*	$NetBSD: uvm_pglist.c,v 1.42.16.14 2014/02/15 10:19:14 matt Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_pglist.c,v 1.42.16.13 2012/02/29 18:03:40 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_pglist.c,v 1.42.16.14 2014/02/15 10:19:14 matt Exp $");
 
 #include 
 #include 
@@ -204,22 +204,22 @@ uvm_pglistalloc_c_ps(struct vm_physseg *
 		 * Make sure this is a managed physical page.
 		 */
 		KDASSERTMSG(vm_physseg_find(try, &cidx) == ps - vm_physmem,
-		("%s: %s(%#x, &cidx) (%d) != ps - vm_physmem (%zd)",
+		"%s: %s(%#x, &cidx) (%d) != ps - vm_physmem (%zd)",
 		 __func__, "vm_physseg_find", try,
-		vm_physseg_find(try, &cidx), ps - vm_physmem));
+		vm_physseg_find(try, &cidx), ps - vm_physmem);
 
 		KDASSERTMSG(cidx == try - ps->start,
-		("%s: cidx (%#x) != try (%#x) - ps->start (%#"PRIxPADDR")",
-		 __func__, cidx, try, ps->start));
+		"%s: cidx (%#x) != try (%#x) - ps->start (%#"PRIxPADDR")",
+		__func__, cidx, try, ps->start);
 
 		KDASSERTMSG(vm_physseg_find(try + num - 1, &cidx) == ps - vm_physmem,
-		("%s: %s(%#x + %#x - 1, &cidx) (%d) != ps - vm_physmem (%zd)",
-		 __func__, "vm_physseg_find", try, num,
-		vm_physseg_find(try, &cidx), ps - vm_physmem));
+		"%s: %s(%#x + %#x - 1, &cidx) (%d) != ps - vm_physmem (%zd)",
+		__func__, "vm_physseg_find", try, num,
+		vm_physseg_find(try, &cidx), ps - vm_physmem);
 
 		KDASSERTMSG(cidx == try - ps->start + num - 1,
-		("%s: cidx (%#x) != try (%#x) - ps->start (%#"PRIxPADDR") + num (%#x) - 1",
-		 __func__, cidx, try, ps->start, num));
+		"%s: cidx (%#x) != try (%#x) - ps->start (%#"PRIxPADDR") + num (%#x) - 

CVS commit: [matt-nb5-mips64] src/sys/uvm

2014-02-15 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Feb 15 10:18:33 UTC 2014

Modified Files:
src/sys/uvm [matt-nb5-mips64]: uvm_pmap.h

Log Message:
Add PMAP_NOCACHE + others.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.23.10.1 src/sys/uvm/uvm_pmap.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/uvm/uvm_pmap.h
diff -u src/sys/uvm/uvm_pmap.h:1.23 src/sys/uvm/uvm_pmap.h:1.23.10.1
--- src/sys/uvm/uvm_pmap.h:1.23	Wed Jul 16 14:33:09 2008
+++ src/sys/uvm/uvm_pmap.h	Sat Feb 15 10:18:33 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_pmap.h,v 1.23 2008/07/16 14:33:09 matt Exp $	*/
+/*	$NetBSD: uvm_pmap.h,v 1.23.10.1 2014/02/15 10:18:33 matt Exp $	*/
 
 /*
  * Copyright (c) 1991, 1993
@@ -86,6 +86,9 @@ typedef struct pmap_statistics	*pmap_sta
 #include 
 #endif
 
+/* All accesses are uncacheable. No speculative accesses. */
+#define PMAP_NOCACHE	0x0100	/* [BOTH] */
+
 /*
  * Flags passed to pmap_enter().  Note the bottom 3 bits are VM_PROT_*
  * bits, used to indicate the access type that was made (to seed modified
@@ -101,6 +104,10 @@ typedef struct pmap_statistics	*pmap_sta
 #define	PMAP_KMPAGE	0x	/* this is from the kmem allocator */
 #endif
 
+#define PMAP_MD_MASK	0xff00	/* [BOTH] Machine-dependent bits */
+#define PMAP_PROT_MASK	0x000f	/* [BOTH] VM_PROT_* bit mask */
+
+
 #ifndef PMAP_EXCLUDE_DECLS	/* Used in Sparc port to virtualize pmap mod */
 #ifdef _KERNEL
 __BEGIN_DECLS



CVS commit: [matt-nb5-mips64] src/sys/dev/pci

2014-02-15 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Feb 15 10:17:20 UTC 2014

Modified Files:
src/sys/dev/pci [matt-nb5-mips64]: pcivar.h

Log Message:
Add a few OKAY flags from HEAD


To generate a diff of this commit:
cvs rdiff -u -r1.83.12.1 -r1.83.12.2 src/sys/dev/pci/pcivar.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/dev/pci/pcivar.h
diff -u src/sys/dev/pci/pcivar.h:1.83.12.1 src/sys/dev/pci/pcivar.h:1.83.12.2
--- src/sys/dev/pci/pcivar.h:1.83.12.1	Tue Nov  5 18:34:44 2013
+++ src/sys/dev/pci/pcivar.h	Sat Feb 15 10:17:20 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcivar.h,v 1.83.12.1 2013/11/05 18:34:44 matt Exp $	*/
+/*	$NetBSD: pcivar.h,v 1.83.12.2 2014/02/15 10:17:20 matt Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997 Christopher G. Demetriou.  All rights reserved.
@@ -123,11 +123,18 @@ struct pci_attach_args {
  * Flags given in the bus and device attachment args.
  */
 #define	PCI_FLAGS_IO_ENABLED	0x01		/* I/O space is enabled */
+#define PCI_FLAGS_IO_OKAY	PCI_FLAGS_IO_ENABLED
 #define	PCI_FLAGS_MEM_ENABLED	0x02		/* memory space is enabled */
+#define PCI_FLAGS_MEM_OKAY	PCI_FLAGS_MEM_ENABLED
 #define	PCI_FLAGS_MRL_OKAY	0x04		/* Memory Read Line okay */
 #define	PCI_FLAGS_MRM_OKAY	0x08		/* Memory Read Multiple okay */
 #define	PCI_FLAGS_MWI_OKAY	0x10		/* Memory Write and Invalidate
 		   okay */
+#define PCI_FLAGS_MSI_OKAY	0x20		/* Message Signaled Interrupts
+		   okay */
+#define PCI_FLAGS_MSIX_OKAY	0x40		/* Message Signaled Interrupts
+		   (Extended) okay */  
+
 
 /*
  * PCI device 'quirks'.



CVS commit: [matt-nb5-mips64] src/sys/dev/sysmon

2014-02-15 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Feb 15 10:16:32 UTC 2014

Modified Files:
src/sys/dev/sysmon [matt-nb5-mips64]: sysmon_wdog.c sysmonvar.h

Log Message:
move sysmon_wdog_setmode prototype to sysmonvar.h


To generate a diff of this commit:
cvs rdiff -u -r1.24.28.1 -r1.24.28.2 src/sys/dev/sysmon/sysmon_wdog.c
cvs rdiff -u -r1.27 -r1.27.16.1 src/sys/dev/sysmon/sysmonvar.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/dev/sysmon/sysmon_wdog.c
diff -u src/sys/dev/sysmon/sysmon_wdog.c:1.24.28.1 src/sys/dev/sysmon/sysmon_wdog.c:1.24.28.2
--- src/sys/dev/sysmon/sysmon_wdog.c:1.24.28.1	Thu May 13 15:23:56 2010
+++ src/sys/dev/sysmon/sysmon_wdog.c	Sat Feb 15 10:16:32 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: sysmon_wdog.c,v 1.24.28.1 2010/05/13 15:23:56 cliff Exp $	*/
+/*	$NetBSD: sysmon_wdog.c,v 1.24.28.2 2014/02/15 10:16:32 matt Exp $	*/
 
 /*-
  * Copyright (c) 2000 Zembu Labs, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sysmon_wdog.c,v 1.24.28.1 2010/05/13 15:23:56 cliff Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sysmon_wdog.c,v 1.24.28.2 2014/02/15 10:16:32 matt Exp $");
 
 #include 
 #include 
@@ -67,7 +67,6 @@ static void *sysmon_wdog_sdhook;
 
 struct sysmon_wdog *sysmon_wdog_find(const char *);
 void	sysmon_wdog_release(struct sysmon_wdog *);
-int	sysmon_wdog_setmode(struct sysmon_wdog *, int, u_int);
 void	sysmon_wdog_ktickle(void *);
 void	sysmon_wdog_shutdown(void *);
 void	sysmon_wdog_ref(struct sysmon_wdog *);

Index: src/sys/dev/sysmon/sysmonvar.h
diff -u src/sys/dev/sysmon/sysmonvar.h:1.27 src/sys/dev/sysmon/sysmonvar.h:1.27.16.1
--- src/sys/dev/sysmon/sysmonvar.h:1.27	Tue Jun  3 15:00:57 2008
+++ src/sys/dev/sysmon/sysmonvar.h	Sat Feb 15 10:16:32 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: sysmonvar.h,v 1.27 2008/06/03 15:00:57 jmcneill Exp $	*/
+/*	$NetBSD: sysmonvar.h,v 1.27.16.1 2014/02/15 10:16:32 matt Exp $	*/
 
 /*-
  * Copyright (c) 2000 Zembu Labs, Inc.
@@ -150,8 +150,9 @@ int	sysmonopen_wdog(dev_t, int, int, str
 int	sysmonclose_wdog(dev_t, int, int, struct lwp *);
 int	sysmonioctl_wdog(dev_t, u_long, void *, int, struct lwp *);
 
-int sysmon_wdog_register(struct sysmon_wdog *);
-int sysmon_wdog_unregister(struct sysmon_wdog *);
+int	sysmon_wdog_setmode(struct sysmon_wdog *, int, u_int);
+int	sysmon_wdog_register(struct sysmon_wdog *);
+int	sysmon_wdog_unregister(struct sysmon_wdog *);
 
 void	sysmon_wdog_init(void);
 



CVS commit: [matt-nb5-mips64] src/sys/sys

2014-02-15 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Feb 15 10:14:35 UTC 2014

Modified Files:
src/sys/sys [matt-nb5-mips64]: syscallvar.h

Log Message:
Add sy_invoke inline from HEAD


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.8.1 src/sys/sys/syscallvar.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/syscallvar.h
diff -u src/sys/sys/syscallvar.h:1.2 src/sys/sys/syscallvar.h:1.2.8.1
--- src/sys/sys/syscallvar.h:1.2	Tue Oct 21 12:22:00 2008
+++ src/sys/sys/syscallvar.h	Sat Feb 15 10:14:35 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: syscallvar.h,v 1.2 2008/10/21 12:22:00 ad Exp $	*/
+/*	$NetBSD: syscallvar.h,v 1.2.8.1 2014/02/15 10:14:35 matt Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -52,4 +52,31 @@ sy_call(const struct sysent *sy, struct 
 	return error;
 }
 
+static inline int
+sy_invoke(const struct sysent *sy, struct lwp *l, const void *uap,
+	register_t *rval, int code)
+{
+	const bool do_trace = l->l_proc->p_trace_enabled &&
+	(sy->sy_flags & SYCALL_INDIRECT) == 0;
+	int error;
+
+	if (__predict_true(!do_trace) || (error = trace_enter(code, uap,
+	sy->sy_narg)) == 0) {
+		rval[0] = 0;
+#if !defined(__mips__)
+		/*
+		 * Due to the mips userland code for SYS_break needing v1 to be
+		 * preserved, we can't clear this on mips. 
+		 */
+		rval[1] = 0;
+#endif
+		error = sy_call(sy, l, uap, rval);
+	}
+
+	if (__predict_false(do_trace)) {
+		trace_exit(code, rval, error);
+	}
+	return error;
+}
+
 #endif	/* _SYS_SYSCALLVAR_H_ */



CVS commit: [matt-nb5-mips64] src/sys/sys

2014-02-15 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Feb 15 10:14:10 UTC 2014

Modified Files:
src/sys/sys [matt-nb5-mips64]: ucontext.h

Log Message:
add prototype for cpu_mcontext_validate


To generate a diff of this commit:
cvs rdiff -u -r1.11.12.1 -r1.11.12.2 src/sys/sys/ucontext.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/ucontext.h
diff -u src/sys/sys/ucontext.h:1.11.12.1 src/sys/sys/ucontext.h:1.11.12.2
--- src/sys/sys/ucontext.h:1.11.12.1	Fri Apr 29 08:14:36 2011
+++ src/sys/sys/ucontext.h	Sat Feb 15 10:14:10 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ucontext.h,v 1.11.12.1 2011/04/29 08:14:36 matt Exp $	*/
+/*	$NetBSD: ucontext.h,v 1.11.12.2 2014/02/15 10:14:10 matt Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2003 The NetBSD Foundation, Inc.
@@ -86,6 +86,8 @@ void	getucontext_sa(struct lwp *, uconte
 int	setucontext(struct lwp *, const ucontext_t *);
 void	cpu_getmcontext(struct lwp *, mcontext_t *, unsigned int *);
 int	cpu_setmcontext(struct lwp *, const mcontext_t *, unsigned int);
+int	cpu_mcontext_validate(struct lwp *, const mcontext_t *);
+
 #endif /* _KERNEL */
 
 #endif /* !_SYS_UCONTEXT_H_ */



CVS commit: [matt-nb5-mips64] src/sys

2014-02-15 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Feb 15 10:13:25 UTC 2014

Modified Files:
src/sys/kern [matt-nb5-mips64]: subr_evcnt.c
src/sys/sys [matt-nb5-mips64]: evcnt.h

Log Message:
Add evcnt_attach_dynamic_nozero


To generate a diff of this commit:
cvs rdiff -u -r1.4.94.2 -r1.4.94.3 src/sys/kern/subr_evcnt.c
cvs rdiff -u -r1.5 -r1.5.28.1 src/sys/sys/evcnt.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_evcnt.c
diff -u src/sys/kern/subr_evcnt.c:1.4.94.2 src/sys/kern/subr_evcnt.c:1.4.94.3
--- src/sys/kern/subr_evcnt.c:1.4.94.2	Sat Feb  5 06:54:58 2011
+++ src/sys/kern/subr_evcnt.c	Sat Feb 15 10:13:24 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_evcnt.c,v 1.4.94.2 2011/02/05 06:54:58 cliff Exp $ */
+/* $NetBSD: subr_evcnt.c,v 1.4.94.3 2014/02/15 10:13:24 matt Exp $ */
 
 /*
  * Copyright (c) 1996, 2000 Christopher G. Demetriou
@@ -77,7 +77,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_evcnt.c,v 1.4.94.2 2011/02/05 06:54:58 cliff Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_evcnt.c,v 1.4.94.3 2014/02/15 10:13:24 matt Exp $");
 
 #include "opt_ddb.h"
 
@@ -152,8 +152,15 @@ void
 evcnt_attach_dynamic(struct evcnt *ev, int type, const struct evcnt *parent,
 const char *group, const char *name)
 {
-
 	memset(ev, 0, sizeof *ev);
+	evcnt_attach_dynamic(ev, type, parent, group, name);
+}
+
+void
+evcnt_attach_dynamic_nozero(struct evcnt *ev, int type,
+const struct evcnt *parent, const char *group, const char *name)
+{
+
 	ev->ev_type = type;
 	ev->ev_parent = parent;
 	ev->ev_group = group;

Index: src/sys/sys/evcnt.h
diff -u src/sys/sys/evcnt.h:1.5 src/sys/sys/evcnt.h:1.5.28.1
--- src/sys/sys/evcnt.h:1.5	Sun Dec 16 20:45:59 2007
+++ src/sys/sys/evcnt.h	Sat Feb 15 10:13:25 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: evcnt.h,v 1.5 2007/12/16 20:45:59 dyoung Exp $	*/
+/*	$NetBSD: evcnt.h,v 1.5.28.1 2014/02/15 10:13:25 matt Exp $	*/
 
 /*
  * Copyright (c) 1996, 2000 Christopher G. Demetriou
@@ -131,6 +131,8 @@ void	evcnt_init(void);
 void	evcnt_attach_static(struct evcnt *);
 void	evcnt_attach_dynamic(struct evcnt *, int, const struct evcnt *,
 	const char *, const char *);
+void	evcnt_attach_dynamic_nozero(struct evcnt *, int, const struct evcnt *,
+	const char *, const char *);
 void	evcnt_detach(struct evcnt *);
 
 #ifdef DDB



CVS commit: [matt-nb5-mips64] src/sys

2014-02-15 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Feb 15 10:12:47 UTC 2014

Modified Files:
src/sys/kern [matt-nb5-mips64]: kern_cpu.c
src/sys/sys [matt-nb5-mips64]: cpu.h cpu_data.h

Log Message:
Add cpu_softintr_p()
Add cpu_name to cpu_data


To generate a diff of this commit:
cvs rdiff -u -r1.36.4.2 -r1.36.4.2.4.1 src/sys/kern/kern_cpu.c
cvs rdiff -u -r1.23.4.3.4.1 -r1.23.4.3.4.2 src/sys/sys/cpu.h
cvs rdiff -u -r1.27.16.3 -r1.27.16.4 src/sys/sys/cpu_data.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/kern_cpu.c
diff -u src/sys/kern/kern_cpu.c:1.36.4.2 src/sys/kern/kern_cpu.c:1.36.4.2.4.1
--- src/sys/kern/kern_cpu.c:1.36.4.2	Thu Nov 13 00:04:07 2008
+++ src/sys/kern/kern_cpu.c	Sat Feb 15 10:12:47 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_cpu.c,v 1.36.4.2 2008/11/13 00:04:07 snj Exp $	*/
+/*	$NetBSD: kern_cpu.c,v 1.36.4.2.4.1 2014/02/15 10:12:47 matt Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
@@ -56,7 +56,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_cpu.c,v 1.36.4.2 2008/11/13 00:04:07 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_cpu.c,v 1.36.4.2.4.1 2014/02/15 10:12:47 matt Exp $");
 
 #include 
 #include 
@@ -111,6 +111,10 @@ mi_cpu_attach(struct cpu_info *ci)
 	TAILQ_INIT(&ci->ci_data.cpu_ld_locks);
 	__cpu_simple_lock_init(&ci->ci_data.cpu_ld_lock);
 
+	/* This is useful for eg, per-cpu evcnt */
+	snprintf(ci->ci_data.cpu_name, sizeof(ci->ci_data.cpu_name), "cpu%d",
+	cpu_index(ci));
+
 	sched_cpuattach(ci);
 
 	error = create_idle_lwp(ci);
@@ -366,3 +370,10 @@ cpu_setstate(struct cpu_info *ci, bool o
 	spc->spc_lastmod = time_second;
 	return 0;
 }
+
+bool
+cpu_softintr_p(void)
+{
+ 
+	return (curlwp->l_pflag & LP_INTR) != 0;
+}

Index: src/sys/sys/cpu.h
diff -u src/sys/sys/cpu.h:1.23.4.3.4.1 src/sys/sys/cpu.h:1.23.4.3.4.2
--- src/sys/sys/cpu.h:1.23.4.3.4.1	Fri Apr 29 08:20:15 2011
+++ src/sys/sys/cpu.h	Sat Feb 15 10:12:47 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.23.4.3.4.1 2011/04/29 08:20:15 matt Exp $	*/
+/*	$NetBSD: cpu.h,v 1.23.4.3.4.2 2014/02/15 10:12:47 matt Exp $	*/
 
 /*-
  * Copyright (c) 2007 YAMAMOTO Takashi,
@@ -72,6 +72,7 @@ lwp_t	*cpu_switchto(lwp_t *, lwp_t *, bo
 struct	cpu_info *cpu_lookup(u_int);
 int	cpu_setstate(struct cpu_info *, bool);
 bool	cpu_intr_p(void);
+bool	cpu_softintr_p(void);
 bool	cpu_kpreempt_enter(uintptr_t, int);
 void	cpu_kpreempt_exit(uintptr_t);
 bool	cpu_kpreempt_disabled(void);

Index: src/sys/sys/cpu_data.h
diff -u src/sys/sys/cpu_data.h:1.27.16.3 src/sys/sys/cpu_data.h:1.27.16.4
--- src/sys/sys/cpu_data.h:1.27.16.3	Fri May 20 14:14:51 2011
+++ src/sys/sys/cpu_data.h	Sat Feb 15 10:12:47 2014
@@ -90,6 +90,9 @@ struct cpu_data {
 	u_int		cpu_nsyscall;		/* syscall counter */
 	u_int		cpu_ntrap;		/* trap counter */
 	u_int		cpu_nswtch;		/* context switch counter */
+	u_int		cpu_nintr;		/* interrupt counter */
+	u_int		cpu_nsoft;		/* soft interrupt counter */
+	u_int		cpu_nfault;		/* pagefault counter */
 	void		*cpu_uvm;		/* uvm per-cpu data */
 	void		*cpu_softcpu;		/* soft interrupt table */
 	TAILQ_HEAD(,buf) cpu_biodone;		/* finished block xfers */
@@ -100,6 +103,7 @@ struct cpu_data {
 	__cpu_simple_lock_t cpu_ld_lock;	/* lockdebug */
 	uint64_t	cpu_cc_freq;		/* cycle counter frequency */
 	int64_t		cpu_cc_skew;		/* counter skew vs cpu0 */
+	char		cpu_name[8];		/* eg, "cpu4" */
 };
 
 /* compat definitions */



CVS commit: [matt-nb5-mips64] src/sys

2014-02-14 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Feb 15 03:33:40 UTC 2014

Modified Files:
src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixl_sdhc.c
src/sys/dev/sdmmc [matt-nb5-mips64]: sdhc.c sdhcvar.h

Log Message:
HAS_CGM -> HAVE_CGM (like current)
Add 32BIT_ACCESS


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/arch/mips/rmi/rmixl_sdhc.c
cvs rdiff -u -r1.7.2.5 -r1.7.2.6 src/sys/dev/sdmmc/sdhc.c
cvs rdiff -u -r1.4.2.4 -r1.4.2.5 src/sys/dev/sdmmc/sdhcvar.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/mips/rmi/rmixl_sdhc.c
diff -u src/sys/arch/mips/rmi/rmixl_sdhc.c:1.1.2.1 src/sys/arch/mips/rmi/rmixl_sdhc.c:1.1.2.2
--- src/sys/arch/mips/rmi/rmixl_sdhc.c:1.1.2.1	Sat Dec 24 01:57:54 2011
+++ src/sys/arch/mips/rmi/rmixl_sdhc.c	Sat Feb 15 03:33:40 2014
@@ -29,7 +29,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: rmixl_sdhc.c,v 1.1.2.1 2011/12/24 01:57:54 matt Exp $");
+__KERNEL_RCSID(1, "$NetBSD: rmixl_sdhc.c,v 1.1.2.2 2014/02/15 03:33:40 matt Exp $");
 
 #include 
 #include 
@@ -86,7 +86,7 @@ sdhc_xlsdio_attach(device_t parent, devi
 	KASSERT(psc->sc_slots[xa->xa_slot] == NULL);
 	psc->sc_slots[xa->xa_slot] = sc;
 
-	sc->sc_flags = SDHC_FLAG_HAS_CGM;
+	sc->sc_flags = SDHC_FLAG_HAVE_CGM;
 	sc->sc_dev = self;
 	sc->sc_dmat = xa->xa_dmat;
 	sc->sc_host = malloc(1 * sizeof(sc->sc_host[0]),

Index: src/sys/dev/sdmmc/sdhc.c
diff -u src/sys/dev/sdmmc/sdhc.c:1.7.2.5 src/sys/dev/sdmmc/sdhc.c:1.7.2.6
--- src/sys/dev/sdmmc/sdhc.c:1.7.2.5	Tue Nov  5 18:35:35 2013
+++ src/sys/dev/sdmmc/sdhc.c	Sat Feb 15 03:33:40 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdhc.c,v 1.7.2.5 2013/11/05 18:35:35 matt Exp $	*/
+/*	$NetBSD: sdhc.c,v 1.7.2.6 2014/02/15 03:33:40 matt Exp $	*/
 /*	$OpenBSD: sdhc.c,v 1.25 2009/01/13 19:44:20 grange Exp $	*/
 
 /*
@@ -23,7 +23,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sdhc.c,v 1.7.2.5 2013/11/05 18:35:35 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdhc.c,v 1.7.2.6 2014/02/15 03:33:40 matt Exp $");
 
 #include 
 #include 
@@ -290,7 +290,7 @@ sdhc_host_found(struct sdhc_softc *sc, b
 	hp->maxblklen > 1 ? "s" : ""));
 
 #if 0
-	if (sc->sc_flags & SDHC_FLAG_HAS_CGM) {
+	if (sc->sc_flags & SDHC_FLAG_HAVE_CGM) {
 		uint16_t clk = HREAD2(hp, SDHC_CLOCK_CTL);
 		clk |= SDHC_SDCLK_CGM;
 		HWRITE2(hp, SDHC_CLOCK_CTL, clk);
@@ -312,7 +312,7 @@ sdhc_host_found(struct sdhc_softc *sc, b
 	saa.saa_sct = &sdhc_functions;
 	saa.saa_sch = hp;
 	saa.saa_dmat = hp->dmat;
-	if (sc->sc_flags & SDHC_FLAG_HAS_CGM) {
+	if (sc->sc_flags & SDHC_FLAG_HAVE_CGM) {
 		saa.saa_clkmin = hp->clkbase / 2046;
 	} else {
 		saa.saa_clkmin = hp->clkbase / 256;
@@ -573,7 +573,7 @@ sdhc_clock_divisor(struct sdhc_host *hp,
 {
 	int div;
 
-	if (hp->sc->sc_flags & SDHC_FLAG_HAS_CGM) {
+	if (hp->sc->sc_flags & SDHC_FLAG_HAVE_CGM) {
 		for (div = hp->clkbase / freq; div <= 0x3ff; div++) {
 			if ((hp->clkbase / div) <= freq) {
 *divp = SDHC_SDCLK_CGM

Index: src/sys/dev/sdmmc/sdhcvar.h
diff -u src/sys/dev/sdmmc/sdhcvar.h:1.4.2.4 src/sys/dev/sdmmc/sdhcvar.h:1.4.2.5
--- src/sys/dev/sdmmc/sdhcvar.h:1.4.2.4	Tue Dec 27 17:12:48 2011
+++ src/sys/dev/sdmmc/sdhcvar.h	Sat Feb 15 03:33:40 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdhcvar.h,v 1.4.2.4 2011/12/27 17:12:48 matt Exp $	*/
+/*	$NetBSD: sdhcvar.h,v 1.4.2.5 2014/02/15 03:33:40 matt Exp $	*/
 /*	$OpenBSD: sdhcvar.h,v 1.3 2007/09/06 08:01:01 jsg Exp $	*/
 
 /*
@@ -39,7 +39,8 @@ struct sdhc_softc {
 #define	SDHC_FLAG_FORCE_DMA	0x0002
 #define	SDHC_FLAG_NO_PWR0	0x0004
 #define	SDHC_FLAG_HAVE_DVS	0x0008
-#define	SDHC_FLAG_HAS_CGM	0x0010
+#define	SDHC_FLAG_HAVE_CGM	0x0010
+#define	SDHC_FLAG_32BIT_ACCESS	0x0020
 	uint32_t		sc_clkbase;
 };
 



CVS commit: [matt-nb5-mips64] src/sys/dev/pci

2014-02-14 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Feb 15 03:22:27 UTC 2014

Modified Files:
src/sys/dev/pci [matt-nb5-mips64]: if_wm.c pcireg.h ppb.c

Log Message:
sync pcireg.h with HEAD.
update if_wm.c and ppb.c accordingly.


To generate a diff of this commit:
cvs rdiff -u -r1.162.4.3.2.1.2.1 -r1.162.4.3.2.1.2.2 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.57.26.1 -r1.57.26.2 src/sys/dev/pci/pcireg.h
cvs rdiff -u -r1.39.18.3 -r1.39.18.4 src/sys/dev/pci/ppb.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/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.162.4.3.2.1.2.1 src/sys/dev/pci/if_wm.c:1.162.4.3.2.1.2.2
--- src/sys/dev/pci/if_wm.c:1.162.4.3.2.1.2.1	Wed Apr 21 00:27:41 2010
+++ src/sys/dev/pci/if_wm.c	Sat Feb 15 03:22:27 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.162.4.3.2.1.2.1 2010/04/21 00:27:41 matt Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.162.4.3.2.1.2.2 2014/02/15 03:22:27 matt Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -76,7 +76,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.162.4.3.2.1.2.1 2010/04/21 00:27:41 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.162.4.3.2.1.2.2 2014/02/15 03:22:27 matt Exp $");
 
 #include "bpfilter.h"
 #include "rnd.h"
@@ -1162,25 +1162,25 @@ wm_attach(device_t parent, device_t self
  * incorrectly.
  */
 pcix_cmd = pci_conf_read(pa->pa_pc, pa->pa_tag,
-sc->sc_pcix_offset + PCI_PCIX_CMD);
+sc->sc_pcix_offset + PCIX_CMD);
 pcix_sts = pci_conf_read(pa->pa_pc, pa->pa_tag,
-sc->sc_pcix_offset + PCI_PCIX_STATUS);
+sc->sc_pcix_offset + PCIX_STATUS);
 
 bytecnt =
-(pcix_cmd & PCI_PCIX_CMD_BYTECNT_MASK) >>
-PCI_PCIX_CMD_BYTECNT_SHIFT;
+(pcix_cmd & PCIX_CMD_BYTECNT_MASK) >>
+PCIX_CMD_BYTECNT_SHIFT;
 maxb =
-(pcix_sts & PCI_PCIX_STATUS_MAXB_MASK) >>
-PCI_PCIX_STATUS_MAXB_SHIFT;
+(pcix_sts & PCIX_STATUS_MAXB_MASK) >>
+PCIX_STATUS_MAXB_SHIFT;
 if (bytecnt > maxb) {
 	aprint_verbose_dev(sc->sc_dev,
 	"resetting PCI-X MMRBC: %d -> %d\n",
 	512 << bytecnt, 512 << maxb);
 	pcix_cmd = (pcix_cmd &
-	~PCI_PCIX_CMD_BYTECNT_MASK) |
-	   (maxb << PCI_PCIX_CMD_BYTECNT_SHIFT);
+	~PCIX_CMD_BYTECNT_MASK) |
+	   (maxb << PCIX_CMD_BYTECNT_SHIFT);
 	pci_conf_write(pa->pa_pc, pa->pa_tag,
-	sc->sc_pcix_offset + PCI_PCIX_CMD,
+	sc->sc_pcix_offset + PCIX_CMD,
 	pcix_cmd);
 }
 			}

Index: src/sys/dev/pci/pcireg.h
diff -u src/sys/dev/pci/pcireg.h:1.57.26.1 src/sys/dev/pci/pcireg.h:1.57.26.2
--- src/sys/dev/pci/pcireg.h:1.57.26.1	Sat Dec 24 01:27:25 2011
+++ src/sys/dev/pci/pcireg.h	Sat Feb 15 03:22:27 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcireg.h,v 1.57.26.1 2011/12/24 01:27:25 matt Exp $	*/
+/*	$NetBSD: pcireg.h,v 1.57.26.2 2014/02/15 03:22:27 matt Exp $	*/
 
 /*
  * Copyright (c) 1995, 1996, 1999, 2000
@@ -179,6 +179,7 @@ typedef u_int8_t pci_revision_t;
 #define	PCI_SUBCLASS_MASS_STORAGE_ATA		0x05
 #define	PCI_SUBCLASS_MASS_STORAGE_SATA		0x06
 #define	PCI_SUBCLASS_MASS_STORAGE_SAS		0x07
+#define	PCI_SUBCLASS_MASS_STORAGE_NVM		0x08
 #define	PCI_SUBCLASS_MASS_STORAGE_MISC		0x80
 
 /* 0x02 network subclasses */
@@ -462,6 +463,7 @@ typedef u_int8_t pci_revision_t;
 #define	PCI_CAP_DEBUGPORT	0x0a
 #define	PCI_CAP_CPCI_RSRCCTL	0x0b
 #define	PCI_CAP_HOTPLUG		0x0c
+#define	PCI_CAP_SUBVENDOR	0x0d
 #define	PCI_CAP_AGP8		0x0e
 #define	PCI_CAP_SECURE		0x0f
 #define	PCI_CAP_PCIEXPRESS 	0x10
@@ -567,128 +569,239 @@ struct pci_msix_table_entry {
  * as 32-bit values, offset and shifted appropriately.  Make sure you perform
  * the appropriate R/M/W cycles!
  */
-#define PCI_PCIX_CMD			0x00
-#define PCI_PCIX_CMD_PERR_RECOVER	0x0001
-#define PCI_PCIX_CMD_RELAXED_ORDER	0x0002
-#define PCI_PCIX_CMD_BYTECNT_MASK	0x000c
-#define	PCI_PCIX_CMD_BYTECNT_SHIFT	18
-#define		PCI_PCIX_CMD_BCNT_512		0x
-#define		PCI_PCIX_CMD_BCNT_1024		0x0004
-#define		PCI_PCIX_CMD_BCNT_2048		0x0008
-#define		PCI_PCIX_CMD_BCNT_4096		0x000c
-#define PCI_PCIX_CMD_SPLTRANS_MASK	0x0070
-#define		PCI_PCIX_CMD_SPLTRANS_1		0x
-#define		PCI_PCIX_CMD_SPLTRANS_2		0x0010
-#define		PCI_PCIX_CMD_SPLTRANS_3		0x0020
-#define		PCI_PCIX_CMD_SPLTRANS_4		0x0030
-#define		PCI_PCIX_CMD_SPLTRANS_8		0x0040
-#define		PCI_PCIX_CMD_SPLTRANS_12	0x0050
-#define		PCI_PCIX_CMD_SPLTRANS_16	0x0060
-#define		PCI_PCIX_CMD_SPLTRANS_32	0x0070
+#define PCIX_CMD			0x00
+#define PCIX_CMD_PERR_RECOVER	0x0001
+#define PCIX_CMD_RELAXED_ORDER	0x0002
+#define PCIX_CMD_BYTECNT_MASK	0x000c
+#define	PCIX_CMD_BYTECNT_SHIFT	18
+#define		PCIX_CMD_BCNT_512		0x
+#define		PCIX_CMD_BCNT_1024		0x0004
+#define		PCIX_CMD_BCNT_2048		0x0008
+#define		PCIX_CMD_BCNT_4096		0x000c
+#define PCIX_CMD_SPLTRANS_MASK	0x0070
+#defi

CVS commit: [matt-nb5-mips64] src/sys

2014-02-14 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Feb 14 18:38:16 UTC 2014

Modified Files:
src/sys/arch/mips/mips [matt-nb5-mips64]: mips_softint.c pmap.c
pmap_tlb.c vm_machdep.c
src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixl_intr.c rmixl_nand_pci.c
src/sys/dev/ic [matt-nb5-mips64]: siisata.c
src/sys/kern [matt-nb5-mips64]: subr_prf.c
src/sys/lib/libkern [matt-nb5-mips64]: __assert.c libkern.h
src/sys/sys [matt-nb5-mips64]: cdefs.h systm.h

Log Message:
Change KASSERTMSG/KDASSERTMSG to use varadic arguments like HEAD.
panic -> vpanic, add panic wrapper to vpanic.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.8 -r1.1.2.9 src/sys/arch/mips/mips/mips_softint.c
cvs rdiff -u -r1.179.16.46 -r1.179.16.47 src/sys/arch/mips/mips/pmap.c
cvs rdiff -u -r1.1.2.24 -r1.1.2.25 src/sys/arch/mips/mips/pmap_tlb.c
cvs rdiff -u -r1.121.6.1.2.30 -r1.121.6.1.2.31 \
src/sys/arch/mips/mips/vm_machdep.c
cvs rdiff -u -r1.1.2.38 -r1.1.2.39 src/sys/arch/mips/rmi/rmixl_intr.c
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/sys/arch/mips/rmi/rmixl_nand_pci.c
cvs rdiff -u -r1.2.14.2 -r1.2.14.3 src/sys/dev/ic/siisata.c
cvs rdiff -u -r1.124.4.1.4.1 -r1.124.4.1.4.2 src/sys/kern/subr_prf.c
cvs rdiff -u -r1.11 -r1.11.40.1 src/sys/lib/libkern/__assert.c
cvs rdiff -u -r1.82.8.4 -r1.82.8.5 src/sys/lib/libkern/libkern.h
cvs rdiff -u -r1.69.10.1 -r1.69.10.2 src/sys/sys/cdefs.h
cvs rdiff -u -r1.228.4.2.4.3 -r1.228.4.2.4.4 src/sys/sys/systm.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/mips/mips/mips_softint.c
diff -u src/sys/arch/mips/mips/mips_softint.c:1.1.2.8 src/sys/arch/mips/mips/mips_softint.c:1.1.2.9
--- src/sys/arch/mips/mips/mips_softint.c:1.1.2.8	Fri Apr 29 08:26:29 2011
+++ src/sys/arch/mips/mips/mips_softint.c	Fri Feb 14 18:38:15 2014
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mips_softint.c,v 1.1.2.8 2011/04/29 08:26:29 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mips_softint.c,v 1.1.2.9 2014/02/14 18:38:15 matt Exp $");
 
 #include 
 #include 
@@ -103,7 +103,7 @@ softint_trigger(uintptr_t si)
 		softint_fast_dispatch(ci->ci_softlwps[SOFTINT_##level], \
 		IPL_SOFT##level); \
 		KASSERT(ci->ci_softlwps[SOFTINT_##level]->l_ctxswtch == 0); \
-		KASSERTMSG(ci->ci_cpl == IPL_HIGH, ("cpl (%d) != HIGH", ci->ci_cpl)); \
+		KASSERTMSG(ci->ci_cpl == IPL_HIGH, "cpl (%d) != HIGH", ci->ci_cpl); \
 		continue; \
 	}
 
@@ -117,8 +117,8 @@ softint_process(uint32_t ipending)
 	KASSERT((ipending & ~MIPS_SOFT_INT_MASK) == 0);
 	KASSERT(ci->ci_cpl == IPL_HIGH);
 	KASSERTMSG(ci->ci_mtx_count == 0,
-	("%s: cpu%u (%p): ci_mtx_count (%d) != 0",
-	 __func__, cpu_index(ci), ci, ci->ci_mtx_count));
+	"%s: cpu%u (%p): ci_mtx_count (%d) != 0",
+	 __func__, cpu_index(ci), ci, ci->ci_mtx_count);
 
 	if (ipending & MIPS_SOFT_INT_MASK_0) {
 		/*

Index: src/sys/arch/mips/mips/pmap.c
diff -u src/sys/arch/mips/mips/pmap.c:1.179.16.46 src/sys/arch/mips/mips/pmap.c:1.179.16.47
--- src/sys/arch/mips/mips/pmap.c:1.179.16.46	Sat Aug  4 07:20:31 2012
+++ src/sys/arch/mips/mips/pmap.c	Fri Feb 14 18:38:16 2014
@@ -1446,8 +1446,8 @@ pmap_enter(pmap_t pmap, vaddr_t va, padd
 #endif
 	const bool good_color = PMAP_PAGE_COLOROK_P(pa, va);
 	KASSERTMSG(good_color,
-	("%s(%p, %#"PRIxVADDR", %#"PRIxPADDR", %x, %x): color mismatch\n",
-	 __func__, pmap, va, pa, prot, flags));
+	"%s(%p, %#"PRIxVADDR", %#"PRIxPADDR", %x, %x): color mismatch\n",
+	__func__, pmap, va, pa, prot, flags);
 	if (kernel_pmap_p) {
 		PMAP_COUNT(kernel_mappings);
 		if (!good_color)
@@ -1673,8 +1673,8 @@ pmap_kenter_pa(vaddr_t va, paddr_t pa, v
 #endif
 	PMAP_COUNT(kenter_pa);
 	KASSERTMSG(!managed || PMAP_PAGE_COLOROK_P(pa, va),
-	("%s(%#"PRIxVADDR", %#"PRIxPADDR", %x): color mismatch\n",
-	 __func__, va, pa, prot));
+	"%s(%#"PRIxVADDR", %#"PRIxPADDR", %x): color mismatch\n",
+	__func__, va, pa, prot);
 	if (!PMAP_PAGE_COLOROK_P(pa, va) && managed) {
 		PMAP_COUNT(kenter_pa_bad);
 	}

Index: src/sys/arch/mips/mips/pmap_tlb.c
diff -u src/sys/arch/mips/mips/pmap_tlb.c:1.1.2.24 src/sys/arch/mips/mips/pmap_tlb.c:1.1.2.25
--- src/sys/arch/mips/mips/pmap_tlb.c:1.1.2.24	Mon Jul  9 17:23:37 2012
+++ src/sys/arch/mips/mips/pmap_tlb.c	Fri Feb 14 18:38:16 2014
@@ -453,8 +453,8 @@ pmap_tlb_shootdown_process(void)
 #if 0
 	KASSERT(cpu_intr_p());
 	KASSERTMSG(ci->ci_cpl >= IPL_SCHED,
-	("%s: cpl (%d) < IPL_SCHED (%d)",
-	__func__, ci->ci_cpl, IPL_SCHED));
+	"%s: cpl (%d) < IPL_SCHED (%d)",
+	__func__, ci->ci_cpl, IPL_SCHED);
 #endif
 	TLBINFO_LOCK(ti);
 
@@ -862,8 +862,8 @@ pmap_tlb_asid_deactivate(pmap_t pm)
 		const uint32_t cpu_mask = 1 << cpu_index(ci);
 		KASSERT(!cpu_intr_p());
 		KASSERTMSG(pm->pm_onproc & cpu_mask,
-		("%s: pmap %p onproc %#x doesn't include cpu %d (%p)",
-		__func__, pm, pm->pm_onproc, cpu_index(ci), ci));
+		"%s: pmap %p

CVS commit: [matt-nb5-mips64] src/sys/conf

2014-02-14 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Feb 14 18:36:14 UTC 2014

Modified Files:
src/sys/conf [matt-nb5-mips64]: Makefile.kern.inc

Log Message:
SYSTEM_DEP?= -> SYSTEM_DEP+=
Add KERNLDSCRIPT to SYSTEM_DEP


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

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

Modified files:

Index: src/sys/conf/Makefile.kern.inc
diff -u src/sys/conf/Makefile.kern.inc:1.118.4.2.4.3 src/sys/conf/Makefile.kern.inc:1.118.4.2.4.4
--- src/sys/conf/Makefile.kern.inc:1.118.4.2.4.3	Wed Jan 27 07:28:09 2010
+++ src/sys/conf/Makefile.kern.inc	Fri Feb 14 18:36:14 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.kern.inc,v 1.118.4.2.4.3 2010/01/27 07:28:09 matt Exp $
+#	$NetBSD: Makefile.kern.inc,v 1.118.4.2.4.4 2014/02/14 18:36:14 matt Exp $
 #
 # This file contains common `MI' targets and definitions and it is included
 # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}.
@@ -198,7 +198,10 @@ ${_cfile:T:R}.o: ${_cfile}
 #	${SYSTEM_LD} swapxxx.o
 #	${SYSTEM_LD_TAIL}
 SYSTEM_OBJ?=	${MD_OBJS} ${MI_OBJS} ${OBJS} ${SYSLIBCOMPAT} ${LIBKERN}
-SYSTEM_DEP?=	Makefile ${SYSTEM_OBJ:O} .gdbinit
+SYSTEM_DEP+=	Makefile ${SYSTEM_OBJ:O} .gdbinit
+.if defined(KERNLDSCRIPT)
+SYSTEM_DEP+=	${KERNLDSCRIPT} 
+.endif
 SYSTEM_LD_HEAD?=@rm -f $@
 SYSTEM_LD?=	@${_MKSHMSG} "   link  ${.CURDIR:T}/${.TARGET}"; \
 		${_MKSHECHO}\



CVS commit: [matt-nb5-mips64] src/sys

2014-02-14 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Feb 14 18:35:15 UTC 2014

Modified Files:
src/sys/conf [matt-nb5-mips64]: files
src/sys/dev/ic [matt-nb5-mips64]: comreg.h

Log Message:
defparam COM_TOLERANCE


To generate a diff of this commit:
cvs rdiff -u -r1.924.4.1.4.3 -r1.924.4.1.4.4 src/sys/conf/files
cvs rdiff -u -r1.15 -r1.15.18.1 src/sys/dev/ic/comreg.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/conf/files
diff -u src/sys/conf/files:1.924.4.1.4.3 src/sys/conf/files:1.924.4.1.4.4
--- src/sys/conf/files:1.924.4.1.4.3	Wed Nov 13 22:39:58 2013
+++ src/sys/conf/files	Fri Feb 14 18:35:15 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: files,v 1.924.4.1.4.3 2013/11/13 22:39:58 matt Exp $
+#	$NetBSD: files,v 1.924.4.1.4.4 2014/02/14 18:35:15 matt Exp $
 #	@(#)files.newconf	7.5 (Berkeley) 5/10/93
 
 version 	20080610
@@ -804,6 +804,7 @@ defflag	opt_com.h		COM_DEBUG
 # XXX In a perfect world, this would be done with attributes
 defflag	opt_com.h		COM_16650 COM_HAYESP COM_PXA2X0 COM_AU1X00
 COM_REGMAP
+defparam opt_com.h		COM_TOLERANCE
 device	com { } : tty
 file	dev/ic/com.c			com			needs-flag
 

Index: src/sys/dev/ic/comreg.h
diff -u src/sys/dev/ic/comreg.h:1.15 src/sys/dev/ic/comreg.h:1.15.18.1
--- src/sys/dev/ic/comreg.h:1.15	Mon Apr 28 22:00:01 2008
+++ src/sys/dev/ic/comreg.h	Fri Feb 14 18:35:15 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: comreg.h,v 1.15 2008/04/28 22:00:01 matt Exp $	*/
+/*	$NetBSD: comreg.h,v 1.15.18.1 2014/02/14 18:35:15 matt Exp $	*/
 
 /*-
  * Copyright (c) 1991 The Regents of the University of California.
@@ -33,8 +33,14 @@
 
 #include 
 
+#ifdef _KERNEL_OPT
+#include "opt_com.h"
+#endif
+
 #define	COM_FREQ	1843200	/* 16-bit baud rate divisor */
+#ifndef COM_TOLERANCE
 #define	COM_TOLERANCE	30	/* baud rate tolerance, in 0.1% units */
+#endif
 
 /* interrupt enable register */
 #define	IER_ERXRDY	0x1	/* Enable receiver interrupt */



CVS commit: [matt-nb5-mips64] src/sys/kern

2014-02-14 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Feb 14 18:31:49 UTC 2014

Modified Files:
src/sys/kern [matt-nb5-mips64]: vfs_subr.c

Log Message:
vpanic -> vnpanic


To generate a diff of this commit:
cvs rdiff -u -r1.357.4.4.2.1.2.1 -r1.357.4.4.2.1.2.2 src/sys/kern/vfs_subr.c

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

Modified files:

Index: src/sys/kern/vfs_subr.c
diff -u src/sys/kern/vfs_subr.c:1.357.4.4.2.1.2.1 src/sys/kern/vfs_subr.c:1.357.4.4.2.1.2.2
--- src/sys/kern/vfs_subr.c:1.357.4.4.2.1.2.1	Wed Apr 21 00:28:19 2010
+++ src/sys/kern/vfs_subr.c	Fri Feb 14 18:31:49 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_subr.c,v 1.357.4.4.2.1.2.1 2010/04/21 00:28:19 matt Exp $	*/
+/*	$NetBSD: vfs_subr.c,v 1.357.4.4.2.1.2.2 2014/02/14 18:31:49 matt Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 2004, 2005, 2007, 2008 The NetBSD Foundation, Inc.
@@ -91,7 +91,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.357.4.4.2.1.2.1 2010/04/21 00:28:19 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.357.4.4.2.1.2.2 2014/02/14 18:31:49 matt Exp $");
 
 #include "opt_ddb.h"
 #include "opt_compat_netbsd.h"
@@ -191,7 +191,7 @@ static void vrele_thread(void *);
 static void insmntque(vnode_t *, struct mount *);
 static int getdevvp(dev_t, vnode_t **, enum vtype);
 static vnode_t *getcleanvnode(void);;
-void vpanic(vnode_t *, const char *);
+void vnpanic(vnode_t *, const char *);
 
 #ifdef DEBUG 
 void printlockedvnodes(void);
@@ -199,14 +199,14 @@ void printlockedvnodes(void);
 
 #ifdef DIAGNOSTIC
 void
-vpanic(vnode_t *vp, const char *msg)
+vnpanic(vnode_t *vp, const char *msg)
 {
 
 	vprint(NULL, vp);
 	panic("%s\n", msg);
 }
 #else
-#define	vpanic(vp, msg)	/* nothing */
+#define	vnpanic(vp, msg)	/* nothing */
 #endif
 
 void
@@ -333,14 +333,14 @@ try_nextlist:
 		 * lists.
 		 */
 		if (vp->v_usecount != 0) {
-			vpanic(vp, "free vnode isn't");
+			vnpanic(vp, "free vnode isn't");
 		}
 		if ((vp->v_iflag & VI_CLEAN) != 0) {
-			vpanic(vp, "clean vnode on freelist");
+			vnpanic(vp, "clean vnode on freelist");
 		}
 		if (vp->v_freelisthd != listhd) {
 			printf("vnode sez %p, listhd %p\n", vp->v_freelisthd, listhd);
-			vpanic(vp, "list head mismatch");
+			vnpanic(vp, "list head mismatch");
 		}
 		if (!mutex_tryenter(&vp->v_interlock))
 			continue;
@@ -411,13 +411,13 @@ try_nextlist:
 
 	if (vp->v_data != NULL || vp->v_uobj.uo_npages != 0 ||
 	!TAILQ_EMPTY(&vp->v_uobj.memq)) {
-		vpanic(vp, "cleaned vnode isn't");
+		vnpanic(vp, "cleaned vnode isn't");
 	}
 	if (vp->v_numoutput != 0) {
-		vpanic(vp, "clean vnode has pending I/O's");
+		vnpanic(vp, "clean vnode has pending I/O's");
 	}
 	if ((vp->v_iflag & VI_ONWORKLST) != 0) {
-		vpanic(vp, "clean vnode on syncer list");
+		vnpanic(vp, "clean vnode on syncer list");
 	}
 
 	return vp;
@@ -1376,7 +1376,7 @@ vrelel(vnode_t *vp, int flags)
 
 	if (__predict_false(vp->v_op == dead_vnodeop_p &&
 	(vp->v_iflag & (VI_CLEAN|VI_XLOCK)) == 0)) {
-		vpanic(vp, "dead but not clean");
+		vnpanic(vp, "dead but not clean");
 	}
 
 	/*
@@ -1389,7 +1389,7 @@ vrelel(vnode_t *vp, int flags)
 		return;
 	}
 	if (vp->v_usecount <= 0 || vp->v_writecount != 0) {
-		vpanic(vp, "vrelel: bad ref count");
+		vnpanic(vp, "vrelel: bad ref count");
 	}
 
 	KASSERT((vp->v_iflag & VI_XLOCK) == 0);
@@ -1421,7 +1421,7 @@ vrelel(vnode_t *vp, int flags)
 			LK_RETRY);
 			if (error != 0) {
 /* XXX */
-vpanic(vp, "vrele: unable to lock %p");
+vnpanic(vp, "vrele: unable to lock %p");
 			}
 			mutex_enter(&vp->v_interlock);
 			/*
@@ -1642,7 +1642,7 @@ holdrelel(vnode_t *vp)
 	KASSERT((vp->v_iflag & VI_MARKER) == 0);
 
 	if (vp->v_holdcnt <= 0) {
-		vpanic(vp, "holdrelel: holdcnt vp %p");
+		vnpanic(vp, "holdrelel: holdcnt vp %p");
 	}
 
 	vp->v_holdcnt--;
@@ -1891,7 +1891,7 @@ vclean(vnode_t *vp, int flags)
 
 	/* Disassociate the underlying file system from the vnode. */
 	if (VOP_RECLAIM(vp)) {
-		vpanic(vp, "vclean: cannot reclaim");
+		vnpanic(vp, "vclean: cannot reclaim");
 	}
 
 	KASSERT(vp->v_uobj.uo_npages == 0);



CVS commit: [matt-nb5-mips64] src/lib/csu/common_elf

2014-01-10 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Jan 11 00:23:41 UTC 2014

Modified Files:
src/lib/csu/common_elf [matt-nb5-mips64]: Makefile.inc

Log Message:
Make sure $a/$t/$d are preserved for ARM BE.


To generate a diff of this commit:
cvs rdiff -u -r1.30.10.1 -r1.30.10.2 src/lib/csu/common_elf/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/csu/common_elf/Makefile.inc
diff -u src/lib/csu/common_elf/Makefile.inc:1.30.10.1 src/lib/csu/common_elf/Makefile.inc:1.30.10.2
--- src/lib/csu/common_elf/Makefile.inc:1.30.10.1	Tue Sep  1 23:09:14 2009
+++ src/lib/csu/common_elf/Makefile.inc	Sat Jan 11 00:23:41 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.30.10.1 2009/09/01 23:09:14 matt Exp $
+#	$NetBSD: Makefile.inc,v 1.30.10.2 2014/01/11 00:23:41 matt Exp $
 
 .include 
 
@@ -33,23 +33,23 @@ realall: ${OBJS}
 crt0.o: crt0.c
 	${_MKTARGET_COMPILE}
 	${COMPILE.c} -DCRT0 ${.IMPSRC} -o ${.TARGET}
-	${OBJCOPY} -x ${.TARGET}
+	${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}
 
 # dependant on crt0.o to pick up header dependencies
 gcrt0.o: ${.CURDIR}/crt0.c crt0.o
 	${_MKTARGET_COMPILE}
 	${COMPILE.c} -DMCRT0 ${.CURDIR}/crt0.c -o ${.TARGET}
-	${OBJCOPY} -x ${.TARGET}
+	${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}
 
 crti.o: crti.c
 	${_MKTARGET_COMPILE}
 	${COMPILE.c} ${.IMPSRC} -o ${.TARGET}
-	${OBJCOPY} -X ${.TARGET}
+	${OBJCOPY} ${OBJCOPYLIBFLAGS} -X ${.TARGET}
 
 crtn.o: crtn.c
 	${_MKTARGET_COMPILE}
 	${COMPILE.c} ${.IMPSRC} -o ${.TARGET}
-	${OBJCOPY} -X ${.TARGET}
+	${OBJCOPY} ${OBJCOPYLIBFLAGS} -X ${.TARGET}
 
 FILES=${OBJS}
 FILESDIR=${LIBDIR}



CVS commit: [matt-nb5-mips64] src/distrib/evbarm/instkernel/ramdisk

2014-01-09 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Jan  9 22:58:15 UTC 2014

Modified Files:
src/distrib/evbarm/instkernel/ramdisk [matt-nb5-mips64]: Makefile

Log Message:
Build BE ramdisks for BE MACHINE_ARCH's


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.24.1 src/distrib/evbarm/instkernel/ramdisk/Makefile

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

Modified files:

Index: src/distrib/evbarm/instkernel/ramdisk/Makefile
diff -u src/distrib/evbarm/instkernel/ramdisk/Makefile:1.4 src/distrib/evbarm/instkernel/ramdisk/Makefile:1.4.24.1
--- src/distrib/evbarm/instkernel/ramdisk/Makefile:1.4	Thu May 10 23:22:29 2007
+++ src/distrib/evbarm/instkernel/ramdisk/Makefile	Thu Jan  9 22:58:15 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.4 2007/05/10 23:22:29 dogcow Exp $
+#	$NetBSD: Makefile,v 1.4.24.1 2014/01/09 22:58:15 matt Exp $
 
 .include 
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
@@ -13,7 +13,11 @@ DBG=		-Os
 CRUNCHBIN=	ramdiskbin
 LISTS=		${.CURDIR}/list ${DISTRIBDIR}/common/list.sysinst
 MTREECONF=	${DISTRIBDIR}/common/mtree.common
+.if empty(MACHINE_ARCH:M*eb)
 IMAGEENDIAN=	le
+.else
+IMAGEENDIAN=	be
+.endif
 MAKEDEVTARGETS=	ramdisk
 IMAGEDEPENDS=	${CRUNCHBIN} \
 		disktab.preinstall dot.hdprofile dot.profile \



CVS commit: [matt-nb5-mips64] src/gnu/dist/gdb6/bfd

2014-01-02 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Jan  2 17:34:43 UTC 2014

Modified Files:
src/gnu/dist/gdb6/bfd [matt-nb5-mips64]: config.bfd

Log Message:
allow arm*{,eb]-*-netbsdelf*


To generate a diff of this commit:
cvs rdiff -u -r1.4.24.1 -r1.4.24.2 src/gnu/dist/gdb6/bfd/config.bfd

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

Modified files:

Index: src/gnu/dist/gdb6/bfd/config.bfd
diff -u src/gnu/dist/gdb6/bfd/config.bfd:1.4.24.1 src/gnu/dist/gdb6/bfd/config.bfd:1.4.24.2
--- src/gnu/dist/gdb6/bfd/config.bfd:1.4.24.1	Sun Aug 23 23:04:08 2009
+++ src/gnu/dist/gdb6/bfd/config.bfd	Thu Jan  2 17:34:42 2014
@@ -187,11 +187,11 @@ case "${targ}" in
 targ_selvecs=bfd_elf32_bigarc_vec
 ;;
 
-  armeb-*-netbsdelf*)
+  arm*eb-*-netbsdelf*)
 targ_defvec=bfd_elf32_bigarm_vec
 targ_selvecs="bfd_elf32_littlearm_vec armnetbsd_vec"
 ;;
-  arm-*-netbsdelf*)
+  arm*-*-netbsdelf*)
 targ_defvec=bfd_elf32_littlearm_vec
 targ_selvecs="bfd_elf32_bigarm_vec armnetbsd_vec"
 ;;



CVS commit: [matt-nb5-mips64] src/usr.bin/ldd

2013-12-18 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Dec 19 01:26:38 UTC 2013

Modified Files:
src/usr.bin/ldd [matt-nb5-mips64]: Makefile.common

Log Message:
Match any arm


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.2.4.1 -r1.1.2.2.4.2 src/usr.bin/ldd/Makefile.common

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

Modified files:

Index: src/usr.bin/ldd/Makefile.common
diff -u src/usr.bin/ldd/Makefile.common:1.1.2.2.4.1 src/usr.bin/ldd/Makefile.common:1.1.2.2.4.2
--- src/usr.bin/ldd/Makefile.common:1.1.2.2.4.1	Fri Feb 17 07:43:45 2012
+++ src/usr.bin/ldd/Makefile.common	Thu Dec 19 01:26:37 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.common,v 1.1.2.2.4.1 2012/02/17 07:43:45 matt Exp $
+#	$NetBSD: Makefile.common,v 1.1.2.2.4.2 2013/12/19 01:26:37 matt Exp $
 
 LDELFSO=${NETBSDSRCDIR}/libexec/ld.elf_so
 CPPFLAGS+= -I${LDELFSO} -DLIBDIR=\"${LIBDIR}\"
@@ -7,7 +7,7 @@ CPPFLAGS+= -D_RTLD_SOURCE
 .PATH: ${LDELFSO}
 
 .if (${MACHINE_ARCH} == "sparc") || (${MACHINE_ARCH} == "sparc64") || \
-(${MACHINE_ARCH} == "arm") || (${MACHINE_ARCH} == "m68k") || \
+(${MACHINE_ARCH:M*arm*} != "") || (${MACHINE_ARCH} == "m68k") || \
 (${MACHINE_ARCH} == "powerpc") || (${MACHINE_ARCH:Mmips*} != "")
 CPPFLAGS+= -DVARPSZ
 .endif



CVS commit: [matt-nb5-mips64] src/sys/uvm

2013-12-18 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Dec 19 01:22:02 UTC 2013

Modified Files:
src/sys/uvm [matt-nb5-mips64]: uvm_pglist.h

Log Message:
error out if VM_NFREELIST isn't defined


To generate a diff of this commit:
cvs rdiff -u -r1.7.16.5 -r1.7.16.6 src/sys/uvm/uvm_pglist.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/uvm/uvm_pglist.h
diff -u src/sys/uvm/uvm_pglist.h:1.7.16.5 src/sys/uvm/uvm_pglist.h:1.7.16.6
--- src/sys/uvm/uvm_pglist.h:1.7.16.5	Thu Feb 16 04:20:46 2012
+++ src/sys/uvm/uvm_pglist.h	Thu Dec 19 01:22:02 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_pglist.h,v 1.7.16.5 2012/02/16 04:20:46 matt Exp $	*/
+/*	$NetBSD: uvm_pglist.h,v 1.7.16.6 2013/12/19 01:22:02 matt Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -34,6 +34,9 @@
 
 #ifndef VM_NFREELIST
 #include 
+#ifndef VM_NFREELIST
+#error  did not define VM_NFREELIST
+#endif
 #endif
 
 /*



CVS commit: [matt-nb5-mips64] src/sys

2013-12-18 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Dec 19 01:20:41 UTC 2013

Modified Files:
src/sys/rump/librump/rumpkern [matt-nb5-mips64]: vm.c
src/sys/ufs/lfs [matt-nb5-mips64]: lfs_bio.c

Log Message:
Adapt to new uvm_estimatepageable arguments


To generate a diff of this commit:
cvs rdiff -u -r1.41.8.2 -r1.41.8.3 src/sys/rump/librump/rumpkern/vm.c
cvs rdiff -u -r1.114 -r1.114.18.1 src/sys/ufs/lfs/lfs_bio.c

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

Modified files:

Index: src/sys/rump/librump/rumpkern/vm.c
diff -u src/sys/rump/librump/rumpkern/vm.c:1.41.8.2 src/sys/rump/librump/rumpkern/vm.c:1.41.8.3
--- src/sys/rump/librump/rumpkern/vm.c:1.41.8.2	Fri Feb 10 06:00:55 2012
+++ src/sys/rump/librump/rumpkern/vm.c	Thu Dec 19 01:20:41 2013
@@ -519,7 +519,8 @@ uvm_page_unbusy(struct vm_page **pgs, in
 }
 
 void
-uvm_estimatepageable(u_int *active, u_int *inactive)
+uvm_estimatepageable(const struct uvm_pggroup *pg,
+u_int *active, u_int *inactive)
 {
 
 	/* XXX: guessing game */

Index: src/sys/ufs/lfs/lfs_bio.c
diff -u src/sys/ufs/lfs/lfs_bio.c:1.114 src/sys/ufs/lfs/lfs_bio.c:1.114.18.1
--- src/sys/ufs/lfs/lfs_bio.c:1.114	Tue May  6 18:43:45 2008
+++ src/sys/ufs/lfs/lfs_bio.c	Thu Dec 19 01:20:41 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: lfs_bio.c,v 1.114 2008/05/06 18:43:45 ad Exp $	*/
+/*	$NetBSD: lfs_bio.c,v 1.114.18.1 2013/12/19 01:20:41 matt Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003, 2008 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: lfs_bio.c,v 1.114 2008/05/06 18:43:45 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_bio.c,v 1.114.18.1 2013/12/19 01:20:41 matt Exp $");
 
 #include 
 #include 
@@ -842,7 +842,7 @@ lfs_wait_pages(void)
 {
 	int active, inactive;
 
-	uvm_estimatepageable(&active, &inactive);
+	uvm_estimatepageable(NULL, &active, &inactive);
 	return LFS_WAIT_RESOURCE(active + inactive + uvmexp.free, 1);
 }
 
@@ -851,6 +851,6 @@ lfs_max_pages(void)
 {
 	int active, inactive;
 
-	uvm_estimatepageable(&active, &inactive);
+	uvm_estimatepageable(NULL, &active, &inactive);
 	return LFS_MAX_RESOURCE(active + inactive + uvmexp.free, 1);
 }



CVS commit: [matt-nb5-mips64] src/sys/lkm/arch/arm

2013-12-18 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Dec 19 01:19:26 UTC 2013

Modified Files:
src/sys/lkm/arch/arm [matt-nb5-mips64]: lkmtramp.awk lkmwrap.awk

Log Message:
Update to use -Wl and change \. to just .


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.90.1 src/sys/lkm/arch/arm/lkmtramp.awk \
src/sys/lkm/arch/arm/lkmwrap.awk

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

Modified files:

Index: src/sys/lkm/arch/arm/lkmtramp.awk
diff -u src/sys/lkm/arch/arm/lkmtramp.awk:1.2 src/sys/lkm/arch/arm/lkmtramp.awk:1.2.90.1
--- src/sys/lkm/arch/arm/lkmtramp.awk:1.2	Sun Dec 11 12:24:46 2005
+++ src/sys/lkm/arch/arm/lkmtramp.awk	Thu Dec 19 01:19:26 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: lkmtramp.awk,v 1.2 2005/12/11 12:24:46 christos Exp $
+#	$NetBSD: lkmtramp.awk,v 1.2.90.1 2013/12/19 01:19:26 matt Exp $
 #
 BEGIN {
 	print "#include "
@@ -7,7 +7,7 @@ BEGIN {
 $2 == "R_ARM_PC24" {
 	if (x[$3] != "")
 		next;
-	if ($3 == "\.text")
+	if ($3 == ".text")
 		next;
 	print "ENTRY(__wrap_"$3")"
 	print "\tldr\tpc,1f"
Index: src/sys/lkm/arch/arm/lkmwrap.awk
diff -u src/sys/lkm/arch/arm/lkmwrap.awk:1.2 src/sys/lkm/arch/arm/lkmwrap.awk:1.2.90.1
--- src/sys/lkm/arch/arm/lkmwrap.awk:1.2	Sun Dec 11 12:24:46 2005
+++ src/sys/lkm/arch/arm/lkmwrap.awk	Thu Dec 19 01:19:26 2013
@@ -1,10 +1,10 @@
-#	$NetBSD: lkmwrap.awk,v 1.2 2005/12/11 12:24:46 christos Exp $
+#	$NetBSD: lkmwrap.awk,v 1.2.90.1 2013/12/19 01:19:26 matt Exp $
 
 $2 == "R_ARM_PC24" {
 	if (x[$3] != "")
 		next;
-	if ($3 == "\.text")
+	if ($3 == ".text")
 		next
-	printf " --wrap "$3;
+	printf " -Wl,--wrap,"$3;
 	x[$3]=".";
 }



CVS commit: [matt-nb5-mips64] src/sys/arch/evbarm/stand/gzboot

2013-12-18 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Dec 19 01:18:44 UTC 2013

Modified Files:
src/sys/arch/evbarm/stand/gzboot [matt-nb5-mips64]: Makefile

Log Message:
Make endian check more generic


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.9.10.1 src/sys/arch/evbarm/stand/gzboot/Makefile

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/stand/gzboot/Makefile
diff -u src/sys/arch/evbarm/stand/gzboot/Makefile:1.9 src/sys/arch/evbarm/stand/gzboot/Makefile:1.9.10.1
--- src/sys/arch/evbarm/stand/gzboot/Makefile:1.9	Thu Oct 30 15:33:42 2008
+++ src/sys/arch/evbarm/stand/gzboot/Makefile	Thu Dec 19 01:18:44 2013
@@ -1,6 +1,6 @@
-#	$NetBSD: Makefile,v 1.9 2008/10/30 15:33:42 cliff Exp $
+#	$NetBSD: Makefile,v 1.9.10.1 2013/12/19 01:18:44 matt Exp $
 
-.if ${MACHINE_ARCH} == "arm"
+.if ${MACHINE_ARCH:Marm*eb} == ""
 # Little endian platforms
 SUBDIR=  ADI_BRH_flash_0x0014
 SUBDIR+=  GEMINI_dram_0x0160



CVS commit: [matt-nb5-mips64] src/sys/arch/evbarm/include

2013-12-18 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Dec 19 01:18:01 UTC 2013

Modified Files:
src/sys/arch/evbarm/include [matt-nb5-mips64]: vmparam.h

Log Message:
compat in libc needs some uvm stuff which needs VM_NFREELIST defined.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.25.18.1 src/sys/arch/evbarm/include/vmparam.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/evbarm/include/vmparam.h
diff -u src/sys/arch/evbarm/include/vmparam.h:1.25 src/sys/arch/evbarm/include/vmparam.h:1.25.18.1
--- src/sys/arch/evbarm/include/vmparam.h:1.25	Sun Apr 27 18:58:46 2008
+++ src/sys/arch/evbarm/include/vmparam.h	Thu Dec 19 01:18:01 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.25 2008/04/27 18:58:46 matt Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.25.18.1 2013/12/19 01:18:01 matt Exp $	*/
 
 /*
  * Copyright (c) 1988 The Regents of the University of California.
@@ -32,7 +32,7 @@
 #ifndef	_ARM32_VMPARAM_H_
 #define	_ARM32_VMPARAM_H_
 
-#ifdef _KERNEL
+#if defined(_KERNEL) || 1
 
 #include 
 



CVS commit: [matt-nb5-mips64] src/sys/arch/arm/include

2013-12-18 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Dec 19 01:17:06 UTC 2013

Modified Files:
src/sys/arch/arm/include [matt-nb5-mips64]: cdefs.h

Log Message:
Pull from HEAD (for post armv6 defines).


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.38.1 src/sys/arch/arm/include/cdefs.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/cdefs.h
diff -u src/sys/arch/arm/include/cdefs.h:1.3 src/sys/arch/arm/include/cdefs.h:1.3.38.1
--- src/sys/arch/arm/include/cdefs.h:1.3	Wed Oct 17 19:53:41 2007
+++ src/sys/arch/arm/include/cdefs.h	Thu Dec 19 01:17:06 2013
@@ -1,15 +1,31 @@
-/*	$NetBSD: cdefs.h,v 1.3 2007/10/17 19:53:41 garbled Exp $	*/
+/*	$NetBSD: cdefs.h,v 1.3.38.1 2013/12/19 01:17:06 matt Exp $	*/
 
-#ifndef	_MACHINE_CDEFS_H_
-#define	_MACHINE_CDEFS_H_
+#ifndef	_ARM_CDEFS_H_
+#define	_ARM_CDEFS_H_
 
-#if defined (__ARM_ARCH_6__) || defined (__ARM_ARCH_6J__)
+#if defined (__ARM_ARCH_7__) || defined (__ARM_ARCH_7A__) || \
+defined (__ARM_ARCH_7R__) || defined (__ARM_ARCH_7M__) || \
+defined (__ARM_ARCH_7EM__) /* 7R, 7M, 7EM are for non MMU arms */
+#define _ARM_ARCH_7
+#endif
+
+#if defined (_ARM_ARCH_7) || defined (__ARM_ARCH_6T2__)
+#define _ARM_ARCH_T2		/* Thumb2 */
+#endif
+
+#if defined (_ARM_ARCH_T2) || defined (__ARM_ARCH_6__) || \
+defined (__ARM_ARCH_6J__) || defined (__ARM_ARCH_6K__) || \
+defined (__ARM_ARCH_6Z__) || defined (__ARM_ARCH_6ZK__) || \
+defined (__ARM_ARCH_6ZM__)
 #define _ARM_ARCH_6
 #endif
 
-#if defined (_ARM_ARCH_6) || defined (__ARM_ARCH_5__) || \
-defined (__ARM_ARCH_5T__) || defined (__ARM_ARCH_5TE__) || \
-defined (__ARM_ARCH_5TEJ__)
+#if defined (_ARM_ARCH_6) || defined (__ARM_ARCH_5T__) || \
+defined (__ARM_ARCH_5TE__) || defined (__ARM_ARCH_5TEJ__)
+#define _ARM_ARCH_5T
+#endif
+
+#if defined (_ARM_ARCH_6) || defined (_ARM_ARCH_5T) || defined (__ARM_ARCH_5__)
 #define _ARM_ARCH_5
 #endif
 
@@ -17,4 +33,17 @@
 #define _ARM_ARCH_4T
 #endif
 
-#endif /* !_MACHINE_CDEFS_H_ */
+#if defined (_ARM_ARCH_T2) || \
+(!defined (__thumb__) && \
+ (defined (_ARM_ARCH_6) || defined (__ARM_ARCH_5TE__) || \
+  defined (__ARM_ARCH_5TEJ__)))
+#define	_ARM_ARCH_DWORD_OK
+#endif
+
+#ifdef __ARM_EABI__
+#define __ALIGNBYTES		(8 - 1)
+#else
+#define __ALIGNBYTES		(sizeof(int) - 1)
+#endif
+
+#endif /* !_ARM_CDEFS_H_ */



CVS commit: [matt-nb5-mips64] src/gnu/lib

2013-12-18 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Dec 19 01:16:13 UTC 2013

Modified Files:
src/gnu/lib/libgcc4/libgcov [matt-nb5-mips64]: Makefile
src/gnu/lib/libiberty [matt-nb5-mips64]: Makefile
src/gnu/lib/libsupc++4 [matt-nb5-mips64]: Makefile.common

Log Message:
support for armv7/armv7eb MACHINE_ARCH


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.8.1 src/gnu/lib/libgcc4/libgcov/Makefile
cvs rdiff -u -r1.10.30.1 -r1.10.30.2 src/gnu/lib/libiberty/Makefile
cvs rdiff -u -r1.1 -r1.1.32.1 src/gnu/lib/libsupc++4/Makefile.common

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

Modified files:

Index: src/gnu/lib/libgcc4/libgcov/Makefile
diff -u src/gnu/lib/libgcc4/libgcov/Makefile:1.3 src/gnu/lib/libgcc4/libgcov/Makefile:1.3.8.1
--- src/gnu/lib/libgcc4/libgcov/Makefile:1.3	Mon Oct  6 14:20:12 2008
+++ src/gnu/lib/libgcc4/libgcov/Makefile	Thu Dec 19 01:16:13 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.3 2008/10/06 14:20:12 tron Exp $
+#	$NetBSD: Makefile,v 1.3.8.1 2013/12/19 01:16:13 matt Exp $
 
 REQUIRETOOLS=	yes
 NOPIC=		# defined
@@ -8,17 +8,18 @@ NOLINT=		# defined
 LIB=		gcov
 
 .include 
+.include "../../Makefile.inc"
 
-.if exists(${.CURDIR}/arch/${MACHINE_ARCH}/defs.mk) && ${MKGCC} != "no"
+.if exists(${.CURDIR}/arch/${GCC_MACHINE_ARCH}/defs.mk) && ${MKGCC} != "no"
 
-.include "${.CURDIR}/arch/${MACHINE_ARCH}/defs.mk"
+.include "${.CURDIR}/arch/${GCC_MACHINE_ARCH}/defs.mk"
 
 LIBGCOVSRCS=	${G_LIBGCOV:=.c}
 
-CPPFLAGS+=	-I${.CURDIR}/arch/${MACHINE_ARCH}
+CPPFLAGS+=	-I${.CURDIR}/arch/${GCC_MACHINE_ARCH}
 CPPFLAGS+=	-Wno-stack-protector
 
-DPSRCS+=	${.CURDIR}/arch/${MACHINE_ARCH}/defs.mk
+DPSRCS+=	${.CURDIR}/arch/${GCC_MACHINE_ARCH}/defs.mk
 SRCS+=		${LIBGCOVSRCS}
 
 CLEANFILES+=	${LIBGCOVSRCS}

Index: src/gnu/lib/libiberty/Makefile
diff -u src/gnu/lib/libiberty/Makefile:1.10.30.1 src/gnu/lib/libiberty/Makefile:1.10.30.2
--- src/gnu/lib/libiberty/Makefile:1.10.30.1	Wed Dec 18 18:41:39 2013
+++ src/gnu/lib/libiberty/Makefile	Thu Dec 19 01:16:13 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.10.30.1 2013/12/18 18:41:39 matt Exp $
+#	$NetBSD: Makefile,v 1.10.30.2 2013/12/19 01:16:13 matt Exp $
 
 NOLINT=		# defined
 NOPROFILE=	# defined
@@ -6,10 +6,11 @@ NOPIC=		# defined
 NOLINKLIB=	# defined
 
 .include 
+.include "../Makefile.inc"
 
 LIB=		iberty
 
-.include "${.CURDIR}/arch/${MACHINE_ARCH:S/armv7/arm/}/defs.mk"
+.include "${.CURDIR}/arch/${GCC_MACHINE_ARCH}/defs.mk"
 
 COPTS.argv.c = -Wno-stack-protector
 COPTS.cp-demangle.c = -Wno-stack-protector
@@ -21,7 +22,7 @@ DIST=		${NETBSDSRCDIR}/gnu/dist/binutils
 SRCS=		${G_REQUIRED_OFILES:.o=.c} ${G_EXTRA_OFILES:.o=.c} \
 		${G_LIBOBJS:.o=.c} ${G_ALLOCA:.o=.c}
 
-CPPFLAGS+=	-DHAVE_CONFIG_H -I${.CURDIR}/arch/${MACHINE_ARCH} \
+CPPFLAGS+=	-DHAVE_CONFIG_H -I${.CURDIR}/arch/${GCC_MACHINE_ARCH} \
 		-I${DIST}/include
 
 .PATH: ${DIST}/libiberty

Index: src/gnu/lib/libsupc++4/Makefile.common
diff -u src/gnu/lib/libsupc++4/Makefile.common:1.1 src/gnu/lib/libsupc++4/Makefile.common:1.1.32.1
--- src/gnu/lib/libsupc++4/Makefile.common:1.1	Wed May 10 22:53:51 2006
+++ src/gnu/lib/libsupc++4/Makefile.common	Thu Dec 19 01:16:13 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.common,v 1.1 2006/05/10 22:53:51 mrg Exp $
+#	$NetBSD: Makefile.common,v 1.1.32.1 2013/12/19 01:16:13 matt Exp $
 
 DIST=		${NETBSDSRCDIR}/gnu/dist/gcc4
 GNUHOSTDIST=	${DIST}
@@ -10,7 +10,7 @@ LIBSUPCXXSRCS=	${G_LIBSUPCXX_SOURCES} ${
 CPPFLAGS+=	-I${DIST}/gcc
 CPPFLAGS+=	-I${DIST}/include
 CPPFLAGS+=	-I${DIST}/libstdc++-v3/libsupc++
-CPPFLAGS+=	-I${.CURDIR}/../libstdc++-v3_4/arch/${MACHINE_ARCH} -I.
+CPPFLAGS+=	-I${.CURDIR}/../libstdc++-v3_4/arch/${GCC_MACHINE_ARCH} -I.
 CPPFLAGS+=	-DHAVE_STDLIB_H -DHAVE_STRING_H
 
 CPPFLAGS.cp-demangle.c=-DIN_GLIBCPP_V3



CVS commit: [matt-nb5-mips64] src/etc

2013-12-18 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Dec 19 01:15:09 UTC 2013

Modified Files:
src/etc [matt-nb5-mips64]: MAKEDEV.awk Makefile
src/etc/mtree [matt-nb5-mips64]: Makefile NetBSD.dist
Added Files:
src/etc/mtree [matt-nb5-mips64]: NetBSD.dist.mips64eb
NetBSD.dist.mips64el

Log Message:
Deal with MACHINE_ARCH of armv7/armv7eb.
Split out mips64 compat dirs.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.20.10.1 src/etc/MAKEDEV.awk
cvs rdiff -u -r1.359.2.3.4.2 -r1.359.2.3.4.3 src/etc/Makefile
cvs rdiff -u -r1.5 -r1.5.40.1 src/etc/mtree/Makefile
cvs rdiff -u -r1.385.2.1.4.2 -r1.385.2.1.4.3 src/etc/mtree/NetBSD.dist
cvs rdiff -u -r0 -r1.7.2.2 src/etc/mtree/NetBSD.dist.mips64eb
cvs rdiff -u -r0 -r1.8.2.2 src/etc/mtree/NetBSD.dist.mips64el

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

Modified files:

Index: src/etc/MAKEDEV.awk
diff -u src/etc/MAKEDEV.awk:1.20 src/etc/MAKEDEV.awk:1.20.10.1
--- src/etc/MAKEDEV.awk:1.20	Wed Apr 30 13:10:49 2008
+++ src/etc/MAKEDEV.awk	Thu Dec 19 01:15:09 2013
@@ -1,6 +1,6 @@
 #!/usr/bin/awk -
 #
-#	$NetBSD: MAKEDEV.awk,v 1.20 2008/04/30 13:10:49 martin Exp $
+#	$NetBSD: MAKEDEV.awk,v 1.20.10.1 2013/12/19 01:15:09 matt Exp $
 #
 # Copyright (c) 2003 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -55,7 +55,7 @@ BEGIN {
 
 	# file with major definitions
 	majors[0] = "conf/majors"
-	if ((maarch == "arm" || maarch == "armeb") && system("test -f '" top "arch/" machine "/conf/majors." machine "'") != 0)
+	if ((maarch == "arm" || maarch == "armeb" || maarch == "armv7" || maarch == "armv7eb") && system("test -f '" top "arch/" machine "/conf/majors." machine "'") != 0)
 		majors[1] = "arch/arm/conf/majors.arm32";
 	else if (machine == "sbmips")
 		majors[1] = "arch/evbmips/conf/majors.evbmips";
@@ -211,7 +211,7 @@ BEGIN {
 	print "# Generated from:"
 
 	# MAKEDEV.awk (this script) RCS Id
-	ARCSID = "$NetBSD: MAKEDEV.awk,v 1.20 2008/04/30 13:10:49 martin Exp $"
+	ARCSID = "$NetBSD: MAKEDEV.awk,v 1.20.10.1 2013/12/19 01:15:09 matt Exp $"
 	gsub(/\$/, "", ARCSID)
 	print "#	" ARCSID
 	

Index: src/etc/Makefile
diff -u src/etc/Makefile:1.359.2.3.4.2 src/etc/Makefile:1.359.2.3.4.3
--- src/etc/Makefile:1.359.2.3.4.2	Wed Apr 21 05:21:22 2010
+++ src/etc/Makefile	Thu Dec 19 01:15:09 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.359.2.3.4.2 2010/04/21 05:21:22 matt Exp $
+#	$NetBSD: Makefile,v 1.359.2.3.4.3 2013/12/19 01:15:09 matt Exp $
 #	from: @(#)Makefile	8.7 (Berkeley) 5/25/95
 
 # Environment variables without default values:
@@ -401,12 +401,21 @@ distrib-dirs: .PHONY check_DESTDIR
 # XXX: It would be nice if a single mtree invocation could both
 # append to the metalog and do real work.  Instead, we have to
 # repeat the command twice in slightly different ways.
-	${TOOL_MTREE} -def ${.CURDIR}/mtree/NetBSD.dist -N ${.CURDIR} \
-	-p ${DESTDIR}/ -U ${TOOL_MTREE.unpriv}
+	${TOOL_MTREE} -def ${.CURDIR}/mtree/NetBSD.dist \
+	-N ${.CURDIR} -p ${DESTDIR}/ -U ${TOOL_MTREE.unpriv}
+.if exists(${.CURDIR}/mtree/NetBSD.dist.${MACHINE_ARCH})
+	${TOOL_MTREE} -def ${.CURDIR}/mtree/NetBSD.dist.${MACHINE_ARCH} \
+	-N ${.CURDIR} -p ${DESTDIR}/ -U ${TOOL_MTREE.unpriv}
+.endif
 .if ${MKUNPRIVED} != "no"		# {
-	${TOOL_MTREE} -def ${.CURDIR}/mtree/NetBSD.dist -N ${.CURDIR} \
-	-p ${DESTDIR}/ -C -k all | \
+	${TOOL_MTREE} -def ${.CURDIR}/mtree/NetBSD.dist \
+	-N ${.CURDIR} -p ${DESTDIR}/ -C -k all | \
+	${TOOL_AWK} '/ optional/ {next} // {print}' | ${METALOG.add}
+.if exists(${.CURDIR}/mtree/NetBSD.dist.${MACHINE_ARCH})
+	${TOOL_MTREE} -def ${.CURDIR}/mtree/NetBSD.dist.${MACHINE_ARCH} \
+	-N ${.CURDIR} -p ${DESTDIR}/ -C -k all | \
 	${TOOL_AWK} '/ optional/ {next} // {print}' | ${METALOG.add}
+.endif
 .endif	# MKUNPRIVED			# }
 .endif	# DISTRIBUTION_DONE		# }
 

Index: src/etc/mtree/Makefile
diff -u src/etc/mtree/Makefile:1.5 src/etc/mtree/Makefile:1.5.40.1
--- src/etc/mtree/Makefile:1.5	Sun May 16 09:53:09 2004
+++ src/etc/mtree/Makefile	Thu Dec 19 01:15:09 2013
@@ -1,6 +1,9 @@
-#	$NetBSD: Makefile,v 1.5 2004/05/16 09:53:09 lukem Exp $
+#	$NetBSD: Makefile,v 1.5.40.1 2013/12/19 01:15:09 matt Exp $
 
 CONFIGFILES=	NetBSD.dist special
+.if exists(${.CURDIR}/NetBSD.dist.${MACHINE_ARCH})
+CONFIGFILES+=	NetBSD.dist.${MACHINE_ARCH}
+.endif
 FILESDIR=	/etc/mtree
 
 .include 

Index: src/etc/mtree/NetBSD.dist
diff -u src/etc/mtree/NetBSD.dist:1.385.2.1.4.2 src/etc/mtree/NetBSD.dist:1.385.2.1.4.3
--- src/etc/mtree/NetBSD.dist:1.385.2.1.4.2	Wed Apr 21 05:21:23 2010
+++ src/etc/mtree/NetBSD.dist	Thu Dec 19 01:15:09 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist,v 1.385.2.1.4.2 2010/04/21 05:21:23 matt Exp $
+#	$NetBSD: NetBSD.dist,v 1.385.2.1.4.3 2013/12/19 01:15:09 matt Exp $
 #	@(#)4.4BSD.dist	8.1 (Berkeley) 6/13/93
 
 # Do not customize this file as it may be overwritten on upgrades.
@@ -511,12 +511,6 @@
 ./usr/include/ufs/ufs
 ./usr/incl

CVS commit: [matt-nb5-mips64] src/distrib/sets/lists

2013-12-18 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Dec 19 01:14:12 UTC 2013

Added Files:
src/distrib/sets/lists/base [matt-nb5-mips64]: ad.armv7eb
md.evbarm.armv7eb rescue.ad.armv7eb
src/distrib/sets/lists/comp [matt-nb5-mips64]: ad.armv7eb

Log Message:
set changes for armv7eb (similar to armeb)


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1.2.1 src/distrib/sets/lists/base/ad.armv7eb \
src/distrib/sets/lists/base/md.evbarm.armv7eb \
src/distrib/sets/lists/base/rescue.ad.armv7eb
cvs rdiff -u -r0 -r1.1.2.1 src/distrib/sets/lists/comp/ad.armv7eb

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

Added files:

Index: src/distrib/sets/lists/base/ad.armv7eb
diff -u /dev/null src/distrib/sets/lists/base/ad.armv7eb:1.1.2.1
--- /dev/null	Thu Dec 19 01:14:12 2013
+++ src/distrib/sets/lists/base/ad.armv7eb	Thu Dec 19 01:14:11 2013
@@ -0,0 +1,11 @@
+# $NetBSD: ad.armv7eb,v 1.1.2.1 2013/12/19 01:14:11 matt Exp $
+#
+# The armeb MACHINE_ARCH never existed in NetBSD as a.out, so we
+#	skip the old a.out compatibility tools.
+#
+./usr/lib/libarm.sobase-sys-shlib
+./usr/lib/libarm.so.0base-sys-shlib
+./usr/lib/libarm.so.0.0base-sys-shlib
+./usr/lib/libpmc.sobase-sys-shlib
+./usr/lib/libpmc.so.0base-sys-shlib
+./usr/lib/libpmc.so.0.0base-sys-shlib
Index: src/distrib/sets/lists/base/md.evbarm.armv7eb
diff -u /dev/null src/distrib/sets/lists/base/md.evbarm.armv7eb:1.1.2.1
--- /dev/null	Thu Dec 19 01:14:12 2013
+++ src/distrib/sets/lists/base/md.evbarm.armv7eb	Thu Dec 19 01:14:11 2013
@@ -0,0 +1,2 @@
+# $NetBSD: md.evbarm.armv7eb,v 1.1.2.1 2013/12/19 01:14:11 matt Exp $
+./usr/mdec/gzboot_ADI_BRH_0x0014.bin	base-sysutil-bin
Index: src/distrib/sets/lists/base/rescue.ad.armv7eb
diff -u /dev/null src/distrib/sets/lists/base/rescue.ad.armv7eb:1.1.2.1
--- /dev/null	Thu Dec 19 01:14:12 2013
+++ src/distrib/sets/lists/base/rescue.ad.armv7eb	Thu Dec 19 01:14:11 2013
@@ -0,0 +1,3 @@
+# $NetBSD: rescue.ad.armv7eb,v 1.1.2.1 2013/12/19 01:14:11 matt Exp $
+# No armeb rescue files.  DO NOT DELETE THIS EMPTY FILE!  If you
+# do, then armeb will incorrectly use the generic arm rescue files.

Index: src/distrib/sets/lists/comp/ad.armv7eb
diff -u /dev/null src/distrib/sets/lists/comp/ad.armv7eb:1.1.2.1
--- /dev/null	Thu Dec 19 01:14:12 2013
+++ src/distrib/sets/lists/comp/ad.armv7eb	Thu Dec 19 01:14:12 2013
@@ -0,0 +1,93 @@
+# $NetBSD: ad.armv7eb,v 1.1.2.1 2013/12/19 01:14:12 matt Exp $
+./usr/include/armcomp-c-include
+./usr/include/arm/ansi.h			comp-c-include
+./usr/include/arm/aout_machdep.h		comp-c-include
+./usr/include/arm/arm26comp-c-include
+./usr/include/arm/arm26/types.h			comp-c-include
+./usr/include/arm/arm32comp-c-include
+./usr/include/arm/arm32/bus.h			comp-obsolete		obsolete
+./usr/include/arm/arm32/frame.h			comp-c-include
+./usr/include/arm/arm32/katelib.h		comp-c-include
+./usr/include/arm/arm32/param.h			comp-c-include
+./usr/include/arm/arm32/pmap.h			comp-c-include
+./usr/include/arm/arm32/psl.h			comp-c-include
+./usr/include/arm/arm32/pte.h			comp-c-include
+./usr/include/arm/arm32/rtc.h			comp-c-include
+./usr/include/arm/arm32/sysarch.h		comp-obsolete		obsolete
+./usr/include/arm/arm32/types.h			comp-c-include
+./usr/include/arm/arm32/vmparam.h		comp-c-include
+./usr/include/arm/armreg.h			comp-c-include
+./usr/include/arm/asm.hcomp-c-include
+./usr/include/arm/atomic.h			comp-c-include
+./usr/include/arm/bswap.h			comp-c-include
+./usr/include/arm/bus.hcomp-c-include
+./usr/include/arm/byte_swap.h			comp-c-include
+./usr/include/arm/cdefs.h			comp-c-include
+./usr/include/arm/cpu.hcomp-c-include
+./usr/include/arm/db_machdep.h			comp-obsolete		obsolete
+./usr/include/arm/disklabel.h			comp-c-include
+./usr/include/arm/disklabel_acorn.h		comp-obsolete		obsolete
+./usr/include/arm/elf_machdep.h			comp-c-include
+./usr/include/arm/endian.h			comp-c-include
+./usr/include/arm/endian_machdep.h		comp-c-include
+./usr/include/arm/float.h			comp-c-include
+./usr/include/arm/footbridge			comp-c-include
+./usr/include/arm/footbridge/footbridge_intr.h	comp-c-include
+./usr/include/arm/fp.hcomp-c-include
+./usr/include/arm/frame.h			comp-c-include
+./usr/include/arm/ieee.h			comp-c-include
+./usr/include/arm/ieeefp.h			comp-c-include
+./usr/include/arm/int_const.h			comp-c-include
+./usr/include/arm/int_fmtio.h			comp-c-include
+./usr/include/arm/int_limits.h			comp-c-include
+./usr/include/arm/int_mwgwtypes.h		comp-c-include
+./usr/include/arm/int_types.h			comp-c-include
+./usr/include/arm/iomdcomp-obsolete		obsolete
+./usr/include/arm/iomd/vidc.h			comp-obsolete		obsolete
+./usr/include/arm/ipkdb.h			comp-obsolete		obsolete
+./usr/include/arm/kcore.h			comp-c-include
+./usr/include/arm/limits.h			comp-c-include
+./usr/include/arm/lock.h			comp-c-include
+./usr/include/arm/math.h			comp-c-include
+./usr/include/arm/mcontext.h			comp-c-include
+./

CVS commit: [matt-nb5-mips64] src/common/lib/libc/arch/arm/atomic

2013-12-18 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Dec 19 01:12:39 UTC 2013

Modified Files:
src/common/lib/libc/arch/arm/atomic [matt-nb5-mips64]: Makefile.inc
atomic_cas_32.S

Log Message:
Enable ldrex/strex based atomic ops on armv6/armv7


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.7.8.1 src/common/lib/libc/arch/arm/atomic/Makefile.inc
cvs rdiff -u -r1.2 -r1.2.12.1 \
src/common/lib/libc/arch/arm/atomic/atomic_cas_32.S

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

Modified files:

Index: src/common/lib/libc/arch/arm/atomic/Makefile.inc
diff -u src/common/lib/libc/arch/arm/atomic/Makefile.inc:1.7 src/common/lib/libc/arch/arm/atomic/Makefile.inc:1.7.8.1
--- src/common/lib/libc/arch/arm/atomic/Makefile.inc:1.7	Mon Sep 29 08:43:00 2008
+++ src/common/lib/libc/arch/arm/atomic/Makefile.inc	Thu Dec 19 01:12:39 2013
@@ -1,18 +1,37 @@
-#	$NetBSD: Makefile.inc,v 1.7 2008/09/29 08:43:00 ad Exp $
+#	$NetBSD: Makefile.inc,v 1.7.8.1 2013/12/19 01:12:39 matt Exp $
+
+ARMV6= ${CPUFLAGS:M-march=armv7*} ${CPUFLAGS:M-mcpu=cortex*}
+ARMV6+= ${CPUFLAGS:M-march=armv6*} ${CPUFLAGS:M-mcpu=arm11*}
+ARMV6+= ${CFLAGS:M-march=armv7*:} ${CFLAGS:M-mcpu=cortex*}
+ARMV6+= ${CFLAGS:M-march=armv6*:} ${CFLAGS:M-mcpu=arm11*}
+ARMV6+= ${CPPFLAGS:M-march=armv7*:} ${CPPFLAGS:M-mcpu=cortex*}
+ARMV6+= ${CPPFLAGS:M-march=armv6*:} ${CPPFLAGS:M-mcpu=arm11*}
+
 
 .if defined(LIB) && (${LIB} == "kern" || ${LIB} == "c" || ${LIB} == "pthread")
+.if ${MACHINE_ARCH:Marmv7*} == "" && empty(ARMV6)
 
 SRCS+=	atomic_add_32_cas.c atomic_add_32_nv_cas.c atomic_and_32_cas.c \
 	atomic_and_32_nv_cas.c atomic_dec_32_cas.c atomic_dec_32_nv_cas.c \
 	atomic_inc_32_cas.c atomic_inc_32_nv_cas.c atomic_or_32_cas.c \
 	atomic_or_32_nv_cas.c atomic_swap_32_cas.c membar_ops_nop.c
 
+.else
+SRCS+=	atomic_add_32.S atomic_and_32.S atomic_cas_32.S
+SRCS+=	atomic_dec_32.S atomic_inc_32.S atomic_or_32.S
+SRCS+=	atomic_swap.S membar_ops.S
+.endif
 .endif
 
 .if defined(LIB) && (${LIB} == "c" || ${LIB} == "pthread")
 
+.if ${MACHINE_ARCH:Marmv7*} == "" && empty(ARMV6)
 SRCS+=	atomic_init_testset.c
 SRCS+=	atomic_cas_up.S
 CPPFLAGS+= -D__HAVE_ASM_ATOMIC_CAS_UP
+.else
+SRCS+=	atomic_init_cas.c
+
+.endif
 
 .endif

Index: src/common/lib/libc/arch/arm/atomic/atomic_cas_32.S
diff -u src/common/lib/libc/arch/arm/atomic/atomic_cas_32.S:1.2 src/common/lib/libc/arch/arm/atomic/atomic_cas_32.S:1.2.12.1
--- src/common/lib/libc/arch/arm/atomic/atomic_cas_32.S:1.2	Sat Aug 16 07:12:39 2008
+++ src/common/lib/libc/arch/arm/atomic/atomic_cas_32.S	Thu Dec 19 01:12:39 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: atomic_cas_32.S,v 1.2 2008/08/16 07:12:39 matt Exp $	*/
+/*	$NetBSD: atomic_cas_32.S,v 1.2.12.1 2013/12/19 01:12:39 matt Exp $	*/
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -48,11 +48,20 @@ ENTRY_NP(_atomic_cas_32)
 	END(_atomic_cas_32)
 
 ATOMIC_OP_ALIAS(atomic_cas_32,_atomic_cas_32)
+ATOMIC_OP_ALIAS(atomic_cas_32_ni,_atomic_cas_32)
 ATOMIC_OP_ALIAS(atomic_cas_uint,_atomic_cas_32)
+ATOMIC_OP_ALIAS(atomic_cas_uint_ni,_atomic_cas_32)
 ATOMIC_OP_ALIAS(atomic_cas_ulong,_atomic_cas_32)
+ATOMIC_OP_ALIAS(atomic_cas_ulong_ni,_atomic_cas_32)
 ATOMIC_OP_ALIAS(atomic_cas_ptr,_atomic_cas_32)
+ATOMIC_OP_ALIAS(atomic_cas_ptr_ni,_atomic_cas_32)
+STRONG_ALIAS(__sync_val_compare_and_swap_4,_atomic_cas_32)
+STRONG_ALIAS(_atomic_cas_32_ni,_atomic_cas_32)
 STRONG_ALIAS(_atomic_cas_uint,_atomic_cas_32)
+STRONG_ALIAS(_atomic_cas_uint_ni,_atomic_cas_32)
 STRONG_ALIAS(_atomic_cas_ulong,_atomic_cas_32)
+STRONG_ALIAS(_atomic_cas_ulong_ni,_atomic_cas_32)
 STRONG_ALIAS(_atomic_cas_ptr,_atomic_cas_32)
+STRONG_ALIAS(_atomic_cas_ptr_ni,_atomic_cas_32)
 
 #endif /* _ARCH_ARM_6 */



CVS commit: [matt-nb5-mips64] src/distrib/evbarm

2013-12-18 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Dec 19 01:13:27 UTC 2013

Modified Files:
src/distrib/evbarm [matt-nb5-mips64]: Makefile
src/distrib/evbarm/instkernel/instkernel [matt-nb5-mips64]: Makefile

Log Message:
adapt for evbarmv7


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.8.26.1 src/distrib/evbarm/Makefile
cvs rdiff -u -r1.13.26.1 -r1.13.26.1.4.1 \
src/distrib/evbarm/instkernel/instkernel/Makefile

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

Modified files:

Index: src/distrib/evbarm/Makefile
diff -u src/distrib/evbarm/Makefile:1.8 src/distrib/evbarm/Makefile:1.8.26.1
--- src/distrib/evbarm/Makefile:1.8	Tue Mar  6 21:56:58 2007
+++ src/distrib/evbarm/Makefile	Thu Dec 19 01:13:27 2013
@@ -1,11 +1,16 @@
-#	$NetBSD: Makefile,v 1.8 2007/03/06 21:56:58 bouyer Exp $
+#	$NetBSD: Makefile,v 1.8.26.1 2013/12/19 01:13:27 matt Exp $
 
 .include 
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
 
-SUBDIR=		gzboot instkernel cdroms
+SUBDIR=
+.if ${MACHINE_ARCH:Marmv7*} == ""
+SUBDIR+=	gzboot
+.endif
+SUBDIR+=	instkernel cdroms
 TARGETS+=	release
 
+
 iso_image:
 	${MAKEDIRTARGET} cdroms iso_image
 

Index: src/distrib/evbarm/instkernel/instkernel/Makefile
diff -u src/distrib/evbarm/instkernel/instkernel/Makefile:1.13.26.1 src/distrib/evbarm/instkernel/instkernel/Makefile:1.13.26.1.4.1
--- src/distrib/evbarm/instkernel/instkernel/Makefile:1.13.26.1	Sat Nov  1 19:44:25 2008
+++ src/distrib/evbarm/instkernel/instkernel/Makefile	Thu Dec 19 01:13:27 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.13.26.1 2008/11/01 19:44:25 snj Exp $
+#	$NetBSD: Makefile,v 1.13.26.1.4.1 2013/12/19 01:13:27 matt Exp $
 
 .include 
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
@@ -17,6 +17,9 @@ MDSETTARGETS=		ADI_BRH_INSTALL		${RAMDIS
 			IQ80321_INSTALL		${RAMDISK}	-	\
 			TS7200_INSTALL		${RAMDISK}	- 	\
 			TEAMASA_NPWR_INSTALL	${RAMDISK}	-
+.elif ${MACHINE_ARCH:Marmv7*} != ""
+MDSETTARGETS=		BCM5301X_INSTALL	${RAMDISK}	- 	\
+			BCM56340_INSTALL	${RAMDISK}	-
 .else
 # Big endian platforms.
 MDSETTARGETS=		ADI_BRH_INSTALL		${RAMDISK}	-



CVS commit: [matt-nb5-mips64] src/gnu

2013-12-18 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 18 18:43:30 UTC 2013

Modified Files:
src/gnu/usr.bin/binutils [matt-nb5-mips64]: Makefile Makefile.inc
src/gnu/usr.bin/binutils/common [matt-nb5-mips64]: Makefile
Makefile.inc Makefile.prog
src/gnu/usr.bin/binutils/gas [matt-nb5-mips64]: Makefile
src/gnu/usr.bin/binutils/gprof [matt-nb5-mips64]: Makefile
src/gnu/usr.bin/binutils/ld [matt-nb5-mips64]: Makefile
src/gnu/usr.bin/gdb6 [matt-nb5-mips64]: Makefile.inc
src/gnu/usr.bin/gdb6/bfd [matt-nb5-mips64]: Makefile
src/gnu/usr.bin/gdb6/gdb [matt-nb5-mips64]: Makefile
src/gnu/usr.bin/gdb6/gdbtui [matt-nb5-mips64]: Makefile
src/gnu/usr.bin/gdb6/libgdb [matt-nb5-mips64]: Makefile
src/gnu/usr.bin/gdb6/libiberty [matt-nb5-mips64]: Makefile
src/gnu/usr.bin/gdb6/opcodes [matt-nb5-mips64]: Makefile
src/gnu/usr.bin/gdb6/readline [matt-nb5-mips64]: Makefile
src/gnu/usr.bin/gdb6/sim [matt-nb5-mips64]: Makefile
src/gnu/usr.sbin/dbsym [matt-nb5-mips64]: Makefile
src/gnu/usr.sbin/mdsetimage [matt-nb5-mips64]: Makefile

Log Message:
Treat MACHINE_ARCH of armv7/armv7eb as arm/armeb


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.22.44.1 src/gnu/usr.bin/binutils/Makefile
cvs rdiff -u -r1.14 -r1.14.38.1 src/gnu/usr.bin/binutils/Makefile.inc
cvs rdiff -u -r1.16.44.1 -r1.16.44.2 src/gnu/usr.bin/binutils/common/Makefile
cvs rdiff -u -r1.2 -r1.2.44.1 src/gnu/usr.bin/binutils/common/Makefile.inc
cvs rdiff -u -r1.8 -r1.8.30.1 src/gnu/usr.bin/binutils/common/Makefile.prog
cvs rdiff -u -r1.8 -r1.8.30.1 src/gnu/usr.bin/binutils/gas/Makefile
cvs rdiff -u -r1.5 -r1.5.44.1 src/gnu/usr.bin/binutils/gprof/Makefile
cvs rdiff -u -r1.27.2.3.4.1 -r1.27.2.3.4.2 \
src/gnu/usr.bin/binutils/ld/Makefile
cvs rdiff -u -r1.1 -r1.1.32.1 src/gnu/usr.bin/gdb6/Makefile.inc
cvs rdiff -u -r1.4 -r1.4.8.1 src/gnu/usr.bin/gdb6/bfd/Makefile
cvs rdiff -u -r1.7 -r1.7.24.1 src/gnu/usr.bin/gdb6/gdb/Makefile
cvs rdiff -u -r1.3 -r1.3.24.1 src/gnu/usr.bin/gdb6/gdbtui/Makefile
cvs rdiff -u -r1.8 -r1.8.12.1 src/gnu/usr.bin/gdb6/libgdb/Makefile
cvs rdiff -u -r1.5 -r1.5.12.1 src/gnu/usr.bin/gdb6/libiberty/Makefile
cvs rdiff -u -r1.3 -r1.3.12.1 src/gnu/usr.bin/gdb6/opcodes/Makefile
cvs rdiff -u -r1.3 -r1.3.12.1 src/gnu/usr.bin/gdb6/readline/Makefile
cvs rdiff -u -r1.3 -r1.3.30.1 src/gnu/usr.bin/gdb6/sim/Makefile
cvs rdiff -u -r1.13 -r1.13.44.1 src/gnu/usr.sbin/dbsym/Makefile
cvs rdiff -u -r1.19 -r1.19.16.1 src/gnu/usr.sbin/mdsetimage/Makefile

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

Modified files:

Index: src/gnu/usr.bin/binutils/Makefile
diff -u src/gnu/usr.bin/binutils/Makefile:1.22 src/gnu/usr.bin/binutils/Makefile:1.22.44.1
--- src/gnu/usr.bin/binutils/Makefile:1.22	Thu Dec  4 09:29:33 2003
+++ src/gnu/usr.bin/binutils/Makefile	Wed Dec 18 18:43:29 2013
@@ -1,9 +1,10 @@
-#	$NetBSD: Makefile,v 1.22 2003/12/04 09:29:33 mrg Exp $
+#	$NetBSD: Makefile,v 1.22.44.1 2013/12/18 18:43:29 matt Exp $
 
 .include 
+.include "Makefile.inc"
 
-.if ${MKBFD} != "no" && exists(${.CURDIR}/common/arch/${MACHINE_ARCH}/defs.mk)
-.include "${.CURDIR}/common/arch/${MACHINE_ARCH}/defs.mk"
+.if ${MKBFD} != "no" && exists(${.CURDIR}/common/arch/${BFD_MACHINE_ARCH}/defs.mk)
+.include "${.CURDIR}/common/arch/${BFD_MACHINE_ARCH}/defs.mk"
 
 #SUBDIR=		libopcodes libbfd libiberty .WAIT
 

Index: src/gnu/usr.bin/binutils/Makefile.inc
diff -u src/gnu/usr.bin/binutils/Makefile.inc:1.14 src/gnu/usr.bin/binutils/Makefile.inc:1.14.38.1
--- src/gnu/usr.bin/binutils/Makefile.inc:1.14	Sun Dec 12 12:43:05 2004
+++ src/gnu/usr.bin/binutils/Makefile.inc	Wed Dec 18 18:43:29 2013
@@ -1,14 +1,16 @@
-#	$NetBSD: Makefile.inc,v 1.14 2004/12/12 12:43:05 mrg Exp $
+#	$NetBSD: Makefile.inc,v 1.14.38.1 2013/12/18 18:43:29 matt Exp $
 
 .if !defined(__MAKEFILE_INC_INCLUDED__)
 __MAKEFILE_INC_INCLUDED__=1
 
 .include 
 
+BFD_MACHINE_ARCH?=${MACHINE_ARCH:S/armv7/arm/}
+
 GNUHOSTDIST=	${DIST}
 GNUCPPFLAGS=	${G_DEFS} ${G_INCLUDES}
 CPPFLAGS+=	${GNUCPPFLAGS:M-D*:N-DLOCALEDIR*} ${GNUCPPFLAGS:M-I*:N-I.*} \
-		-I${TOP}/${BFDSUBDIR}/libbfd/arch/${MACHINE_ARCH} \
+		-I${TOP}/${BFDSUBDIR}/libbfd/arch/${BFD_MACHINE_ARCH} \
 		-I${DIST}/include -I${DIST}/bfd -I${DIST}/binutils \
 		-DLOCALEDIR=\"${LOCALEDIR}\"
 

Index: src/gnu/usr.bin/binutils/common/Makefile
diff -u src/gnu/usr.bin/binutils/common/Makefile:1.16.44.1 src/gnu/usr.bin/binutils/common/Makefile:1.16.44.2
--- src/gnu/usr.bin/binutils/common/Makefile:1.16.44.1	Wed Apr 21 05:25:48 2010
+++ src/gnu/usr.bin/binutils/common/Makefile	Wed Dec 18 18:43:29 2013
@@ -1,11 +1,11 @@
-#	$NetBSD: Makefile,v 1.16.44.1 2010/04/21 05:25:48 matt Exp $
+#	$NetBSD: Makefile,v 1.16.44.2 2013/12/18 18:43:29 matt Exp $
 
 .include 
 
 TOP=		${NETBSDSRCDIR}/gnu
 
-.include "${.CURDIR}/arch/${MACHINE_ARCH}/defs.mk"
 .include "${.CURDIR}/../common/Makefile.in

CVS commit: [matt-nb5-mips64] src/gnu/lib

2013-12-18 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 18 18:41:40 UTC 2013

Modified Files:
src/gnu/lib/crtstuff4 [matt-nb5-mips64]: Makefile
src/gnu/lib/libbfd [matt-nb5-mips64]: Makefile
src/gnu/lib/libgcc4 [matt-nb5-mips64]: Makefile.inc
src/gnu/lib/libiberty [matt-nb5-mips64]: Makefile
src/gnu/lib/libobjc4 [matt-nb5-mips64]: Makefile
src/gnu/lib/libopcodes [matt-nb5-mips64]: Makefile
src/gnu/lib/libstdc++-v3_4 [matt-nb5-mips64]: Makefile
src/gnu/lib/libstdc++-v3_4/include [matt-nb5-mips64]: Makefile
src/gnu/lib/libstdc++-v3_4/include/backward [matt-nb5-mips64]: Makefile
src/gnu/lib/libstdc++-v3_4/include/bits [matt-nb5-mips64]: Makefile
src/gnu/lib/libstdc++-v3_4/include/debug [matt-nb5-mips64]: Makefile
src/gnu/lib/libstdc++-v3_4/include/ext [matt-nb5-mips64]: Makefile
src/gnu/lib/libstdc++-v3_4/include/tr1 [matt-nb5-mips64]: Makefile
src/gnu/lib/libsupc++4 [matt-nb5-mips64]: Makefile
Added Files:
src/gnu/lib [matt-nb5-mips64]: Makefile.inc

Log Message:
Treat MACHINE_ARCH of armv7/armv7eb as arm/armeb


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1.2.1 src/gnu/lib/Makefile.inc
cvs rdiff -u -r1.3.10.1 -r1.3.10.2 src/gnu/lib/crtstuff4/Makefile
cvs rdiff -u -r1.45 -r1.45.6.1 src/gnu/lib/libbfd/Makefile
cvs rdiff -u -r1.13.10.1 -r1.13.10.2 src/gnu/lib/libgcc4/Makefile.inc
cvs rdiff -u -r1.10 -r1.10.30.1 src/gnu/lib/libiberty/Makefile
cvs rdiff -u -r1.11 -r1.11.6.1 src/gnu/lib/libobjc4/Makefile
cvs rdiff -u -r1.5 -r1.5.6.1 src/gnu/lib/libopcodes/Makefile
cvs rdiff -u -r1.3 -r1.3.28.1 src/gnu/lib/libstdc++-v3_4/Makefile
cvs rdiff -u -r1.1 -r1.1.32.1 src/gnu/lib/libstdc++-v3_4/include/Makefile
cvs rdiff -u -r1.1 -r1.1.32.1 \
src/gnu/lib/libstdc++-v3_4/include/backward/Makefile
cvs rdiff -u -r1.1 -r1.1.32.1 \
src/gnu/lib/libstdc++-v3_4/include/bits/Makefile
cvs rdiff -u -r1.1 -r1.1.32.1 \
src/gnu/lib/libstdc++-v3_4/include/debug/Makefile
cvs rdiff -u -r1.1 -r1.1.32.1 src/gnu/lib/libstdc++-v3_4/include/ext/Makefile
cvs rdiff -u -r1.1 -r1.1.32.1 src/gnu/lib/libstdc++-v3_4/include/tr1/Makefile
cvs rdiff -u -r1.2 -r1.2.28.1 src/gnu/lib/libsupc++4/Makefile

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

Modified files:

Index: src/gnu/lib/crtstuff4/Makefile
diff -u src/gnu/lib/crtstuff4/Makefile:1.3.10.1 src/gnu/lib/crtstuff4/Makefile:1.3.10.2
--- src/gnu/lib/crtstuff4/Makefile:1.3.10.1	Tue Dec 22 04:51:26 2009
+++ src/gnu/lib/crtstuff4/Makefile	Wed Dec 18 18:41:39 2013
@@ -1,17 +1,19 @@
-#	$NetBSD: Makefile,v 1.3.10.1 2009/12/22 04:51:26 mrg Exp $
+#	$NetBSD: Makefile,v 1.3.10.2 2013/12/18 18:41:39 matt Exp $
 
 REQUIRETOOLS=	yes
 NOLINT=		# defined
 
 .include 
 
+CRT_MACHINE_ARCH?=${MACHINE_ARCH:S/armv7/arm/}
+
 # If using an external toolchain, we expect crtbegin/crtend to be
 # supplied by that toolchain's run-time support.
 .if !defined(EXTERNAL_TOOLCHAIN) && ${MKGCC} != "no" && ${OBJECT_FMT} == "ELF"
 
 DIST=		${NETBSDSRCDIR}/gnu/dist/gcc4
 GNUHOSTDIST=	${DIST}
-GCCARCH=	${NETBSDSRCDIR}/gnu/usr.bin/gcc4/arch/${MACHINE_ARCH}
+GCCARCH=	${NETBSDSRCDIR}/gnu/usr.bin/gcc4/arch/${CRT_MACHINE_ARCH}
 
 GALLCFLAGS=	${G_CRTSTUFF_CFLAGS} ${G_CRTSTUFF_T_CFLAGS}
 
@@ -20,10 +22,10 @@ CPPFLAGS+=	-I.
 
 GCFLAGS=	${GALLCFLAGS:N-D*:N-I*:N-i*:N./*}
 
-DPSRCS+=	${.CURDIR}/arch/${MACHINE_ARCH}.mk tconfig.h
+DPSRCS+=	${.CURDIR}/arch/${CRT_MACHINE_ARCH}.mk tconfig.h
 CLEANFILES+=	cs-tconfig.h tconfig.h
 
-.include "${.CURDIR}/arch/${MACHINE_ARCH}.mk"
+.include "${.CURDIR}/arch/${CRT_MACHINE_ARCH}.mk"
 
 SRCS+=		crtbegin.c crtend.c
 OBJS+=		crtbegin.o crtend.o
@@ -66,7 +68,7 @@ ${OBJS}: ${DPSRCS}
 	${CC} ${CPPFLAGS} ${GCFLAGS} ${CPUFLAGS} -c ${.IMPSRC} -o ${.TARGET}.o
 	mv ${.TARGET}.o ${.TARGET}
 
-.if (${MACHINE_ARCH} == "mips64eb") || (${MACHINE_ARCH} == "mips64el")
+.if (${CRT_MACHINE_ARCH} == "mips64eb") || (${CRT_MACHINE_ARCH} == "mips64el")
 # Turn off as(1) warnings on MIPS, since warnings are fatal with WARNS>0
 # and GCC configury passes -finhibit-size-directive which causes mips-gas
 # to barf.  Don't know what the real fix for this is...

Index: src/gnu/lib/libbfd/Makefile
diff -u src/gnu/lib/libbfd/Makefile:1.45 src/gnu/lib/libbfd/Makefile:1.45.6.1
--- src/gnu/lib/libbfd/Makefile:1.45	Sat Oct 25 23:56:02 2008
+++ src/gnu/lib/libbfd/Makefile	Wed Dec 18 18:41:39 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.45 2008/10/25 23:56:02 mrg Exp $
+#	$NetBSD: Makefile,v 1.45.6.1 2013/12/18 18:41:39 matt Exp $
 
 NOLINKLIB=	# defined
 NOLINT=		# defined
@@ -17,7 +17,7 @@ libinstall:	# do nothing
 
 LIB=		bfd
 
-BFD_MACHINE_ARCH?=	${MACHINE_ARCH}
+BFD_MACHINE_ARCH?=	${MACHINE_ARCH:S/armv7/arm/}
 
 .if exists(${.CURDIR}/arch/${BFD_MACHINE_ARCH}/defs.mk)
 .include "${.CURDIR}/arch/${BFD_MACHINE_ARCH}/defs.mk"

Index: src/gnu/lib/libgcc4/Makefile.inc
diff -u src/gnu/lib/libgcc4/Makefile.inc:1.13.10.1 src/gnu/lib/lib

CVS commit: [matt-nb5-mips64] src

2013-12-18 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 18 18:40:35 UTC 2013

Modified Files:
src [matt-nb5-mips64]: build.sh

Log Message:
Allow arch of armv7/armv7eb for evbarm.  Add evbarmv7-e[bl] alias


To generate a diff of this commit:
cvs rdiff -u -r1.198.2.3.4.3 -r1.198.2.3.4.4 src/build.sh

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

Modified files:

Index: src/build.sh
diff -u src/build.sh:1.198.2.3.4.3 src/build.sh:1.198.2.3.4.4
--- src/build.sh:1.198.2.3.4.3	Sun Feb 28 04:05:41 2010
+++ src/build.sh	Wed Dec 18 18:40:35 2013
@@ -1,5 +1,5 @@
 #! /usr/bin/env sh
-#	$NetBSD: build.sh,v 1.198.2.3.4.3 2010/02/28 04:05:41 matt Exp $
+#	$NetBSD: build.sh,v 1.198.2.3.4.4 2013/12/18 18:40:35 matt Exp $
 #
 # Copyright (c) 2001-2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -290,7 +290,15 @@ getarch()
 		# MACHINE_ARCH is "arm" or "armeb", not "armel"
 		MACHINE_ARCH=arm${MACHINE##*-}
 		MACHINE_ARCH=${MACHINE_ARCH%el}
-		MACHINE=${MACHINE%-e[bl]}
+		MACHINE=evbarm
+		;;
+
+	evbarmv7-e[bl])
+		makewrappermachine=${MACHINE}
+		# MACHINE_ARCH is "armv7" or "armv7eb", not "armv7el"
+		MACHINE_ARCH=armv7${MACHINE##*-}
+		MACHINE_ARCH=${MACHINE_ARCH%el}
+		MACHINE=evbarm
 		;;
 
 	evbmips-e[bl]|sbmips-e[bl])
@@ -402,7 +410,7 @@ validatearch()
 	#
 	case "${MACHINE_ARCH}" in
 
-	alpha|arm|armeb|hppa|i386|m68000|m68k|mipse[bl]|mips64e[bl]|powerpc|powerpc64|sh3e[bl]|sparc|sparc64|vax|x86_64|ia64)
+	alpha|arm|armeb|armv7|armv7eb|hppa|i386|m68000|m68k|mipse[bl]|mips64e[bl]|powerpc|powerpc64|sh3e[bl]|sparc|sparc64|vax|x86_64|ia64)
 		;;
 
 	"")
@@ -420,7 +428,7 @@ validatearch()
 	case "${MACHINE}" in
 
 	evbarm)
-		arches="arm armeb"
+		arches="arm armeb armv7 armv7eb"
 		;;
 
 	algor|arc|cobalt|pmax)
@@ -1225,7 +1233,7 @@ createmakewrapper()
 	eval cat <

CVS commit: [matt-nb5-mips64] src/share/mk

2013-12-18 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 18 18:39:05 UTC 2013

Modified Files:
src/share/mk [matt-nb5-mips64]: bsd.lib.mk

Log Message:
Bring OBJCOPYLIBFLAGS from HEAD so we can preserve $a/$d/$t on BE ARM


To generate a diff of this commit:
cvs rdiff -u -r1.289.2.2.2.1.2.1 -r1.289.2.2.2.1.2.2 src/share/mk/bsd.lib.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.lib.mk
diff -u src/share/mk/bsd.lib.mk:1.289.2.2.2.1.2.1 src/share/mk/bsd.lib.mk:1.289.2.2.2.1.2.2
--- src/share/mk/bsd.lib.mk:1.289.2.2.2.1.2.1	Mon Dec 14 06:33:16 2009
+++ src/share/mk/bsd.lib.mk	Wed Dec 18 18:39:05 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.lib.mk,v 1.289.2.2.2.1.2.1 2009/12/14 06:33:16 mrg Exp $
+#	$NetBSD: bsd.lib.mk,v 1.289.2.2.2.1.2.2 2013/12/18 18:39:05 matt Exp $
 #	@(#)bsd.lib.mk	8.3 (Berkeley) 4/22/94
 
 .include 
@@ -215,14 +215,14 @@ FFLAGS+=	${FOPTS}
 	${_MKTARGET_COMPILE}
 	${COMPILE.c} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
 .if !defined(CFLAGS) || empty(CFLAGS:M*-g*)
-	${OBJCOPY} -x ${.TARGET}
+	${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}
 .endif
 
 .c.po:
 	${_MKTARGET_COMPILE}
 	${COMPILE.c} ${PROFFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} -pg ${.IMPSRC} -o ${.TARGET}
 .if !defined(CFLAGS) || empty(CFLAGS:M*-g*)
-	${OBJCOPY} -X ${.TARGET}
+	${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}
 .endif
 
 .c.go:
@@ -233,21 +233,21 @@ FFLAGS+=	${FOPTS}
 	${_MKTARGET_COMPILE}
 	${COMPILE.c} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${CSHLIBFLAGS} ${.IMPSRC} -o ${.TARGET}
 .if !defined(CFLAGS) || empty(CFLAGS:M*-g*)
-	${OBJCOPY} -x ${.TARGET}
+	${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}
 .endif
 
 .cc.o .cpp.o .cxx.o .C.o:
 	${_MKTARGET_COMPILE}
 	${COMPILE.cc} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
 .if !defined(CFLAGS) || empty(CFLAGS:M*-g*)
-	${OBJCOPY} -x ${.TARGET}
+	${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}
 .endif
 
 .cc.po .cpp.po .cxx.po .C.po:
 	${_MKTARGET_COMPILE}
 	${COMPILE.cc} ${PROFFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} -pg ${.IMPSRC} -o ${.TARGET}
 .if !defined(CFLAGS) || empty(CFLAGS:M*-g*)
-	${OBJCOPY} -X ${.TARGET}
+	${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}
 .endif
 
 .cc.go .cpp.go .cxx.go .C.go:
@@ -258,21 +258,21 @@ FFLAGS+=	${FOPTS}
 	${_MKTARGET_COMPILE}
 	${COMPILE.cc} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${CSHLIBFLAGS} ${.IMPSRC} -o ${.TARGET}
 .if !defined(CFLAGS) || empty(CFLAGS:M*-g*)
-	${OBJCOPY} -x ${.TARGET}
+	${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}
 .endif
 
 .f.o:
 	${_MKTARGET_COMPILE}
 	${COMPILE.f} ${.IMPSRC} -o ${.TARGET}
 .if !defined(FOPTS) || empty(FOPTS:M*-g*)
-	${OBJCOPY} -x ${.TARGET}
+	${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}
 .endif
 
 .f.po:
 	${_MKTARGET_COMPILE}
 	${COMPILE.f} ${PROFFLAGS} -pg ${.IMPSRC} -o ${.TARGET}
 .if !defined(FOPTS) || empty(FOPTS:M*-g*)
-	${OBJCOPY} -X ${.TARGET}
+	${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}
 .endif
 
 .f.go:
@@ -283,7 +283,7 @@ FFLAGS+=	${FOPTS}
 	${_MKTARGET_COMPILE}
 	${COMPILE.f} ${FPICFLAGS} ${.IMPSRC} -o ${.TARGET}
 .if !defined(FOPTS) || empty(FOPTS:M*-g*)
-	${OBJCOPY} -x ${.TARGET}
+	${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}
 .endif
 
 .f.ln:
@@ -294,49 +294,49 @@ FFLAGS+=	${FOPTS}
 	${_MKTARGET_COMPILE}
 	${COMPILE.m} ${OBJCOPTS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
 .if !defined(OBJCFLAGS) || empty(OBJCFLAGS:M*-g*)
-	${OBJCOPY} -x ${.TARGET}
+	${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}
 .endif
 
 .m.po:
 	${_MKTARGET_COMPILE}
 	${COMPILE.m} ${PROFFLAGS} -pg ${OBJCOPTS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
 .if !defined(OBJCFLAGS) || empty(OBJCFLAGS:M*-g*)
-	${OBJCOPY} -X ${.TARGET}
+	${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}
 .endif
 
 .m.go:
 	${_MKTARGET_COMPILE}
 	${COMPILE.m} ${DEBUGFLAGS} -g ${OBJCOPTS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
 .if !defined(OBJCFLAGS) || empty(OBJCFLAGS:M*-g*)
-	${OBJCOPY} -X ${.TARGET}
+	${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}
 .endif
 
 .m.so:
 	${_MKTARGET_COMPILE}
 	${COMPILE.m} ${CSHLIBFLAGS} ${OBJCOPTS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
 .if !defined(OBJCFLAGS) || empty(OBJCFLAGS:M*-g*)
-	${OBJCOPY} -x ${.TARGET}
+	${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}
 .endif
 
 .s.o:
 	${_MKTARGET_COMPILE}
 	${COMPILE.s} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
-	${OBJCOPY} -x ${.TARGET}
+	${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}
 
 .S.o:
 	${_MKTARGET_COMPILE}
 	${COMPILE.S} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} -o ${.TARGET}
-	${OBJCOPY} -x ${.TARGET}
+	${OBJCOPY} ${OBJCOPYLIBFLAGS} ${.TARGET}
 
 .s.po:
 	${_MKTARGET_COMPILE}
 	${COMPILE.s} ${PROFFLAGS} ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:

CVS commit: [matt-nb5-mips64] src/share/mk

2013-12-18 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 18 18:39:25 UTC 2013

Modified Files:
src/share/mk [matt-nb5-mips64]: bsd.sys.mk

Log Message:
Bring OBJCOPYLIBFLAGS from HEAD so we can preserve $a/$d/$t on BE ARM


To generate a diff of this commit:
cvs rdiff -u -r1.179.8.5 -r1.179.8.6 src/share/mk/bsd.sys.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.sys.mk
diff -u src/share/mk/bsd.sys.mk:1.179.8.5 src/share/mk/bsd.sys.mk:1.179.8.6
--- src/share/mk/bsd.sys.mk:1.179.8.5	Wed Aug 26 03:34:21 2009
+++ src/share/mk/bsd.sys.mk	Wed Dec 18 18:39:25 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.sys.mk,v 1.179.8.5 2009/08/26 03:34:21 matt Exp $
+#	$NetBSD: bsd.sys.mk,v 1.179.8.6 2013/12/18 18:39:25 matt Exp $
 #
 # Build definitions used for NetBSD source tree builds.
 
@@ -212,4 +212,9 @@ YFLAGS+=	${YPREFIX:D-p${YPREFIX}} ${YHEA
 .y.h: ${.TARGET:.h=.c}
 .endif
 
+# Objcopy   
+# ARM big endian needs to preserve $a/$d/$t symbols for the linker.
+OBJCOPYLIBFLAGS?=${"${.TARGET:M*.po}" != "":?-X:-x} \
+${"${MACHINE_ARCH:M*arm*eb}" != "":?-K '\$a' -K '\$d' -K '\$t':}
+
 .endif	# !defined(_BSD_SYS_MK_)



CVS commit: [matt-nb5-mips64] src/share/mk

2013-12-18 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 18 18:38:21 UTC 2013

Modified Files:
src/share/mk [matt-nb5-mips64]: bsd.own.mk

Log Message:
Allow armv7/armv7eb as valid MACHINE_ARCH for arm


To generate a diff of this commit:
cvs rdiff -u -r1.542.2.9.4.7 -r1.542.2.9.4.8 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.542.2.9.4.7 src/share/mk/bsd.own.mk:1.542.2.9.4.8
--- src/share/mk/bsd.own.mk:1.542.2.9.4.7	Fri May 20 16:35:10 2011
+++ src/share/mk/bsd.own.mk	Wed Dec 18 18:38:21 2013
@@ -14,7 +14,7 @@ MAKECONF?=	/etc/mk.conf
 #
 # CPU model, derived from MACHINE_ARCH
 #
-MACHINE_CPU=	${MACHINE_ARCH:C/mipse[bl]/mips/:C/mips64e[bl]/mips/:C/sh3e[bl]/sh3/:S/m68000/m68k/:S/armeb/arm/}
+MACHINE_CPU=	${MACHINE_ARCH:C/mipse[bl]/mips/:C/mips64e[bl]/mips/:C/sh3e[bl]/sh3/:S/m68000/m68k/:C/arm.*/arm/}
 
 #
 # Subdirectory used below ${RELEASEDIR} when building a release
@@ -557,8 +557,7 @@ MACHINE_GNU_ARCH=${GNU_ARCH.${MACHINE_AR
 # an "elf" tag for historically a.out platforms.
 #
 .if ${OBJECT_FMT} == "ELF" && \
-(${MACHINE_GNU_ARCH} == "arm" || \
- ${MACHINE_GNU_ARCH} == "armeb" || \
+(${MACHINE_CPU} == "arm" || \
  ${MACHINE_ARCH} == "i386" || \
  ${MACHINE_CPU} == "m68k" || \
  ${MACHINE_GNU_ARCH} == "sh" || \



CVS commit: [matt-nb5-mips64] src/gnu/dist/binutils

2013-12-18 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 18 18:33:11 UTC 2013

Modified Files:
src/gnu/dist/binutils/bfd [matt-nb5-mips64]: config.bfd
src/gnu/dist/binutils/ld [matt-nb5-mips64]: configure.tgt

Log Message:
All arm*{,eb}-*-netbsdelf* to match


To generate a diff of this commit:
cvs rdiff -u -r1.14.24.4 -r1.14.24.5 src/gnu/dist/binutils/bfd/config.bfd
cvs rdiff -u -r1.8.30.3 -r1.8.30.4 src/gnu/dist/binutils/ld/configure.tgt

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

Modified files:

Index: src/gnu/dist/binutils/bfd/config.bfd
diff -u src/gnu/dist/binutils/bfd/config.bfd:1.14.24.4 src/gnu/dist/binutils/bfd/config.bfd:1.14.24.5
--- src/gnu/dist/binutils/bfd/config.bfd:1.14.24.4	Fri Dec  2 10:08:43 2011
+++ src/gnu/dist/binutils/bfd/config.bfd	Wed Dec 18 18:33:11 2013
@@ -172,11 +172,11 @@ case "${targ}" in
 targ_selvecs=bfd_elf32_bigarc_vec
 ;;
 
-  armeb-*-netbsdelf*)
+  arm*eb-*-netbsdelf*)
 targ_defvec=bfd_elf32_bigarm_vec
 targ_selvecs="bfd_elf32_littlearm_vec armnetbsd_vec armcoff_little_vec armcoff_big_vec"
 ;;
-  arm-*-netbsdelf*)
+  arm*-*-netbsdelf*)
 targ_defvec=bfd_elf32_littlearm_vec
 targ_selvecs="bfd_elf32_bigarm_vec armnetbsd_vec armcoff_little_vec armcoff_big_vec"
 ;;

Index: src/gnu/dist/binutils/ld/configure.tgt
diff -u src/gnu/dist/binutils/ld/configure.tgt:1.8.30.3 src/gnu/dist/binutils/ld/configure.tgt:1.8.30.4
--- src/gnu/dist/binutils/ld/configure.tgt:1.8.30.3	Fri Dec  2 10:08:44 2011
+++ src/gnu/dist/binutils/ld/configure.tgt	Wed Dec 18 18:33:11 2013
@@ -250,9 +250,9 @@ arm-*-coff)		targ_emul=armcoff ;;
 arm-*-freebsd* | arm-*-kfreebsd*-gnu)
 	   		targ_emul=armelf_fbsd
 			targ_extra_emuls="armelf" ;;
-armeb-*-netbsdelf*)	targ_emul=armelfb_nbsd;
+arm*eb-*-netbsdelf*)	targ_emul=armelfb_nbsd;
 			targ_extra_emuls="armelf_nbsd armelf armnbsd" ;;
-arm-*-netbsdelf*)	targ_emul=armelf_nbsd;
+arm*-*-netbsdelf*)	targ_emul=armelf_nbsd;
 			targ_extra_emuls="armelfb_nbsd armelf armnbsd" ;;
 arm-*-netbsd*)		targ_emul=armnbsd;
 			targ_extra_emuls="armelf armelf_nbsd armelfb_nbsd"  ;;



CVS commit: [matt-nb5-mips64] src/gnu/dist/binutils/opcodes

2013-12-18 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 18 18:31:22 UTC 2013

Modified Files:
src/gnu/dist/binutils/opcodes [matt-nb5-mips64]: arm-dis.c

Log Message:
Decode some armv7 instructions


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r1.1.1.3.32.1 src/gnu/dist/binutils/opcodes/arm-dis.c

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

Modified files:

Index: src/gnu/dist/binutils/opcodes/arm-dis.c
diff -u src/gnu/dist/binutils/opcodes/arm-dis.c:1.1.1.3 src/gnu/dist/binutils/opcodes/arm-dis.c:1.1.1.3.32.1
--- src/gnu/dist/binutils/opcodes/arm-dis.c:1.1.1.3	Thu Feb  2 21:14:00 2006
+++ src/gnu/dist/binutils/opcodes/arm-dis.c	Wed Dec 18 18:31:22 2013
@@ -80,6 +80,7 @@
%A			print address for ldc/stc/ldf/stf instruction
%m			print register mask for ldm/stm instruction
%C			print the PSR sub type.
+   %E			print the LSB and WIDTH fields of a BFI or BFC instruction.
%F			print the COUNT field of a LFM/SFM instruction.
 IWMMXT specific format options:
%g print as an iWMMXt 64-bit register
@@ -118,6 +119,18 @@ static const struct arm_opcode arm_opcod
   {ARM_EXT_V3M, 0x00800090, 0x0fa000f0, "%22?sumull%c%20's\t%12-15r, %16-19r, %0-3r, %8-11r"},
   {ARM_EXT_V3M, 0x00a00090, 0x0fa000f0, "%22?sumlal%c%20's\t%12-15r, %16-19r, %0-3r, %8-11r"},
 
+  /* ARM V7 instructions.  */
+  {ARM_EXT_V7A, 0x07a00050, 0x0fa00070, "%22?usbfx%c\t%12-15r, %0-3r, #%7-11d, #%16-20W"},
+  {ARM_EXT_V7A, 0x07c0001f, 0x0fa0007f, "bfc%c\t%12-15R, %E"},
+  {ARM_EXT_V7A, 0x07c00010, 0x0fa00070, "bfi%c\t%12-15R, %0-3r, %E"},
+  {ARM_EXT_V7A, 0x0300, 0x0ff0, "movw%c\t%12-15r, #%16-19,0-11d"},
+  {ARM_EXT_V7A, 0xf57ff05f, 0x, "dmb"},
+  {ARM_EXT_V7A, 0xf57ff050, 0xfff0, "dmb\t#%0-3d"},
+  {ARM_EXT_V7A, 0xf57ff05f, 0x, "dsb"},
+  {ARM_EXT_V7A, 0xf57ff050, 0xfff0, "dsb\t%#0-3d"},
+  {ARM_EXT_V7A, 0xf57ff06f, 0x, "isb"},
+  {ARM_EXT_V7A, 0xf57ff060, 0xfff0, "isb\t%#0-3d"},
+
   /* ARM V6Z instructions.  */
   {ARM_EXT_V6Z, 0x01600070, 0x0ff000f0, "smi%c\t%e"},
 
@@ -380,7 +393,8 @@ static const struct arm_opcode arm_opcod
   {ARM_EXT_V1, 0x00e0, 0x0de0, "rsc%c%20's\t%12-15r, %16-19r, %o"},
   {ARM_EXT_V3, 0x0120f000, 0x0db0f000, "msr%c\t%22?SCPSR%C, %o"},
   {ARM_EXT_V3, 0x010f, 0x0fbf0fff, "mrs%c\t%12-15r, %22?SCPSR"},
-  {ARM_EXT_V1, 0x0100, 0x0de0, "tst%c%p\t%16-19r, %o"},
+  {ARM_EXT_V1, 0x0110, 0x0df0, "tst%c%p\t%16-19r, %o"},
+  {ARM_EXT_V1, 0x0310, 0x0df0, "tst%c%p\t%16-19r, %o"},
   {ARM_EXT_V1, 0x0120, 0x0de0, "teq%c%p\t%16-19r, %o"},
   {ARM_EXT_V1, 0x0140, 0x0de0, "cmp%c%p\t%16-19r, %o"},
   {ARM_EXT_V1, 0x0160, 0x0de0, "cmn%c%p\t%16-19r, %o"},
@@ -1234,6 +1248,19 @@ print_insn_arm (pc, info, given)
 			func (stream, "c");
 		  break;
 
+		case 'E':
+		  {
+			long msb = (given >> 16) & 0x1f;
+			long lsb = (given >> 7) & 0x1f;
+			long width = msb - lsb + 1;
+
+			if (width > 0)
+			  func(stream, "#%lu, #%lu", lsb, width);
+			else
+			  func(stream, "(invalid %lu:%lu)", lsb, msb);
+		  }
+		  break;
+
 		case 'F':
 		  switch (given & 0x00408000)
 			{
@@ -1307,60 +1334,59 @@ print_insn_arm (pc, info, given)
 		  {
 			int bitstart = *c++ - '0';
 			int bitend = 0;
+			long value = 0;
+
 			while (*c >= '0' && *c <= '9')
 			  bitstart = (bitstart * 10) + *c++ - '0';
 
 			switch (*c)
 			  {
 			  case '-':
-			c++;
+			while (*c == '-')
+			  {
+c++;
+bitend = 0;
+while (*c >= '0' && *c <= '9')
+  bitend = (bitend * 10) + *c++ - '0';
 
-			while (*c >= '0' && *c <= '9')
-			  bitend = (bitend * 10) + *c++ - '0';
+if (!bitend)
+  abort ();
+
+if (*c == ',')
+  {
+c++;
+value <<= (bitend - bitstart + 1);
+value |= (given & ((2 << bitend) - 1)) >> bitstart;
+
+bitstart = 0;
+while (*c >= '0' && *c <= '9')
+  bitstart = (bitstart * 10) + *c++ - '0';
+  }
+			  }
 
-			if (!bitend)
-			  abort ();
+			value <<= (bitend - bitstart + 1);
+			value |= (given & ((2 << bitend) - 1)) >> bitstart;
 
 			switch (*c)
 			  {
 			  case 'r':
 {
-  long reg;
-
-  reg = given >> bitstart;
-  reg &= (2 << (bitend - bitstart)) - 1;
-
-  func (stream, "%s", arm_regnames[reg]);
+  func (stream, "%s", arm_regnames[value]);
 }
 break;
 			  case 'd':
 {
-  long reg;
-
-  reg = given >> bitstart;
-  reg &= (2 << (bitend - bitstart)) - 1;
-
-  func (stream, "%d", reg);
+  func (stream, "%d", value);
 }
 break;
 			  case 'W':
 {
-  long reg;
-  
-  reg = given >> bitstart;
-  reg &= (2 << (bitend - bitstart)) - 1;
-  
-  func (stream, "%d", reg + 1);
+  func (stream, "%d", value + 1);
 }
 break;
 			  case 'x':
 {
-  long reg;
-
-  reg 

CVS commit: [matt-nb5-mips64] src/gnu/dist/gcc4/gcc

2013-12-18 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 18 14:49:47 UTC 2013

Modified Files:
src/gnu/dist/gcc4/gcc [matt-nb5-mips64]: config.gcc
src/gnu/dist/gcc4/gcc/config/arm [matt-nb5-mips64]: arm-cores.def arm.c
arm.h netbsd-elf.h

Log Message:
Make gcc4.1 aware of cortex-a[89]/armv7a and be8 linking.  cortex is
treated as arm11.


To generate a diff of this commit:
cvs rdiff -u -r1.19.8.2 -r1.19.8.3 src/gnu/dist/gcc4/gcc/config.gcc
cvs rdiff -u -r1.1.1.1 -r1.1.1.1.32.1 \
src/gnu/dist/gcc4/gcc/config/arm/arm-cores.def \
src/gnu/dist/gcc4/gcc/config/arm/arm.h \
src/gnu/dist/gcc4/gcc/config/arm/netbsd-elf.h
cvs rdiff -u -r1.1.1.4 -r1.1.1.4.16.1 src/gnu/dist/gcc4/gcc/config/arm/arm.c

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

Modified files:

Index: src/gnu/dist/gcc4/gcc/config.gcc
diff -u src/gnu/dist/gcc4/gcc/config.gcc:1.19.8.2 src/gnu/dist/gcc4/gcc/config.gcc:1.19.8.3
--- src/gnu/dist/gcc4/gcc/config.gcc:1.19.8.2	Thu May  6 06:19:02 2010
+++ src/gnu/dist/gcc4/gcc/config.gcc	Wed Dec 18 14:49:46 2013
@@ -668,7 +668,13 @@ arm*-*-netbsdelf*)
 	tm_file="dbxelf.h elfos.h netbsd.h netbsd-elf.h arm/elf.h arm/aout.h arm/arm.h arm/netbsd-elf.h"
 	tmake_file="${tmake_file} arm/t-arm arm/t-netbsd"
 	case ${target} in
-	armeb*) tm_defines="${tm_defines} TARGET_ENDIAN_DEFAULT=MASK_BIG_END" ;;
+	arm*eb-*) tm_defines="${tm_defines} TARGET_ENDIAN_DEFAULT=MASK_BIG_END" ;;
+	esac
+	case ${target} in
+	armv4*) with_cpu=${with_cpu:-strongarm};;
+	armv5*) with_cpu=${with_cpu:-arm9e};;
+	armv6*) with_cpu=${with_cpu:-arm1176jzf-s};;
+	armv7*) with_cpu=${with_cpu:-cortex-a8};;
 	esac
 	;;
 arm*-*-netbsd*)
@@ -2569,7 +2575,7 @@ case "${target}" in
 		case "$with_arch" in
 		"" \
 		| armv[23456] | armv2a | armv3m | armv4t | armv5t \
-		| armv5te | armv6j |armv6k | armv6z | armv6zk \
+		| armv5te | armv6j |armv6k | armv6z | armv6zk | armv7a \
 		| iwmmxt | ep9312)
 			# OK
 			;;

Index: src/gnu/dist/gcc4/gcc/config/arm/arm-cores.def
diff -u src/gnu/dist/gcc4/gcc/config/arm/arm-cores.def:1.1.1.1 src/gnu/dist/gcc4/gcc/config/arm/arm-cores.def:1.1.1.1.32.1
--- src/gnu/dist/gcc4/gcc/config/arm/arm-cores.def:1.1.1.1	Thu Apr 20 09:50:55 2006
+++ src/gnu/dist/gcc4/gcc/config/arm/arm-cores.def	Wed Dec 18 14:49:46 2013
@@ -115,3 +115,7 @@ ARM_CORE("arm1176jz-s",	  arm1176jzs,	6Z
 ARM_CORE("arm1176jzf-s",  arm1176jzfs,	6ZK, FL_LDSCHED | FL_VFPV2, 9e)
 ARM_CORE("mpcorenovfp",	  mpcorenovfp,	6K, FL_LDSCHED, 9e)
 ARM_CORE("mpcore",	  mpcore,	6K, FL_LDSCHED | FL_VFPV2, 9e)
+
+/* V7 Architecture Processors */
+ARM_CORE("cortex-a8", cortexa8,	7A, FL_LDSCHED | FL_VFPV2, 9e)
+ARM_CORE("cortex-a9", cortexa9,	7A, FL_LDSCHED | FL_VFPV2, 9e)
Index: src/gnu/dist/gcc4/gcc/config/arm/arm.h
diff -u src/gnu/dist/gcc4/gcc/config/arm/arm.h:1.1.1.1 src/gnu/dist/gcc4/gcc/config/arm/arm.h:1.1.1.1.32.1
--- src/gnu/dist/gcc4/gcc/config/arm/arm.h:1.1.1.1	Thu Apr 20 09:50:52 2006
+++ src/gnu/dist/gcc4/gcc/config/arm/arm.h	Wed Dec 18 14:49:46 2013
@@ -77,7 +77,12 @@ extern char arm_arch_name[];
 	if (arm_arch_iwmmxt)\
 	  builtin_define ("__IWMMXT__");		\
 	if (TARGET_AAPCS_BASED)\
-	  builtin_define ("__ARM_EABI__");		\
+	  {		\
+	builtin_define ("__ARM_EABI__");		\
+	builtin_define ("__ARM_PCS");		\
+	if (TARGET_HARD_FLOAT && TARGET_VFP)	\
+	  builtin_define ("__ARM_PCS_VFP");		\
+	  }		\
 } while (0)
 
 /* The various ARM cores.  */
Index: src/gnu/dist/gcc4/gcc/config/arm/netbsd-elf.h
diff -u src/gnu/dist/gcc4/gcc/config/arm/netbsd-elf.h:1.1.1.1 src/gnu/dist/gcc4/gcc/config/arm/netbsd-elf.h:1.1.1.1.32.1
--- src/gnu/dist/gcc4/gcc/config/arm/netbsd-elf.h:1.1.1.1	Thu Apr 20 09:51:16 2006
+++ src/gnu/dist/gcc4/gcc/config/arm/netbsd-elf.h	Wed Dec 18 14:49:46 2013
@@ -61,10 +61,19 @@
   "%{mhard-float:{!mfpu=*:-mfpu=vfp}}   \
%{mfloat-abi=hard:{!mfpu=*:-mfpu=vfp}}"
 
+#define TARGET_FIX_V4BX_SPEC " %{mcpu=arm8|mcpu=arm810|mcpu=strongarm*|march=armv4:--fix-v4bx}"
+#if TARGET_ENDIAN_DEFAULT == MASK_BIG_END
+#define BE8_LINK_SPEC " %{!mlittle-endian:%{march=armv7*|mcpu=cortex*:%{!r:--be8}}}"
+#else
+#define BE8_LINK_SPEC " %{mbig-endian:%{march=armv7*|mcpu=cortex*:%{!r:--be8}}}"
+#endif
+
 #undef SUBTARGET_EXTRA_SPECS
 #define SUBTARGET_EXTRA_SPECS\
   { "subtarget_extra_asm_spec",	SUBTARGET_EXTRA_ASM_SPEC }, \
   { "subtarget_asm_float_spec", SUBTARGET_ASM_FLOAT_SPEC }, \
+  { "be8_link_spec",		BE8_LINK_SPEC }, \
+  { "target_fix_v4bx_spec",	TARGET_FIX_V4BX_SPEC }, \
   { "netbsd_link_spec",		NETBSD_LINK_SPEC_ELF },	\
   { "netbsd_entry_point",	NETBSD_ENTRY_POINT },
 
@@ -73,6 +82,7 @@
 #undef LINK_SPEC
 #define LINK_SPEC \
   "-X %{mbig-endian:-EB} %{mlittle-endian:-EL} \
+   %(be8_link_spec) %(target_fix_v4bx_spec) \
%(netbsd_link_spec)"
 
 /* Make GCC agree with .  */

Index: src/gnu/dist/gcc4/gcc/config/arm/arm.c
diff -u src/gnu/dist/gcc4/gcc/config/arm/arm.c:1.1.1.4 src

CVS commit: [matt-nb5-mips64] src/gnu/dist/binutils

2013-12-18 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Dec 18 14:07:30 UTC 2013

Modified Files:
src/gnu/dist/binutils/gas/config [matt-nb5-mips64]: tc-arm.c
src/gnu/dist/binutils/include/opcode [matt-nb5-mips64]: arm.h

Log Message:
Add some armv7 instructions.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.5.32.1 src/gnu/dist/binutils/gas/config/tc-arm.c
cvs rdiff -u -r1.1.1.2 -r1.1.1.2.32.1 \
src/gnu/dist/binutils/include/opcode/arm.h

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

Modified files:

Index: src/gnu/dist/binutils/gas/config/tc-arm.c
diff -u src/gnu/dist/binutils/gas/config/tc-arm.c:1.5 src/gnu/dist/binutils/gas/config/tc-arm.c:1.5.32.1
--- src/gnu/dist/binutils/gas/config/tc-arm.c:1.5	Thu Feb  2 22:03:54 2006
+++ src/gnu/dist/binutils/gas/config/tc-arm.c	Wed Dec 18 14:07:30 2013
@@ -6651,25 +6651,35 @@ do_ldmstm (char * str)
 
   skip_whitespace (str);
 
-  if ((base_reg = reg_required_here (&str, 16)) == FAIL)
-return;
-
-  if (base_reg == REG_PC)
+  base_reg = (inst.instruction >> 16) & 0xf;
+  if (base_reg == 0)
 {
-  inst.error = _("r15 not allowed as base register");
-  return;
-}
+  if ((base_reg = reg_required_here (&str, 16)) == FAIL)
+	return;
 
-  skip_whitespace (str);
+  if (base_reg == REG_PC)
+	{
+	  inst.error = _("r15 not allowed as base register");
+	  return;
+	}
 
-  if (*str == '!')
-{
-  inst.instruction |= WRITE_BACK;
-  str++;
+  skip_whitespace (str);
+
+  if (*str == '!')
+	{
+	  inst.instruction |= WRITE_BACK;
+	  str++;
+	}
+
+  if (skip_past_comma (&str) == FAIL)
+	{
+	  if (! inst.error)
+	inst.error = BAD_ARGS;
+	  return;
+	}
 }
 
-  if (skip_past_comma (&str) == FAIL
-  || (range = reg_list (&str)) == FAIL)
+  if ((range = reg_list (&str)) == FAIL)
 {
   if (! inst.error)
 	inst.error = BAD_ARGS;
@@ -6746,6 +6756,231 @@ do_swi (char * str)
 }
 
 static void
+do_dsb (char * str)
+{
+  skip_whitespace (str);
+  /* Allow optional leading '#'.  */
+  if (is_immediate_prefix (*str))
+str++;
+
+  end_of_line (str);
+}
+
+static void
+do_movwt (char * str)
+{
+  expressionS expr;
+  int reg;
+
+  skip_whitespace (str);
+
+  if ((reg = reg_required_here (&str, 12)) == FAIL
+  || skip_past_comma (&str) == FAIL)
+return;
+
+  if (reg == REG_PC)
+{
+  inst.error = BAD_PC;
+  return;
+}
+
+  if (is_immediate_prefix (*str))
+str++;
+  else
+{
+  inst.error = _("immediate expression expected");
+  return;
+}
+
+  if (my_get_expression (&expr, &str))
+return;
+
+  if (expr.X_op != O_constant)
+{
+  inst.error = _("constant expression expected");
+  return;
+}
+
+  if ((expr.X_add_number & 0x) != 0)
+{
+  inst.error = _("invalid unsigned 16-bit value");
+  return;
+}
+
+  inst.instruction |= (expr.X_add_number & 0xf000) << 4;
+  inst.instruction |= (expr.X_add_number & 0x0fff);
+}
+
+static void
+do_bfci (char * str)
+{
+  expressionS expr;
+  unsigned long lsb;
+  unsigned long width;
+  int reg;
+
+  skip_whitespace (str);
+
+  if ((reg = reg_required_here (&str, 12)) == FAIL
+  || skip_past_comma (&str) == FAIL)
+return;
+
+  if (reg == REG_PC)
+{
+  inst.error = BAD_PC;
+  return;
+}
+
+  if ((inst.instruction & 0xf) == 0)
+{
+  if ((reg == reg_required_here (&str, 0)) == FAIL
+	  || skip_past_comma (&str) == FAIL)
+	return;
+
+  if (reg == REG_PC)
+	{
+	  inst.error = BAD_PC;
+	  return;
+	}
+}
+
+  if (is_immediate_prefix (*str))
+str++;
+  else
+{
+  inst.error = _("immediate expression expected");
+  return;
+}
+
+  if (my_get_expression (&expr, &str))
+return;
+
+  if (expr.X_op != O_constant)
+{
+  inst.error = _("constant expression expected");
+  return;
+}
+
+  lsb = expr.X_add_number;
+  if (lsb > 31)
+{
+  inst.error = _("invalid lsb");
+  return;
+}
+
+  if (skip_past_comma (&str) == FAIL)
+return;
+
+  if (is_immediate_prefix (*str))
+str++;
+  else
+{
+  inst.error = _("immediate expression expected");
+  return;
+}
+
+  if (my_get_expression (&expr, &str))
+return;
+
+  if (expr.X_op != O_constant)
+{
+  inst.error = _("constant expression expected");
+  return;
+}
+
+  width = expr.X_add_number;
+  if (lsb + width > 32 || width > 32 || width == 0)
+{
+  if (!inst.error)
+inst.error = _("invalid width");
+  return;
+}
+
+  inst.instruction |= (lsb << 7);
+  inst.instruction |= (lsb + width - 1) << 16;
+
+  end_of_line (str);
+}
+
+static void
+do_bfx (char * str)
+{
+  expressionS expr;
+  unsigned long lsb;
+  unsigned long width;
+  int rd, rn;
+
+  skip_whitespace (str);
+
+  if ((rd = reg_required_here (&str, 12)) == FAIL
+  || skip_past_comma (&str) == FAIL
+  || (rn = reg_required_here (&str, 0)) == FAIL
+  || ski

  1   2   3   4   5   6   7   8   9   10   >