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

2010-01-21 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Fri Jan 22 07:58:52 UTC 2010

Modified Files:
src/sys/arch/evbmips/rmixl [matt-nb5-mips64]: machdep.c

Log Message:
- memsize and related now uint64_t to handle >4GB mem
- if MULTIPROCESSOR do not 'disable all threads except #0' or
  'set single MMU Thread Mode'


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.15 -r1.1.2.16 src/sys/arch/evbmips/rmixl/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/evbmips/rmixl/machdep.c
diff -u src/sys/arch/evbmips/rmixl/machdep.c:1.1.2.15 src/sys/arch/evbmips/rmixl/machdep.c:1.1.2.16
--- src/sys/arch/evbmips/rmixl/machdep.c:1.1.2.15	Wed Jan 20 09:04:33 2010
+++ src/sys/arch/evbmips/rmixl/machdep.c	Fri Jan 22 07:58:51 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.1.2.15 2010/01/20 09:04:33 matt Exp $	*/
+/*	$NetBSD: machdep.c,v 1.1.2.16 2010/01/22 07:58:51 cliff Exp $	*/
 
 /*
  * Copyright 2001, 2002 Wasabi Systems, Inc.
@@ -112,7 +112,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.1.2.15 2010/01/20 09:04:33 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.1.2.16 2010/01/22 07:58:51 cliff Exp $");
 
 #include "opt_ddb.h"
 #include "opt_com.h"
@@ -244,13 +244,14 @@
 
 void configure(void);
 void mach_init(int, int32_t *, void *, int64_t);
-static u_long rmixlfw_init(int64_t);
-static u_long mem_clusters_init(rmixlfw_mmap_t *, rmixlfw_mmap_t *);
+static uint64_t rmixlfw_init(int64_t);
+static uint64_t mem_clusters_init(rmixlfw_mmap_t *, rmixlfw_mmap_t *);
 static void __attribute__((__noreturn__)) rmixl_reset(void);
 static void rmixl_physaddr_init(void);
 static u_int ram_seg_resv(phys_ram_seg_t *, u_int, u_quad_t, u_quad_t);
 void rmixlfw_mmap_print(rmixlfw_mmap_t *);
 
+
 #ifdef MULTIPROCESSOR
 void rmixl_get_wakeup_info(struct rmixl_config *);
 #ifdef MACHDEP_DEBUG
@@ -273,7 +274,7 @@
 {
 	struct rmixl_config *rcp = &rmixl_configuration;
 	void *kernend;
-	u_long memsize;
+	uint64_t memsize;
 	u_int vm_cluster_cnt;
 	uint32_t r;
 	phys_ram_seg_t vm_clusters[VM_PHYSSEG_MAX];
@@ -281,16 +282,15 @@
 
 #ifndef MULTIPROCESSOR
 	rmixl_mtcr(0, 1);		/* disable all threads except #0 */
+	rmixl_mtcr(0x400, 0);		/* enable MMU clock gating */
+	/* set single MMU Thread Mode */
+	/* TLB is partitioned (1 partition) */
 #endif
 
 	r = rmixl_mfcr(0x300);
 	r &= ~__BIT(14);		/* disabled Unaligned Access */
 	rmixl_mtcr(0x300, r);
 
-	rmixl_mtcr(0x400, 0);		/* enable MMU clock gating */
-	/* set single MMU Thread Mode */
-	/* TLB is partitioned (1 partition) */
-
 	/*
 	 * Clear the BSS segment.
 	 */
@@ -325,7 +325,7 @@
 #endif
 
 	printf("\nNetBSD/rmixl\n");
-	printf("memsize = %#lx\n", memsize);
+	printf("memsize = %#"PRIx64"\n", memsize);
 
 #if defined(MULTIPROCESSOR) && defined(MACHDEP_DEBUG)
 	rmixl_wakeup_info_print(rcp->rc_cpu_wakeup_info);
@@ -615,7 +615,7 @@
 #endif
 }
 
-static u_long
+static uint64_t
 rmixlfw_init(int64_t infop)
 {
 	struct rmixl_config *rcp = &rmixl_configuration;
@@ -698,7 +698,7 @@
  * these will be limited by MEMSIZE if it is configured.
  * if neither are available, just use MEMSIZE.
  */
-static u_long
+static uint64_t
 mem_clusters_init(
 	rmixlfw_mmap_t *psb_physaddr_map,
 	rmixlfw_mmap_t *avail_mem_map)
@@ -709,7 +709,7 @@
 	uint64_t sum;
 	u_int cnt;
 #ifdef MEMSIZE
-	u_long memsize = MEMSIZE;
+	uint64_t memsize = MEMSIZE;
 #endif
 
 #ifdef MACHDEP_DEBUG
@@ -856,7 +856,7 @@
 {
 	int i;
 
-	printf("%s: wip %p\n", __func__, wip);
+	printf("%s: wip %p, size %lu\n", __func__, wip, sizeof(*wip));
 
 	printf("cpu_status %#x\n",  wip->cpu_status);
 	printf("valid: %d\n", wip->valid);



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

2010-01-21 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan 22 07:41:10 UTC 2010

Modified Files:
src/sys/arch/mips/conf [matt-nb5-mips64]: files.mips
src/sys/arch/mips/include [matt-nb5-mips64]: pmap.h
src/sys/arch/mips/mips [matt-nb5-mips64]: pmap.c trap.c
Added Files:
src/sys/arch/mips/mips [matt-nb5-mips64]: pmap_tlb.c

Log Message:
Seperate the pmap TLB functions into their own file.
For 32 bit kernels, make sure that mips_virtual_end doesn't go past
VM_MAX_KERNEL_ADDRESS.


To generate a diff of this commit:
cvs rdiff -u -r1.58.24.4 -r1.58.24.5 src/sys/arch/mips/conf/files.mips
cvs rdiff -u -r1.54.26.6 -r1.54.26.7 src/sys/arch/mips/include/pmap.h
cvs rdiff -u -r1.179.16.11 -r1.179.16.12 src/sys/arch/mips/mips/pmap.c
cvs rdiff -u -r0 -r1.1.2.1 src/sys/arch/mips/mips/pmap_tlb.c
cvs rdiff -u -r1.217.12.14 -r1.217.12.15 src/sys/arch/mips/mips/trap.c

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

Modified files:

Index: src/sys/arch/mips/conf/files.mips
diff -u src/sys/arch/mips/conf/files.mips:1.58.24.4 src/sys/arch/mips/conf/files.mips:1.58.24.5
--- src/sys/arch/mips/conf/files.mips:1.58.24.4	Wed Dec 30 04:51:25 2009
+++ src/sys/arch/mips/conf/files.mips	Fri Jan 22 07:41:10 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: files.mips,v 1.58.24.4 2009/12/30 04:51:25 matt Exp $
+#	$NetBSD: files.mips,v 1.58.24.5 2010/01/22 07:41:10 matt Exp $
 #
 
 defflag	opt_cputype.h		NOFPU
@@ -35,6 +35,7 @@
 file	arch/mips/mips/mem.c
 file	arch/mips/mips/pmap.c
 file	arch/mips/mips/pmap_segtab.c
+file	arch/mips/mips/pmap_tlb.c
 file	arch/mips/mips/trap.c			# trap handlers
 file	arch/mips/mips/syscall.c		# syscall entries
 file	arch/mips/mips/mips_machdep.c

Index: src/sys/arch/mips/include/pmap.h
diff -u src/sys/arch/mips/include/pmap.h:1.54.26.6 src/sys/arch/mips/include/pmap.h:1.54.26.7
--- src/sys/arch/mips/include/pmap.h:1.54.26.6	Wed Jan 20 06:58:35 2010
+++ src/sys/arch/mips/include/pmap.h	Fri Jan 22 07:41:10 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.54.26.6 2010/01/20 06:58:35 matt Exp $	*/
+/*	$NetBSD: pmap.h,v 1.54.26.7 2010/01/22 07:41:10 matt Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -218,10 +218,14 @@
 void	pmap_bootstrap(void);
 
 void	pmap_set_modified(paddr_t);
-
 void	pmap_procwr(struct proc *, vaddr_t, size_t);
 #define	PMAP_NEED_PROCWR
 
+uint32_t pmap_tlb_asid_alloc(pmap_t pmap, struct cpu_info *ci);
+void	pmap_tlb_invalidate_asid(pmap_t pmap);
+int	pmap_tlb_update(pmap_t pmap, vaddr_t, uint32_t);
+void	pmap_tlb_invalidate_addr(pmap_t pmap, vaddr_t);
+
 /*
  * pmap_prefer() helps reduce virtual-coherency exceptions in
  * the virtually-indexed cache on mips3 CPUs.

Index: src/sys/arch/mips/mips/pmap.c
diff -u src/sys/arch/mips/mips/pmap.c:1.179.16.11 src/sys/arch/mips/mips/pmap.c:1.179.16.12
--- src/sys/arch/mips/mips/pmap.c:1.179.16.11	Wed Jan 20 06:58:36 2010
+++ src/sys/arch/mips/mips/pmap.c	Fri Jan 22 07:41:10 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.179.16.11 2010/01/20 06:58:36 matt Exp $	*/
+/*	$NetBSD: pmap.c,v 1.179.16.12 2010/01/22 07:41:10 matt Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.179.16.11 2010/01/20 06:58:36 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.179.16.12 2010/01/22 07:41:10 matt Exp $");
 
 /*
  *	Manages physical address maps.
@@ -244,7 +244,6 @@
 
 /* Forward function declarations */
 void pmap_remove_pv(pmap_t, vaddr_t, struct vm_page *);
-uint32_t pmap_tlb_asid_alloc(pmap_t pmap, struct cpu_info *ci);
 void pmap_enter_pv(pmap_t, vaddr_t, struct vm_page *, u_int *);
 pt_entry_t *pmap_pte(pmap_t, vaddr_t);
 
@@ -359,6 +358,7 @@
 	 */
 
 	/* Get size of buffer cache and set an upper limit */
+	buf_setvalimit((VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) / 8);
 	bufsz = buf_memcalc();
 	buf_setvalimit(bufsz);
 
@@ -384,6 +384,13 @@
 	mips_avail_start = ptoa(vm_physmem[0].start);
 	mips_avail_end = ptoa(vm_physmem[vm_nphysseg - 1].end);
 	mips_virtual_end = VM_MIN_KERNEL_ADDRESS + Sysmapsize * NBPG;
+#ifndef _LP64
+	if (mips_virtual_end > VM_MAX_KERNEL_ADDRESS) {
+		mips_virtual_end = VM_MAX_KERNEL_ADDRESS;
+		Sysmapsize =
+		(VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) / NBPG;
+	}
+#endif
 
 	/*
 	 * Now actually allocate the kernel PTE array (must be done
@@ -717,11 +724,6 @@
 pmap_pte_remove(pmap_t pmap, vaddr_t sva, vaddr_t eva, pt_entry_t *pte,
 	uintptr_t flags)
 {
-	struct cpu_info * const ci = curcpu();
-	struct pmap_asid_info * const pai = PMAP_PAI(pmap, ci);
-	const uint32_t asid = pai->pai_asid << MIPS_TLB_PID_SHIFT;
-	const bool needflush = PMAP_PAI_ASIDVALID_P(pai, ci);
-
 #ifdef DEBUG
 	if (pmapdebug & (PDB_FOLLOW|PDB_REMOVE|PDB_PROTECT)) {
 		printf("%s: %p, %"PRIxVADDR", %"PRIxVADDR", %p, %"PRIxPTR"\n",
@@ -731,25 +733,23 @@
 
 	for (; sva < eva; sva += NBPG, pte++) {
 		struct vm_page *pg;
-		uint32_t entry = pte->pt_entry;
-		if (!mips_pg_v(

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

2010-01-21 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan 22 07:05:29 UTC 2010

Modified Files:
src/sys/arch/mips/mips [matt-nb5-mips64]: mips_emul.c

Log Message:
in MachEmulateBranch, print useful information on panics


To generate a diff of this commit:
cvs rdiff -u -r1.14.78.5 -r1.14.78.6 src/sys/arch/mips/mips/mips_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/arch/mips/mips/mips_emul.c
diff -u src/sys/arch/mips/mips/mips_emul.c:1.14.78.5 src/sys/arch/mips/mips/mips_emul.c:1.14.78.6
--- src/sys/arch/mips/mips/mips_emul.c:1.14.78.5	Sat Nov 14 21:52:08 2009
+++ src/sys/arch/mips/mips/mips_emul.c	Fri Jan 22 07:05:28 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips_emul.c,v 1.14.78.5 2009/11/14 21:52:08 matt Exp $ */
+/*	$NetBSD: mips_emul.c,v 1.14.78.6 2010/01/22 07:05:28 matt Exp $ */
 
 /*
  * Copyright (c) 1999 Shuichiro URATA.  All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mips_emul.c,v 1.14.78.5 2009/11/14 21:52:08 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mips_emul.c,v 1.14.78.6 2010/01/22 07:05:28 matt Exp $");
 
 #include 
 #include 
@@ -115,8 +115,8 @@
 		else if (allowNonBranch)
 			nextpc = instpc + 4;
 		else
-			panic("MachEmulateBranch: Non-branch instruction at "
-			"pc 0x%lx", (long)instpc);
+			panic("%s: %s instruction %08x at pc 0x%"PRIxVADDR,
+			__func__, "non-branch", inst.word, instpc);
 		break;
 
 	case OP_BCOND:
@@ -142,7 +142,8 @@
 			break;
 
 		default:
-			panic("MachEmulateBranch: Bad branch cond");
+			panic("%s: %s instruction 0x%08x at pc 0x%"PRIxVADDR,
+			__func__, "bad branch", inst.word, instpc);
 		}
 		break;
 
@@ -197,13 +198,14 @@
 		else if (allowNonBranch)
 			nextpc = instpc + 4;
 		else
-			panic("MachEmulateBranch: Bad COP1 branch instruction");
+			panic("%s: %s instruction 0x%08x at pc 0x%"PRIxVADDR,
+			__func__, "bad COP1 branch", inst.word, instpc);
 		break;
 
 	default:
 		if (!allowNonBranch)
-			panic("MachEmulateBranch: Non-branch instruction at "
-			"pc 0x%lx", (long)instpc);
+			panic("%s: %s instruction 0x%08x at pc 0x%"PRIxVADDR,
+			__func__, "non-branch", inst.word, instpc);
 		nextpc = instpc + 4;
 	}
 	return nextpc;



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

2010-01-21 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Jan 22 06:05:16 UTC 2010

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

Log Message:
Fix a couple comment typos.


To generate a diff of this commit:
cvs rdiff -u -r1.42.16.1 -r1.42.16.2 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_pglist.c
diff -u src/sys/uvm/uvm_pglist.c:1.42.16.1 src/sys/uvm/uvm_pglist.c:1.42.16.2
--- src/sys/uvm/uvm_pglist.c:1.42.16.1	Fri Jan 22 05:17:32 2010
+++ src/sys/uvm/uvm_pglist.c	Fri Jan 22 06:05:16 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_pglist.c,v 1.42.16.1 2010/01/22 05:17:32 matt Exp $	*/
+/*	$NetBSD: uvm_pglist.c,v 1.42.16.2 2010/01/22 06:05:16 snj Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_pglist.c,v 1.42.16.1 2010/01/22 05:17:32 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_pglist.c,v 1.42.16.2 2010/01/22 06:05:16 snj Exp $");
 
 #include 
 #include 
@@ -203,7 +203,7 @@
 
 		/*
 		 * We start at the end since if we find a non-free page, it
-		 * make no sense to ever test any pages before it since the
+		 * makes no sense to ever test any pages before it since the
 		 * conditions for this allocation could never be satisified.
 		 *
 		 * Also since we have "vetted" these free pages, if this
@@ -265,7 +265,7 @@
 		cnt = roundup(cnt, align);
 		/*
 		 * The number of pages we can skip checking 
-		 * (might be 0 is cnt > num).
+		 * (might be 0 if cnt > num).
 		 */
 		skip = max(num - cnt, 0);
 		try += cnt;



CVS commit: src/bin/chmod

2010-01-21 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Jan 22 05:41:36 UTC 2010

Modified Files:
src/bin/chmod: chmod.1 chmod.c

Log Message:
Document "-f".  From Andreas Wiese in PR bin/35409, slightly modified.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/bin/chmod/chmod.1
cvs rdiff -u -r1.34 -r1.35 src/bin/chmod/chmod.c

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

Modified files:

Index: src/bin/chmod/chmod.1
diff -u src/bin/chmod/chmod.1:1.22 src/bin/chmod/chmod.1:1.23
--- src/bin/chmod/chmod.1:1.22	Tue Mar 24 00:10:58 2009
+++ src/bin/chmod/chmod.1	Fri Jan 22 05:41:36 2010
@@ -1,4 +1,4 @@
-.\"	$NetBSD: chmod.1,v 1.22 2009/03/24 00:10:58 joerg Exp $
+.\"	$NetBSD: chmod.1,v 1.23 2010/01/22 05:41:36 snj Exp $
 .\"
 .\" Copyright (c) 1989, 1990, 1993, 1994
 .\"	The Regents of the University of California.  All rights reserved.
@@ -32,7 +32,7 @@
 .\"
 .\"	@(#)chmod.1	8.4 (Berkeley) 3/31/94
 .\"
-.Dd December 9, 2005
+.Dd January 22, 2010
 .Dt CHMOD 1
 .Os
 .Sh NAME
@@ -44,7 +44,7 @@
 .Fl R
 .Op Fl H | Fl L | Fl P
 .Oc
-.Op Fl h
+.Op Fl fh
 .Ar mode
 .Ar
 .Sh DESCRIPTION
@@ -73,6 +73,10 @@
 .It Fl R
 Change the modes of the file hierarchies rooted in the files
 instead of just the files themselves.
+.It Fl f
+Do not display a diagnostic message or modify the exit status if
+.Nm
+fails to change the mode of a file.
 .It Fl h
 If
 .Ar file

Index: src/bin/chmod/chmod.c
diff -u src/bin/chmod/chmod.c:1.34 src/bin/chmod/chmod.c:1.35
--- src/bin/chmod/chmod.c:1.34	Sun Jul 20 00:52:39 2008
+++ src/bin/chmod/chmod.c	Fri Jan 22 05:41:36 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: chmod.c,v 1.34 2008/07/20 00:52:39 lukem Exp $ */
+/* $NetBSD: chmod.c,v 1.35 2010/01/22 05:41:36 snj Exp $ */
 
 /*
  * Copyright (c) 1989, 1993, 1994
@@ -40,7 +40,7 @@
 #if 0
 static char sccsid[] = "@(#)chmod.c	8.8 (Berkeley) 4/1/94";
 #else
-__RCSID("$NetBSD: chmod.c,v 1.34 2008/07/20 00:52:39 lukem Exp $");
+__RCSID("$NetBSD: chmod.c,v 1.35 2010/01/22 05:41:36 snj Exp $");
 #endif
 #endif /* not lint */
 
@@ -91,7 +91,7 @@
 		case 'R':
 			Rflag = 1;
 			break;
-		case 'f':		/* XXX: undocumented. */
+		case 'f':
 			fflag = 1;
 			break;
 		case 'h':
@@ -207,7 +207,7 @@
 usage(void)
 {
 	(void)fprintf(stderr,
-	"usage: %s [-R [-H | -L | -P]] [-h] mode file ...\n",
+	"usage: %s [-R [-H | -L | -P]] [-fh] mode file ...\n",
 	getprogname());
 	exit(1);
 	/* NOTREACHED */



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

2010-01-21 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan 22 05:17:32 UTC 2010

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

Log Message:
Rework the algorithm to allocate contiguous pages to be much much faster.
(read the comments if you want to know how it's done).


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.42.16.1 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_pglist.c
diff -u src/sys/uvm/uvm_pglist.c:1.42 src/sys/uvm/uvm_pglist.c:1.42.16.1
--- src/sys/uvm/uvm_pglist.c:1.42	Wed Jun  4 12:45:28 2008
+++ src/sys/uvm/uvm_pglist.c	Fri Jan 22 05:17:32 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_pglist.c,v 1.42 2008/06/04 12:45:28 ad Exp $	*/
+/*	$NetBSD: uvm_pglist.c,v 1.42.16.1 2010/01/22 05:17:32 matt Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_pglist.c,v 1.42 2008/06/04 12:45:28 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_pglist.c,v 1.42.16.1 2010/01/22 05:17:32 matt Exp $");
 
 #include 
 #include 
@@ -82,9 +82,6 @@
 uvm_pglist_add(struct vm_page *pg, struct pglist *rlist)
 {
 	int free_list, color, pgflidx;
-#ifdef DEBUG
-	struct vm_page *tp;
-#endif
 
 	KASSERT(mutex_owned(&uvm_fpageqlock));
 
@@ -95,11 +92,11 @@
 	free_list = uvm_page_lookup_freelist(pg);
 	color = VM_PGCOLOR_BUCKET(pg);
 	pgflidx = (pg->flags & PG_ZERO) ? PGFL_ZEROS : PGFL_UNKNOWN;
-#ifdef DEBUG
-	for (tp = LIST_FIRST(&uvm.page_free[
-		free_list].pgfl_buckets[color].pgfl_queues[pgflidx]);
-	 tp != NULL;
-	 tp = LIST_NEXT(tp, pageq.list)) {
+#if defined(DEBUG) && DEBUG > 1
+	struct vm_page *tp;
+	LIST_FOREACH(tp,
+	&uvm.page_free[free_list].pgfl_buckets[color].pgfl_queues[pgflidx],
+	pageq.list) {
 		if (tp == pg)
 			break;
 	}
@@ -124,7 +121,8 @@
 uvm_pglistalloc_c_ps(struct vm_physseg *ps, int num, paddr_t low, paddr_t high,
 paddr_t alignment, paddr_t boundary, struct pglist *rlist)
 {
-	int try, limit, tryidx, end, idx;
+	signed int try, limit, tryidx, end, idx, skip;
+	const signed int align = atop(alignment);
 	struct vm_page *pgs;
 	int pagemask;
 #ifdef DEBUG
@@ -138,11 +136,15 @@
 
 	KASSERT(mutex_owned(&uvm_fpageqlock));
 
-	try = roundup(max(atop(low), ps->avail_start), atop(alignment));
+	try = roundup(max(atop(low), ps->avail_start), align);
 	limit = min(atop(high), ps->avail_end);
 	pagemask = ~((boundary >> PAGE_SHIFT) - 1);
+	skip = 0;
 
 	for (;;) {
+		bool ok = true;
+		int cnt;
+
 		if (try + num > limit) {
 			/*
 			 * We've run past the allowable range.
@@ -156,7 +158,7 @@
 			 * just crossed and ensure alignment.
 			 */
 			try = (try + num - 1) & pagemask;
-			try = roundup(try, atop(alignment));
+			try = roundup(try, align);
 			continue;
 		}
 #ifdef DEBUG
@@ -180,9 +182,42 @@
 		/*
 		 * Found a suitable starting page.  See if the range is free.
 		 */
-		for (idx = tryidx; idx < end; idx++) {
-			if (VM_PAGE_IS_FREE(&pgs[idx]) == 0)
+#ifdef PGALLOC_VERBOSE
+		printf("%s: ps=%p try=%#x end=%#x skip=%#x, align=%#x",
+		__func__, ps, tryidx, end, skip, align);
+#endif
+		/*
+		 * Test both the ending and starting pages to see if they are
+		 * both free.  If the ending and starting pages are same page,
+		 * we only test one of them.  If the pages aren't free, there
+		 * is no reason to continue this iteration so advance to the
+		 * next address and try again.
+		 */
+		if (VM_PAGE_IS_FREE(&pgs[end - 1]) == 0
+		|| end - 1 == tryidx + skip
+		|| VM_PAGE_IS_FREE(&pgs[tryidx + skip]) == 0) {
+			try += roundup(num, align);
+			skip = 0;
+			continue;
+		}
+
+		/*
+		 * We start at the end since if we find a non-free page, it
+		 * make no sense to ever test any pages before it since the
+		 * conditions for this allocation could never be satisified.
+		 *
+		 * Also since we have "vetted" these free pages, if this
+		 * iteration fails, we may be able to skip testing those pages
+		 * in the next iteration.
+		 *
+		 * The loop condition will never be satisfied if we've already
+		 * found enough pages (either one or two).
+		 */
+		for (idx = end - 2; idx >= tryidx + skip + 1; idx--) {
+			if (VM_PAGE_IS_FREE(&pgs[idx]) == 0) {
+ok = false;
 break;
+			}
 
 #ifdef DEBUG
 			idxpa = VM_PAGE_TO_PHYS(&pgs[idx]);
@@ -205,18 +240,42 @@
 			}
 #endif
 		}
-		if (idx == end)
+
+		if (ok) {
+			while (skip-- > 0) {
+KDASSERT(VM_PAGE_IS_FREE(&pgs[tryidx + skip]));
+			}
+#ifdef PGALLOC_VERBOSE
+			printf(": ok\n");
+#endif
 			break;
+		}
 
-		try += atop(alignment);
+#ifdef PGALLOC_VERBOSE
+		printf(": non-free at %#x\n", idx - tryidx);
+#endif
+		/*
+		 * count the number of pages we can advance
+		 * since we know they aren't all free.
+		 */
+		cnt = idx + 1 - tryidx;
+		/*
+		 * now round up that to the needed alignment.
+		 */
+		cnt = roundup(cnt, align);
+		/*
+		 * The number of pages we can skip che

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

2010-01-21 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan 22 04:03:22 UTC 2010

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

Log Message:
Print out colors in uvmexp_print


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.31.12.1 src/sys/uvm/uvm_stat.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_stat.c
diff -u src/sys/uvm/uvm_stat.c:1.31 src/sys/uvm/uvm_stat.c:1.31.12.1
--- src/sys/uvm/uvm_stat.c:1.31	Fri Aug  8 17:09:28 2008
+++ src/sys/uvm/uvm_stat.c	Fri Jan 22 04:03:21 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_stat.c,v 1.31 2008/08/08 17:09:28 skrll Exp $	 */
+/*	$NetBSD: uvm_stat.c,v 1.31.12.1 2010/01/22 04:03:21 matt Exp $	 */
 
 /*
  *
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_stat.c,v 1.31 2008/08/08 17:09:28 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_stat.c,v 1.31.12.1 2010/01/22 04:03:21 matt Exp $");
 
 #include "opt_uvmhist.h"
 #include "opt_readahead.h"
@@ -212,9 +212,9 @@
 	uvm_estimatepageable(&active, &inactive);
 
 	(*pr)("Current UVM status:\n");
-	(*pr)("  pagesize=%d (0x%x), pagemask=0x%x, pageshift=%d\n",
+	(*pr)("  pagesize=%d (0x%x), pagemask=0x%x, pageshift=%d, ncolors=%d\n",
 	uvmexp.pagesize, uvmexp.pagesize, uvmexp.pagemask,
-	uvmexp.pageshift);
+	uvmexp.pageshift, uvmexp.ncolors);
 	(*pr)("  %d VM pages: %d active, %d inactive, %d wired, %d free\n",
 	uvmexp.npages, active, inactive, uvmexp.wired,
 	uvmexp.free);



CVS commit: src/crypto/external/bsd/openssl/dist/crypto/comp

2010-01-21 Thread Takahiro Kambe
Module Name:src
Committed By:   taca
Date:   Fri Jan 22 03:42:47 UTC 2010

Modified Files:
src/crypto/external/bsd/openssl/dist/crypto/comp: c_zlib.c

Log Message:
Fix to deal with CVE-2009-4355 from OpenSSL's repositroy.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/crypto/external/bsd/openssl/dist/crypto/comp/c_zlib.c

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

Modified files:

Index: src/crypto/external/bsd/openssl/dist/crypto/comp/c_zlib.c
diff -u src/crypto/external/bsd/openssl/dist/crypto/comp/c_zlib.c:1.1.1.1 src/crypto/external/bsd/openssl/dist/crypto/comp/c_zlib.c:1.2
--- src/crypto/external/bsd/openssl/dist/crypto/comp/c_zlib.c:1.1.1.1	Sun Jul 19 23:03:29 2009
+++ src/crypto/external/bsd/openssl/dist/crypto/comp/c_zlib.c	Fri Jan 22 03:42:47 2010
@@ -136,15 +136,6 @@
 
 static int zlib_stateful_ex_idx = -1;
 
-static void zlib_stateful_free_ex_data(void *obj, void *item,
-	CRYPTO_EX_DATA *ad, int ind,long argl, void *argp)
-	{
-	struct zlib_state *state = (struct zlib_state *)item;
-	inflateEnd(&state->istream);
-	deflateEnd(&state->ostream);
-	OPENSSL_free(state);
-	}
-
 static int zlib_stateful_init(COMP_CTX *ctx)
 	{
 	int err;
@@ -188,6 +179,12 @@
 
 static void zlib_stateful_finish(COMP_CTX *ctx)
 	{
+	struct zlib_state *state =
+		(struct zlib_state *)CRYPTO_get_ex_data(&ctx->ex_data,
+			zlib_stateful_ex_idx);
+	inflateEnd(&state->istream);
+	deflateEnd(&state->ostream);
+	OPENSSL_free(state);
 	CRYPTO_free_ex_data(CRYPTO_EX_INDEX_COMP,ctx,&ctx->ex_data);
 	}
 
@@ -402,7 +399,7 @@
 			if (zlib_stateful_ex_idx == -1)
 zlib_stateful_ex_idx =
 	CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_COMP,
-		0,NULL,NULL,NULL,zlib_stateful_free_ex_data);
+		0,NULL,NULL,NULL,NULL);
 			CRYPTO_w_unlock(CRYPTO_LOCK_COMP);
 			if (zlib_stateful_ex_idx == -1)
 goto err;



CVS commit: src/sys/dev/ata

2010-01-21 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Fri Jan 22 01:22:01 UTC 2010

Modified Files:
src/sys/dev/ata: atareg.h

Log Message:
Correct an error in previous commit.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/ata/atareg.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/atareg.h
diff -u src/sys/dev/ata/atareg.h:1.36 src/sys/dev/ata/atareg.h:1.37
--- src/sys/dev/ata/atareg.h:1.36	Thu Jan 21 23:26:58 2010
+++ src/sys/dev/ata/atareg.h	Fri Jan 22 01:22:00 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: atareg.h,v 1.36 2010/01/21 23:26:58 jakllsch Exp $	*/
+/*	$NetBSD: atareg.h,v 1.37 2010/01/22 01:22:00 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.
@@ -501,7 +501,7 @@
 } __packed;
 
 struct ata_smart_thresholds {
-	uint16_		data_structure_revision;
+	uint16_t	data_structure_revision;
 	struct ata_smart_thresh	thresholds[30];
 	uint8_t		reserved[18];
 	uint8_t		vendor_specific[131];



CVS commit: src/sys/dev/ata

2010-01-21 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Thu Jan 21 23:26:58 UTC 2010

Modified Files:
src/sys/dev/ata: atareg.h

Log Message:
Convert to C99 types. Make whitespace more consistent.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/ata/atareg.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/atareg.h
diff -u src/sys/dev/ata/atareg.h:1.35 src/sys/dev/ata/atareg.h:1.36
--- src/sys/dev/ata/atareg.h:1.35	Sun Jan 10 16:04:25 2010
+++ src/sys/dev/ata/atareg.h	Thu Jan 21 23:26:58 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: atareg.h,v 1.35 2010/01/10 16:04:25 tsutsui Exp $	*/
+/*	$NetBSD: atareg.h,v 1.36 2010/01/21 23:26:58 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.
@@ -261,7 +261,7 @@
  */
 struct ataparams {
 /* drive info */
-u_int16_t	atap_config;		/* 0: general configuration */
+uint16_t	atap_config;		/* 0: general configuration */
 #define WDC_CFG_ATAPI_MASK	0xc000
 #define WDC_CFG_ATAPI	0x8000
 #define	ATA_CFG_REMOVABLE	0x0080
@@ -277,21 +277,21 @@
 #define ATAPI_CFG_CMD_12	0x
 #define ATAPI_CFG_CMD_16	0x0001
 /* words 1-9 are ATA only */
-u_int16_t	atap_cylinders;		/* 1: # of non-removable cylinders */
-u_int16_t	__reserved1;
-u_int16_t	atap_heads;		/* 3: # of heads */
-u_int16_t	__retired1[2];		/* 4-5: # of unform. bytes/track */
-u_int16_t	atap_sectors;		/* 6: # of sectors */
-u_int16_t	__retired2[3];
-
-u_int8_t	atap_serial[20];	/* 10-19: serial number */
-u_int16_t	__retired3[2];
-u_int16_t	__obsolete1;
-u_int8_t	atap_revision[8];	/* 23-26: firmware revision */
-u_int8_t	atap_model[40];		/* 27-46: model number */
-u_int16_t	atap_multi;		/* 47: maximum sectors per irq (ATA) */
-u_int16_t	__reserved2;
-u_int16_t	atap_capabilities1;	/* 49: capability flags */
+uint16_t	atap_cylinders;		/* 1: # of non-removable cylinders */
+uint16_t	__reserved1;
+uint16_t	atap_heads;		/* 3: # of heads */
+uint16_t	__retired1[2];		/* 4-5: # of unform. bytes/track */
+uint16_t	atap_sectors;		/* 6: # of sectors */
+uint16_t	__retired2[3];
+
+uint8_t	atap_serial[20];	/* 10-19: serial number */
+uint16_t	__retired3[2];
+uint16_t	__obsolete1;
+uint8_t	atap_revision[8];	/* 23-26: firmware revision */
+uint8_t	atap_model[40];		/* 27-46: model number */
+uint16_t	atap_multi;		/* 47: maximum sectors per irq (ATA) */
+uint16_t	__reserved2;
+uint16_t	atap_capabilities1;	/* 49: capability flags */
 #define WDC_CAP_IORDY	0x0800
 #define WDC_CAP_IORDY_DSBL 0x0400
 #define	WDC_CAP_LBA	0x0200
@@ -301,69 +301,69 @@
 #define ATAPI_CAP_CMD_QUEUE	0x4000
 #define	ATAPI_CAP_OVERLP	0X2000
 #define ATAPI_CAP_ATA_RST	0x1000
-u_int16_t	atap_capabilities2;	/* 50: capability flags (ATA) */
+uint16_t	atap_capabilities2;	/* 50: capability flags (ATA) */
 #if BYTE_ORDER == LITTLE_ENDIAN
-u_int8_t	__junk2;
-u_int8_t	atap_oldpiotiming;	/* 51: old PIO timing mode */
-u_int8_t	__junk3;
-u_int8_t	atap_olddmatiming;	/* 52: old DMA timing mode (ATA) */
+uint8_t	__junk2;
+uint8_t	atap_oldpiotiming;	/* 51: old PIO timing mode */
+uint8_t	__junk3;
+uint8_t	atap_olddmatiming;	/* 52: old DMA timing mode (ATA) */
 #else
-u_int8_t	atap_oldpiotiming;	/* 51: old PIO timing mode */
-u_int8_t	__junk2;
-u_int8_t	atap_olddmatiming;	/* 52: old DMA timing mode (ATA) */
-u_int8_t	__junk3;
+uint8_t	atap_oldpiotiming;	/* 51: old PIO timing mode */
+uint8_t	__junk2;
+uint8_t	atap_olddmatiming;	/* 52: old DMA timing mode (ATA) */
+uint8_t	__junk3;
 #endif
-u_int16_t	atap_extensions;	/* 53: extensions supported */
+uint16_t	atap_extensions;	/* 53: extensions supported */
 #define WDC_EXT_UDMA_MODES	0x0004
 #define WDC_EXT_MODES		0x0002
 #define WDC_EXT_GEOM		0x0001
 /* words 54-62 are ATA only */
-u_int16_t	atap_curcylinders;	/* 54: current logical cylinders */
-u_int16_t	atap_curheads;		/* 55: current logical heads */
-u_int16_t	atap_cursectors;	/* 56: current logical sectors/tracks */
-u_int16_t	atap_curcapacity[2];	/* 57-58: current capacity */
-u_int16_t	atap_curmulti;		/* 59: current multi-sector setting */
+uint16_t	atap_curcylinders;	/* 54: current logical cylinders */
+uint16_t	atap_curheads;		/* 55: current logical heads */
+uint16_t	atap_cursectors;	/* 56: current logical sectors/tracks */
+uint16_t	atap_curcapacity[2];	/* 57-58: current capacity */
+uint16_t	atap_curmulti;		/* 59: current multi-sector setting */
 #define WDC_MULTI_VALID 0x0100
 #define WDC_MULTI_MASK  0x00ff
-u_int16_t	atap_capacity[2];  	/* 60-61: total capacity (LBA only) */
-u_int16_t	__retired4;
+uint16_t	atap_capacity[2];  	/* 60-61: total capacity (LBA only) */
+uint16_t	__retired4;
 #if BYTE_ORDER == LITTLE_ENDIAN
-u_int8_t	atap_dmamode_supp; 	/* 63: mult

CVS commit: src/sys/dev/pci

2010-01-21 Thread Hubert Feyrer
Module Name:src
Committed By:   hubertf
Date:   Thu Jan 21 23:23:44 UTC 2010

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
add/improve a few devices


To generate a diff of this commit:
cvs rdiff -u -r1.1015 -r1.1016 src/sys/dev/pci/pcidevs

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/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1015 src/sys/dev/pci/pcidevs:1.1016
--- src/sys/dev/pci/pcidevs:1.1015	Tue Jan 19 11:43:33 2010
+++ src/sys/dev/pci/pcidevs	Thu Jan 21 23:23:44 2010
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1015 2010/01/19 11:43:33 mbalmer Exp $
+$NetBSD: pcidevs,v 1.1016 2010/01/21 23:23:44 hubertf Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -1916,8 +1916,8 @@
 product O2MICRO OZ6922		0x6925	OZ6922 PCI-CardBus Bridge
 product O2MICRO OZ6933		0x6933	OZ6933 PCI-CardBus Bridge
 product O2MICRO OZ6972		0x6972	OZ6912/OZ6972 PCI-CardBus Bridge
-product O2MICRO 7120		0x7120	Integrated MMC/SD Controller
-product O2MICRO 7130		0x7130	Integrated MS/xD/SM Controller
+product O2MICRO 7120		0x7120	OZ7120 Integrated MMC/SD Controller
+product O2MICRO 7130		0x7130	OZ7130 Integrated MS/xD/SM Controller
 product O2MICRO 7223		0x7223	OZ711E0 PCI-CardBus Bridge
 
 /* Evans & Sutherland products */
@@ -3522,6 +3522,7 @@
 product PLX 9054	0x9054	9054 I/O Accelerator
 product PLX 9060ES	0x906e	9060ES PCI Bus Controller
 product PLX 9656	0x9656	9656 I/O Accelerator
+product PLX 9656FPBGA	0x5601	9656 I/O Accelerator FPBGA
 
 /* Powerhouse Systems products */
 product POWERHOUSE POWERTOP	0x6037	PowerTop PowerPC System Controller



CVS commit: src/sys/net

2010-01-21 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Thu Jan 21 20:51:31 UTC 2010

Modified Files:
src/sys/net: bpfdesc.h

Log Message:
Spelling fix: correspoding -> corresponding.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/net/bpfdesc.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/net/bpfdesc.h
diff -u src/sys/net/bpfdesc.h:1.30 src/sys/net/bpfdesc.h:1.31
--- src/sys/net/bpfdesc.h:1.30	Sat Apr 11 15:47:33 2009
+++ src/sys/net/bpfdesc.h	Thu Jan 21 20:51:31 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: bpfdesc.h,v 1.30 2009/04/11 15:47:33 christos Exp $	*/
+/*	$NetBSD: bpfdesc.h,v 1.31 2010/01/21 20:51:31 dyoung Exp $	*/
 
 /*
  * Copyright (c) 1990, 1991, 1993
@@ -132,7 +132,7 @@
 	struct bpf_if **bif_driverp;	/* pointer into softc */
 	u_int bif_dlt;			/* link layer type */
 	u_int bif_hdrlen;		/* length of header (with padding) */
-	struct ifnet *bif_ifp;		/* correspoding interface */
+	struct ifnet *bif_ifp;		/* corresponding interface */
 };
 
 #ifdef _KERNEL



CVS commit: [netbsd-4] src/doc

2010-01-21 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Thu Jan 21 19:33:05 UTC 2010

Modified Files:
src/doc [netbsd-4]: CHANGES-4.1

Log Message:
Update description of ticket 1376: the patch applied is the equivalent
of 9.4.3 to 9.4.3-P5, not 9.4.2 to 9.4.3-P5.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.193 -r1.1.2.194 src/doc/CHANGES-4.1

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

Modified files:

Index: src/doc/CHANGES-4.1
diff -u src/doc/CHANGES-4.1:1.1.2.193 src/doc/CHANGES-4.1:1.1.2.194
--- src/doc/CHANGES-4.1:1.1.2.193	Thu Jan 21 19:09:02 2010
+++ src/doc/CHANGES-4.1	Thu Jan 21 19:33:05 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: CHANGES-4.1,v 1.1.2.193 2010/01/21 19:09:02 snj Exp $
+#	$NetBSD: CHANGES-4.1,v 1.1.2.194 2010/01/21 19:33:05 snj Exp $
 
 A complete list of changes from the NetBSD 4.0 release to the NetBSD 4.1
 release:
@@ -3992,6 +3992,7 @@
 dist/bind/lib/lwres/man/lwres_resutil.html	patch
 dist/bind/versionpatch
 
-	Update BIND to 9.4.3-P5, fixing a number of security issues.
+	Backport changes from 9.4.3-9.4.3-P5 to 9.4.2, fixing a number of
+	security issues.
 	[christos, ticket #1376]
 



CVS commit: [netbsd-4-0] src/doc

2010-01-21 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Thu Jan 21 19:32:42 UTC 2010

Modified Files:
src/doc [netbsd-4-0]: CHANGES-4.0.2

Log Message:
Update description of ticket 1376: the patch applied is the equivalent
of 9.4.3 to 9.4.3-P5, not 9.4.2 to 9.4.3-P5.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.67 -r1.1.2.68 src/doc/CHANGES-4.0.2

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

Modified files:

Index: src/doc/CHANGES-4.0.2
diff -u src/doc/CHANGES-4.0.2:1.1.2.67 src/doc/CHANGES-4.0.2:1.1.2.68
--- src/doc/CHANGES-4.0.2:1.1.2.67	Thu Jan 21 19:05:41 2010
+++ src/doc/CHANGES-4.0.2	Thu Jan 21 19:32:42 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: CHANGES-4.0.2,v 1.1.2.67 2010/01/21 19:05:41 snj Exp $
+#	$NetBSD: CHANGES-4.0.2,v 1.1.2.68 2010/01/21 19:32:42 snj Exp $
 
 A complete list of changes from the NetBSD 4.0.1 release to the NetBSD 4.0.2
 release:
@@ -1016,6 +1016,7 @@
 dist/bind/lib/lwres/man/lwres_resutil.html	patch
 dist/bind/versionpatch
 
-	Update BIND to 9.4.3-P5, fixing a number of security issues.
+	Backport changes from 9.4.3-9.4.3-P5 to 9.4.2, fixing a number of
+	security issues.
 	[christos, ticket #1376]
 



CVS commit: [netbsd-4] src/doc

2010-01-21 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Thu Jan 21 19:09:02 UTC 2010

Modified Files:
src/doc [netbsd-4]: CHANGES-4.1

Log Message:
Ticket 1376.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.192 -r1.1.2.193 src/doc/CHANGES-4.1

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

Modified files:

Index: src/doc/CHANGES-4.1
diff -u src/doc/CHANGES-4.1:1.1.2.192 src/doc/CHANGES-4.1:1.1.2.193
--- src/doc/CHANGES-4.1:1.1.2.192	Thu Jan 21 08:35:30 2010
+++ src/doc/CHANGES-4.1	Thu Jan 21 19:09:02 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: CHANGES-4.1,v 1.1.2.192 2010/01/21 08:35:30 snj Exp $
+#	$NetBSD: CHANGES-4.1,v 1.1.2.193 2010/01/21 19:09:02 snj Exp $
 
 A complete list of changes from the NetBSD 4.0 release to the NetBSD 4.1
 release:
@@ -3956,3 +3956,42 @@
 	Signedness bug/crash in azalia.  Fixes PR 42604.
 	[tonnerre, ticket #1375]
 
+dist/bind/CHANGESpatch
+dist/bind/FAQ	patch
+dist/bind/FAQ.xmlpatch
+dist/bind/bin/named/query.c			patch
+dist/bind/bin/tests/system/conf.sh.in		patch
+dist/bind/bin/tests/system/dnssec/ns2/example.db.in patch
+dist/bind/bin/tests/system/dnssec/ns2/sign.sh	patch
+dist/bind/bin/tests/system/dnssec/tests.sh	patch
+dist/bind/doc/rfc/indexpatch
+dist/bind/lib/dns/apipatch
+dist/bind/lib/dns/include/dns/types.h		patch
+dist/bind/lib/dns/masterdump.c			patch
+dist/bind/lib/dns/openssldsa_link.c		patch
+dist/bind/lib/dns/opensslrsa_link.c		patch
+dist/bind/lib/dns/rbtdb.c			patch
+dist/bind/lib/dns/resolver.c			patch
+dist/bind/lib/dns/validator.c			patch
+dist/bind/lib/lwres/man/lwres.html		patch
+dist/bind/lib/lwres/man/lwres_buffer.html	patch
+dist/bind/lib/lwres/man/lwres_config.html	patch
+dist/bind/lib/lwres/man/lwres_context.html	patch
+dist/bind/lib/lwres/man/lwres_gabn.html		patch
+dist/bind/lib/lwres/man/lwres_gai_strerror.html	patch
+dist/bind/lib/lwres/man/lwres_getaddrinfo.html	patch
+dist/bind/lib/lwres/man/lwres_gethostent.html	patch
+dist/bind/lib/lwres/man/lwres_getipnode.html	patch
+dist/bind/lib/lwres/man/lwres_getnameinfo.html	patch
+dist/bind/lib/lwres/man/lwres_getrrsetbyname.html patch
+dist/bind/lib/lwres/man/lwres_gnba.html		patch
+dist/bind/lib/lwres/man/lwres_hstrerror.html	patch
+dist/bind/lib/lwres/man/lwres_inetntop.html	patch
+dist/bind/lib/lwres/man/lwres_noop.html		patch
+dist/bind/lib/lwres/man/lwres_packet.html	patch
+dist/bind/lib/lwres/man/lwres_resutil.html	patch
+dist/bind/versionpatch
+
+	Update BIND to 9.4.3-P5, fixing a number of security issues.
+	[christos, ticket #1376]
+



CVS commit: [netbsd-4-0] src/doc

2010-01-21 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Thu Jan 21 19:05:41 UTC 2010

Modified Files:
src/doc [netbsd-4-0]: CHANGES-4.0.2

Log Message:
Ticket 1376.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.66 -r1.1.2.67 src/doc/CHANGES-4.0.2

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

Modified files:

Index: src/doc/CHANGES-4.0.2
diff -u src/doc/CHANGES-4.0.2:1.1.2.66 src/doc/CHANGES-4.0.2:1.1.2.67
--- src/doc/CHANGES-4.0.2:1.1.2.66	Thu Jan 21 08:37:19 2010
+++ src/doc/CHANGES-4.0.2	Thu Jan 21 19:05:41 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: CHANGES-4.0.2,v 1.1.2.66 2010/01/21 08:37:19 snj Exp $
+#	$NetBSD: CHANGES-4.0.2,v 1.1.2.67 2010/01/21 19:05:41 snj Exp $
 
 A complete list of changes from the NetBSD 4.0.1 release to the NetBSD 4.0.2
 release:
@@ -980,3 +980,42 @@
 	Signedness bug/crash in azalia.  Fixes PR 42604.
 	[tonnerre, ticket #1375]
 
+dist/bind/CHANGESpatch
+dist/bind/FAQ	patch
+dist/bind/FAQ.xmlpatch
+dist/bind/bin/named/query.c			patch
+dist/bind/bin/tests/system/conf.sh.in		patch
+dist/bind/bin/tests/system/dnssec/ns2/example.db.in patch
+dist/bind/bin/tests/system/dnssec/ns2/sign.sh	patch
+dist/bind/bin/tests/system/dnssec/tests.sh	patch
+dist/bind/doc/rfc/indexpatch
+dist/bind/lib/dns/apipatch
+dist/bind/lib/dns/include/dns/types.h		patch
+dist/bind/lib/dns/masterdump.c			patch
+dist/bind/lib/dns/openssldsa_link.c		patch
+dist/bind/lib/dns/opensslrsa_link.c		patch
+dist/bind/lib/dns/rbtdb.c			patch
+dist/bind/lib/dns/resolver.c			patch
+dist/bind/lib/dns/validator.c			patch
+dist/bind/lib/lwres/man/lwres.html		patch
+dist/bind/lib/lwres/man/lwres_buffer.html	patch
+dist/bind/lib/lwres/man/lwres_config.html	patch
+dist/bind/lib/lwres/man/lwres_context.html	patch
+dist/bind/lib/lwres/man/lwres_gabn.html		patch
+dist/bind/lib/lwres/man/lwres_gai_strerror.html	patch
+dist/bind/lib/lwres/man/lwres_getaddrinfo.html	patch
+dist/bind/lib/lwres/man/lwres_gethostent.html	patch
+dist/bind/lib/lwres/man/lwres_getipnode.html	patch
+dist/bind/lib/lwres/man/lwres_getnameinfo.html	patch
+dist/bind/lib/lwres/man/lwres_getrrsetbyname.html patch
+dist/bind/lib/lwres/man/lwres_gnba.html		patch
+dist/bind/lib/lwres/man/lwres_hstrerror.html	patch
+dist/bind/lib/lwres/man/lwres_inetntop.html	patch
+dist/bind/lib/lwres/man/lwres_noop.html		patch
+dist/bind/lib/lwres/man/lwres_packet.html	patch
+dist/bind/lib/lwres/man/lwres_resutil.html	patch
+dist/bind/versionpatch
+
+	Update BIND to 9.4.3-P5, fixing a number of security issues.
+	[christos, ticket #1376]
+



CVS commit: src/usr.bin/config

2010-01-21 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Jan 21 18:06:38 UTC 2010

Modified Files:
src/usr.bin/config: pack.c

Log Message:
Add static to packdevi() like the local prototype says.


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

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

Modified files:

Index: src/usr.bin/config/pack.c
diff -u src/usr.bin/config/pack.c:1.6 src/usr.bin/config/pack.c:1.7
--- src/usr.bin/config/pack.c:1.6	Sat Apr 11 12:41:10 2009
+++ src/usr.bin/config/pack.c	Thu Jan 21 18:06:38 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pack.c,v 1.6 2009/04/11 12:41:10 lukem Exp $	*/
+/*	$NetBSD: pack.c,v 1.7 2010/01/21 18:06:38 pooka Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -132,7 +132,7 @@
 /*
  * Pack device instances together wherever possible.
  */
-void
+static void
 packdevi(void)
 {
 	struct devi *firststar, *i, **ip, *l, *p;



CVS commit: src/sys/dev/pci

2010-01-21 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Jan 21 17:40:09 UTC 2010

Modified Files:
src/sys/dev/pci: if_gem_pci.c

Log Message:
get rid of architecture-specific firmware calls to determine the MAC address
on sparc(64) and macppc - use device properties instead
tested by myself on macppc and martin on sparc64


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/dev/pci/if_gem_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/if_gem_pci.c
diff -u src/sys/dev/pci/if_gem_pci.c:1.40 src/sys/dev/pci/if_gem_pci.c:1.41
--- src/sys/dev/pci/if_gem_pci.c:1.40	Tue Jan 19 22:07:00 2010
+++ src/sys/dev/pci/if_gem_pci.c	Thu Jan 21 17:40:09 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_gem_pci.c,v 1.40 2010/01/19 22:07:00 pooka Exp $ */
+/*	$NetBSD: if_gem_pci.c,v 1.41 2010/01/21 17:40:09 macallan Exp $ */
 
 /*
  *
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_gem_pci.c,v 1.40 2010/01/19 22:07:00 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_gem_pci.c,v 1.41 2010/01/21 17:40:09 macallan Exp $");
 
 #include 
 #include 
@@ -68,23 +68,7 @@
 #include 
 #include 
 #include 
-
-/* XXX Should use Properties when that's fleshed out. */
-#ifdef macppc
-#include 
-#endif /* macppc */
-#ifdef __sparc__
-#include 
-#endif
-
-#ifndef GEM_USE_LOCAL_MAC_ADDRESS
-#if defined (macppc) || defined (__sparc__)
-#define GEM_USE_LOCAL_MAC_ADDRESS	0	/* use system-wide address */
-#else
-#define GEM_USE_LOCAL_MAC_ADDRESS	1
-#endif
-#endif
-
+#include 
 
 struct gem_pci_softc {
 	struct	gem_softc	gsc_gem;	/* GEM device */
@@ -133,7 +117,6 @@
 	return (0);
 }
 
-#if GEM_USE_LOCAL_MAC_ADDRESS
 static inline int
 gempromvalid(u_int8_t* buf)
 {
@@ -153,7 +136,6 @@
 	buf[6] == '-' && buf[7] == 'p' && buf[8] == 'i' &&
 	buf[9] == 'n' && buf[10] == 's';
 }
-#endif
 
 static inline int
 isserdes(u_int8_t* buf)
@@ -169,15 +151,13 @@
 	struct gem_pci_softc *gsc = device_private(self);
 	struct gem_softc *sc = &gsc->gsc_gem;
 	char devinfo[256];
+	prop_data_t data;
 	uint8_t enaddr[ETHER_ADDR_LEN];
-#if GEM_USE_LOCAL_MAC_ADDRESS
 	u_int8_t		*enp;
 	bus_space_handle_t	romh;
 	u_int8_t		buf[0x0800];
 	int			dataoff, vpdoff, serdes;
-#if GEM_USE_LOCAL_MAC_ADDRESS || defined(GEM_DEBUG)
-	int i;
-#endif
+	int i, got_addr = 0;
 #ifdef GEM_DEBUG
 	int j;
 #endif
@@ -192,7 +172,6 @@
 	};
 #define PROMDATA_PTR_VPD	0x08
 #define PROMDATA_DATA2		0x0a
-#endif  /* GEM_USE_LOCAL_MAC_ADDRESS */
 
 	aprint_naive(": Ethernet controller\n");
 
@@ -251,141 +230,130 @@
 		return;
 	}
 
-#if GEM_USE_LOCAL_MAC_ADDRESS
-	/*
-	 * Dig out VPD (vital product data) and acquire Ethernet address.
-	 * The VPD of gem resides in the PCI PROM (PCI FCode).
-	 */
-	/*
-	 * ``Writing FCode 3.x Programs'' (newer ones, dated 1997 and later)
-	 * chapter 2 describes the data structure.
-	 */
-
-	enp = NULL;
-
-	if (sc->sc_variant == GEM_SUN_GEM &&
-	(bus_space_subregion(sc->sc_bustag, sc->sc_h1,
-	GEM_PCI_ROM_OFFSET, GEM_PCI_ROM_SIZE, &romh)) == 0) {
-
-		/* read PCI Expansion PROM Header */
-		bus_space_read_region_1(sc->sc_bustag,
-		romh, 0, buf, sizeof buf);
-
-		/* Check for "shared-pins = serdes" in FCode. */
-		i = 0;
-		serdes = 0;
-		while (i < (sizeof buf) - sizeof "serdes") {
-			if (!serdes) {
-if (isserdes(&buf[i]))
-	serdes = 1;
-			} else {
-if (isshared_pins(&buf[i]))
-	serdes = 2;
-			}
-			if (serdes == 2) {
+	if ((data = prop_dictionary_get(device_properties(sc->sc_dev),
+	"mac-address")) != NULL) {
+		memcpy(enaddr, prop_data_data_nocopy(data), ETHER_ADDR_LEN);
+		got_addr = 1;
+		if ((data = prop_dictionary_get(device_properties(sc->sc_dev),
+		"shared-pins")) != NULL) {
+			memcpy(buf, prop_data_data_nocopy(data),
+			prop_data_size(data));
+			if (isserdes(buf)) {
 sc->sc_flags |= GEM_SERDES;
-break;
 			}
-			i++;
 		}
-#ifdef GEM_DEBUG
-		/* PROM dump */
-		printf("%s: PROM dump (0x to %04lx)\n", device_xname(sc->sc_dev),
-		(sizeof buf) - 1);
-		i = 0;
-		j = 0;
-		printf("  %04x  ", i);
-		while (i < sizeof buf) {
-			printf("%02x ", buf[i]);
-			if (i && !(i % 8))
-printf(" ");
-			if (i && !(i % 16)) {
-printf(" ");
-while (j < i) {
-	if (buf[j] > 31 && buf[j] < 128)
-		printf("%c", buf[j]);
-	else
-		printf(".");
-	j++;
+	} else {
+		/*
+		 * Dig out VPD (vital product data) and acquire Ethernet address.
+		 * The VPD of gem resides in the PCI PROM (PCI FCode).
+		 */
+		/*
+		 * ``Writing FCode 3.x Programs'' (newer ones, dated 1997 and later)
+		 * chapter 2 describes the data structure.
+		 */
+
+		enp = NULL;
+
+		if (sc->sc_variant == GEM_SUN_GEM &&
+		(bus_space_subregion(sc->sc_bustag, sc->sc_h1,
+		GEM_PCI_ROM_OFFSET, GEM_PCI_ROM_SIZE, &romh)) == 0) {
+
+			/* read PCI Expansion PROM Header */
+			bus_space_read_region_1(sc->sc_bustag,
+			romh, 0, buf, sizeof buf);
+
+			/* 

CVS commit: src/sys/dev/pci

2010-01-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jan 21 16:14:39 UTC 2010

Modified Files:
src/sys/dev/pci: if_tlp_pci.c

Log Message:
Remove sparc specific code, rely on device properties instead


To generate a diff of this commit:
cvs rdiff -u -r1.115 -r1.116 src/sys/dev/pci/if_tlp_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/if_tlp_pci.c
diff -u src/sys/dev/pci/if_tlp_pci.c:1.115 src/sys/dev/pci/if_tlp_pci.c:1.116
--- src/sys/dev/pci/if_tlp_pci.c:1.115	Tue Sep  1 21:46:53 2009
+++ src/sys/dev/pci/if_tlp_pci.c	Thu Jan 21 16:14:39 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_tlp_pci.c,v 1.115 2009/09/01 21:46:53 jmcneill Exp $	*/
+/*	$NetBSD: if_tlp_pci.c,v 1.116 2010/01/21 16:14:39 martin Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2002 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_tlp_pci.c,v 1.115 2009/09/01 21:46:53 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_tlp_pci.c,v 1.116 2010/01/21 16:14:39 martin Exp $");
 
 #include 
 #include 
@@ -57,9 +57,6 @@
 
 #include 
 #include 
-#ifdef __sparc__
-#include 
-#endif
 
 #include 
 #include 
@@ -645,7 +642,7 @@
 		 * XXX dependent wart from the PCI front-end.
 		 */
 		ea = prop_dictionary_get(device_properties(self),
-	 "mac-addr");
+	 "mac-address");
 		if (ea != NULL) {
 			extern int tlp_srom_debug;
 			KASSERT(prop_object_type(ea) == PROP_TYPE_DATA);
@@ -930,17 +927,20 @@
 		 * multi-port boards).
 		 */
 		if (!tlp_isv_srom_enaddr(sc, enaddr)) {
-#ifdef __sparc__
-			if ((sc->sc_srom[20] == 0 &&
-			 sc->sc_srom[21] == 0 &&
-			 sc->sc_srom[22] == 0) ||
-			(sc->sc_srom[20] == 0xff &&
-			 sc->sc_srom[21] == 0xff &&
-			 sc->sc_srom[22] == 0xff)) {
-prom_getether(PCITAG_NODE(pa->pa_tag), enaddr);
-			} else
-#endif
-			memcpy(enaddr, &sc->sc_srom[20], ETHER_ADDR_LEN);
+
+			prop_data_t eaddrprop;
+
+			eaddrprop = prop_dictionary_get(
+device_properties(self), "mac-address");
+
+			if (eaddrprop != NULL
+			&& prop_data_size(eaddrprop) == ETHER_ADDR_LEN)
+memcpy(enaddr,
+prop_data_data_nocopy(eaddrprop),
+ETHER_ADDR_LEN);
+			else
+memcpy(enaddr, &sc->sc_srom[20],
+ETHER_ADDR_LEN);
 		}
 
 		/*



CVS commit: src/sys/arch/sparc64/sparc64

2010-01-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jan 21 15:58:32 UTC 2010

Modified Files:
src/sys/arch/sparc64/sparc64: autoconf.c

Log Message:
Copy the "shared-pins" property over to device_props as well.


To generate a diff of this commit:
cvs rdiff -u -r1.165 -r1.166 src/sys/arch/sparc64/sparc64/autoconf.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/sparc64/sparc64/autoconf.c
diff -u src/sys/arch/sparc64/sparc64/autoconf.c:1.165 src/sys/arch/sparc64/sparc64/autoconf.c:1.166
--- src/sys/arch/sparc64/sparc64/autoconf.c:1.165	Thu Jan 21 11:43:20 2010
+++ src/sys/arch/sparc64/sparc64/autoconf.c	Thu Jan 21 15:58:32 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.165 2010/01/21 11:43:20 martin Exp $ */
+/*	$NetBSD: autoconf.c,v 1.166 2010/01/21 15:58:32 martin Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.165 2010/01/21 11:43:20 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.166 2010/01/21 15:58:32 martin Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -945,6 +945,8 @@
 			blob = prop_data_create_data(eaddr, ETHER_ADDR_LEN);
 			prop_dictionary_set(dict, "mac-address", blob);
 			prop_object_release(blob);
+			of_to_dataprop(dict, ofnode, "shared-pins",
+			"shared-pins");
 		}
 noether:
 



CVS commit: src/sys/dev/ofw

2010-01-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jan 21 15:56:08 UTC 2010

Modified Files:
src/sys/dev/ofw: ofw_subr.c

Log Message:
fix a ref counting leak


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/ofw/ofw_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/dev/ofw/ofw_subr.c
diff -u src/sys/dev/ofw/ofw_subr.c:1.15 src/sys/dev/ofw/ofw_subr.c:1.16
--- src/sys/dev/ofw/ofw_subr.c:1.15	Wed Nov 11 16:56:52 2009
+++ src/sys/dev/ofw/ofw_subr.c	Thu Jan 21 15:56:08 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ofw_subr.c,v 1.15 2009/11/11 16:56:52 macallan Exp $	*/
+/*	$NetBSD: ofw_subr.c,v 1.16 2010/01/21 15:56:08 martin Exp $	*/
 
 /*
  * Copyright 1998
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ofw_subr.c,v 1.15 2009/11/11 16:56:52 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofw_subr.c,v 1.16 2010/01/21 15:56:08 martin Exp $");
 
 #include 
 #include 
@@ -283,13 +283,16 @@
 	prop_data_t data;
 	int len;
 	uint8_t prop[256];
+	boolean_t res;
 
 	len = OF_getprop(node, ofname, prop, 256);
 	if (len < 1)
 		return FALSE;
 
 	data = prop_data_create_data(prop, len);
-	return(prop_dictionary_set(dict, propname, data));
+	res = prop_dictionary_set(dict, propname, data);
+	prop_object_release(data);
+	return res;
 }
 
 /*



CVS commit: src/tools/compat

2010-01-21 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Thu Jan 21 12:55:04 UTC 2010

Modified Files:
src/tools/compat: nbtool_config.h.in

Log Message:
Regen this properly per procedure described in src/tools/compat/configure.ac.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/tools/compat/nbtool_config.h.in

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

Modified files:

Index: src/tools/compat/nbtool_config.h.in
diff -u src/tools/compat/nbtool_config.h.in:1.24 src/tools/compat/nbtool_config.h.in:1.25
--- src/tools/compat/nbtool_config.h.in:1.24	Fri Jan 15 11:26:25 2010
+++ src/tools/compat/nbtool_config.h.in	Thu Jan 21 12:55:04 2010
@@ -1,6 +1,6 @@
 /* nbtool_config.h.in.  Generated automatically from configure.ac by autoheader.  */
 
-/*  $NetBSD: nbtool_config.h.in,v 1.24 2010/01/15 11:26:25 asau Exp $*/
+/*  $NetBSD: nbtool_config.h.in,v 1.25 2010/01/21 12:55:04 tsutsui Exp $*/
  
 #ifndef __NETBSD_NBTOOL_CONFIG_H__
 #define __NETBSD_NBTOOL_CONFIG_H__
@@ -336,9 +336,6 @@
 /* Define if you have the  header file. */
 #undef HAVE_MACHINE_ENDIAN_H
 
-/* Define if you have the  header file. */
-#undef HAVE_SYS_ENDIAN_H
-
 /* Define if you have the  header file. */
 #undef HAVE_MALLOC_H
 
@@ -492,6 +489,9 @@
 /* Define if you have the  header file, and it defines `DIR'. */
 #undef HAVE_SYS_DIR_H
 
+/* Define if you have the  header file. */
+#undef HAVE_SYS_ENDIAN_H
+
 /* Define if you have the  header file. */
 #undef HAVE_SYS_FEATURETEST_H
 



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

2010-01-21 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Jan 21 12:02:25 UTC 2010

Modified Files:
src/sys/arch/i386/conf: GENERIC

Log Message:
remove accidentally committed bit.  pointed out by Patrick Welche


To generate a diff of this commit:
cvs rdiff -u -r1.960 -r1.961 src/sys/arch/i386/conf/GENERIC

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

Modified files:

Index: src/sys/arch/i386/conf/GENERIC
diff -u src/sys/arch/i386/conf/GENERIC:1.960 src/sys/arch/i386/conf/GENERIC:1.961
--- src/sys/arch/i386/conf/GENERIC:1.960	Tue Jan 19 22:06:20 2010
+++ src/sys/arch/i386/conf/GENERIC	Thu Jan 21 12:02:25 2010
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.960 2010/01/19 22:06:20 pooka Exp $
+# $NetBSD: GENERIC,v 1.961 2010/01/21 12:02:25 pooka Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.960 $"
+#ident 		"GENERIC-$Revision: 1.961 $"
 
 maxusers	64		# estimated number of users
 
@@ -90,7 +90,7 @@
 options 	RTC_OFFSET=0	# hardware clock is this many mins. west of GMT
 options 	NTP		# NTP phase/frequency locked loop
 
-#options 	KTRACE		# system call tracing via ktrace(1)
+options 	KTRACE		# system call tracing via ktrace(1)
 
 # Note: SysV IPC parameters could be changed dynamically, see sysctl(8).
 options 	SYSVMSG		# System V-like message queues



CVS commit: src/sys/arch/sparc64/sparc64

2010-01-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jan 21 11:43:20 UTC 2010

Modified Files:
src/sys/arch/sparc64/sparc64: autoconf.c

Log Message:
Make sure to not provide the global ethernet address for add on
interfaces w/o FCode (the respective driver will know what to do).


To generate a diff of this commit:
cvs rdiff -u -r1.164 -r1.165 src/sys/arch/sparc64/sparc64/autoconf.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/sparc64/sparc64/autoconf.c
diff -u src/sys/arch/sparc64/sparc64/autoconf.c:1.164 src/sys/arch/sparc64/sparc64/autoconf.c:1.165
--- src/sys/arch/sparc64/sparc64/autoconf.c:1.164	Wed Jan 20 15:45:52 2010
+++ src/sys/arch/sparc64/sparc64/autoconf.c	Thu Jan 21 11:43:20 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.164 2010/01/20 15:45:52 martin Exp $ */
+/*	$NetBSD: autoconf.c,v 1.165 2010/01/21 11:43:20 martin Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.164 2010/01/20 15:45:52 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.165 2010/01/21 11:43:20 martin Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -927,21 +927,26 @@
 		if (strcmp(tmpstr, "network") == 0
 		   || strcmp(tmpstr, "ethernet") == 0
 		   || OF_getprop(ofnode, "mac-address", &eaddr, sizeof(eaddr))
-		  == sizeof(eaddr)) {
-			prom_getether(ofnode, eaddr);
+		  >= ETHER_ADDR_LEN) {
+
 			dict = device_properties(dev);
+
+			/*
+			 * Is it a network interface with FCode?
+			 */
+			if (strcmp(tmpstr, "network") == 0) {
+prop_dictionary_set_bool(dict,
+"without-seeprom", true);
+prom_getether(ofnode, eaddr);
+			} else {
+if (!prom_get_node_ether(ofnode, eaddr))
+	goto noether;
+			}
 			blob = prop_data_create_data(eaddr, ETHER_ADDR_LEN);
 			prop_dictionary_set(dict, "mac-address", blob);
 			prop_object_release(blob);
 		}
-		/*
-		 * Is it a network interface with FCode? (others are called
-		 * "ethernet" by the firmware)
-		 */
-		if (strcmp(tmpstr, "network") == 0) {
-			dict = device_properties(dev);
-			prop_dictionary_set_bool(dict, "without-seeprom", true);
-		}
+noether:
 
 		/* is this a FC node? */
 		if (OF_getprop(ofnode, "device_type", tmpstr,



CVS commit: src/sys/arch/sparc

2010-01-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jan 21 11:40:02 UTC 2010

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

Log Message:
Split the part out of prom_getether() that deals with the local
firmware device node into a new function.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/sparc/include/promlib.h
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/sparc/sparc/promlib.c

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

Modified files:

Index: src/sys/arch/sparc/include/promlib.h
diff -u src/sys/arch/sparc/include/promlib.h:1.23 src/sys/arch/sparc/include/promlib.h:1.24
--- src/sys/arch/sparc/include/promlib.h:1.23	Mon Apr 28 20:23:36 2008
+++ src/sys/arch/sparc/include/promlib.h	Thu Jan 21 11:40:01 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: promlib.h,v 1.23 2008/04/28 20:23:36 martin Exp $ */
+/*	$NetBSD: promlib.h,v 1.24 2010/01/21 11:40:01 martin Exp $ */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -129,6 +129,7 @@
 
 struct idprom	*prom_getidprom(void);
 void		prom_getether(int, u_char *);
+bool		prom_get_node_ether(int, u_char*);
 const char	*prom_pa_location(u_int, u_int);
 
 void	prom_init(void);	/* To setup promops */

Index: src/sys/arch/sparc/sparc/promlib.c
diff -u src/sys/arch/sparc/sparc/promlib.c:1.41 src/sys/arch/sparc/sparc/promlib.c:1.42
--- src/sys/arch/sparc/sparc/promlib.c:1.41	Mon Apr 28 20:23:36 2008
+++ src/sys/arch/sparc/sparc/promlib.c	Thu Jan 21 11:40:01 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: promlib.c,v 1.41 2008/04/28 20:23:36 martin Exp $ */
+/*	$NetBSD: promlib.c,v 1.42 2010/01/21 11:40:01 martin Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: promlib.c,v 1.41 2008/04/28 20:23:36 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: promlib.c,v 1.42 2010/01/21 11:40:01 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_sparc_arch.h"
@@ -993,12 +993,24 @@
 
 void prom_getether(int node, u_char *cp)
 {
-	struct idprom *idp = prom_getidprom();
+	struct idprom *idp;
+
+	if (prom_get_node_ether(node, cp))
+		return;
+
+	/* Fall back on the machine's global ethernet address */
+	idp = prom_getidprom();
+	memcpy(cp, idp->idp_etheraddr, 6);
+}
+
+bool
+prom_get_node_ether(int node, u_char *cp)
+{
 	char buf[6+1], *bp;
 	int nitem;
 
 	if (node == 0)
-		goto read_idprom;
+		return false;
 
 	/*
 	 * First, try the node's "mac-address" property.
@@ -1013,7 +1025,7 @@
 	if (prom_getprop(node, "mac-address", 1, &nitem, &bp) == 0 &&
 	nitem >= 6) {
 		memcpy(cp, bp, 6);
-		return;
+		return true;
 	}
 
 	/*
@@ -1023,17 +1035,15 @@
 	 */
 	if (prom_getoption("local-mac-address?", buf, sizeof buf) != 0 ||
 	strcmp(buf, "true") != 0)
-		goto read_idprom;
+		return false;
 
 	/* Retrieve the node's "local-mac-address" property, if any */
 	nitem = 6;
 	if (prom_getprop(node, "local-mac-address", 1, &nitem, &cp) == 0 &&
 	nitem == 6)
-		return;
+		return true;
 
-	/* Fall back on the machine's global ethernet address */
-read_idprom:
-	memcpy(cp, idp->idp_etheraddr, 6);
+	return false;
 }
 
 /*



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

2010-01-21 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Jan 21 09:03:17 UTC 2010

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

Log Message:
Define the FIRST512 and FIRST4G vm freelists


To generate a diff of this commit:
cvs rdiff -u -r1.1.142.1 -r1.1.142.2 src/sys/arch/sbmips/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/sbmips/include/vmparam.h
diff -u src/sys/arch/sbmips/include/vmparam.h:1.1.142.1 src/sys/arch/sbmips/include/vmparam.h:1.1.142.2
--- src/sys/arch/sbmips/include/vmparam.h:1.1.142.1	Fri Dec 11 20:22:15 2009
+++ src/sys/arch/sbmips/include/vmparam.h	Thu Jan 21 09:03:17 2010
@@ -1,6 +1,19 @@
-/* $NetBSD: vmparam.h,v 1.1.142.1 2009/12/11 20:22:15 matt Exp $ */
+/* $NetBSD: vmparam.h,v 1.1.142.2 2010/01/21 09:03:17 matt Exp $ */
 
+#ifndef _SBMIPS_VMPARAM_H_
+#define _SBMIPS_VMPARAM_H_
 #include 
 
 /* XXXcgd */
 #define	VM_PHYSSEG_MAX		8
+
+#undef VM_FREELIST_MAX
+#define VM_FREELIST_MAX		3
+#if defined(_MIPS_PADDR_T_64BIT) || defined(_LP64)
+#define VM_FREELIST_FIRST4G	2
+#endif
+#if !defined(_LP64)
+#define VM_FREELIST_FIRST512M	1
+#endif
+
+#endif /* _SBMIPS_VMPARAM_H_ */



CVS commit: src/sys/dev/acpi

2010-01-21 Thread Jukka Ruohonen
Module Name:src
Committed By:   jruoho
Date:   Thu Jan 21 08:57:17 UTC 2010

Modified Files:
src/sys/dev/acpi: acpi_bat.c

Log Message:
In preparation for upcoming changes:

  * Provide proper definitions and use these.
  * Clarify the evaluation of _STA.
  * Mark the state of a sensor according to the return value from _STA.
  * Share the basic object evaluation in _BIF and _BST.
  * Verify the object types before using the objects.
  * Be aware of bogus values from _BIF and _BST, as noted in the specifcation.

Despite of the list, functional change should be minimal. Ok pgoye...@.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/dev/acpi/acpi_bat.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/acpi/acpi_bat.c
diff -u src/sys/dev/acpi/acpi_bat.c:1.75 src/sys/dev/acpi/acpi_bat.c:1.76
--- src/sys/dev/acpi/acpi_bat.c:1.75	Fri Jan  8 20:40:41 2010
+++ src/sys/dev/acpi/acpi_bat.c	Thu Jan 21 08:57:17 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_bat.c,v 1.75 2010/01/08 20:40:41 dyoung Exp $	*/
+/*	$NetBSD: acpi_bat.c,v 1.76 2010/01/21 08:57:17 jruoho Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_bat.c,v 1.75 2010/01/08 20:40:41 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_bat.c,v 1.76 2010/01/21 08:57:17 jruoho Exp $");
 
 #include 
 #include 
@@ -95,21 +95,58 @@
 #define _COMPONENT  ACPI_BAT_COMPONENT
 ACPI_MODULE_NAME("acpi_bat")
 
-/* sensor indexes */
-#define ACPIBAT_PRESENT		0
-#define ACPIBAT_DCAPACITY	1
-#define ACPIBAT_LFCCAPACITY	2
-#define ACPIBAT_TECHNOLOGY	3
-#define ACPIBAT_DVOLTAGE	4
-#define ACPIBAT_WCAPACITY	5
-#define ACPIBAT_LCAPACITY	6
-#define ACPIBAT_VOLTAGE		7
-#define ACPIBAT_CHARGERATE	8
-#define ACPIBAT_DISCHARGERATE	9
-#define ACPIBAT_CAPACITY	10
-#define ACPIBAT_CHARGING	11
-#define ACPIBAT_CHARGE_STATE	12
-#define ACPIBAT_NSENSORS	13  /* number of sensors */
+/*
+ * Sensor indexes.
+ */
+enum {
+	ACPIBAT_PRESENT		 = 0,
+	ACPIBAT_DCAPACITY	 = 1,
+	ACPIBAT_LFCCAPACITY	 = 2,
+	ACPIBAT_TECHNOLOGY	 = 3,
+	ACPIBAT_DVOLTAGE	 = 4,
+	ACPIBAT_WCAPACITY	 = 5,
+	ACPIBAT_LCAPACITY	 = 6,
+	ACPIBAT_VOLTAGE		 = 7,
+	ACPIBAT_CHARGERATE	 = 8,
+	ACPIBAT_DISCHARGERATE	 = 9,
+	ACPIBAT_CAPACITY	 = 10,
+	ACPIBAT_CHARGING	 = 11,
+	ACPIBAT_CHARGE_STATE	 = 12,
+	ACPIBAT_COUNT		 = 13
+};
+
+/*
+ * Battery Information, _BIF
+ * (ACPI 3.0, sec. 10.2.2.1).
+ */
+enum {
+	ACPIBAT_BIF_UNIT	 = 0,
+	ACPIBAT_BIF_DCAPACITY	 = 1,
+	ACPIBAT_BIF_LFCCAPACITY	 = 2,
+	ACPIBAT_BIF_TECHNOLOGY	 = 3,
+	ACPIBAT_BIF_DVOLTAGE	 = 4,
+	ACPIBAT_BIF_WCAPACITY	 = 5,
+	ACPIBAT_BIF_LCAPACITY	 = 6,
+	ACPIBAT_BIF_GRANULARITY1 = 7,
+	ACPIBAT_BIF_GRANULARITY2 = 8,
+	ACPIBAT_BIF_MODEL	 = 9,
+	ACPIBAT_BIF_SERIAL	 = 10,
+	ACPIBAT_BIF_TYPE	 = 11,
+	ACPIBAT_BIF_OEM		 = 12,
+	ACPIBAT_BIF_COUNT	 = 13
+};
+
+/*
+ * Battery Status, _BST
+ * (ACPI 3.0, sec. 10.2.2.3).
+ */
+enum {
+	ACPIBAT_BST_STATE	 = 0,
+	ACPIBAT_BST_RATE	 = 1,
+	ACPIBAT_BST_CAPACITY	 = 2,
+	ACPIBAT_BST_VOLTAGE	 = 3,
+	ACPIBAT_BST_COUNT	 = 4
+};
 
 struct acpibat_softc {
 	struct acpi_devnode *sc_node;	/* our ACPI devnode */
@@ -117,7 +154,7 @@
 	int sc_available;		/* available information level */
 
 	struct sysmon_envsys *sc_sme;
-	envsys_data_t sc_sensor[ACPIBAT_NSENSORS];
+	envsys_data_t sc_sensor[ACPIBAT_COUNT];
 	struct timeval sc_lastupdate;
 
 	kmutex_t sc_mutex;
@@ -144,11 +181,27 @@
 #define ACPIBAT_ST_CRITICAL	0x0004  /* battery is critical */
 
 /*
- * Flags for battery status from _STA return
+ * Flags for battery status from _STA return. Note that
+ * this differs from the conventional evaluation of _STA:
+ *
+ *	"Unlike most other devices, when a battery is inserted or
+ *	 removed from the system, the device itself (the battery bay)
+ *	 is still considered to be present in the system. For most
+ *	 systems, the _STA for this device will always return a value
+ *	 with bits 0-3 set and will toggle bit 4 to indicate the actual
+ *	 presence of a battery. (ACPI 3.0, sec. 10.2.1, p. 320.)"
  */
 #define ACPIBAT_STA_PRESENT	0x0010  /* battery present */
 
 /*
+ * A value used when _BST or _BIF is teporarily unknown (see ibid.).
+ */
+#define ACPIBAT_VAL_UNKNOWN	0x
+
+#define ACPIBAT_VAL_ISVALID(x)		  \
+	(((x) != ACPIBAT_VAL_UNKNOWN) ? ENVSYS_SVALID : ENVSYS_SINVALID)
+
+/*
  * These flags are used to set internal state in our softc.
  */
 #define	ABAT_F_VERBOSE		0x01	/* verbose events */
@@ -179,6 +232,7 @@
 static void acpibat_clear_info(struct acpibat_softc *);
 static void acpibat_clear_stat(struct acpibat_softc *);
 static int acpibat_battery_present(device_t);
+static ACPI_OBJECT *acpibat_get_object(ACPI_HANDLE, const char *, int);
 static ACPI_STATUS acpibat_get_status(device_t);
 static ACPI_STATUS acpibat_get_info(device_t);
 static void acpibat_print_info(device_t);
@@ -305,73 +359,126 

CVS commit: src/sys/dev/pci

2010-01-21 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Jan 21 08:52:20 UTC 2010

Modified Files:
src/sys/dev/pci: if_wm.c

Log Message:
Remove an extra debug printf(). KNF.
No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.193 -r1.194 src/sys/dev/pci/if_wm.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.193 src/sys/dev/pci/if_wm.c:1.194
--- src/sys/dev/pci/if_wm.c:1.193	Tue Jan 19 22:07:02 2010
+++ src/sys/dev/pci/if_wm.c	Thu Jan 21 08:52:20 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.193 2010/01/19 22:07:02 pooka Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.194 2010/01/21 08:52:20 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -76,7 +76,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.193 2010/01/19 22:07:02 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.194 2010/01/21 08:52:20 msaitoh Exp $");
 
 #include "rnd.h"
 
@@ -937,9 +937,9 @@
 	for (wmp = wm_products; wmp->wmp_name != NULL; wmp++) {
 		if (PCI_VENDOR(pa->pa_id) == wmp->wmp_vendor &&
 		PCI_PRODUCT(pa->pa_id) == wmp->wmp_product)
-			return (wmp);
+			return wmp;
 	}
-	return (NULL);
+	return NULL;
 }
 
 static int
@@ -948,9 +948,9 @@
 	struct pci_attach_args *pa = aux;
 
 	if (wm_lookup(pa) != NULL)
-		return (1);
+		return 1;
 
-	return (0);
+	return 0;
 }
 
 static void
@@ -1229,8 +1229,7 @@
 	sizeof(struct wm_control_data_82542) :
 	sizeof(struct wm_control_data_82544);
 	if ((error = bus_dmamem_alloc(sc->sc_dmat, cdata_size, PAGE_SIZE,
-  (bus_size_t) 0x1ULL,
-  &seg, 1, &rseg, 0)) != 0) {
+		(bus_size_t) 0x1ULL, &seg, 1, &rseg, 0)) != 0) {
 		aprint_error_dev(sc->sc_dev,
 		"unable to allocate control data, error = %d\n",
 		error);
@@ -1238,15 +1237,14 @@
 	}
 
 	if ((error = bus_dmamem_map(sc->sc_dmat, &seg, rseg, cdata_size,
-(void **)&sc->sc_control_data, 
-BUS_DMA_COHERENT)) != 0) {
+		(void **)&sc->sc_control_data, BUS_DMA_COHERENT)) != 0) {
 		aprint_error_dev(sc->sc_dev,
 		"unable to map control data, error = %d\n", error);
 		goto fail_1;
 	}
 
 	if ((error = bus_dmamap_create(sc->sc_dmat, cdata_size, 1, cdata_size,
-   0, 0, &sc->sc_cddmamap)) != 0) {
+		0, 0, &sc->sc_cddmamap)) != 0) {
 		aprint_error_dev(sc->sc_dev,
 		"unable to create control data DMA map, error = %d\n",
 		error);
@@ -1254,8 +1252,7 @@
 	}
 
 	if ((error = bus_dmamap_load(sc->sc_dmat, sc->sc_cddmamap,
- sc->sc_control_data, cdata_size, NULL,
- 0)) != 0) {
+		sc->sc_control_data, cdata_size, NULL, 0)) != 0) {
 		aprint_error_dev(sc->sc_dev,
 		"unable to load control data DMA map, error = %d\n",
 		error);
@@ -1270,8 +1267,8 @@
 	WM_TXQUEUELEN_MAX_82547 : WM_TXQUEUELEN_MAX;
 	for (i = 0; i < WM_TXQUEUELEN(sc); i++) {
 		if ((error = bus_dmamap_create(sc->sc_dmat, WM_MAXTXDMA,
-	   WM_NTXSEGS, WTX_MAX_LEN, 0, 0,
-	  &sc->sc_txsoft[i].txs_dmamap)) != 0) {
+			WM_NTXSEGS, WTX_MAX_LEN, 0, 0,
+			&sc->sc_txsoft[i].txs_dmamap)) != 0) {
 			aprint_error_dev(sc->sc_dev,
 			"unable to create Tx DMA map %d, error = %d\n",
 			i, error);
@@ -1284,8 +1281,8 @@
 	 */
 	for (i = 0; i < WM_NRXDESC; i++) {
 		if ((error = bus_dmamap_create(sc->sc_dmat, MCLBYTES, 1,
-	   MCLBYTES, 0, 0,
-	  &sc->sc_rxsoft[i].rxs_dmamap)) != 0) {
+			MCLBYTES, 0, 0,
+			&sc->sc_rxsoft[i].rxs_dmamap)) != 0) {
 			aprint_error_dev(sc->sc_dev,
 			"unable to create Rx DMA map %d error = %d\n",
 			i, error);
@@ -1846,7 +1843,7 @@
 		 */
 		*fieldsp = 0;
 		*cmdp = 0;
-		return (0);
+		return 0;
 	}
 
 	if ((m0->m_pkthdr.csum_flags &
@@ -1998,7 +1995,7 @@
 	*cmdp = cmd;
 	*fieldsp = fields;
 
-	return (0);
+	return 0;
 }
 
 static void
@@ -2086,7 +2083,7 @@
 
 	/* Just return if already stalled. */
 	if (sc->sc_txfifo_stall)
-		return (1);
+		return 1;
 
 	if (sc->sc_mii.mii_media_active & IFM_FDX) {
 		/* Stall only occurs in half-duplex mode. */
@@ -2096,7 +2093,7 @@
 	if (len >= WM_82547_PAD_LEN + space) {
 		sc->sc_txfifo_stall = 1;
 		callout_schedule(&sc->sc_txfifo_ch, 1);
-		return (1);
+		return 1;
 	}
 
  send_packet:
@@ -2104,7 +2101,7 @@
 	if (sc->sc_txfifo_head >= sc->sc_txfifo_size)
 		sc->sc_txfifo_head -= sc->sc_txfifo_size;
 
-	return (0);
+	return 0;
 }
 
 /*
@@ -2544,7 +2541,7 @@
 	wm_start(ifp);
 
 	splx(s);
-	return (error);
+	return error;
 }
 
 /*
@@ -2611,7 +2608,7 @@
 		wm_start(ifp);
 	}
 
-	return (handled);
+	return handled;
 }
 
 /*
@@ -2970,7 +2967,6 @@
 			== IFM_1000_T)) {
 
 			if ((sc->sc_mii.mii_media_status & IFM_ACTIVE) != 0) {
-printf("XXX link sall wa\n");
 delay(200*1000); /* XXX too big */
 
 /* Link stall fix for link up */
@@ -3180,7 +3176,7 @@
 	delay(10*1000);
 
 	/* Must acquire the MDIO ownership before MAC rese

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

2010-01-21 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Jan 21 08:50:00 UTC 2010

Modified Files:
src/sys/arch/mips/sibyte/pci [matt-nb5-mips64]: sbbrz_bus_io.c
sbbrz_bus_mem.c

Log Message:
Define PCI bus spaces as little endian


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/arch/mips/sibyte/pci/sbbrz_bus_io.c \
src/sys/arch/mips/sibyte/pci/sbbrz_bus_mem.c

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

Modified files:

Index: src/sys/arch/mips/sibyte/pci/sbbrz_bus_io.c
diff -u src/sys/arch/mips/sibyte/pci/sbbrz_bus_io.c:1.1.2.1 src/sys/arch/mips/sibyte/pci/sbbrz_bus_io.c:1.1.2.2
--- src/sys/arch/mips/sibyte/pci/sbbrz_bus_io.c:1.1.2.1	Thu Jan 21 04:22:33 2010
+++ src/sys/arch/mips/sibyte/pci/sbbrz_bus_io.c	Thu Jan 21 08:50:00 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: sbbrz_bus_io.c,v 1.1.2.1 2010/01/21 04:22:33 matt Exp $	*/
+/*	$NetBSD: sbbrz_bus_io.c,v 1.1.2.2 2010/01/21 08:50:00 matt Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2010 The NetBSD Foundation, Inc.
@@ -34,15 +34,16 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sbbrz_bus_io.c,v 1.1.2.1 2010/01/21 04:22:33 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sbbrz_bus_io.c,v 1.1.2.2 2010/01/21 08:50:00 matt Exp $");
 
 #include 
 
 #include 
 #include 
 
-#define	CHIP		sbbrz
-#define	CHIP_IO		/* defined */
+#define	CHIP			sbbrz
+#define	CHIP_IO			/* defined */
+#define CHIP_LITTLE_ENDIAN
 
 #define	CHIP_EX_MALLOC_SAFE(v)	true
 #define	CHIP_EXTENT(v)		(((struct sbbrz_softc *)(v))->sc_io_ex)
Index: src/sys/arch/mips/sibyte/pci/sbbrz_bus_mem.c
diff -u src/sys/arch/mips/sibyte/pci/sbbrz_bus_mem.c:1.1.2.1 src/sys/arch/mips/sibyte/pci/sbbrz_bus_mem.c:1.1.2.2
--- src/sys/arch/mips/sibyte/pci/sbbrz_bus_mem.c:1.1.2.1	Thu Jan 21 04:22:33 2010
+++ src/sys/arch/mips/sibyte/pci/sbbrz_bus_mem.c	Thu Jan 21 08:50:00 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: sbbrz_bus_mem.c,v 1.1.2.1 2010/01/21 04:22:33 matt Exp $	*/
+/*	$NetBSD: sbbrz_bus_mem.c,v 1.1.2.2 2010/01/21 08:50:00 matt Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sbbrz_bus_mem.c,v 1.1.2.1 2010/01/21 04:22:33 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sbbrz_bus_mem.c,v 1.1.2.2 2010/01/21 08:50:00 matt Exp $");
 
 #include 
 
@@ -43,6 +43,7 @@
 
 #define	CHIP			sbbrz
 #define	CHIP_MEM		/* defined */
+#define	CHIP_LITTLE_ENDIAN
 
 #define	CHIP_EX_MALLOC_SAFE(v)	true
 #define	CHIP_EXTENT(v)		(((struct sbbrz_softc *)(v))->sc_mem_ex)



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

2010-01-21 Thread Erik Berls
Module Name:src
Committed By:   cyber
Date:   Thu Jan 21 08:47:22 UTC 2010

Modified Files:
src/sys/arch/mips/sibyte/pci [matt-nb5-mips64]: sbbrz_pci.c

Log Message:
and the tmp var


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.4 -r1.1.2.5 src/sys/arch/mips/sibyte/pci/sbbrz_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/arch/mips/sibyte/pci/sbbrz_pci.c
diff -u src/sys/arch/mips/sibyte/pci/sbbrz_pci.c:1.1.2.4 src/sys/arch/mips/sibyte/pci/sbbrz_pci.c:1.1.2.5
--- src/sys/arch/mips/sibyte/pci/sbbrz_pci.c:1.1.2.4	Thu Jan 21 08:45:41 2010
+++ src/sys/arch/mips/sibyte/pci/sbbrz_pci.c	Thu Jan 21 08:47:22 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: sbbrz_pci.c,v 1.1.2.4 2010/01/21 08:45:41 cyber Exp $ */
+/* $NetBSD: sbbrz_pci.c,v 1.1.2.5 2010/01/21 08:47:22 cyber Exp $ */
 
 /*
  * Copyright 2000, 2001
@@ -64,7 +64,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: sbbrz_pci.c,v 1.1.2.4 2010/01/21 08:45:41 cyber Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sbbrz_pci.c,v 1.1.2.5 2010/01/21 08:47:22 cyber Exp $");
 
 #include 
 #include 
@@ -175,7 +175,6 @@
 sbbrz_pci_conf_read(void *cpv, pcitag_t tag, int offset)
 {
 	uint64_t addr;
-	pcitag_t tmptag;
 
 #ifdef DIAGNOSTIC
 	if ((offset & 0x3) != 0)



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

2010-01-21 Thread Erik Berls
Module Name:src
Committed By:   cyber
Date:   Thu Jan 21 08:45:41 UTC 2010

Modified Files:
src/sys/arch/mips/sibyte/pci [matt-nb5-mips64]: sbbrz_pci.c

Log Message:
GC some debug code


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/sys/arch/mips/sibyte/pci/sbbrz_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/arch/mips/sibyte/pci/sbbrz_pci.c
diff -u src/sys/arch/mips/sibyte/pci/sbbrz_pci.c:1.1.2.3 src/sys/arch/mips/sibyte/pci/sbbrz_pci.c:1.1.2.4
--- src/sys/arch/mips/sibyte/pci/sbbrz_pci.c:1.1.2.3	Thu Jan 21 08:31:24 2010
+++ src/sys/arch/mips/sibyte/pci/sbbrz_pci.c	Thu Jan 21 08:45:41 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: sbbrz_pci.c,v 1.1.2.3 2010/01/21 08:31:24 matt Exp $ */
+/* $NetBSD: sbbrz_pci.c,v 1.1.2.4 2010/01/21 08:45:41 cyber Exp $ */
 
 /*
  * Copyright 2000, 2001
@@ -64,7 +64,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: sbbrz_pci.c,v 1.1.2.3 2010/01/21 08:31:24 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sbbrz_pci.c,v 1.1.2.4 2010/01/21 08:45:41 cyber Exp $");
 
 #include 
 #include 
@@ -183,27 +183,14 @@
 #endif
 
 	addr = A_PHYS_LDTPCI_CFG_MATCH_BITS + tag + offset;
-#if 0
-addr = mips3_ld((void *)MIPS_PHYS_TO_KSEG1(addr));
-tmptag = mips3_lw_a64(addr);
-printf("s_c_r KSEG1: %"PRIx64"\n", (uint64_t)tmptag);
-#endif
 	addr = MIPS_PHYS_TO_XKPHYS(MIPS3_TLB_ATTR_UNCACHED, addr);
 
-tmptag = mips3_lw_a64(addr);
-printf("s_c_r XKSEG (%"PRIx64"): %"PRIx64"\n", addr, (uint64_t)tmptag);
-
-
 #ifdef _punt_on_64
 	if (badaddr64(addr, 4) != 0)
 		return 0x;
 #endif
 
-#if not_yet
 	return mips3_lw_a64(addr);
-#else
-	return tmptag;
-#endif
 }
 
 void
@@ -218,7 +205,6 @@
 
 	addr = A_PHYS_LDTPCI_CFG_MATCH_BITS + tag + offset;
 	addr = MIPS_PHYS_TO_XKPHYS(MIPS3_TLB_ATTR_UNCACHED, addr);
-printf("s_c_W XKSEG (%"PRIx64"): %"PRIx64"\n", addr, (uint64_t)data);
 
 	return mips3_sw_a64(addr, data);
 }



CVS commit: [netbsd-5-0] src/doc

2010-01-21 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Thu Jan 21 08:41:40 UTC 2010

Modified Files:
src/doc [netbsd-5-0]: CHANGES-5.0.2

Log Message:
Ticket 1258.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.42 -r1.1.2.43 src/doc/CHANGES-5.0.2

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

Modified files:

Index: src/doc/CHANGES-5.0.2
diff -u src/doc/CHANGES-5.0.2:1.1.2.42 src/doc/CHANGES-5.0.2:1.1.2.43
--- src/doc/CHANGES-5.0.2:1.1.2.42	Wed Jan 20 05:36:59 2010
+++ src/doc/CHANGES-5.0.2	Thu Jan 21 08:41:39 2010
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.0.2,v 1.1.2.42 2010/01/20 05:36:59 snj Exp $
+# $NetBSD: CHANGES-5.0.2,v 1.1.2.43 2010/01/21 08:41:39 snj Exp $
 
 A complete list of changes from the NetBSD 5.0.1 release to the NetBSD 5.0.2
 release:
@@ -968,3 +968,8 @@
 	prevents accidentally ending up in a short ARC4 cycle.
 	[joerg, ticket #1253]
 
+sys/dev/pci/azalia.c1.72
+
+	Signedness bug/crash in azalia. Fixes PR 42604.
+	[tonnerre, ticket #1258]
+



CVS commit: [netbsd-5-0] src/sys/dev/pci

2010-01-21 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Thu Jan 21 08:41:01 UTC 2010

Modified Files:
src/sys/dev/pci [netbsd-5-0]: azalia.c

Log Message:
Pull up following revision(s) (requested by tonnerre in ticket #1258):
sys/dev/pci/azalia.c: revision 1.72
Signedness bug/crash in azalia. Fixes PR 42604.
By Pierre Pronchery.


To generate a diff of this commit:
cvs rdiff -u -r1.64.6.1 -r1.64.6.1.2.1 src/sys/dev/pci/azalia.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/azalia.c
diff -u src/sys/dev/pci/azalia.c:1.64.6.1 src/sys/dev/pci/azalia.c:1.64.6.1.2.1
--- src/sys/dev/pci/azalia.c:1.64.6.1	Mon Mar  2 19:53:26 2009
+++ src/sys/dev/pci/azalia.c	Thu Jan 21 08:41:00 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: azalia.c,v 1.64.6.1 2009/03/02 19:53:26 snj Exp $	*/
+/*	$NetBSD: azalia.c,v 1.64.6.1.2.1 2010/01/21 08:41:00 snj Exp $	*/
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: azalia.c,v 1.64.6.1 2009/03/02 19:53:26 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: azalia.c,v 1.64.6.1.2.1 2010/01/21 08:41:00 snj Exp $");
 
 #include 
 #include 
@@ -2257,7 +2257,7 @@
 
 	az = v;
 	co = &az->codecs[az->codecno];
-	if (mdev->index >= co->nmixers)
+	if (mdev->index < 0 || mdev->index >= co->nmixers)
 		return ENXIO;
 	*mdev = co->mixers[mdev->index].devinfo;
 	return 0;



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

2010-01-21 Thread Erik Berls
Module Name:src
Committed By:   cyber
Date:   Thu Jan 21 08:39:55 UTC 2010

Modified Files:
src/sys/arch/mips/conf [matt-nb5-mips64]: files.sibyte

Log Message:
Remove sbpcihb, unused


To generate a diff of this commit:
cvs rdiff -u -r1.5.124.2 -r1.5.124.3 src/sys/arch/mips/conf/files.sibyte

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/conf/files.sibyte
diff -u src/sys/arch/mips/conf/files.sibyte:1.5.124.2 src/sys/arch/mips/conf/files.sibyte:1.5.124.3
--- src/sys/arch/mips/conf/files.sibyte:1.5.124.2	Thu Jan 21 07:46:01 2010
+++ src/sys/arch/mips/conf/files.sibyte	Thu Jan 21 08:39:54 2010
@@ -25,10 +25,6 @@
 file	arch/mips/sibyte/pci/sbbrz_bus_io.c	sbbrz
 file	arch/mips/sibyte/pci/sbbrz_bus_mem.c	sbbrz
 
-# Instantiated SB-1250 PCI Host bridge
-device	sbpcihb
-attach	sbpcihb at pci
-file	arch/mips/sibyte/pci/sbpcihb.c		sbpcihb
 
 # sbscd children
 



CVS commit: [netbsd-5] src/doc

2010-01-21 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Thu Jan 21 08:39:22 UTC 2010

Modified Files:
src/doc [netbsd-5]: CHANGES-5.1

Log Message:
Ticket 1258.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.176 -r1.1.2.177 src/doc/CHANGES-5.1

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

Modified files:

Index: src/doc/CHANGES-5.1
diff -u src/doc/CHANGES-5.1:1.1.2.176 src/doc/CHANGES-5.1:1.1.2.177
--- src/doc/CHANGES-5.1:1.1.2.176	Wed Jan 20 05:33:10 2010
+++ src/doc/CHANGES-5.1	Thu Jan 21 08:39:22 2010
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.1,v 1.1.2.176 2010/01/20 05:33:10 snj Exp $
+# $NetBSD: CHANGES-5.1,v 1.1.2.177 2010/01/21 08:39:22 snj Exp $
 
 A complete list of changes from the NetBSD 5.0 release to the NetBSD 5.1
 release:
@@ -16100,3 +16100,9 @@
 	prevents accidentally ending up in a short ARC4 cycle.
 	[joerg, ticket #1253]
 
+sys/dev/pci/azalia.c1.72
+sys/dev/pci/hdaudio/hdaudio_afg.c		1.19
+
+	Signedness bug/crash in azalia and hdaudio. Fixes PR 42604.
+	[tonnerre, ticket #1258]
+



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

2010-01-21 Thread Erik Berls
Module Name:src
Committed By:   cyber
Date:   Thu Jan 21 08:38:46 UTC 2010

Modified Files:
src/sys/arch/sbmips/conf [matt-nb5-mips64]: GENERIC

Log Message:
Get rid of sbpcihb, unused
increase SYMTAB_SPACE


To generate a diff of this commit:
cvs rdiff -u -r1.70.8.2 -r1.70.8.3 src/sys/arch/sbmips/conf/GENERIC

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/sbmips/conf/GENERIC
diff -u src/sys/arch/sbmips/conf/GENERIC:1.70.8.2 src/sys/arch/sbmips/conf/GENERIC:1.70.8.3
--- src/sys/arch/sbmips/conf/GENERIC:1.70.8.2	Thu Jan 21 07:46:01 2010
+++ src/sys/arch/sbmips/conf/GENERIC	Thu Jan 21 08:38:46 2010
@@ -1,10 +1,10 @@
-# $NetBSD: GENERIC,v 1.70.8.2 2010/01/21 07:46:01 matt Exp $
+# $NetBSD: GENERIC,v 1.70.8.3 2010/01/21 08:38:46 cyber Exp $
 
 include 	"arch/sbmips/conf/std.sbmips"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.70.8.2 $"
+#ident 		"GENERIC-$Revision: 1.70.8.3 $"
 
 #options 	LOCKDEBUG	# XXX XXX XXX XXX
 #options 	DEBUG		# extra kernel debugging support
@@ -35,7 +35,7 @@
 options 	DDB		# kernel dynamic debugger
 options 	DDB_HISTORY_SIZE=100 # enable history editing in DDB
 #makeoptions 	DEBUG="-g"	# compile full symbol table
-options 	SYMTAB_SPACE=33	# size for embedded symbol table
+options 	SYMTAB_SPACE=34	# size for embedded symbol table
 
 # Compatibility options
 options 	COMPAT_43	# compatibility with 4.3BSD binaries
@@ -142,14 +142,10 @@
 sbobio*		at zbbus? busid ?
 
 pci*		at sbbrz? bus ?
-
-sbpcihb*	at pci? dev ?
 ppb*		at pci? dev ?
-
 pci*		at ppb?
 
 bge*		at pci? dev ?
-#vga*		at pci? dev ?
 
 #sbicu*		at sbscd? offset ?
 sbwdog*		at sbscd? offset ? intr ?



CVS commit: [netbsd-5] src/sys/dev/pci

2010-01-21 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Thu Jan 21 08:38:45 UTC 2010

Modified Files:
src/sys/dev/pci [netbsd-5]: azalia.c
src/sys/dev/pci/hdaudio [netbsd-5]: hdaudio_afg.c

Log Message:
Pull up following revision(s) (requested by tonnerre in ticket #1258):
sys/dev/pci/azalia.c: revision 1.72
sys/dev/pci/hdaudio/hdaudio_afg.c: revision 1.19
Signedness bug/crash in azalia and hdaudio. Fixes PR 42604.
By Pierre Pronchery.


To generate a diff of this commit:
cvs rdiff -u -r1.64.6.1 -r1.64.6.2 src/sys/dev/pci/azalia.c
cvs rdiff -u -r1.14.2.5 -r1.14.2.6 src/sys/dev/pci/hdaudio/hdaudio_afg.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/azalia.c
diff -u src/sys/dev/pci/azalia.c:1.64.6.1 src/sys/dev/pci/azalia.c:1.64.6.2
--- src/sys/dev/pci/azalia.c:1.64.6.1	Mon Mar  2 19:53:26 2009
+++ src/sys/dev/pci/azalia.c	Thu Jan 21 08:38:45 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: azalia.c,v 1.64.6.1 2009/03/02 19:53:26 snj Exp $	*/
+/*	$NetBSD: azalia.c,v 1.64.6.2 2010/01/21 08:38:45 snj Exp $	*/
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: azalia.c,v 1.64.6.1 2009/03/02 19:53:26 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: azalia.c,v 1.64.6.2 2010/01/21 08:38:45 snj Exp $");
 
 #include 
 #include 
@@ -2257,7 +2257,7 @@
 
 	az = v;
 	co = &az->codecs[az->codecno];
-	if (mdev->index >= co->nmixers)
+	if (mdev->index < 0 || mdev->index >= co->nmixers)
 		return ENXIO;
 	*mdev = co->mixers[mdev->index].devinfo;
 	return 0;

Index: src/sys/dev/pci/hdaudio/hdaudio_afg.c
diff -u src/sys/dev/pci/hdaudio/hdaudio_afg.c:1.14.2.5 src/sys/dev/pci/hdaudio/hdaudio_afg.c:1.14.2.6
--- src/sys/dev/pci/hdaudio/hdaudio_afg.c:1.14.2.5	Sun Oct 18 16:50:13 2009
+++ src/sys/dev/pci/hdaudio/hdaudio_afg.c	Thu Jan 21 08:38:45 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: hdaudio_afg.c,v 1.14.2.5 2009/10/18 16:50:13 bouyer Exp $ */
+/* $NetBSD: hdaudio_afg.c,v 1.14.2.6 2010/01/21 08:38:45 snj Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdaudio_afg.c,v 1.14.2.5 2009/10/18 16:50:13 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdaudio_afg.c,v 1.14.2.6 2010/01/21 08:38:45 snj Exp $");
 
 #include 
 #include 
@@ -3500,7 +3500,7 @@
 	struct hdaudio_audiodev *ad = opaque;
 	struct hdaudio_afg_softc *sc = ad->ad_sc;
 
-	if (di->index >= sc->sc_nmixers)
+	if (di->index < 0 || di->index >= sc->sc_nmixers)
 		return ENXIO;
 
 	*di = sc->sc_mixers[di->index].mx_di;



CVS commit: [netbsd-4-0] src/doc

2010-01-21 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Thu Jan 21 08:37:19 UTC 2010

Modified Files:
src/doc [netbsd-4-0]: CHANGES-4.0.2

Log Message:
Tickets 137[45].


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.65 -r1.1.2.66 src/doc/CHANGES-4.0.2

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

Modified files:

Index: src/doc/CHANGES-4.0.2
diff -u src/doc/CHANGES-4.0.2:1.1.2.65 src/doc/CHANGES-4.0.2:1.1.2.66
--- src/doc/CHANGES-4.0.2:1.1.2.65	Tue Jan 12 09:21:06 2010
+++ src/doc/CHANGES-4.0.2	Thu Jan 21 08:37:19 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: CHANGES-4.0.2,v 1.1.2.65 2010/01/12 09:21:06 snj Exp $
+#	$NetBSD: CHANGES-4.0.2,v 1.1.2.66 2010/01/21 08:37:19 snj Exp $
 
 A complete list of changes from the NetBSD 4.0.1 release to the NetBSD 4.0.2
 release:
@@ -969,3 +969,14 @@
 	Disable OpenSSL renegotiation, thus avoiding CVE-2009-3555.
 	[tonnerre, ticket #1373]
 
+sys/lib/libkern/arc4random.c			1.21
+
+	Keep arc4_i and arc4_j synchronised after a rekeying. This
+	prevents accidentally ending up in a short ARC4 cycle.
+	[joerg, ticket #1374]
+
+sys/dev/pci/azalia.cpatch
+
+	Signedness bug/crash in azalia.  Fixes PR 42604.
+	[tonnerre, ticket #1375]
+



CVS commit: [netbsd-4-0] src/sys/dev/pci

2010-01-21 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Thu Jan 21 08:35:56 UTC 2010

Modified Files:
src/sys/dev/pci [netbsd-4-0]: azalia.c

Log Message:
Apply patch (requested by tonnerre in ticket #1375):
Signedness bug/crash in azalia.  Fixes PR 42604.


To generate a diff of this commit:
cvs rdiff -u -r1.42.2.1 -r1.42.2.1.4.1 src/sys/dev/pci/azalia.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/azalia.c
diff -u src/sys/dev/pci/azalia.c:1.42.2.1 src/sys/dev/pci/azalia.c:1.42.2.1.4.1
--- src/sys/dev/pci/azalia.c:1.42.2.1	Sun May 20 09:57:08 2007
+++ src/sys/dev/pci/azalia.c	Thu Jan 21 08:35:55 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: azalia.c,v 1.42.2.1 2007/05/20 09:57:08 jdc Exp $	*/
+/*	$NetBSD: azalia.c,v 1.42.2.1.4.1 2010/01/21 08:35:55 snj Exp $	*/
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: azalia.c,v 1.42.2.1 2007/05/20 09:57:08 jdc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: azalia.c,v 1.42.2.1.4.1 2010/01/21 08:35:55 snj Exp $");
 
 #include 
 #include 
@@ -2137,7 +2137,7 @@
 
 	az = v;
 	co = &az->codecs[az->codecno];
-	if (mdev->index >= co->nmixers)
+	if (mdev->index < 0 || mdev->index >= co->nmixers)
 		return ENXIO;
 	*mdev = co->mixers[mdev->index].devinfo;
 	return 0;



CVS commit: [netbsd-4] src/doc

2010-01-21 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Thu Jan 21 08:35:30 UTC 2010

Modified Files:
src/doc [netbsd-4]: CHANGES-4.1

Log Message:
Tickets 137[45].


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.191 -r1.1.2.192 src/doc/CHANGES-4.1

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

Modified files:

Index: src/doc/CHANGES-4.1
diff -u src/doc/CHANGES-4.1:1.1.2.191 src/doc/CHANGES-4.1:1.1.2.192
--- src/doc/CHANGES-4.1:1.1.2.191	Tue Jan 12 09:22:58 2010
+++ src/doc/CHANGES-4.1	Thu Jan 21 08:35:30 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: CHANGES-4.1,v 1.1.2.191 2010/01/12 09:22:58 snj Exp $
+#	$NetBSD: CHANGES-4.1,v 1.1.2.192 2010/01/21 08:35:30 snj Exp $
 
 A complete list of changes from the NetBSD 4.0 release to the NetBSD 4.1
 release:
@@ -3945,3 +3945,14 @@
 	Disable OpenSSL renegotiation, thus avoiding CVE-2009-3555.
 	[tonnerre, ticket #1373]
 
+sys/lib/libkern/arc4random.c			1.21
+
+	Keep arc4_i and arc4_j synchronised after a rekeying. This
+	prevents accidentally ending up in a short ARC4 cycle.
+	[joerg, ticket #1374]
+
+sys/dev/pci/azalia.cpatch
+
+	Signedness bug/crash in azalia.  Fixes PR 42604.
+	[tonnerre, ticket #1375]
+



CVS commit: [netbsd-4] src/sys/dev/pci

2010-01-21 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Thu Jan 21 08:34:27 UTC 2010

Modified Files:
src/sys/dev/pci [netbsd-4]: azalia.c

Log Message:
Apply patch (requested by tonnerre in ticket #1375):
Signedness bug/crash in azalia.  Fixes PR 42604.


To generate a diff of this commit:
cvs rdiff -u -r1.42.2.1 -r1.42.2.2 src/sys/dev/pci/azalia.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/azalia.c
diff -u src/sys/dev/pci/azalia.c:1.42.2.1 src/sys/dev/pci/azalia.c:1.42.2.2
--- src/sys/dev/pci/azalia.c:1.42.2.1	Sun May 20 09:57:08 2007
+++ src/sys/dev/pci/azalia.c	Thu Jan 21 08:34:27 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: azalia.c,v 1.42.2.1 2007/05/20 09:57:08 jdc Exp $	*/
+/*	$NetBSD: azalia.c,v 1.42.2.2 2010/01/21 08:34:27 snj Exp $	*/
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: azalia.c,v 1.42.2.1 2007/05/20 09:57:08 jdc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: azalia.c,v 1.42.2.2 2010/01/21 08:34:27 snj Exp $");
 
 #include 
 #include 
@@ -2137,7 +2137,7 @@
 
 	az = v;
 	co = &az->codecs[az->codecno];
-	if (mdev->index >= co->nmixers)
+	if (mdev->index < 0 || mdev->index >= co->nmixers)
 		return ENXIO;
 	*mdev = co->mixers[mdev->index].devinfo;
 	return 0;



CVS commit: [netbsd-4-0] src/sys/lib/libkern

2010-01-21 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Thu Jan 21 08:32:25 UTC 2010

Modified Files:
src/sys/lib/libkern [netbsd-4-0]: arc4random.c

Log Message:
Pull up following revision(s) (requested by joerg in ticket #1374):
sys/lib/libkern/arc4random.c: revision 1.21
Keep arc4_i and arc4_j synchronised after a rekeying. This prevents
accidentally ending up in a short ARC4 cycle.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.18.22.1 src/sys/lib/libkern/arc4random.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/lib/libkern/arc4random.c
diff -u src/sys/lib/libkern/arc4random.c:1.18 src/sys/lib/libkern/arc4random.c:1.18.22.1
--- src/sys/lib/libkern/arc4random.c:1.18	Sun Nov  5 14:13:56 2006
+++ src/sys/lib/libkern/arc4random.c	Thu Jan 21 08:32:24 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: arc4random.c,v 1.18 2006/11/05 14:13:56 christos Exp $	*/
+/*	$NetBSD: arc4random.c,v 1.18.22.1 2010/01/21 08:32:24 snj Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -141,6 +141,7 @@
 		arc4_j = (arc4_j + arc4_sbox[n] + key[n]) % 256;
 		arc4_swap(&arc4_sbox[n], &arc4_sbox[arc4_j]);
 	}
+	arc4_i = arc4_j;
 
 	/* Reset for next reseed cycle. */
 	arc4_nextreseed = time_uptime + ARC4_RESEED_SECONDS;



CVS commit: [netbsd-4] src/sys/lib/libkern

2010-01-21 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Thu Jan 21 08:31:34 UTC 2010

Modified Files:
src/sys/lib/libkern [netbsd-4]: arc4random.c

Log Message:
Pull up following revision(s) (requested by joerg in ticket #1374):
sys/lib/libkern/arc4random.c: revision 1.21
Keep arc4_i and arc4_j synchronised after a rekeying. This prevents
accidentally ending up in a short ARC4 cycle.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.18.2.1 src/sys/lib/libkern/arc4random.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/lib/libkern/arc4random.c
diff -u src/sys/lib/libkern/arc4random.c:1.18 src/sys/lib/libkern/arc4random.c:1.18.2.1
--- src/sys/lib/libkern/arc4random.c:1.18	Sun Nov  5 14:13:56 2006
+++ src/sys/lib/libkern/arc4random.c	Thu Jan 21 08:31:34 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: arc4random.c,v 1.18 2006/11/05 14:13:56 christos Exp $	*/
+/*	$NetBSD: arc4random.c,v 1.18.2.1 2010/01/21 08:31:34 snj Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -141,6 +141,7 @@
 		arc4_j = (arc4_j + arc4_sbox[n] + key[n]) % 256;
 		arc4_swap(&arc4_sbox[n], &arc4_sbox[arc4_j]);
 	}
+	arc4_i = arc4_j;
 
 	/* Reset for next reseed cycle. */
 	arc4_nextreseed = time_uptime + ARC4_RESEED_SECONDS;



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

2010-01-21 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Jan 21 08:31:24 UTC 2010

Modified Files:
src/sys/arch/mips/sibyte/pci [matt-nb5-mips64]: sbbrz_pci.c

Log Message:
fix off by one in intr_map.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/arch/mips/sibyte/pci/sbbrz_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/arch/mips/sibyte/pci/sbbrz_pci.c
diff -u src/sys/arch/mips/sibyte/pci/sbbrz_pci.c:1.1.2.2 src/sys/arch/mips/sibyte/pci/sbbrz_pci.c:1.1.2.3
--- src/sys/arch/mips/sibyte/pci/sbbrz_pci.c:1.1.2.2	Thu Jan 21 06:59:12 2010
+++ src/sys/arch/mips/sibyte/pci/sbbrz_pci.c	Thu Jan 21 08:31:24 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: sbbrz_pci.c,v 1.1.2.2 2010/01/21 06:59:12 matt Exp $ */
+/* $NetBSD: sbbrz_pci.c,v 1.1.2.3 2010/01/21 08:31:24 matt Exp $ */
 
 /*
  * Copyright 2000, 2001
@@ -64,7 +64,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: sbbrz_pci.c,v 1.1.2.2 2010/01/21 06:59:12 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sbbrz_pci.c,v 1.1.2.3 2010/01/21 08:31:24 matt Exp $");
 
 #include 
 #include 
@@ -233,7 +233,7 @@
 		return EINVAL;
 	if (bus == 0) {
 		*ihp = K_INT_PCI_INTA
-		+ ((device + pa->pa_intrpin - PCI_INTERRUPT_PIN_A) % 4);
+		+ (((device-5) + pa->pa_intrswiz + pa->pa_intrpin - PCI_INTERRUPT_PIN_A) % 4);
 		return 0;
 	}
 	return EOPNOTSUPP;



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

2010-01-21 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Jan 21 08:08:41 UTC 2010

Modified Files:
src/sys/arch/mips/sibyte/pci [matt-nb5-mips64]: sbbrz.c

Log Message:
Don't forget to init pba_bridgetag


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/sys/arch/mips/sibyte/pci/sbbrz.c

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

Modified files:

Index: src/sys/arch/mips/sibyte/pci/sbbrz.c
diff -u src/sys/arch/mips/sibyte/pci/sbbrz.c:1.1.2.3 src/sys/arch/mips/sibyte/pci/sbbrz.c:1.1.2.4
--- src/sys/arch/mips/sibyte/pci/sbbrz.c:1.1.2.3	Thu Jan 21 08:00:23 2010
+++ src/sys/arch/mips/sibyte/pci/sbbrz.c	Thu Jan 21 08:08:41 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: sbbrz.c,v 1.1.2.3 2010/01/21 08:00:23 matt Exp $ */
+/* $NetBSD: sbbrz.c,v 1.1.2.4 2010/01/21 08:08:41 matt Exp $ */
 
 /*
  * Copyright 2000, 2001
@@ -197,6 +197,7 @@
 	pba.pba_dmat = sc->sc_dmat32;
 	pba.pba_pc = &sc->sc_pc;
 	pba.pba_bus = 0;
+	pba.pba_bridgetag = NULL;
 	pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED |
 	PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | PCI_FLAGS_MWI_OKAY;
 	config_found(self, &pba, sbbrz_print);



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

2010-01-21 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Jan 21 08:00:23 UTC 2010

Modified Files:
src/sys/arch/mips/sibyte/pci [matt-nb5-mips64]: sbbrz.c

Log Message:
Print out the mode of pci (device or host).


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/arch/mips/sibyte/pci/sbbrz.c

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

Modified files:

Index: src/sys/arch/mips/sibyte/pci/sbbrz.c
diff -u src/sys/arch/mips/sibyte/pci/sbbrz.c:1.1.2.2 src/sys/arch/mips/sibyte/pci/sbbrz.c:1.1.2.3
--- src/sys/arch/mips/sibyte/pci/sbbrz.c:1.1.2.2	Thu Jan 21 04:53:06 2010
+++ src/sys/arch/mips/sibyte/pci/sbbrz.c	Thu Jan 21 08:00:23 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: sbbrz.c,v 1.1.2.2 2010/01/21 04:53:06 snj Exp $ */
+/* $NetBSD: sbbrz.c,v 1.1.2.3 2010/01/21 08:00:23 matt Exp $ */
 
 /*
  * Copyright 2000, 2001
@@ -107,6 +107,8 @@
 #include 
 #include 
 
+#include 
+#include 
 #include 
 #include 
 
@@ -167,8 +169,14 @@
 {
 	struct sbbrz_softc *sc = &sbbrz_softc;
 	struct pcibus_attach_args pba;
+uint64_t regval;
+bool host;
 
-	aprint_normal("\n");	// zbbus leaves this open for addition info
+/* Tell the user whether it's host or device mode. */
+regval = mips3_ld((void *)MIPS_PHYS_TO_KSEG1(A_SCD_SYSTEM_CFG));
+host = (regval & M_SYS_PCI_HOST) != 0;
+
+aprint_normal(": %s pci mode\n", host ? "host" : "device");
 
 	/* note that we've attached the bridge; can't have two. */
 	sc->sc_dev = self;