CVS commit: [netbsd-5] src/sys/arch

2013-01-13 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 13 16:46:23 UTC 2013

Modified Files:
src/sys/arch/amd64/conf [netbsd-5]: XEN3_DOMU
src/sys/arch/i386/conf [netbsd-5]: XEN2_DOMU

Log Message:
apply patch(s) (requested by sborrill in ticket #1834):
sys/arch/i386/conf/XEN2_DOMU: patch
sys/arch/amd64/conf/XEN3_DOMU: patch
Add drvctl to Xen DOMU kernels


To generate a diff of this commit:
cvs rdiff -u -r1.13.4.2 -r1.13.4.3 src/sys/arch/amd64/conf/XEN3_DOMU
cvs rdiff -u -r1.19.4.2 -r1.19.4.3 src/sys/arch/i386/conf/XEN2_DOMU

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

Modified files:

Index: src/sys/arch/amd64/conf/XEN3_DOMU
diff -u src/sys/arch/amd64/conf/XEN3_DOMU:1.13.4.2 src/sys/arch/amd64/conf/XEN3_DOMU:1.13.4.3
--- src/sys/arch/amd64/conf/XEN3_DOMU:1.13.4.2	Mon Feb 15 18:04:11 2010
+++ src/sys/arch/amd64/conf/XEN3_DOMU	Sun Jan 13 16:46:22 2013
@@ -1,4 +1,4 @@
-# $NetBSD: XEN3_DOMU,v 1.13.4.2 2010/02/15 18:04:11 sborrill Exp $
+# $NetBSD: XEN3_DOMU,v 1.13.4.3 2013/01/13 16:46:22 bouyer Exp $
 
 include 	"arch/amd64/conf/std.xen"
 
@@ -223,3 +223,6 @@ pseudo-device	vcoda		4	# coda minicache 
 
 # a pseudo device needed for SMBFS
 pseudo-device	nsmb			# experimental - SMB requester
+
+# userland interface to drivers, including autoconf and properties retrieval
+pseudo-device   drvctl

Index: src/sys/arch/i386/conf/XEN2_DOMU
diff -u src/sys/arch/i386/conf/XEN2_DOMU:1.19.4.2 src/sys/arch/i386/conf/XEN2_DOMU:1.19.4.3
--- src/sys/arch/i386/conf/XEN2_DOMU:1.19.4.2	Mon Feb 15 18:04:11 2010
+++ src/sys/arch/i386/conf/XEN2_DOMU	Sun Jan 13 16:46:22 2013
@@ -1,4 +1,4 @@
-# $NetBSD: XEN2_DOMU,v 1.19.4.2 2010/02/15 18:04:11 sborrill Exp $
+# $NetBSD: XEN2_DOMU,v 1.19.4.3 2013/01/13 16:46:22 bouyer Exp $
 
 include 	"arch/xen/conf/std.xen"
 
@@ -237,3 +237,6 @@ pseudo-device	vcoda		4	# coda minicache 
 
 # a pseudo device needed for SMBFS
 pseudo-device	nsmb			# experimental - SMB requester
+
+# userland interface to drivers, including autoconf and properties retrieval
+pseudo-device   drvctl



CVS commit: [netbsd-5] src/sys/arch

2012-05-19 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sat May 19 16:37:14 UTC 2012

Modified Files:
src/sys/arch/amd64/amd64 [netbsd-5]: db_memrw.c
src/sys/arch/i386/i386 [netbsd-5]: db_memrw.c

Log Message:
Pull up following revision(s) (requested by jym in ticket #1754):
sys/arch/amd64/amd64/db_memrw.c: revision 1.10
sys/arch/amd64/amd64/db_memrw.c: revision 1.11
sys/arch/i386/i386/db_memrw.c: revision 1.29
Use the current destination address to compute PTE, not the address of
origin.
Harmless, except when db_write_text() passes a page boundary.
 From Bug Hunting.
XXX has to be pulled up to -5 and -6.
invlpg on a non canonical address is a noop, so no chance to invalidate
the TLB and the CPU will not notice the access right change.
This results in write protection faults in supervisor mode when patching
kernel code through ddb(4) (originally mapped as read only).
Bug reported by David Laight on port-amd64@ (thanks!), patch and test by
me.
i386 is unaffected as PG_LGFRAME does not mask the sign bits. For the
sake of correctness, use VA_SIGN_NEG(...) anyway.
XXX this is the patch that will be pulled-up to -5 and -6.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.6.10.1 src/sys/arch/amd64/amd64/db_memrw.c
cvs rdiff -u -r1.24.10.1 -r1.24.10.2 src/sys/arch/i386/i386/db_memrw.c

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

Modified files:

Index: src/sys/arch/amd64/amd64/db_memrw.c
diff -u src/sys/arch/amd64/amd64/db_memrw.c:1.6 src/sys/arch/amd64/amd64/db_memrw.c:1.6.10.1
--- src/sys/arch/amd64/amd64/db_memrw.c:1.6	Mon Apr 28 20:23:12 2008
+++ src/sys/arch/amd64/amd64/db_memrw.c	Sat May 19 16:37:14 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_memrw.c,v 1.6 2008/04/28 20:23:12 martin Exp $	*/
+/*	$NetBSD: db_memrw.c,v 1.6.10.1 2012/05/19 16:37:14 riz Exp $	*/
 
 /*-
  * Copyright (c) 1996, 2000 The NetBSD Foundation, Inc.
@@ -51,7 +51,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_memrw.c,v 1.6 2008/04/28 20:23:12 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_memrw.c,v 1.6.10.1 2012/05/19 16:37:14 riz Exp $");
 
 #include "opt_xen.h"
 
@@ -115,7 +115,7 @@ db_write_text(vaddr_t addr, size_t size,
 		/*
 		 * Get the PTE for the page.
 		 */
-		pte = kvtopte(addr);
+		pte = kvtopte((vaddr_t)dst);
 		oldpte = *pte;
 
 		if ((oldpte & PG_V) == 0) {
@@ -127,7 +127,7 @@ db_write_text(vaddr_t addr, size_t size,
 		 * Get the VA for the page.
 		 */
 		if (oldpte & PG_PS)
-			pgva = (vaddr_t)dst & PG_LGFRAME;
+			pgva = VA_SIGN_NEG((vaddr_t)dst & PG_LGFRAME);
 		else
 			pgva = x86_trunc_page(dst);
 

Index: src/sys/arch/i386/i386/db_memrw.c
diff -u src/sys/arch/i386/i386/db_memrw.c:1.24.10.1 src/sys/arch/i386/i386/db_memrw.c:1.24.10.2
--- src/sys/arch/i386/i386/db_memrw.c:1.24.10.1	Wed Sep 30 00:08:03 2009
+++ src/sys/arch/i386/i386/db_memrw.c	Sat May 19 16:37:14 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_memrw.c,v 1.24.10.1 2009/09/30 00:08:03 snj Exp $	*/
+/*	$NetBSD: db_memrw.c,v 1.24.10.2 2012/05/19 16:37:14 riz Exp $	*/
 
 /*-
  * Copyright (c) 1996, 2000 The NetBSD Foundation, Inc.
@@ -49,7 +49,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_memrw.c,v 1.24.10.1 2009/09/30 00:08:03 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_memrw.c,v 1.24.10.2 2012/05/19 16:37:14 riz Exp $");
 
 #include "opt_xen.h"
 
@@ -111,7 +111,7 @@ db_write_text(vaddr_t addr, size_t size,
 		/*
 		 * Get the PTE for the page.
 		 */
-		pte = kvtopte(addr);
+		pte = kvtopte((vaddr_t)dst);
 		oldpte = *pte;
 
 		if ((oldpte & PG_V) == 0) {



CVS commit: [netbsd-5] src/sys/arch

2012-02-24 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Fri Feb 24 17:29:32 UTC 2012

Modified Files:
src/sys/arch/x86/x86 [netbsd-5]: pmap.c
src/sys/arch/xen/x86 [netbsd-5]: x86_xpmap.c

Log Message:
Pull up the following revisions(s) (requested by bouyer in ticket #1729):
sys/arch/x86/x86/pmap.c:revision 1.170 via patch
sys/arch/xen/x86/x86_xpmap.c:   revision 1.40 via patch

Fix random kernel panic on domains with large memory.
May fix PR port-xen/38699


To generate a diff of this commit:
cvs rdiff -u -r1.74.4.3 -r1.74.4.4 src/sys/arch/x86/x86/pmap.c
cvs rdiff -u -r1.11 -r1.11.4.1 src/sys/arch/xen/x86/x86_xpmap.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/x86/x86/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.74.4.3 src/sys/arch/x86/x86/pmap.c:1.74.4.4
--- src/sys/arch/x86/x86/pmap.c:1.74.4.3	Thu Apr 22 20:02:48 2010
+++ src/sys/arch/x86/x86/pmap.c	Fri Feb 24 17:29:32 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.74.4.3 2010/04/22 20:02:48 snj Exp $	*/
+/*	$NetBSD: pmap.c,v 1.74.4.4 2012/02/24 17:29:32 sborrill Exp $	*/
 
 /*
  * Copyright (c) 2007 Manuel Bouyer.
@@ -154,7 +154,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.74.4.3 2010/04/22 20:02:48 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.74.4.4 2012/02/24 17:29:32 sborrill Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -535,7 +535,12 @@ static struct pool_cache pmap_pv_cache;
  * special VAs and the PTEs that map them
  */
 static pt_entry_t *csrc_pte, *cdst_pte, *zero_pte, *ptp_pte, *early_zero_pte;
-static char *csrcp, *cdstp, *zerop, *ptpp, *early_zerop;
+static char *csrcp, *cdstp, *zerop, *ptpp;
+#ifdef XEN
+char *early_zerop; /* also referenced from xen_pmap_bootstrap() */
+#else
+static char *early_zerop;
+#endif
 
 /*
  * pool and cache that PDPs are allocated from
@@ -1340,8 +1345,11 @@ pmap_bootstrap(vaddr_t kva_start)
 		 * when it's called for the first time.
 		 * XXXfvdl fix this for MULTIPROCESSOR later.
 		 */
-
+#ifdef XEN
+		/* early_zerop initialized in xen_pmap_bootstrap() */
+#else
 		early_zerop = (void *)(KERNBASE + NKL2_KIMG_ENTRIES * NBPD_L2);
+#endif
 		early_zero_pte = PTE_BASE + pl1_i((unsigned long)early_zerop);
 	}
 

Index: src/sys/arch/xen/x86/x86_xpmap.c
diff -u src/sys/arch/xen/x86/x86_xpmap.c:1.11 src/sys/arch/xen/x86/x86_xpmap.c:1.11.4.1
--- src/sys/arch/xen/x86/x86_xpmap.c:1.11	Fri Oct 24 21:09:24 2008
+++ src/sys/arch/xen/x86/x86_xpmap.c	Fri Feb 24 17:29:32 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: x86_xpmap.c,v 1.11 2008/10/24 21:09:24 jym Exp $	*/
+/*	$NetBSD: x86_xpmap.c,v 1.11.4.1 2012/02/24 17:29:32 sborrill Exp $	*/
 
 /*
  * Copyright (c) 2006 Mathieu Ropert 
@@ -79,7 +79,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: x86_xpmap.c,v 1.11 2008/10/24 21:09:24 jym Exp $");
+__KERNEL_RCSID(0, "$NetBSD: x86_xpmap.c,v 1.11.4.1 2012/02/24 17:29:32 sborrill Exp $");
 
 #include "opt_xen.h"
 #include "opt_ddb.h"
@@ -545,6 +545,7 @@ xen_pmap_bootstrap(void)
 	 *  - UAREA
 	 *  - dummy user PGD (x86_64)
 	 *  - HYPERVISOR_shared_info
+	 *  - early_zerop
 	 *  - ISA I/O mem (if needed)
 	 */
 	mapsize += UPAGES * NBPG;
@@ -552,6 +553,7 @@ xen_pmap_bootstrap(void)
 	mapsize += NBPG;
 #endif
 	mapsize += NBPG;
+	mapsize += NBPG;
 
 #ifdef DOM0OPS
 	if (xendomain_is_dom0()) {
@@ -639,6 +641,7 @@ xen_bootstrap_tables (vaddr_t old_pgd, v
 	vaddr_t page, avail, text_end, map_end;
 	int i;
 	extern char __data_start;
+	extern char *early_zerop; /* from pmap.c */
 
 	__PRINTK(("xen_bootstrap_tables(0x%lx, 0x%lx, %d, %d)\n",
 	old_pgd, new_pgd, old_count, new_count));
@@ -652,6 +655,7 @@ xen_bootstrap_tables (vaddr_t old_pgd, v
 	 *  UAREA
 	 *  dummy user PGD (x86_64 only)/gdt page (i386 only)
 	 *  HYPERVISOR_shared_info
+	 *  early_zerop
 	 *  ISA I/O mem (if needed)
 	 */
 	map_end = new_pgd + ((new_count + l2_4_count) * NBPG);
@@ -659,6 +663,8 @@ xen_bootstrap_tables (vaddr_t old_pgd, v
 		map_end += (UPAGES + 1) * NBPG;
 		HYPERVISOR_shared_info = (shared_info_t *)map_end;
 		map_end += NBPG;
+		early_zerop = (char *)map_end;
+		map_end += NBPG;
 	}
 	/*
 	 * we always set atdevbase, as it's used by init386 to find the first



CVS commit: [netbsd-5] src/sys/arch

2009-06-19 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Jun 19 21:22:11 UTC 2009

Modified Files:
src/sys/arch/amd64/conf [netbsd-5]: files.amd64
src/sys/arch/i386/conf [netbsd-5]: files.i386
src/sys/arch/x86/isa [netbsd-5]: clock.c
src/sys/arch/xen/conf [netbsd-5]: files.xen
src/sys/arch/xen/xen [netbsd-5]: clock.c
Added Files:
src/sys/arch/x86/include [netbsd-5]: rtc.h
src/sys/arch/x86/isa [netbsd-5]: rtc.c

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #816):
sys/arch/amd64/conf/files.amd64: revision 1.68
sys/arch/i386/conf/files.i386: revision 1.350
sys/arch/x86/include/rtc.h: revision 1.1
sys/arch/x86/isa/clock.c: revision 1.33
sys/arch/x86/isa/rtc.c: revision 1.1
sys/arch/xen/conf/files.xen: revision 1.100
sys/arch/xen/xen/clock.c: revision 1.50 via patch
Split mc146818-related functions from clock.c into rtc.c.
Call rtc_set_ymdhms() from xen/xen/clock.c:xen_rtc_set() for xen3 dom0
kernels as the Xen3 hypervisor doesn't write the new date/time to the CMOS
by itself.
Now a XEN3_DOM0 kernel properly updates the CMOS time.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.60.8.1 src/sys/arch/amd64/conf/files.amd64
cvs rdiff -u -r1.338.6.2 -r1.338.6.3 src/sys/arch/i386/conf/files.i386
cvs rdiff -u -r0 -r1.1.2.2 src/sys/arch/x86/include/rtc.h
cvs rdiff -u -r1.30 -r1.30.8.1 src/sys/arch/x86/isa/clock.c
cvs rdiff -u -r0 -r1.1.2.2 src/sys/arch/x86/isa/rtc.c
cvs rdiff -u -r1.88.4.3 -r1.88.4.4 src/sys/arch/xen/conf/files.xen
cvs rdiff -u -r1.47 -r1.47.4.1 src/sys/arch/xen/xen/clock.c

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

Modified files:

Index: src/sys/arch/amd64/conf/files.amd64
diff -u src/sys/arch/amd64/conf/files.amd64:1.60 src/sys/arch/amd64/conf/files.amd64:1.60.8.1
--- src/sys/arch/amd64/conf/files.amd64:1.60	Sun May 11 14:44:53 2008
+++ src/sys/arch/amd64/conf/files.amd64	Fri Jun 19 21:22:10 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: files.amd64,v 1.60 2008/05/11 14:44:53 ad Exp $
+#	$NetBSD: files.amd64,v 1.60.8.1 2009/06/19 21:22:10 snj Exp $
 #
 # new style config file for amd64 architecture
 #
@@ -112,6 +112,7 @@
 
 # PC clock
 file 	arch/x86/isa/clock.c 			isa
+file	arch/x86/isa/rtc.c			isa
 
 # TSC timecounter support
 file	arch/x86/x86/tsc.c

Index: src/sys/arch/i386/conf/files.i386
diff -u src/sys/arch/i386/conf/files.i386:1.338.6.2 src/sys/arch/i386/conf/files.i386:1.338.6.3
--- src/sys/arch/i386/conf/files.i386:1.338.6.2	Mon Feb 16 03:03:36 2009
+++ src/sys/arch/i386/conf/files.i386	Fri Jun 19 21:22:10 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: files.i386,v 1.338.6.2 2009/02/16 03:03:36 snj Exp $
+#	$NetBSD: files.i386,v 1.338.6.3 2009/06/19 21:22:10 snj Exp $
 #
 # new style config file for i386 architecture
 #
@@ -248,6 +248,7 @@
 
 # PC clock
 file	arch/x86/isa/clock.c		isa
+file	arch/x86/isa/rtc.c		isa
 
 # TSC support
 file	arch/x86/x86/tsc.c

Index: src/sys/arch/x86/isa/clock.c
diff -u src/sys/arch/x86/isa/clock.c:1.30 src/sys/arch/x86/isa/clock.c:1.30.8.1
--- src/sys/arch/x86/isa/clock.c:1.30	Sun May 11 22:18:08 2008
+++ src/sys/arch/x86/isa/clock.c	Fri Jun 19 21:22:10 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock.c,v 1.30 2008/05/11 22:18:08 ad Exp $	*/
+/*	$NetBSD: clock.c,v 1.30.8.1 2009/06/19 21:22:10 snj Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -121,7 +121,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.30 2008/05/11 22:18:08 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.30.8.1 2009/06/19 21:22:10 snj Exp $");
 
 /* #define CLOCKDEBUG */
 /* #define CLOCK_PARANOIA */
@@ -150,8 +150,8 @@
 #include 
 #include 
 #include 
-#include 
 #include  
+#include 
 
 #ifndef __x86_64__
 #include "mca.h"
@@ -188,13 +188,7 @@
 static void tickle_tc(void);
 
 static int	clockintr(void *, struct intrframe *);
-static void	rtcinit(void);
-static int	rtcget(mc_todregs *);
-static void	rtcput(mc_todregs *);
 
-static int	cmoscheck(void);
-
-static int	clock_expandyear(int);
 int 		sysbeepdetach(device_t, int);
 
 static unsigned int	gettick_broken_latch(void);
@@ -206,11 +200,7 @@
 /* to protect TC timer variables */
 static __cpu_simple_lock_t tmr_lock = __SIMPLELOCK_UNLOCKED;
 
-inline u_int mc146818_read(void *, u_int);
-inline void mc146818_write(void *, u_int, u_int);
-
 u_int i8254_get_timecount(struct timecounter *);
-static void rtc_register(void);
 
 static struct timecounter i8254_timecounter = {
 	i8254_get_timecount,	/* get_timecount */
@@ -223,24 +213,6 @@
 	NULL,			/* next */
 };
 
-/* XXX use sc? */
-inline u_int
-mc146818_read(void *sc, u_int reg)
-{
-
-	outb(IO_RTC, reg);
-	return (inb(IO_RTC+1));
-}
-
-/* XXX use sc? */
-inline void
-mc146818_write(void *sc, u_int reg, u_int datum)
-{
-
-	outb(IO_RTC, reg);
-	outb(IO_RTC+1, datum);
-}
-
 u_long rtclock_tval;		/* i8254 reload value for countdown */
 intrtcl

CVS commit: [netbsd-5] src/sys/arch

2009-06-19 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Jun 19 21:33:57 UTC 2009

Modified Files:
src/sys/arch/amd64/amd64 [netbsd-5]: mainbus.c
src/sys/arch/i386/i386 [netbsd-5]: mainbus.c
src/sys/arch/x86/x86 [netbsd-5]: mpacpi.c mpbios.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #819):
sys/arch/amd64/amd64/mainbus.c: revision 1.28 via patch
sys/arch/i386/i386/mainbus.c: revision 1.85 via patch
sys/arch/x86/x86/mpacpi.c: patch
sys/arch/x86/x86/mpbios.c: patch
Apply fixes from jmcneill@ for PR port-i386/38729
(ACPI kernel booted under qemu cannot detect devices):
- make MP SCANPCI function for ACPI_SCANPCI and MPBIOS_SCANPCI
  return a number of attached PCI busses
- if no valid PCI busses are attached in the MP SCANPCI function,
  try to probe and attach pci0 at mainbus as well as kernels
  with no SCANPCI options


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.24.8.1 src/sys/arch/amd64/amd64/mainbus.c
cvs rdiff -u -r1.77 -r1.77.8.1 src/sys/arch/i386/i386/mainbus.c
cvs rdiff -u -r1.69.4.1 -r1.69.4.2 src/sys/arch/x86/x86/mpacpi.c
cvs rdiff -u -r1.47 -r1.47.4.1 src/sys/arch/x86/x86/mpbios.c

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

Modified files:

Index: src/sys/arch/amd64/amd64/mainbus.c
diff -u src/sys/arch/amd64/amd64/mainbus.c:1.24 src/sys/arch/amd64/amd64/mainbus.c:1.24.8.1
--- src/sys/arch/amd64/amd64/mainbus.c:1.24	Sun May 18 02:06:14 2008
+++ src/sys/arch/amd64/amd64/mainbus.c	Fri Jun 19 21:33:56 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: mainbus.c,v 1.24 2008/05/18 02:06:14 jmcneill Exp $	*/
+/*	$NetBSD: mainbus.c,v 1.24.8.1 2009/06/19 21:33:56 snj Exp $	*/
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.24 2008/05/18 02:06:14 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.24.8.1 2009/06/19 21:33:56 snj Exp $");
 
 #include 
 #include 
@@ -254,6 +254,8 @@
 
 #if NPCI > 0
 	if (pci_mode != 0) {
+		int npcibus = 0;
+
 		mba.mba_pba.pba_iot = X86_BUS_SPACE_IO;
 		mba.mba_pba.pba_memt = X86_BUS_SPACE_MEM;
 		mba.mba_pba.pba_dmat = &pci_bus_dma_tag;
@@ -263,17 +265,18 @@
 		mba.mba_pba.pba_bus = 0;
 		mba.mba_pba.pba_bridgetag = NULL;
 #if NACPI > 0 && defined(ACPI_SCANPCI)
-		if (mpacpi_active)
-			mpacpi_scan_pci(self, &mba.mba_pba, pcibusprint);
-		else
+		if (npcibus == 0 && mpacpi_active)
+			npcibus = mpacpi_scan_pci(self, &mba.mba_pba,
+			pcibusprint);
 #endif
 #if defined(MPBIOS) && defined(MPBIOS_SCANPCI)
-		if (mpbios_scanned != 0)
-			mpbios_scan_pci(self, &mba.mba_pba, pcibusprint);
-		else
-#endif
-		config_found_ia(self, "pcibus", &mba.mba_pba, pcibusprint);
-
+		if (npcibus == 0 && mpbios_scanned != 0)
+			npcibus = mpbios_scan_pci(self, &mba.mba_pba,
+			pcibusprint);
+#endif
+		if (npcibus == 0)
+			config_found_ia(self, "pcibus", &mba.mba_pba,
+			pcibusprint);
 #if NACPI > 0
 		if (mp_verbose)
 			acpi_pci_link_state();

Index: src/sys/arch/i386/i386/mainbus.c
diff -u src/sys/arch/i386/i386/mainbus.c:1.77 src/sys/arch/i386/i386/mainbus.c:1.77.8.1
--- src/sys/arch/i386/i386/mainbus.c:1.77	Sun May 18 02:06:14 2008
+++ src/sys/arch/i386/i386/mainbus.c	Fri Jun 19 21:33:57 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: mainbus.c,v 1.77 2008/05/18 02:06:14 jmcneill Exp $	*/
+/*	$NetBSD: mainbus.c,v 1.77.8.1 2009/06/19 21:33:57 snj Exp $	*/
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.77 2008/05/18 02:06:14 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.77.8.1 2009/06/19 21:33:57 snj Exp $");
 
 #include 
 #include 
@@ -319,6 +319,8 @@
 	 */
 #if NPCI > 0
 	if (pci_mode != 0) {
+		int npcibus = 0;
+
 		mba.mba_pba.pba_iot = X86_BUS_SPACE_IO;
 		mba.mba_pba.pba_memt = X86_BUS_SPACE_MEM;
 		mba.mba_pba.pba_dmat = &pci_bus_dma_tag;
@@ -328,16 +330,18 @@
 		mba.mba_pba.pba_bus = 0;
 		mba.mba_pba.pba_bridgetag = NULL;
 #if NACPI > 0 && defined(ACPI_SCANPCI)
-		if (mpacpi_active)
-			mpacpi_scan_pci(self, &mba.mba_pba, pcibusprint);
-		else
+		if (npcibus == 0 && mpacpi_active)
+			npcibus = mpacpi_scan_pci(self, &mba.mba_pba,
+			pcibusprint);
 #endif
 #if defined(MPBIOS) && defined(MPBIOS_SCANPCI)
-		if (mpbios_scanned != 0)
-			mpbios_scan_pci(self, &mba.mba_pba, pcibusprint);
-		else
-#endif
-		config_found_ia(self, "pcibus", &mba.mba_pba, pcibusprint);
+		if (npcibus == 0 && mpbios_scanned != 0)
+			npcibus = mpbios_scan_pci(self, &mba.mba_pba,
+			pcibusprint);
+#endif
+		if (npcibus == 0)
+			config_found_ia(self, "pcibus", &mba.mba_pba,
+			pcibusprint);
 #if NACPI > 0
 		if (mp_verbose)
 			acpi_pci_link_state();

Index: src/sys/arch/x86/x86/mpacpi.c
diff -u src/sys/arch/x86/x86/mpacpi.c:1.69.4.1 src/sys/arch/x86/x86/mpacpi.c:1.69.4.2
--- src/sys/arch/x86/x86/mpacpi

CVS commit: [netbsd-5] src/sys/arch

2009-08-07 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Aug  7 18:33:49 UTC 2009

Modified Files:
src/sys/arch/alpha/conf [netbsd-5]: Makefile.alpha
src/sys/arch/amd64/conf [netbsd-5]: Makefile.amd64
src/sys/arch/i386/conf [netbsd-5]: Makefile.i386
src/sys/arch/macppc/conf [netbsd-5]: Makefile.macppc
src/sys/arch/mips/conf [netbsd-5]: Makefile.mips
src/sys/arch/sparc64/conf [netbsd-5]: Makefile.sparc64
src/sys/arch/xen/conf [netbsd-5]: Makefile.xen

Log Message:
Pull up following revision(s) (requested by sborrill in ticket #905):
sys/arch/alpha/conf/Makefile.alpha: revision 1.81
sys/arch/amd64/conf/Makefile.amd64: revision 1.26
sys/arch/i386/conf/Makefile.i386: revision 1.162
sys/arch/macppc/conf/Makefile.macppc: revision 1.31
sys/arch/mips/conf/Makefile.mips: revision 1.52
sys/arch/sparc64/conf/Makefile.sparc64: revision 1.68
sys/arch/xen/conf/Makefile.xen: revision 1.28
Clean-up makefile stub used to include in the build the binary HAL object


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.80.4.1 src/sys/arch/alpha/conf/Makefile.alpha
cvs rdiff -u -r1.25 -r1.25.2.1 src/sys/arch/amd64/conf/Makefile.amd64
cvs rdiff -u -r1.159 -r1.159.4.1 src/sys/arch/i386/conf/Makefile.i386
cvs rdiff -u -r1.29 -r1.29.14.1 src/sys/arch/macppc/conf/Makefile.macppc
cvs rdiff -u -r1.50 -r1.50.20.1 src/sys/arch/mips/conf/Makefile.mips
cvs rdiff -u -r1.67 -r1.67.4.1 src/sys/arch/sparc64/conf/Makefile.sparc64
cvs rdiff -u -r1.27 -r1.27.2.1 src/sys/arch/xen/conf/Makefile.xen

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

Modified files:

Index: src/sys/arch/alpha/conf/Makefile.alpha
diff -u src/sys/arch/alpha/conf/Makefile.alpha:1.80 src/sys/arch/alpha/conf/Makefile.alpha:1.80.4.1
--- src/sys/arch/alpha/conf/Makefile.alpha:1.80	Sat Oct 25 22:27:36 2008
+++ src/sys/arch/alpha/conf/Makefile.alpha	Fri Aug  7 18:33:48 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.alpha,v 1.80 2008/10/25 22:27:36 apb Exp $
+#	$NetBSD: Makefile.alpha,v 1.80.4.1 2009/08/07 18:33:48 snj Exp $
 
 # Makefile for NetBSD
 #
@@ -93,9 +93,6 @@
 
 %RULES
 
-## Include rules for Atheros WLAN
-.include "$S/contrib/dev/ath/netbsd/Makefile.ath.inc"
-
 ##
 ## (9) port independent kernel machinery
 ##

Index: src/sys/arch/amd64/conf/Makefile.amd64
diff -u src/sys/arch/amd64/conf/Makefile.amd64:1.25 src/sys/arch/amd64/conf/Makefile.amd64:1.25.2.1
--- src/sys/arch/amd64/conf/Makefile.amd64:1.25	Thu Oct 30 20:07:01 2008
+++ src/sys/arch/amd64/conf/Makefile.amd64	Fri Aug  7 18:33:48 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.amd64,v 1.25 2008/10/30 20:07:01 joerg Exp $
+#	$NetBSD: Makefile.amd64,v 1.25.2.1 2009/08/07 18:33:48 snj Exp $
 
 # Makefile for NetBSD
 #
@@ -99,31 +99,9 @@
 %LOAD
 
 %RULES
-## Include rules for Atheros WLAN
-.include "$S/contrib/dev/ath/netbsd/Makefile.ath.inc"
-.include "$S/arch/x86/acpi/Makefile.wakecode.inc"
 
-# XXX -	Ugly, but make doesn't easily handle .o.uu (assumes it's a suffix)
-# XXX -	Also, config has no simple was to just add foo.o to the Makefile.
-#	It needs a pathname of some sort for "object"
-.if !empty(OBJS:M\/athhal.o)
-OBJS:=${OBJS:C/\/athhal.o/athhal.o/}
-
-.PATH: $S/contrib/dev/ath/public
-ATH_UUDEC?=	@${_MKSHMSG} "uudecode ${.CURDIR:T}/${.TARGET}"; \
-		${_MKSHECHO}\
-		${UUDECODE} -p $> \> ${.TARGET}; \
-		rm -f ${.TARGET}; \
-		${UUDECODE} -p $> > ${.TARGET}
-
-athhal.o: x86_64-elf.hal.o.uu
-	${ATH_UUDEC}
-.if defined(COPTS) && !empty(COPTS:M-fno-asynchronous-unwind-tables)
-	${_MKSHECHO}\
-	${OBJCOPY} -R .eh_frame $@
-	${OBJCOPY} -R .eh_frame $@
-.endif
-.endif
+## Include rules for ACPI wakecode
+.include "$S/arch/x86/acpi/Makefile.wakecode.inc"
 
 ##
 ## (9) port independent kernel machinery

Index: src/sys/arch/i386/conf/Makefile.i386
diff -u src/sys/arch/i386/conf/Makefile.i386:1.159 src/sys/arch/i386/conf/Makefile.i386:1.159.4.1
--- src/sys/arch/i386/conf/Makefile.i386:1.159	Sun Oct 26 06:56:39 2008
+++ src/sys/arch/i386/conf/Makefile.i386	Fri Aug  7 18:33:48 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.i386,v 1.159 2008/10/26 06:56:39 mrg Exp $
+#	$NetBSD: Makefile.i386,v 1.159.4.1 2009/08/07 18:33:48 snj Exp $
 
 # Makefile for NetBSD
 #
@@ -117,8 +117,7 @@
 
 %RULES
 
-## Include rules for Atheros WLAN
-.include "$S/contrib/dev/ath/netbsd/Makefile.ath.inc"
+## Include rules for ACPI wakecode
 .include "$S/arch/x86/acpi/Makefile.wakecode.inc"
 
 ##

Index: src/sys/arch/macppc/conf/Makefile.macppc
diff -u src/sys/arch/macppc/conf/Makefile.macppc:1.29 src/sys/arch/macppc/conf/Makefile.macppc:1.29.14.1
--- src/sys/arch/macppc/conf/Makefile.macppc:1.29	Sat Mar  1 13:59:26 2008
+++ src/sys/arch/macppc/conf/Makefile.macppc	Fri Aug  7 18:33:48 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.macppc,v 1.29 2008/03/01 13:59:26 joerg Exp $
+#	$NetBSD: Makefile.macppc,v 1.29.14.1 2009/08/07 18:33:48 snj Exp $
 #
 # Makefile for NetBSD
 #
@@ -118,

CVS commit: [netbsd-5] src/sys/arch

2009-08-14 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Aug 14 21:30:19 UTC 2009

Modified Files:
src/sys/arch/hp300/include [netbsd-5]: cpu.h
src/sys/arch/news68k/include [netbsd-5]: cpu.h
src/sys/arch/powerpc/powerpc [netbsd-5]: trap.c

Log Message:
Pull up following revision(s) (requested by rmind in ticket #897):
sys/arch/hp300/include/cpu.h: revision 1.60
sys/arch/news68k/include/cpu.h: revision 1.34
sys/arch/powerpc/powerpc/trap.c: revision 1.130 via patch
Fix few more l_pflag and LP_OWEUPC confusions.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.59.14.1 src/sys/arch/hp300/include/cpu.h
cvs rdiff -u -r1.33 -r1.33.14.1 src/sys/arch/news68k/include/cpu.h
cvs rdiff -u -r1.128 -r1.128.4.1 src/sys/arch/powerpc/powerpc/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/hp300/include/cpu.h
diff -u src/sys/arch/hp300/include/cpu.h:1.59 src/sys/arch/hp300/include/cpu.h:1.59.14.1
--- src/sys/arch/hp300/include/cpu.h:1.59	Wed Feb 27 18:26:15 2008
+++ src/sys/arch/hp300/include/cpu.h	Fri Aug 14 21:30:19 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.59 2008/02/27 18:26:15 xtraeme Exp $	*/
+/*	$NetBSD: cpu.h,v 1.59.14.1 2009/08/14 21:30:19 snj Exp $	*/
 
 /*
  * Copyright (c) 1982, 1990, 1993
@@ -159,7 +159,7 @@
  * through trap, marking the proc as needing a profiling tick.
  */
 #define	cpu_need_proftick(l)	\
-	do { (l)->l_flag |= LP_OWEUPC; aston(); } while (/* CONSTCOND */0)
+	do { (l)->l_pflag |= LP_OWEUPC; aston(); } while (/* CONSTCOND */0)
 
 /*
  * Notify the current process (p) that it has a signal pending,

Index: src/sys/arch/news68k/include/cpu.h
diff -u src/sys/arch/news68k/include/cpu.h:1.33 src/sys/arch/news68k/include/cpu.h:1.33.14.1
--- src/sys/arch/news68k/include/cpu.h:1.33	Wed Feb 27 18:26:16 2008
+++ src/sys/arch/news68k/include/cpu.h	Fri Aug 14 21:30:19 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.33 2008/02/27 18:26:16 xtraeme Exp $	*/
+/*	$NetBSD: cpu.h,v 1.33.14.1 2009/08/14 21:30:19 snj Exp $	*/
 
 /*
  * Copyright (c) 1982, 1990, 1993
@@ -174,7 +174,7 @@
  * through trap, marking the proc as needing a profiling tick.
  */
 #define cpu_need_proftick(l)	\
-	do { (l)->l_flag |= LP_OWEUPC; aston(); } while (/* CONSTCOND */0)
+	do { (l)->l_pflag |= LP_OWEUPC; aston(); } while (/* CONSTCOND */0)
 
 /*
  * Notify the current process (p) that it has a signal pending,

Index: src/sys/arch/powerpc/powerpc/trap.c
diff -u src/sys/arch/powerpc/powerpc/trap.c:1.128 src/sys/arch/powerpc/powerpc/trap.c:1.128.4.1
--- src/sys/arch/powerpc/powerpc/trap.c:1.128	Sat Oct 25 09:10:07 2008
+++ src/sys/arch/powerpc/powerpc/trap.c	Fri Aug 14 21:30:19 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.128 2008/10/25 09:10:07 mrg Exp $	*/
+/*	$NetBSD: trap.c,v 1.128.4.1 2009/08/14 21:30:19 snj Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.128 2008/10/25 09:10:07 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.128.4.1 2009/08/14 21:30:19 snj Exp $");
 
 #include "opt_altivec.h"
 #include "opt_ddb.h"
@@ -342,7 +342,7 @@
 		ci->ci_astpending = 0;		/* we are about to do it */
 		uvmexp.softs++;
 		if (l->l_pflag & LP_OWEUPC) {
-			l->l_flag &= ~LP_OWEUPC;
+			l->l_pflag &= ~LP_OWEUPC;
 			ADDUPROF(p);
 		}
 		/* Check whether we are being preempted. */



CVS commit: [netbsd-5] src/sys/arch

2009-09-29 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Sep 30 00:08:03 UTC 2009

Modified Files:
src/sys/arch/i386/i386 [netbsd-5]: db_memrw.c
src/sys/arch/i386/include [netbsd-5]: param.h
src/sys/arch/xen/include [netbsd-5]: xenpmap.h
src/sys/arch/xen/xen [netbsd-5]: xenevt.c
Added Files:
src/sys/arch/i386/conf [netbsd-5]: XEN3PAE_DOM0

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #1040):
sys/arch/i386/include/param.h: revision 1.71
sys/arch/i386/i386/db_memrw.c: revision 1.25
sys/arch/xen/include/xenpmap.h: revision 1.22
sys/arch/xen/xen/xenevt.c: revision 1.31
More i386PAE fixes:
- x86_round_page, x86_trunc_page, x86_btop and x86_ptob macros are used with
  physical addresses; cast to paddr_t instead of u_long. Issue pointed out
  by jym@
- machine_to_phys_mapping[] is a long. This is fine as it holds page
  frame numbers (and this fits in a 32bit int as physical addresses are
  only 36bits), but cast to paddr_t before << PAGE_SHIFT
- xen_start_info.store_mfn is a long; cast it to paddr_t before << PAGE_SHIFT.
  should fix issue pointed out by cegger@


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1.8.2 src/sys/arch/i386/conf/XEN3PAE_DOM0
cvs rdiff -u -r1.24 -r1.24.10.1 src/sys/arch/i386/i386/db_memrw.c
cvs rdiff -u -r1.67.30.3 -r1.67.30.4 src/sys/arch/i386/include/param.h
cvs rdiff -u -r1.21 -r1.21.4.1 src/sys/arch/xen/include/xenpmap.h
cvs rdiff -u -r1.29.4.1 -r1.29.4.2 src/sys/arch/xen/xen/xenevt.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/i386/i386/db_memrw.c
diff -u src/sys/arch/i386/i386/db_memrw.c:1.24 src/sys/arch/i386/i386/db_memrw.c:1.24.10.1
--- src/sys/arch/i386/i386/db_memrw.c:1.24	Mon Apr 28 20:23:24 2008
+++ src/sys/arch/i386/i386/db_memrw.c	Wed Sep 30 00:08:03 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_memrw.c,v 1.24 2008/04/28 20:23:24 martin Exp $	*/
+/*	$NetBSD: db_memrw.c,v 1.24.10.1 2009/09/30 00:08:03 snj Exp $	*/
 
 /*-
  * Copyright (c) 1996, 2000 The NetBSD Foundation, Inc.
@@ -49,7 +49,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_memrw.c,v 1.24 2008/04/28 20:23:24 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_memrw.c,v 1.24.10.1 2009/09/30 00:08:03 snj Exp $");
 
 #include "opt_xen.h"
 
@@ -125,7 +125,7 @@
 		if (oldpte & PG_PS)
 			pgva = (vaddr_t)dst & PG_LGFRAME;
 		else
-			pgva = x86_trunc_page(dst);
+			pgva = x86_trunc_page((vaddr_t)dst);
 
 		/*
 		 * Compute number of bytes that can be written

Index: src/sys/arch/i386/include/param.h
diff -u src/sys/arch/i386/include/param.h:1.67.30.3 src/sys/arch/i386/include/param.h:1.67.30.4
--- src/sys/arch/i386/include/param.h:1.67.30.3	Mon Feb 16 03:06:21 2009
+++ src/sys/arch/i386/include/param.h	Wed Sep 30 00:08:03 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.67.30.3 2009/02/16 03:06:21 snj Exp $	*/
+/*	$NetBSD: param.h,v 1.67.30.4 2009/09/30 00:08:03 snj Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -161,9 +161,9 @@
 #define	x86_trunc_pdr(x)	((unsigned long)(x) & ~(NBPD_L2 - 1))
 #define	x86_btod(x)		((unsigned long)(x) >> L2_SHIFT)
 #define	x86_dtob(x)		((unsigned long)(x) << L2_SHIFT)
-#define	x86_round_page(x)	unsigned long)(x)) + PGOFSET) & ~PGOFSET)
-#define	x86_trunc_page(x)	((unsigned long)(x) & ~PGOFSET)
-#define	x86_btop(x)		((unsigned long)(x) >> PGSHIFT)
-#define	x86_ptob(x)		((unsigned long)(x) << PGSHIFT)
+#define	x86_round_page(x)	paddr_t)(x)) + PGOFSET) & ~PGOFSET)
+#define	x86_trunc_page(x)	((paddr_t)(x) & ~PGOFSET)
+#define	x86_btop(x)		((paddr_t)(x) >> PGSHIFT)
+#define	x86_ptob(x)		((paddr_t)(x) << PGSHIFT)
 
 #endif /* _I386_PARAM_H_ */

Index: src/sys/arch/xen/include/xenpmap.h
diff -u src/sys/arch/xen/include/xenpmap.h:1.21 src/sys/arch/xen/include/xenpmap.h:1.21.4.1
--- src/sys/arch/xen/include/xenpmap.h:1.21	Fri Oct 24 22:06:06 2008
+++ src/sys/arch/xen/include/xenpmap.h	Wed Sep 30 00:08:03 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: xenpmap.h,v 1.21 2008/10/24 22:06:06 jym Exp $	*/
+/*	$NetBSD: xenpmap.h,v 1.21.4.1 2009/09/30 00:08:03 snj Exp $	*/
 
 /*
  *
@@ -71,15 +71,17 @@
 static __inline paddr_t
 xpmap_mtop(paddr_t mpa)
 {
-	return ((machine_to_phys_mapping[mpa >> PAGE_SHIFT] << PAGE_SHIFT) +
-	XPMAP_OFFSET) | (mpa & ~PG_FRAME);
+	return (
+	((paddr_t)machine_to_phys_mapping[mpa >> PAGE_SHIFT] << PAGE_SHIFT)
+	+ XPMAP_OFFSET) | (mpa & ~PG_FRAME);
 }
 
 static __inline paddr_t
 xpmap_mtop_masked(paddr_t mpa)
 {
-	return ((machine_to_phys_mapping[mpa >> PAGE_SHIFT] << PAGE_SHIFT) +
-	XPMAP_OFFSET);
+	return (
+	((paddr_t)machine_to_phys_mapping[mpa >> PAGE_SHIFT] << PAGE_SHIFT)
+	+ XPMAP_OFFSET);
 }
 
 static __inline paddr_t

Index: src/sys/arch/xen/xen/xenevt.c
diff -u src/sys/arch/xen/xen/xenevt.c:1.29.4.1 src/sys/arch/xen/xen/xenevt.c:1.29.4.2
--- src/sys/arch/xen/xen/xenevt.c:1.29.4.1	Sat Apr  4 23:36:2

CVS commit: [netbsd-5] src/sys/arch

2009-10-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Oct  3 23:49:50 UTC 2009

Modified Files:
src/sys/arch/amd64/amd64 [netbsd-5]: machdep.c
src/sys/arch/i386/i386 [netbsd-5]: machdep.c

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #1054):
sys/arch/amd64/amd64/machdep.c: revision 1.124
sys/arch/i386/i386/machdep.c: revision 1.660
Prepare for PCI frontend support in Xen3 domUs:
call x86_bus_space_init() and x86_bus_space_mallocok() if we have ISA or PCI
  devices configured; not only for non-Xen or dom0 Xen
On Xen, always call PHYSDEVOP_SET_IOPL on context switch
on amd64, also call PHYSDEVOP_SET_IOPL from x86_64_proc0_tss_ldt_init()


To generate a diff of this commit:
cvs rdiff -u -r1.102.4.10 -r1.102.4.11 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.644.4.10 -r1.644.4.11 src/sys/arch/i386/i386/machdep.c

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

Modified files:

Index: src/sys/arch/amd64/amd64/machdep.c
diff -u src/sys/arch/amd64/amd64/machdep.c:1.102.4.10 src/sys/arch/amd64/amd64/machdep.c:1.102.4.11
--- src/sys/arch/amd64/amd64/machdep.c:1.102.4.10	Sat Apr  4 17:39:09 2009
+++ src/sys/arch/amd64/amd64/machdep.c	Sat Oct  3 23:49:50 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.102.4.10 2009/04/04 17:39:09 snj Exp $	*/
+/*	$NetBSD: machdep.c,v 1.102.4.11 2009/10/03 23:49:50 snj Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008
@@ -112,7 +112,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.102.4.10 2009/04/04 17:39:09 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.102.4.11 2009/10/03 23:49:50 snj Exp $");
 
 /* #define XENDEBUG_LOW  */
 
@@ -131,6 +131,8 @@
 #ifndef XEN
 #include "opt_physmem.h"
 #endif
+#include "isa.h"
+#include "pci.h"
 
 #include 
 #include 
@@ -365,7 +367,7 @@
 	format_bytes(pbuf, sizeof(pbuf), ptoa(uvmexp.free));
 	printf("avail memory = %s\n", pbuf);
 
-#if !defined(XEN) || defined(DOM0OPS)
+#if NISA > 0 || NPCI > 0
 	/* Safe for i/o port / memory space allocation to use malloc now. */
 	x86_bus_space_mallocok();
 #endif
@@ -391,12 +393,10 @@
 	struct cpu_info *ci;
 	ci = curcpu();
 	HYPERVISOR_stack_switch(GSEL(GDATA_SEL, SEL_KPL), new->pcb_rsp0);
-	if (xendomain_is_privileged()) {
-		struct physdev_op physop;
-		physop.cmd = PHYSDEVOP_SET_IOPL;
-		physop.u.set_iopl.iopl = new->pcb_iopl;
-		HYPERVISOR_physdev_op(&physop);
-	}
+	struct physdev_op physop;
+	physop.cmd = PHYSDEVOP_SET_IOPL;
+	physop.u.set_iopl.iopl = new->pcb_iopl;
+	HYPERVISOR_physdev_op(&physop);
 	if (new->pcb_fpcpu != ci) {
 		HYPERVISOR_fpu_taskswitch(1);
 	}
@@ -429,10 +429,16 @@
 #if !defined(XEN)
 	lldt(pcb->pcb_ldt_sel);
 #else
+	{
+	struct physdev_op physop;
 	xen_set_ldt((vaddr_t) ldtstore, LDT_SIZE >> 3);
 	/* Reset TS bit and set kernel stack for interrupt handlers */
 	HYPERVISOR_fpu_taskswitch(1);
 	HYPERVISOR_stack_switch(GSEL(GDATA_SEL, SEL_KPL), pcb->pcb_rsp0);
+	physop.cmd = PHYSDEVOP_SET_IOPL;
+	physop.u.set_iopl.iopl = pcb->pcb_iopl;
+	HYPERVISOR_physdev_op(&physop);
+	}
 #endif /* XEN */
 }
 
@@ -1399,7 +1405,7 @@
 	__PRINTK(("pcb_cr3 0x%lx\n", xen_start_info.pt_base - KERNBASE));
 #endif
 
-#if !defined(XEN) || defined(DOM0OPS)
+#if NISA > 0 || NPCI > 0
 	x86_bus_space_init();
 #endif
 

Index: src/sys/arch/i386/i386/machdep.c
diff -u src/sys/arch/i386/i386/machdep.c:1.644.4.10 src/sys/arch/i386/i386/machdep.c:1.644.4.11
--- src/sys/arch/i386/i386/machdep.c:1.644.4.10	Sat Apr  4 17:39:09 2009
+++ src/sys/arch/i386/i386/machdep.c	Sat Oct  3 23:49:50 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.644.4.10 2009/04/04 17:39:09 snj Exp $	*/
+/*	$NetBSD: machdep.c,v 1.644.4.11 2009/10/03 23:49:50 snj Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.644.4.10 2009/04/04 17:39:09 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.644.4.11 2009/10/03 23:49:50 snj Exp $");
 
 #include "opt_beep.h"
 #include "opt_compat_ibcs2.h"
@@ -513,7 +513,7 @@
 	printf("avail memory = %s\n", pbuf);
 
 	/* Safe for i/o port / memory space allocation to use malloc now. */
-#if !defined(XEN) || defined(DOM0OPS)
+#if NISA > 0 || NPCI > 0
 	x86_bus_space_mallocok();
 #endif
 
@@ -580,21 +580,20 @@
 
 	HYPERVISOR_stack_switch(GSEL(GDATA_SEL, SEL_KPL), pcb->pcb_esp0);
 
-	if (xendomain_is_privileged()) {
-		int iopl = pcb->pcb_iopl;
 #ifdef XEN3
-	struct physdev_op physop;
-		physop.cmd = PHYSDEVOP_SET_IOPL;
-		physop.u.set_iopl.iopl = iopl;
-		HYPERVISOR_physdev_op(&physop);
+	struct physdev_op physop;
+	physop.cmd = PHYSDEVOP_SET_IOPL;
+	physop.u.set_iopl.iopl = pcb->pcb_iopl;
+	HYPERVISOR_physdev_op(&physop);
 #else
+	if (xendomain_is_privileged()) {
 		dom0_op_t op;
 		op.cmd = DOM0_IOPL;
 		op.u.iopl.domain = DOMID_SELF;
-		op.u.iopl.iopl = iopl;
+		op.u.iopl.iopl = pcb->pcb_iopl;
 		HYPERVISOR_dom0_o

CVS commit: [netbsd-5] src/sys/arch

2009-10-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Oct  3 23:55:43 UTC 2009

Modified Files:
src/sys/arch/amd64/conf [netbsd-5]: XEN3_DOMU
src/sys/arch/i386/conf [netbsd-5]: XEN3_DOMU

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #1054):
sys/arch/amd64/conf/XEN3_DOMU: revision 1.16
sys/arch/i386/conf/XEN3_DOMU: revision 1.12
Add commented out PCI pass-through support:


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.13.4.1 src/sys/arch/amd64/conf/XEN3_DOMU
cvs rdiff -u -r1.10 -r1.10.66.1 src/sys/arch/i386/conf/XEN3_DOMU

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

Modified files:

Index: src/sys/arch/amd64/conf/XEN3_DOMU
diff -u src/sys/arch/amd64/conf/XEN3_DOMU:1.13 src/sys/arch/amd64/conf/XEN3_DOMU:1.13.4.1
--- src/sys/arch/amd64/conf/XEN3_DOMU:1.13	Sun Aug 10 08:53:29 2008
+++ src/sys/arch/amd64/conf/XEN3_DOMU	Sat Oct  3 23:55:43 2009
@@ -1,4 +1,4 @@
-# $NetBSD: XEN3_DOMU,v 1.13 2008/08/10 08:53:29 cegger Exp $
+# $NetBSD: XEN3_DOMU,v 1.13.4.1 2009/10/03 23:55:43 snj Exp $
 
 include 	"arch/amd64/conf/std.xen"
 
@@ -158,6 +158,11 @@
 
 xencons*	at hypervisor?		# Xen virtual console
 
+# PCI pass-through support: 
+#xpci* at xenbus ?			#Xen3 PCI front end driver
+#pci* at xpci ?
+# you then need to add your PCI devices drivers below.
+
 cinclude "arch/amd64/conf/GENERIC.local"
 
 # Pseudo-Devices

Index: src/sys/arch/i386/conf/XEN3_DOMU
diff -u src/sys/arch/i386/conf/XEN3_DOMU:1.10 src/sys/arch/i386/conf/XEN3_DOMU:1.10.66.1
--- src/sys/arch/i386/conf/XEN3_DOMU:1.10	Sat Nov 11 20:00:39 2006
+++ src/sys/arch/i386/conf/XEN3_DOMU	Sat Oct  3 23:55:43 2009
@@ -1,4 +1,4 @@
-# $NetBSD: XEN3_DOMU,v 1.10 2006/11/11 20:00:39 bouyer Exp $
+# $NetBSD: XEN3_DOMU,v 1.10.66.1 2009/10/03 23:55:43 snj Exp $
 
 include "arch/i386/conf/XEN2_DOMU"
 
@@ -14,3 +14,8 @@
 xenbus*		at hypervisor?		# Xen virtual bus
 xennet*		at xenbus?		# Xen virtual network interface
 xbd*		at xenbus?		# Xen virtual block device
+
+# PCI pass-through support: 
+#xpci* at xenbus ?			#Xen3 PCI front end driver
+#pci* at xpci ?
+# you then need to add your PCI devices drivers below.



CVS commit: [netbsd-5] src/sys/arch

2009-10-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Oct  3 23:57:54 UTC 2009

Modified Files:
src/sys/arch/amd64/conf [netbsd-5]: XEN3_DOM0
src/sys/arch/i386/conf [netbsd-5]: XEN3_DOM0

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #1054):
sys/arch/amd64/conf/XEN3_DOM0: revision 1.37
sys/arch/i386/conf/XEN3_DOM0: revision 1.12
Add pciback device to XEN3 dom0 kernels


To generate a diff of this commit:
cvs rdiff -u -r1.33.4.2 -r1.33.4.3 src/sys/arch/amd64/conf/XEN3_DOM0
cvs rdiff -u -r1.10 -r1.10.8.1 src/sys/arch/i386/conf/XEN3_DOM0

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

Modified files:

Index: src/sys/arch/amd64/conf/XEN3_DOM0
diff -u src/sys/arch/amd64/conf/XEN3_DOM0:1.33.4.2 src/sys/arch/amd64/conf/XEN3_DOM0:1.33.4.3
--- src/sys/arch/amd64/conf/XEN3_DOM0:1.33.4.2	Sat Sep 26 19:52:09 2009
+++ src/sys/arch/amd64/conf/XEN3_DOM0	Sat Oct  3 23:57:54 2009
@@ -1,4 +1,4 @@
-# $NetBSD: XEN3_DOM0,v 1.33.4.2 2009/09/26 19:52:09 snj Exp $
+# $NetBSD: XEN3_DOM0,v 1.33.4.3 2009/10/03 23:57:54 snj Exp $
 
 include 	"arch/amd64/conf/std.xen"
 
@@ -228,6 +228,14 @@
 ppb*		at pci? dev ? function ?	# PCI-PCI bridges
 pci*		at ppb? bus ?
 
+# pci backend devices, used for PCI pass-through. To export a PCI device
+# to a domU, the device has to be attached to the pciback driver in the dom0.
+# you can force a device to attach to the pciback driver in dom0 passing
+# pciback.hide=(bus:dev.fun)(bus:dev.func) to the dom0 kernel boot parameters.
+# bus and dev are 2-digits hex number, func is a single-digit number:
+# pciback.hide=(00:1a.0)(00:1a.1)(00:1a.7)
+pciback* at pci?#pci backend device
+
 # PCI bridges
 ichlpcib* at pci? dev ? function ?	# Intel ICH PCI-ISA w/ timecounter,
 	# watchdog and SpeedStep support

Index: src/sys/arch/i386/conf/XEN3_DOM0
diff -u src/sys/arch/i386/conf/XEN3_DOM0:1.10 src/sys/arch/i386/conf/XEN3_DOM0:1.10.8.1
--- src/sys/arch/i386/conf/XEN3_DOM0:1.10	Sun May 18 22:05:59 2008
+++ src/sys/arch/i386/conf/XEN3_DOM0	Sat Oct  3 23:57:54 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: XEN3_DOM0,v 1.10 2008/05/18 22:05:59 cegger Exp $
+#	$NetBSD: XEN3_DOM0,v 1.10.8.1 2009/10/03 23:57:54 snj Exp $
 #
 #	XEN3_0: Xen 3.0 domain0 kernel
 
@@ -14,6 +14,14 @@
 ppb*	at pci? dev ? function ?	# PCI-PCI bridges
 pci*	at ppb? bus ?
 
+# pci backend devices, used for PCI pass-through. To export a PCI device
+# to a domU, the device has to be attached to the pciback driver in the dom0.
+# you can force a device to attach to the pciback driver in dom0 passing
+# pciback.hide=(bus:dev.fun)(bus:dev.func) to the dom0 kernel boot parameters.
+# bus and dev are 2-digits hex number, func is a single-digit number:
+# pciback.hide=(00:1a.0)(00:1a.1)(00:1a.7)
+pciback* at pci?#pci backend device
+
 acpi0 		at hypervisor?
 options 	MPBIOS
 options 	MPDEBUG



CVS commit: [netbsd-5] src/sys/arch

2009-10-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Oct  4 00:45:35 UTC 2009

Modified Files:
src/sys/arch/landisk/dev [netbsd-5]: obio.c
src/sys/arch/landisk/include [netbsd-5]: bus.h
src/sys/arch/landisk/landisk [netbsd-5]: shpcic_machdep.c
src/sys/arch/sh3/dev [netbsd-5]: shpcic.c shpcicvar.h

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1063):
sys/arch/landisk/dev/obio.c: revision 1.7
sys/arch/landisk/include/bus.h: revision 1.5
sys/arch/landisk/landisk/shpcic_machdep.c: revision 1.2
sys/arch/sh3/dev/shpcic.c: revision 1.13
sys/arch/sh3/dev/shpcicvar.h: revision 1.7
fix build failure.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.6.10.1 src/sys/arch/landisk/dev/obio.c
cvs rdiff -u -r1.4 -r1.4.10.1 src/sys/arch/landisk/include/bus.h
cvs rdiff -u -r1.1 -r1.1.76.1 src/sys/arch/landisk/landisk/shpcic_machdep.c
cvs rdiff -u -r1.12 -r1.12.14.1 src/sys/arch/sh3/dev/shpcic.c
cvs rdiff -u -r1.6 -r1.6.88.1 src/sys/arch/sh3/dev/shpcicvar.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/landisk/dev/obio.c
diff -u src/sys/arch/landisk/dev/obio.c:1.6 src/sys/arch/landisk/dev/obio.c:1.6.10.1
--- src/sys/arch/landisk/dev/obio.c:1.6	Mon Apr 28 20:23:26 2008
+++ src/sys/arch/landisk/dev/obio.c	Sun Oct  4 00:45:35 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: obio.c,v 1.6 2008/04/28 20:23:26 martin Exp $	*/
+/*	$NetBSD: obio.c,v 1.6.10.1 2009/10/04 00:45:35 snj Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: obio.c,v 1.6 2008/04/28 20:23:26 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: obio.c,v 1.6.10.1 2009/10/04 00:45:35 snj Exp $");
 
 #include "btn_obio.h"
 #include "pwrsw_obio.h"
@@ -243,6 +243,8 @@
 bus_size_t size, bus_size_t alignment, bus_size_t boundary, int flags,
 bus_addr_t *bpap, bus_space_handle_t *bshp);
 void obio_iomem_free(void *v, bus_space_handle_t bsh, bus_size_t size);
+paddr_t obio_iomem_mmap(void *v, bus_addr_t addr, off_t off, int prot,
+int flags);
 
 static int obio_iomem_add_mapping(bus_addr_t, bus_size_t, int,
 bus_space_handle_t *);
@@ -384,6 +386,13 @@
 	obio_iomem_unmap(v, bsh, size);
 }
 
+paddr_t
+obio_iomem_mmap(void *v, bus_addr_t addr, off_t off, int prot, int flags)
+{
+
+	return (paddr_t)-1;
+}
+
 /*
  * on-board I/O bus space read/write
  */
@@ -450,6 +459,8 @@
 	.bs_alloc = obio_iomem_alloc,
 	.bs_free = obio_iomem_free,
 
+	.bs_mmap = obio_iomem_mmap,
+
 	.bs_r_1 = obio_iomem_read_1,
 	.bs_r_2 = obio_iomem_read_2,
 	.bs_r_4 = obio_iomem_read_4,

Index: src/sys/arch/landisk/include/bus.h
diff -u src/sys/arch/landisk/include/bus.h:1.4 src/sys/arch/landisk/include/bus.h:1.4.10.1
--- src/sys/arch/landisk/include/bus.h:1.4	Mon Apr 28 20:23:26 2008
+++ src/sys/arch/landisk/include/bus.h	Sun Oct  4 00:45:35 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus.h,v 1.4 2008/04/28 20:23:26 martin Exp $	*/
+/*	$NetBSD: bus.h,v 1.4.10.1 2009/10/04 00:45:35 snj Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -130,6 +130,9 @@
 	/* get kernel virtual address */
 	void *		(*bs_vaddr)(void *, bus_space_handle_t);
 
+	/* mmap bus space for user */
+	paddr_t		(*bs_mmap)(void *, bus_addr_t, off_t, int, int);
+
 	/* read (single) */
 	uint8_t	(*bs_r_1)(void *, bus_space_handle_t,
 			bus_size_t);
@@ -292,6 +295,12 @@
 	(*(t)->bs_vaddr)((t)->bs_cookie, (h))
 
 /*
+ * MMap bus space for a user application.
+ */
+#define bus_space_mmap(t, a, o, p, f)	\
+	(*(t)->bs_mmap)((t)->bs_cookie, (a), (o), (p), (f))
+
+/*
  * Bus barrier operations.  The SH3 does not currently require
  * barriers, but we must provide the flags to MI code.
  */

Index: src/sys/arch/landisk/landisk/shpcic_machdep.c
diff -u src/sys/arch/landisk/landisk/shpcic_machdep.c:1.1 src/sys/arch/landisk/landisk/shpcic_machdep.c:1.1.76.1
--- src/sys/arch/landisk/landisk/shpcic_machdep.c:1.1	Fri Sep  1 21:26:18 2006
+++ src/sys/arch/landisk/landisk/shpcic_machdep.c	Sun Oct  4 00:45:35 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: shpcic_machdep.c,v 1.1 2006/09/01 21:26:18 uwe Exp $	*/
+/*	$NetBSD: shpcic_machdep.c,v 1.1.76.1 2009/10/04 00:45:35 snj Exp $	*/
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: shpcic_machdep.c,v 1.1 2006/09/01 21:26:18 uwe Exp $");
+__KERNEL_RCSID(0, "$NetBSD: shpcic_machdep.c,v 1.1.76.1 2009/10/04 00:45:35 snj Exp $");
 
 #include 
 #include 
@@ -189,6 +189,8 @@
 	.bs_alloc = shpcic_iomem_alloc,
 	.bs_free = shpcic_iomem_free,
 
+	.bs_mmap = shpcic_iomem_mmap,
+
 	.bs_r_1 = shpcic_io_read_1,
 	.bs_r_2 = shpcic_io_read_2,
 	.bs_r_4 = shpcic_io_read_4,
@@ -237,6 +239,8 @@
 	.bs_alloc = shpcic_iomem_alloc,
 	.bs_free = shpcic_iomem_free,
 
+	.bs_mmap = shpcic_iomem_mmap,
+
 	.bs_r_1 = shpcic_mem_read_1,
 	.bs_r_

CVS commit: [netbsd-5] src/sys/arch

2009-10-05 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Mon Oct  5 11:37:14 UTC 2009

Modified Files:
src/sys/arch/i386/conf [netbsd-5]: ALL GENERIC
src/sys/arch/x86/conf [netbsd-5]: files.x86
src/sys/arch/x86/include [netbsd-5]: cpuvar.h
src/sys/arch/x86/x86 [netbsd-5]: identcpu.c
Added Files:
src/sys/arch/x86/x86 [netbsd-5]: viac7temp.c

Log Message:
Pull up the following revisions(s) (requested by jmcneill in ticket #1061):
sys/arch/x86/conf/files.x86:revision 1.53
sys/arch/x86/include/cpuvar.h:  revision 1.31
sys/arch/x86/x86/identcpu.c:revision 1.17
sys/arch/x86/x86/viac7temp.c:   revision 1.1
sys/arch/i386/conf/ALL: revision 1.218
sys/arch/i386/conf/GENERIC: revision 1.949
Add support for VIA C7 temperature sensors (options VIA_C7TEMP) and enable
in i386 GENERIC kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.183.4.4 -r1.183.4.5 src/sys/arch/i386/conf/ALL
cvs rdiff -u -r1.915.2.7 -r1.915.2.8 src/sys/arch/i386/conf/GENERIC
cvs rdiff -u -r1.44.4.1 -r1.44.4.2 src/sys/arch/x86/conf/files.x86
cvs rdiff -u -r1.27.8.1 -r1.27.8.2 src/sys/arch/x86/include/cpuvar.h
cvs rdiff -u -r1.10.4.3 -r1.10.4.4 src/sys/arch/x86/x86/identcpu.c
cvs rdiff -u -r0 -r1.1.2.2 src/sys/arch/x86/x86/viac7temp.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/i386/conf/ALL
diff -u src/sys/arch/i386/conf/ALL:1.183.4.4 src/sys/arch/i386/conf/ALL:1.183.4.5
--- src/sys/arch/i386/conf/ALL:1.183.4.4	Sat Sep 26 19:52:09 2009
+++ src/sys/arch/i386/conf/ALL	Mon Oct  5 11:37:13 2009
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.183.4.4 2009/09/26 19:52:09 snj Exp $
+# $NetBSD: ALL,v 1.183.4.5 2009/10/05 11:37:13 sborrill Exp $
 # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp
 #
 # ALL machine description file
@@ -17,7 +17,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"ALL-$Revision: 1.183.4.4 $"
+#ident 		"ALL-$Revision: 1.183.4.5 $"
 
 maxusers	32		# estimated number of users
 
@@ -629,6 +629,9 @@
 # Intel Core's on-die Thermal sensor
 options 	INTEL_CORETEMP
 
+# VIA C7 Temperature sensor
+options 	VIA_C7TEMP
+
 # Intel ICH SMBus controller
 ichsmb*	at pci? dev ? function ?
 iic*	at ichsmb?

Index: src/sys/arch/i386/conf/GENERIC
diff -u src/sys/arch/i386/conf/GENERIC:1.915.2.7 src/sys/arch/i386/conf/GENERIC:1.915.2.8
--- src/sys/arch/i386/conf/GENERIC:1.915.2.7	Sat Sep 26 19:52:09 2009
+++ src/sys/arch/i386/conf/GENERIC	Mon Oct  5 11:37:13 2009
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.915.2.7 2009/09/26 19:52:09 snj Exp $
+# $NetBSD: GENERIC,v 1.915.2.8 2009/10/05 11:37:13 sborrill Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.915.2.7 $"
+#ident 		"GENERIC-$Revision: 1.915.2.8 $"
 
 maxusers	64		# estimated number of users
 
@@ -622,6 +622,9 @@
 # Intel Core's on-die Thermal sensor
 options 	INTEL_CORETEMP
 
+# VIA C7 Temperature sensor
+options 	VIA_C7TEMP
+
 # Intel ICH SMBus controller
 ichsmb*	at pci? dev ? function ?
 iic*	at ichsmb?

Index: src/sys/arch/x86/conf/files.x86
diff -u src/sys/arch/x86/conf/files.x86:1.44.4.1 src/sys/arch/x86/conf/files.x86:1.44.4.2
--- src/sys/arch/x86/conf/files.x86:1.44.4.1	Tue Jun 16 02:19:44 2009
+++ src/sys/arch/x86/conf/files.x86	Mon Oct  5 11:37:14 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: files.x86,v 1.44.4.1 2009/06/16 02:19:44 snj Exp $
+#	$NetBSD: files.x86,v 1.44.4.2 2009/10/05 11:37:14 sborrill Exp $
 
 # options for MP configuration through the MP spec
 defflag opt_mpbios.h MPBIOS MPVERBOSE MPDEBUG MPBIOS_SCANPCI
@@ -23,6 +23,9 @@
 # AMD Powernow/Cool`n'Quiet Technology
 defflag opt_powernow_k8.h	POWERNOW_K8
 
+# VIA C7 Temperature sensor
+defflag	opt_via_c7temp.h	VIA_C7TEMP: sysmon_envsys
+
 # VIA PadLock support
 defflag	opt_viapadlock.h	VIA_PADLOCK:	opencrypto
 file	arch/x86/x86/via_padlock.c	via_padlock
@@ -93,6 +96,9 @@
 # Intel On-Die Temperature sensor
 file	arch/x86/x86/coretemp.c 	intel_coretemp
 
+# VIA C7 Temperature sensor
+file	arch/x86/x86/viac7temp.c	via_c7temp
+
 # IPMI device
 device	ipmi: sysmon_envsys, sysmon_wdog
 attach	ipmi at ipmibus

Index: src/sys/arch/x86/include/cpuvar.h
diff -u src/sys/arch/x86/include/cpuvar.h:1.27.8.1 src/sys/arch/x86/include/cpuvar.h:1.27.8.2
--- src/sys/arch/x86/include/cpuvar.h:1.27.8.1	Mon Oct  5 10:34:07 2009
+++ src/sys/arch/x86/include/cpuvar.h	Mon Oct  5 11:37:14 2009
@@ -1,4 +1,4 @@
-/* 	$NetBSD: cpuvar.h,v 1.27.8.1 2009/10/05 10:34:07 sborrill Exp $ */
+/* 	$NetBSD: cpuvar.h,v 1.27.8.2 2009/10/05 11:37:14 sborrill Exp $ */
 
 /*-
  * Copyright (c) 2000, 2007 The NetBSD Foundation, Inc.
@@ -91,6 +91,7 @@
 #include "opt_enhanced_speedstep.h"
 #include "opt_intel_coretemp.h"
 #include "opt_intel_odcm.h"
+#include "opt_via_c7temp.h"
 #endif
 
 #ifdef MULTIPROCESSOR
@@ -

CVS commit: [netbsd-5] src/sys/arch

2009-05-11 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon May 11 20:09:09 UTC 2009

Modified Files:
src/sys/arch/sparc/include [netbsd-5]: math.h
src/sys/arch/sparc64/include [netbsd-5]: math.h

Log Message:
Pull up following revision(s) (requested by mrg in ticket #750):
sys/arch/sparc64/include/math.h: revision 1.7
sys/arch/sparc/include/math.h: revision 1.5
merge these two files, makes sparc64 sparc/libc work again.
only provide __HAVE_LONG_DOUBLE if _LP64.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.132.1 src/sys/arch/sparc/include/math.h
cvs rdiff -u -r1.6 -r1.6.88.1 src/sys/arch/sparc64/include/math.h

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

Modified files:

Index: src/sys/arch/sparc/include/math.h
diff -u src/sys/arch/sparc/include/math.h:1.4 src/sys/arch/sparc/include/math.h:1.4.132.1
--- src/sys/arch/sparc/include/math.h:1.4	Tue Feb 19 13:08:15 2002
+++ src/sys/arch/sparc/include/math.h	Mon May 11 20:09:09 2009
@@ -1,3 +1,7 @@
-/*	$NetBSD: math.h,v 1.4 2002/02/19 13:08:15 simonb Exp $	*/
+/*	$NetBSD: math.h,v 1.4.132.1 2009/05/11 20:09:09 bouyer Exp $	*/
 
 #define	__HAVE_NANF
+
+#ifdef _LP64
+#define	__HAVE_LONG_DOUBLE
+#endif

Index: src/sys/arch/sparc64/include/math.h
diff -u src/sys/arch/sparc64/include/math.h:1.6 src/sys/arch/sparc64/include/math.h:1.6.88.1
--- src/sys/arch/sparc64/include/math.h:1.6	Sun Dec 11 12:19:10 2005
+++ src/sys/arch/sparc64/include/math.h	Mon May 11 20:09:09 2009
@@ -1,4 +1,3 @@
-/*	$NetBSD: math.h,v 1.6 2005/12/11 12:19:10 christos Exp $	*/
+/*	$NetBSD: math.h,v 1.6.88.1 2009/05/11 20:09:09 bouyer Exp $	*/
 
-#define	__HAVE_LONG_DOUBLE
-#define	__HAVE_NANF
+#include 



CVS commit: [netbsd-5] src/sys/arch

2009-05-12 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed May 13 00:35:16 UTC 2009

Modified Files:
src/sys/arch/amd64/amd64 [netbsd-5]: lock_stubs.S
src/sys/arch/i386/i386 [netbsd-5]: lock_stubs.S
src/sys/arch/x86/x86 [netbsd-5]: patch.c

Log Message:
Pull up following revision(s) (requested by ad in ticket #725):
sys/arch/amd64/amd64/lock_stubs.S: revision 1.22
sys/arch/i386/i386/lock_stubs.S: revision 1.23
sys/arch/x86/x86/patch.c: revision 1.18
A workaround for a bug with some Opteron revisions where locked operations
sometimes do not serve as memory barriers, allowing memory references to
bleed outside of critical sections.  It is possible that this is the
reason for pkgbuild's longstanding crashiness.
This is not complete (atomic ops need some work too).


To generate a diff of this commit:
cvs rdiff -u -r1.20.6.1 -r1.20.6.2 src/sys/arch/amd64/amd64/lock_stubs.S
cvs rdiff -u -r1.21.6.1 -r1.21.6.2 src/sys/arch/i386/i386/lock_stubs.S
cvs rdiff -u -r1.14.4.3 -r1.14.4.4 src/sys/arch/x86/x86/patch.c

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

Modified files:

Index: src/sys/arch/amd64/amd64/lock_stubs.S
diff -u src/sys/arch/amd64/amd64/lock_stubs.S:1.20.6.1 src/sys/arch/amd64/amd64/lock_stubs.S:1.20.6.2
--- src/sys/arch/amd64/amd64/lock_stubs.S:1.20.6.1	Mon Feb  2 03:01:12 2009
+++ src/sys/arch/amd64/amd64/lock_stubs.S	Wed May 13 00:35:16 2009
@@ -1,7 +1,7 @@
-/*	$NetBSD: lock_stubs.S,v 1.20.6.1 2009/02/02 03:01:12 snj Exp $	*/
+/*	$NetBSD: lock_stubs.S,v 1.20.6.2 2009/05/13 00:35:16 snj Exp $	*/
 
 /*-
- * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
+ * Copyright (c) 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -48,6 +48,7 @@
 
 #define	ENDLABEL(name,a) .align	a; LABEL(name)
 #define	LOCK(num)	.Lpatch/**/num: lock
+#define	RET(num)	.Lret/**/num: ret; nop; nop; ret
 
 #ifndef LOCKDEBUG
 
@@ -64,7 +65,7 @@
 	LOCK(1)
 	cmpxchgq %rcx, (%rdi)
 	jnz	1f
-	ret
+	RET(1)
 1:
 	jmp	_C_LABEL(mutex_vector_enter)
 
@@ -106,7 +107,7 @@
 	testb	%al, %al
 	jnz	1f
 #endif
-	ret
+	RET(2)
 1:
 	jmp	_C_LABEL(mutex_spin_retry)	/* failed; hard case */
 
@@ -186,7 +187,7 @@
 	LOCK(2)
 	cmpxchgq %rdx, (%rdi)
 	jnz	1f
-	ret
+	RET(3)
 1:
 	jmp	0b
 
@@ -199,7 +200,7 @@
 	LOCK(3)
 	cmpxchgq %rcx, (%rdi)
 	jnz	3f
-	ret
+	RET(4)
 3:
 	jmp	_C_LABEL(rw_vector_enter)
 
@@ -256,13 +257,13 @@
 	movq	(%rdi), %rax
 0:
 	testb	$(RW_WRITE_LOCKED|RW_WRITE_WANTED), %al
-	jnz	3f
+	jnz	4f
 	leaq	RW_READ_INCR(%rax), %rdx 
 	LOCK(8)
 	cmpxchgq %rdx, (%rdi)
 	jnz	1f
 	movl	%edx, %eax			/* nonzero */
-	ret
+	RET(5)
 1:
 	jmp	0b
 
@@ -276,10 +277,12 @@
 	cmpxchgq %rcx, (%rdi)
 	movl	$0, %eax
 	setz	%al
+3:
+	RET(6)
 	ret
-
-3:	xorl	%eax, %eax
-	ret
+4:
+	xorl	%eax, %eax
+	jmp	3b
 
 #endif	/* LOCKDEBUG */
 
@@ -296,7 +299,7 @@
 	LOCK(6)
 	cmpxchgb %ah, (%rdi)
 	jnz	2f
-	ret
+	RET(7)
 2:
 	movl	$0x0100, %eax
 	pause
@@ -315,8 +318,8 @@
 	LOCK(7)
 	cmpxchgb %ah, (%rdi)
 	movl	$0, %eax
-	setz	%al	
-	ret
+	setz	%al
+	RET(8)
 
 /*
  * Patchpoints to replace with NOP when ncpu == 1.
@@ -328,3 +331,10 @@
 	.quad	.Lpatch9
 	.quad	0
 #endif
+
+LABEL(x86_retpatch)
+#ifndef LOCKDEBUG
+	.long	.Lret1, .Lret2, .Lret3, .Lret4, .Lret5, .Lret6
+#endif
+	.long	.Lret7, .Lret8
+	.long	0

Index: src/sys/arch/i386/i386/lock_stubs.S
diff -u src/sys/arch/i386/i386/lock_stubs.S:1.21.6.1 src/sys/arch/i386/i386/lock_stubs.S:1.21.6.2
--- src/sys/arch/i386/i386/lock_stubs.S:1.21.6.1	Mon Feb  2 03:01:12 2009
+++ src/sys/arch/i386/i386/lock_stubs.S	Wed May 13 00:35:16 2009
@@ -1,7 +1,7 @@
-/*	$NetBSD: lock_stubs.S,v 1.21.6.1 2009/02/02 03:01:12 snj Exp $	*/
+/*	$NetBSD: lock_stubs.S,v 1.21.6.2 2009/05/13 00:35:16 snj Exp $	*/
 
 /*-
- * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
+ * Copyright (c) 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: lock_stubs.S,v 1.21.6.1 2009/02/02 03:01:12 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lock_stubs.S,v 1.21.6.2 2009/05/13 00:35:16 snj Exp $");
 
 #include "opt_lockdebug.h"
 
@@ -46,6 +46,7 @@
 #define	ALIGN64		.align	64
 #define	ALIGN32		.align	32
 #define	LOCK(num)	.Lpatch/**/num:	lock
+#define	RET(num)	.Lret/**/num: ret; nop; nop; ret
 #define	ENDLABEL(name,a) .align	a; LABEL(name)
 
 #if !defined(LOCKDEBUG)
@@ -59,12 +60,12 @@
 
 ENTRY(mutex_enter)
 	movl	4(%esp), %edx
-	movl	CPUVAR(CURLWP), %ecx
 	xorl	%eax, %eax
+	movl	%fs:CPU_INFO_CURLWP(%eax), %ecx
 	LOCK(1)
 	cmpxchgl %ecx, (%edx)
 	jnz	1f
-	ret
+	RET(1)
 1:
 	jmp	_C_LABEL(mutex_vector_enter)
 END(mutex_enter)
@@ -80,8 +81,8 @@
  */
 ENTRY(mutex_exit)
 	movl	4(%esp), %edx
-	movl	CPUVAR(CURLWP), %eax
 	xorl	%ecx, %ecx
+	movl	%fs:CPU_INFO_CURLWP(%ecx), %eax
 

CVS commit: [netbsd-5] src/sys/arch

2009-06-05 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Jun  5 18:54:58 UTC 2009

Modified Files:
src/sys/arch/hp700/hp700 [netbsd-5]: locore.S
src/sys/arch/hp700/include [netbsd-5]: cpu.h
src/sys/arch/hppa/hppa [netbsd-5]: vm_machdep.c

Log Message:
Pull up following revision(s) (requested by skrll in ticket #793):
sys/arch/hppa/hppa/vm_machdep.c: revision 1.36
sys/arch/hp700/include/cpu.h: revision 1.34
sys/arch/hp700/hp700/locore.S: revision 1.35
Do not use lwp_trampoline for cpu_setfunc, but a simplified setfunc_trampoline
that does not call lwp_startup().


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.30.4.1 src/sys/arch/hp700/hp700/locore.S
cvs rdiff -u -r1.28 -r1.28.4.1 src/sys/arch/hp700/include/cpu.h
cvs rdiff -u -r1.33 -r1.33.4.1 src/sys/arch/hppa/hppa/vm_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/hp700/hp700/locore.S
diff -u src/sys/arch/hp700/hp700/locore.S:1.30 src/sys/arch/hp700/hp700/locore.S:1.30.4.1
--- src/sys/arch/hp700/hp700/locore.S:1.30	Fri Aug  8 17:23:19 2008
+++ src/sys/arch/hp700/hp700/locore.S	Fri Jun  5 18:54:57 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.30 2008/08/08 17:23:19 skrll Exp $	*/
+/*	$NetBSD: locore.S,v 1.30.4.1 2009/06/05 18:54:57 snj Exp $	*/
 /*	$OpenBSD: locore.S,v 1.46 2001/09/20 18:33:03 mickey Exp $	*/
 
 /*
@@ -908,6 +908,7 @@
 	.import	lwp_startup, code
 	CALL(lwp_startup, %r1)
 
+ALTENTRY(setfunc_trampoline)
 	/* get trampoline func (%t3) and arg (%arg0) */
 	ldw	HPPA_FRAME_ARG(3)(%sp), %arg0
 	ldw	HPPA_FRAME_ARG(2)(%sp), %t3

Index: src/sys/arch/hp700/include/cpu.h
diff -u src/sys/arch/hp700/include/cpu.h:1.28 src/sys/arch/hp700/include/cpu.h:1.28.4.1
--- src/sys/arch/hp700/include/cpu.h:1.28	Sat Sep  6 09:45:57 2008
+++ src/sys/arch/hp700/include/cpu.h	Fri Jun  5 18:54:58 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.28 2008/09/06 09:45:57 skrll Exp $	*/
+/*	$NetBSD: cpu.h,v 1.28.4.1 2009/06/05 18:54:58 snj Exp $	*/
 
 /*	$OpenBSD: cpu.h,v 1.20 2001/01/29 00:01:58 mickey Exp $	*/
 
@@ -249,6 +249,7 @@
 		 size_t *);
 int	copy_on_fault(void);
 void	lwp_trampoline(void);
+void	setfunc_trampoline(void);
 int	cpu_dumpsize(void);
 int	cpu_dump(void);
 #endif

Index: src/sys/arch/hppa/hppa/vm_machdep.c
diff -u src/sys/arch/hppa/hppa/vm_machdep.c:1.33 src/sys/arch/hppa/hppa/vm_machdep.c:1.33.4.1
--- src/sys/arch/hppa/hppa/vm_machdep.c:1.33	Fri Oct 17 12:35:12 2008
+++ src/sys/arch/hppa/hppa/vm_machdep.c	Fri Jun  5 18:54:58 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm_machdep.c,v 1.33 2008/10/17 12:35:12 skrll Exp $	*/
+/*	$NetBSD: vm_machdep.c,v 1.33.4.1 2009/06/05 18:54:58 snj Exp $	*/
 
 /*	$OpenBSD: vm_machdep.c,v 1.25 2001/09/19 20:50:56 mickey Exp $	*/
 
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.33 2008/10/17 12:35:12 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.33.4.1 2009/06/05 18:54:58 snj Exp $");
 
 #include 
 #include 
@@ -204,11 +204,11 @@
 	 */
 	osp = sp;
 
-	/* lwp_trampoline's frame */
+	/* setfunc_trampoline's frame */
 	sp += HPPA_FRAME_SIZE;
 
 	*(register_t *)(sp + HPPA_FRAME_PSP) = osp;
-	*(register_t *)(sp + HPPA_FRAME_CRP) = (register_t)lwp_trampoline;
+	*(register_t *)(sp + HPPA_FRAME_CRP) = (register_t)setfunc_trampoline;
 
 	*HPPA_FRAME_CARG(2, sp) = KERNMODE(func);
 	*HPPA_FRAME_CARG(3, sp) = (register_t)arg;



CVS commit: [netbsd-5] src/sys/arch

2011-07-15 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Fri Jul 15 22:43:59 UTC 2011

Modified Files:
src/sys/arch/mvme68k/stand/libsa [netbsd-5]: exec_mvme.c
src/sys/arch/sun68k/stand/tapeboot [netbsd-5]: boot.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1639):
sys/arch/sun68k/stand/tapeboot/boot.c: revision 1.7 via patch
sys/arch/mvme68k/stand/libsa/exec_mvme.c: revision 1.16 via patch
Disable LOAD_BACKWARDS on tapeboot which can't seek backwards.
Fixes bootstrap tapeboot installation failure on TME reported from ryoon@.
Should be pulled up to netbsd-5.
(note netbsd-5 uses LOAD_NOTE instead of LOAD_BACKWARDS)
Avoid backward seek on tape boot.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.15.20.1 src/sys/arch/mvme68k/stand/libsa/exec_mvme.c
cvs rdiff -u -r1.5 -r1.5.88.1 src/sys/arch/sun68k/stand/tapeboot/boot.c

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

Modified files:

Index: src/sys/arch/mvme68k/stand/libsa/exec_mvme.c
diff -u src/sys/arch/mvme68k/stand/libsa/exec_mvme.c:1.15 src/sys/arch/mvme68k/stand/libsa/exec_mvme.c:1.15.20.1
--- src/sys/arch/mvme68k/stand/libsa/exec_mvme.c:1.15	Sat Jan 12 09:54:32 2008
+++ src/sys/arch/mvme68k/stand/libsa/exec_mvme.c	Fri Jul 15 22:43:59 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: exec_mvme.c,v 1.15 2008/01/12 09:54:32 tsutsui Exp $ */
+/*	$NetBSD: exec_mvme.c,v 1.15.20.1 2011/07/15 22:43:59 riz Exp $ */
 
 /*-
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -56,7 +56,7 @@
 
 	lflags = LOAD_KERNEL;
 	if ((flag & RB_NOSYM) != 0 )
-		lflags &= ~LOAD_SYM;
+		lflags &= ~(LOAD_SYM | LOAD_NOTE);
 
 	marks[MARK_START] = KERN_LOADADDR;
 	if ((fd = loadfile(file, marks, lflags)) == -1)

Index: src/sys/arch/sun68k/stand/tapeboot/boot.c
diff -u src/sys/arch/sun68k/stand/tapeboot/boot.c:1.5 src/sys/arch/sun68k/stand/tapeboot/boot.c:1.5.88.1
--- src/sys/arch/sun68k/stand/tapeboot/boot.c:1.5	Sun Dec 11 12:19:29 2005
+++ src/sys/arch/sun68k/stand/tapeboot/boot.c	Fri Jul 15 22:43:59 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: boot.c,v 1.5 2005/12/11 12:19:29 christos Exp $ */
+/*	$NetBSD: boot.c,v 1.5.88.1 2011/07/15 22:43:59 riz Exp $ */
 
 /*-
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -107,7 +107,8 @@
 			printf("tapeboot: loading segment %s\n", file);
 
 		marks[MARK_START] = mark_start;
-		if ((fd = loadfile(file, marks, LOAD_KERNEL)) != -1) {
+		if ((fd = loadfile(file, marks,
+		LOAD_KERNEL & ~LOAD_NOTE)) != -1) {
 			break;
 		}
 		printf("tapeboot: segment %s: %s\n", file, strerror(errno));



CVS commit: [netbsd-5] src/sys/arch

2010-04-22 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Thu Apr 22 20:02:49 UTC 2010

Modified Files:
src/sys/arch/amd64/amd64 [netbsd-5]: locore.S machdep.c mptramp.S
src/sys/arch/i386/i386 [netbsd-5]: machdep.c
src/sys/arch/i386/isa [netbsd-5]: npx.c
src/sys/arch/x86/include [netbsd-5]: cpu.h cpuvar.h
src/sys/arch/x86/x86 [netbsd-5]: cpu.c cpu_topology.c identcpu.c pmap.c
src/sys/arch/xen/x86 [netbsd-5]: cpu.c

Log Message:
Apply patch (requested by jym in ticket #1380):
Fix the NX regression issue observed on amd64 kernels, where per-page
execution right was disabled (therefore leading to the inability
of the kernel to detect fraudulent use of memory mappings marked as not
being executable).


To generate a diff of this commit:
cvs rdiff -u -r1.47.8.3 -r1.47.8.4 src/sys/arch/amd64/amd64/locore.S
cvs rdiff -u -r1.102.4.12 -r1.102.4.13 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.9 -r1.9.8.1 src/sys/arch/amd64/amd64/mptramp.S
cvs rdiff -u -r1.644.4.11 -r1.644.4.12 src/sys/arch/i386/i386/machdep.c
cvs rdiff -u -r1.129.10.5 -r1.129.10.6 src/sys/arch/i386/isa/npx.c
cvs rdiff -u -r1.9.4.1 -r1.9.4.2 src/sys/arch/x86/include/cpu.h
cvs rdiff -u -r1.27.8.2 -r1.27.8.3 src/sys/arch/x86/include/cpuvar.h
cvs rdiff -u -r1.57.4.3 -r1.57.4.4 src/sys/arch/x86/x86/cpu.c
cvs rdiff -u -r1.2.2.3 -r1.2.2.4 src/sys/arch/x86/x86/cpu_topology.c
cvs rdiff -u -r1.10.4.5 -r1.10.4.6 src/sys/arch/x86/x86/identcpu.c
cvs rdiff -u -r1.74.4.2 -r1.74.4.3 src/sys/arch/x86/x86/pmap.c
cvs rdiff -u -r1.28.4.1 -r1.28.4.2 src/sys/arch/xen/x86/cpu.c

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

Modified files:

Index: src/sys/arch/amd64/amd64/locore.S
diff -u src/sys/arch/amd64/amd64/locore.S:1.47.8.3 src/sys/arch/amd64/amd64/locore.S:1.47.8.4
--- src/sys/arch/amd64/amd64/locore.S:1.47.8.3	Thu Apr 22 19:54:34 2010
+++ src/sys/arch/amd64/amd64/locore.S	Thu Apr 22 20:02:48 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.47.8.3 2010/04/22 19:54:34 snj Exp $	*/
+/*	$NetBSD: locore.S,v 1.47.8.4 2010/04/22 20:02:48 snj Exp $	*/
 
 /*
  * Copyright-o-rama!
@@ -235,7 +235,7 @@
 #endif
 
 	.globl	_C_LABEL(cpu_id),_C_LABEL(cpu_vendorname), _C_LABEL(cpu_brand_id)
-	.globl	_C_LABEL(cpuid_level),_C_LABEL(cpu_feature),_C_LABEL(cpu_feature2)
+	.globl	_C_LABEL(cpuid_level)
 	.globl	_C_LABEL(esym),_C_LABEL(eblob),_C_LABEL(boothowto)
 	.globl	_C_LABEL(bootinfo),_C_LABEL(atdevbase)
 	.globl	_C_LABEL(proc0paddr),_C_LABEL(PDPpaddr)
@@ -245,10 +245,6 @@
 _C_LABEL(cpu):		.long	0	# are we 386, 386sx, or 486,
 	#   or Pentium, or..
 _C_LABEL(cpu_id):	.long	0	# saved from `cpuid' instruction
-_C_LABEL(cpu_feature):	.long	0	# feature flags from 'cpuid'
-	#   instruction
-_C_LABEL(cpu_feature2):	.long	0	# feature flags from 'cpuid'
-	#   instruction
 _C_LABEL(cpuid_level):	.long	-1	# max. level accepted by 'cpuid'
 	#   instruction
 _C_LABEL(cpu_vendorname):	.space	16	# vendor string returned by `cpuid'
@@ -300,7 +296,7 @@
 gdt64_end:
 
 farjmp64:
-	.long	longmode-KERNBASE
+	.long	_RELOC(longmode)
 	.word	GSEL(GCODE_SEL, SEL_KPL)
 	
 #endif	/* !XEN */
@@ -423,18 +419,11 @@
 	movl	$1,%eax
 	cpuid
 	movl	%eax,RELOC(cpu_id)
-	movl	%edx,RELOC(cpu_feature)
-	movl	%ecx,RELOC(cpu_feature2)
 
 	/* Brand ID is bits 0-7 of %ebx */
 	andl	$255,%ebx
 	movl	%ebx,RELOC(cpu_brand_id)
 
-	/* add AMD specific feature flags */
-	movl	$0x8001,%eax
-	cpuid
-	orl	%edx,RELOC(cpu_feature)
-
 	/*
 	 * Finished with old stack; load new %esp now instead of later so we
 	 * can trace this code without having to worry about the trace trap

Index: src/sys/arch/amd64/amd64/machdep.c
diff -u src/sys/arch/amd64/amd64/machdep.c:1.102.4.12 src/sys/arch/amd64/amd64/machdep.c:1.102.4.13
--- src/sys/arch/amd64/amd64/machdep.c:1.102.4.12	Tue Dec  1 19:29:54 2009
+++ src/sys/arch/amd64/amd64/machdep.c	Thu Apr 22 20:02:48 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.102.4.12 2009/12/01 19:29:54 snj Exp $	*/
+/*	$NetBSD: machdep.c,v 1.102.4.13 2010/04/22 20:02:48 snj Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008
@@ -112,7 +112,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.102.4.12 2009/12/01 19:29:54 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.102.4.13 2010/04/22 20:02:48 snj Exp $");
 
 /* #define XENDEBUG_LOW  */
 
@@ -1392,9 +1392,9 @@
 	__PRINTK(("init_x86_64(0x%lx)\n", first_avail));
 	first_bt_vaddr = (vaddr_t) (first_avail + KERNBASE + PAGE_SIZE * 2);
 	__PRINTK(("first_bt_vaddr 0x%lx\n", first_bt_vaddr));
-	cpu_feature = cpu_info_primary.ci_feature_flags;
 	/* not on Xen... */
-	cpu_feature &= ~(CPUID_PGE|CPUID_PSE|CPUID_MTRR|CPUID_FXSR|CPUID_NOX);
+	cpu_feature &= ~(CPUID_PGE|CPUID_PSE|CPUID_MTRR|CPUID_FXSR);
+	cpu_feature3 &= ~(CPUID_NOX);
 #endif /* XEN */
 
 	cpu_init_msrs(&cpu_info_primary, true);

Index: src/sys/arch/amd64/amd64/mptramp.S
diff -u src/sys/arch/amd64/amd64/mptramp.S:1.9 src/sys/arch/

CVS commit: [netbsd-5] src/sys/arch

2010-05-20 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Thu May 20 18:44:47 UTC 2010

Modified Files:
src/sys/arch/i386/i386 [netbsd-5]: pmc.c
src/sys/arch/x86/x86 [netbsd-5]: via_padlock.c

Log Message:
Apply patch (requested by sborrill in ticket #1404):
Fix build of the i386 ALL kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.17.8.1 src/sys/arch/i386/i386/pmc.c
cvs rdiff -u -r1.9 -r1.9.14.1 src/sys/arch/x86/x86/via_padlock.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/i386/i386/pmc.c
diff -u src/sys/arch/i386/i386/pmc.c:1.17 src/sys/arch/i386/i386/pmc.c:1.17.8.1
--- src/sys/arch/i386/i386/pmc.c:1.17	Sun May 11 14:44:54 2008
+++ src/sys/arch/i386/i386/pmc.c	Thu May 20 18:44:46 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmc.c,v 1.17 2008/05/11 14:44:54 ad Exp $	*/
+/*	$NetBSD: pmc.c,v 1.17.8.1 2010/05/20 18:44:46 snj Exp $	*/
 
 /*-
  * Copyright (c) 2000 Zembu Labs, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmc.c,v 1.17 2008/05/11 14:44:54 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmc.c,v 1.17.8.1 2010/05/20 18:44:46 snj Exp $");
 
 #include 
 #include 
@@ -50,6 +50,7 @@
 #include 
 #include 
 #include 
+#include 
 
 static int pmc_initialized;
 static int pmc_ncounters;

Index: src/sys/arch/x86/x86/via_padlock.c
diff -u src/sys/arch/x86/x86/via_padlock.c:1.9 src/sys/arch/x86/x86/via_padlock.c:1.9.14.1
--- src/sys/arch/x86/x86/via_padlock.c:1.9	Wed Apr 16 16:06:52 2008
+++ src/sys/arch/x86/x86/via_padlock.c	Thu May 20 18:44:47 2010
@@ -1,5 +1,5 @@
 /*	$OpenBSD: via.c,v 1.8 2006/11/17 07:47:56 tom Exp $	*/
-/*	$NetBSD: via_padlock.c,v 1.9 2008/04/16 16:06:52 cegger Exp $ */
+/*	$NetBSD: via_padlock.c,v 1.9.14.1 2010/05/20 18:44:47 snj Exp $ */
 
 /*-
  * Copyright (c) 2003 Jason Wright
@@ -20,7 +20,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: via_padlock.c,v 1.9 2008/04/16 16:06:52 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: via_padlock.c,v 1.9.14.1 2010/05/20 18:44:47 snj Exp $");
 
 #include "opt_viapadlock.h"
 
@@ -36,6 +36,7 @@
 #include 
 
 #include 
+#include 
 
 #include 
 #include 



CVS commit: [netbsd-5] src/sys/arch

2010-07-16 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Fri Jul 16 18:40:39 UTC 2010

Modified Files:
src/sys/arch/amd64/amd64 [netbsd-5]: netbsd32_machdep.c
src/sys/arch/i386/i386 [netbsd-5]: trap.c

Log Message:
Apply patches (requested by chs in ticket #1424):
sys/arch/amd64/amd64/netbsd32_machdep.c: patch
sys/arch/i386/i386/trap.c:   patch
Fix several panics that can be caused by applications using
bad segment register values with setcontext() or sigreturn().


To generate a diff of this commit:
cvs rdiff -u -r1.55.4.1 -r1.55.4.2 \
src/sys/arch/amd64/amd64/netbsd32_machdep.c
cvs rdiff -u -r1.241.4.2 -r1.241.4.3 src/sys/arch/i386/i386/trap.c

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

Modified files:

Index: src/sys/arch/amd64/amd64/netbsd32_machdep.c
diff -u src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.55.4.1 src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.55.4.2
--- src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.55.4.1	Sat Oct  3 23:34:48 2009
+++ src/sys/arch/amd64/amd64/netbsd32_machdep.c	Fri Jul 16 18:40:39 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep.c,v 1.55.4.1 2009/10/03 23:34:48 snj Exp $	*/
+/*	$NetBSD: netbsd32_machdep.c,v 1.55.4.2 2010/07/16 18:40:39 riz Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.55.4.1 2009/10/03 23:34:48 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.55.4.2 2010/07/16 18:40:39 riz Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_coredump.h"
@@ -942,7 +942,9 @@
 static int
 check_sigcontext32(const struct netbsd32_sigcontext *scp, struct trapframe *tf)
 {
-	if (((scp->sc_eflags ^ tf->tf_rflags) & PSL_USERSTATIC) != 0)
+
+	if (((scp->sc_eflags ^ tf->tf_rflags) & PSL_USERSTATIC) != 0 ||
+	scp->sc_cs != GSEL(GUCODE32_SEL, SEL_UPL))
 		return EINVAL;
 	if (scp->sc_fs != 0 && !VALID_USER_DSEL32(scp->sc_fs))
 		return EINVAL;
@@ -964,7 +966,8 @@
 
 	gr = mcp->__gregs;
 
-	if (((gr[_REG32_EFL] ^ tf->tf_rflags) & PSL_USERSTATIC) != 0)
+	if (((gr[_REG32_EFL] ^ tf->tf_rflags) & PSL_USERSTATIC) != 0 ||
+	gr[_REG32_CS] != GSEL(GUCODE32_SEL, SEL_UPL))
 		return EINVAL;
 	if (gr[_REG32_FS] != 0 && !VALID_USER_DSEL32(gr[_REG32_FS]))
 		return EINVAL;

Index: src/sys/arch/i386/i386/trap.c
diff -u src/sys/arch/i386/i386/trap.c:1.241.4.2 src/sys/arch/i386/i386/trap.c:1.241.4.3
--- src/sys/arch/i386/i386/trap.c:1.241.4.2	Thu May 20 05:51:59 2010
+++ src/sys/arch/i386/i386/trap.c	Fri Jul 16 18:40:39 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.241.4.2 2010/05/20 05:51:59 snj Exp $	*/
+/*	$NetBSD: trap.c,v 1.241.4.3 2010/07/16 18:40:39 riz Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.241.4.2 2010/05/20 05:51:59 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.241.4.3 2010/07/16 18:40:39 riz Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -401,6 +401,7 @@
 		 * returning from a trap, syscall, or interrupt.
 		 */
 
+kern_pagefault:
 		KSI_INIT_TRAP(&ksi);
 		ksi.ksi_signo = SIGSEGV;
 		ksi.ksi_code = SEGV_ACCERR;
@@ -427,7 +428,8 @@
 			break;
 		case 0x8e:
 			switch (*(uint32_t *)frame->tf_eip) {
-			case 0x8e242c8e:	/* mov (%esp,%gs), then */
+			case 0x8e242c8e:	/* mov (%esp),%gs */
+			case 0x00246c8e:	/* mov 0x0(%esp),%gs */
 			case 0x0424648e:	/* mov 0x4(%esp),%fs */
 			case 0x0824448e:	/* mov 0x8(%esp),%es */
 			case 0x0c245c8e:	/* mov 0xc(%esp),%ds */
@@ -734,7 +736,7 @@
 goto copyfault;
 			printf("uvm_fault(%p, %#lx, %d) -> %#x\n",
 			map, va, ftype, error);
-			goto we_re_toast;
+			goto kern_pagefault;
 		}
 		if (error == ENOMEM) {
 			ksi.ksi_signo = SIGKILL;



CVS commit: [netbsd-5] src/sys/arch

2010-02-15 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Mon Feb 15 18:04:11 UTC 2010

Modified Files:
src/sys/arch/amd64/conf [netbsd-5]: XEN3_DOM0 XEN3_DOMU
src/sys/arch/i386/conf [netbsd-5]: XEN2_DOM0 XEN2_DOMU

Log Message:
Pull up the following revisions(s) (requested by tron in ticket #1306):
sys/arch/i386/conf/XEN2_DOM0patch
sys/arch/i386/conf/XEN2_DOMUpatch
sys/arch/amd64/conf/XEN3_DOM0   patch
sys/arch/amd64/conf/XEN3_DOM0   patch

Enable cgd(4) support on all amd64 and i386 XEN kernels.


To generate a diff of this commit:
cvs rdiff -u -r1.33.4.3 -r1.33.4.4 src/sys/arch/amd64/conf/XEN3_DOM0
cvs rdiff -u -r1.13.4.1 -r1.13.4.2 src/sys/arch/amd64/conf/XEN3_DOMU
cvs rdiff -u -r1.53.2.3 -r1.53.2.4 src/sys/arch/i386/conf/XEN2_DOM0
cvs rdiff -u -r1.19.4.1 -r1.19.4.2 src/sys/arch/i386/conf/XEN2_DOMU

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

Modified files:

Index: src/sys/arch/amd64/conf/XEN3_DOM0
diff -u src/sys/arch/amd64/conf/XEN3_DOM0:1.33.4.3 src/sys/arch/amd64/conf/XEN3_DOM0:1.33.4.4
--- src/sys/arch/amd64/conf/XEN3_DOM0:1.33.4.3	Sat Oct  3 23:57:54 2009
+++ src/sys/arch/amd64/conf/XEN3_DOM0	Mon Feb 15 18:04:11 2010
@@ -1,4 +1,4 @@
-# $NetBSD: XEN3_DOM0,v 1.33.4.3 2009/10/03 23:57:54 snj Exp $
+# $NetBSD: XEN3_DOM0,v 1.33.4.4 2010/02/15 18:04:11 sborrill Exp $
 
 include 	"arch/amd64/conf/std.xen"
 
@@ -742,7 +742,7 @@
 # disk/mass storage pseudo-devices
 pseudo-device	bio			# RAID control device driver
 pseudo-device	ccd		4	# concatenated/striped disk devices
-#pseudo-device	cgd		4	# cryptographic disk devices
+pseudo-device	cgd		4	# cryptographic disk devices
 pseudo-device	raid		8	# RAIDframe disk driver
 options 	RAID_AUTOCONFIG		# auto-configuration of RAID components
 # Options to enable various other RAIDframe RAID types.

Index: src/sys/arch/amd64/conf/XEN3_DOMU
diff -u src/sys/arch/amd64/conf/XEN3_DOMU:1.13.4.1 src/sys/arch/amd64/conf/XEN3_DOMU:1.13.4.2
--- src/sys/arch/amd64/conf/XEN3_DOMU:1.13.4.1	Sat Oct  3 23:55:43 2009
+++ src/sys/arch/amd64/conf/XEN3_DOMU	Mon Feb 15 18:04:11 2010
@@ -1,4 +1,4 @@
-# $NetBSD: XEN3_DOMU,v 1.13.4.1 2009/10/03 23:55:43 snj Exp $
+# $NetBSD: XEN3_DOMU,v 1.13.4.2 2010/02/15 18:04:11 sborrill Exp $
 
 include 	"arch/amd64/conf/std.xen"
 
@@ -177,7 +177,7 @@
 
 # disk/mass storage pseudo-devices
 pseudo-device	ccd		4	# concatenated/striped disk devices
-#pseudo-device	cgd		4	# cryptographic disk devices
+pseudo-device	cgd		4	# cryptographic disk devices
 pseudo-device	raid		8	# RAIDframe disk driver
 options 	RAID_AUTOCONFIG		# auto-configuration of RAID components
 # Options to enable various other RAIDframe RAID types.

Index: src/sys/arch/i386/conf/XEN2_DOM0
diff -u src/sys/arch/i386/conf/XEN2_DOM0:1.53.2.3 src/sys/arch/i386/conf/XEN2_DOM0:1.53.2.4
--- src/sys/arch/i386/conf/XEN2_DOM0:1.53.2.3	Sat Sep 26 19:52:09 2009
+++ src/sys/arch/i386/conf/XEN2_DOM0	Mon Feb 15 18:04:11 2010
@@ -1,4 +1,4 @@
-# $NetBSD: XEN2_DOM0,v 1.53.2.3 2009/09/26 19:52:09 snj Exp $
+# $NetBSD: XEN2_DOM0,v 1.53.2.4 2010/02/15 18:04:11 sborrill Exp $
 
 include 	"arch/xen/conf/std.xen"
 
@@ -712,7 +712,7 @@
 # disk/mass storage pseudo-devices
 pseudo-device	bio			# RAID control device driver
 pseudo-device	ccd		4	# concatenated/striped disk devices
-#pseudo-device	cgd		4	# cryptographic disk devices
+pseudo-device	cgd		4	# cryptographic disk devices
 pseudo-device	raid		8	# RAIDframe disk driver
 options 	RAID_AUTOCONFIG		# auto-configuration of RAID components
 # Options to enable various other RAIDframe RAID types.

Index: src/sys/arch/i386/conf/XEN2_DOMU
diff -u src/sys/arch/i386/conf/XEN2_DOMU:1.19.4.1 src/sys/arch/i386/conf/XEN2_DOMU:1.19.4.2
--- src/sys/arch/i386/conf/XEN2_DOMU:1.19.4.1	Tue Nov 18 01:56:59 2008
+++ src/sys/arch/i386/conf/XEN2_DOMU	Mon Feb 15 18:04:11 2010
@@ -1,4 +1,4 @@
-# $NetBSD: XEN2_DOMU,v 1.19.4.1 2008/11/18 01:56:59 snj Exp $
+# $NetBSD: XEN2_DOMU,v 1.19.4.2 2010/02/15 18:04:11 sborrill Exp $
 
 include 	"arch/xen/conf/std.xen"
 
@@ -187,7 +187,7 @@
 
 # disk/mass storage pseudo-devices
 pseudo-device	ccd		4	# concatenated/striped disk devices
-#pseudo-device	cgd		4	# cryptographic disk devices
+pseudo-device	cgd		4	# cryptographic disk devices
 pseudo-device	raid		8	# RAIDframe disk driver
 options 	RAID_AUTOCONFIG		# auto-configuration of RAID components
 # Options to enable various other RAIDframe RAID types.



CVS commit: [netbsd-5] src/sys/arch

2010-11-19 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Fri Nov 19 23:19:13 UTC 2010

Modified Files:
src/sys/arch/x86/x86 [netbsd-5]: bus_dma.c
src/sys/arch/xen/x86 [netbsd-5]: xen_bus_dma.c

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #1348):
sys/arch/x86/x86/bus_dma.c: revision 1.54
sys/arch/xen/x86/xen_bus_dma.c: revision 1.21
bus_dmamem_alloc() may not get a boundary smaller than size, but
it's perfectly valid for bus_dmamap_create() to do so (a contigous
transfers will then split in multiple segment).
Fix _xen_bus_dmamem_alloc_range() and _bus_dmamem_alloc_range() to
allow a boundary limit smaller than size:
- compute appropriate boundary for uvm_pglistalloc(), wich doesn't
  accept boundary < size
- also take care of boundary when deciding to start a new segment.
While there, remove useless boundary argument to _xen_alloc_contig().
Fix the boundary-related issue of PR port-amd64/42980


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.45.6.1 src/sys/arch/x86/x86/bus_dma.c
cvs rdiff -u -r1.11.8.2 -r1.11.8.3 src/sys/arch/xen/x86/xen_bus_dma.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/x86/x86/bus_dma.c
diff -u src/sys/arch/x86/x86/bus_dma.c:1.45 src/sys/arch/x86/x86/bus_dma.c:1.45.6.1
--- src/sys/arch/x86/x86/bus_dma.c:1.45	Sat Jun 28 17:23:01 2008
+++ src/sys/arch/x86/x86/bus_dma.c	Fri Nov 19 23:19:12 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.45 2008/06/28 17:23:01 bouyer Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.45.6.1 2010/11/19 23:19:12 riz Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2007 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.45 2008/06/28 17:23:01 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.45.6.1 2010/11/19 23:19:12 riz Exp $");
 
 /*
  * The following is included because _bus_dma_uiomove is derived from
@@ -155,14 +155,28 @@
 	struct vm_page *m;
 	struct pglist mlist;
 	int curseg, error;
+	bus_size_t uboundary;
 
 	/* Always round the size. */
 	size = round_page(size);
 
+	KASSERT(boundary >= PAGE_SIZE || boundary == 0);
+
 	/*
 	 * Allocate pages from the VM system.
-	 */
-	error = uvm_pglistalloc(size, low, high, alignment, boundary,
+	 * We accept boundaries < size, splitting in multiple segments
+	 * if needed. uvm_pglistalloc does not, so compute an appropriate
+ * boundary: next power of 2 >= size
+ */
+
+	if (boundary == 0)
+		uboundary = 0;
+	else {
+		uboundary = boundary;
+		while (uboundary < size)
+			uboundary = uboundary << 1;
+	}
+	error = uvm_pglistalloc(size, low, high, alignment, uboundary,
 	&mlist, nsegs, (flags & BUS_DMA_NOWAIT) == 0);
 	if (error)
 		return (error);
@@ -186,10 +200,13 @@
 			panic("_bus_dmamem_alloc_range");
 		}
 #endif
-		if (curaddr == (lastaddr + PAGE_SIZE))
+		if (curaddr == (lastaddr + PAGE_SIZE) &&
+		(lastaddr & boundary) == (curaddr & boundary)) {
 			segs[curseg].ds_len += PAGE_SIZE;
-		else {
+		} else {
 			curseg++;
+			if (curseg >= nsegs)
+return EFBIG;
 			segs[curseg].ds_addr = curaddr;
 			segs[curseg].ds_len = PAGE_SIZE;
 		}

Index: src/sys/arch/xen/x86/xen_bus_dma.c
diff -u src/sys/arch/xen/x86/xen_bus_dma.c:1.11.8.2 src/sys/arch/xen/x86/xen_bus_dma.c:1.11.8.3
--- src/sys/arch/xen/x86/xen_bus_dma.c:1.11.8.2	Mon Mar 29 00:23:12 2010
+++ src/sys/arch/xen/x86/xen_bus_dma.c	Fri Nov 19 23:19:12 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: xen_bus_dma.c,v 1.11.8.2 2010/03/29 00:23:12 snj Exp $	*/
+/*	$NetBSD: xen_bus_dma.c,v 1.11.8.3 2010/11/19 23:19:12 riz Exp $	*/
 /*	NetBSD bus_dma.c,v 1.21 2005/04/16 07:53:35 yamt Exp */
 
 /*-
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xen_bus_dma.c,v 1.11.8.2 2010/03/29 00:23:12 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_bus_dma.c,v 1.11.8.3 2010/11/19 23:19:12 riz Exp $");
 
 #include 
 #include 
@@ -61,7 +61,7 @@
 }
 
 static int
-_xen_alloc_contig(bus_size_t size, bus_size_t alignment, bus_size_t boundary,
+_xen_alloc_contig(bus_size_t size, bus_size_t alignment,
 struct pglist *mlistp, int flags, bus_addr_t low, bus_addr_t high)
 {
 	int order, i;
@@ -75,9 +75,9 @@
 
 	/*
 	 * When requesting a contigous memory region, the hypervisor will
-	 * return a memory range aligned on size. This will automagically
-	 * handle "boundary", but the only way to enforce alignment
-	 * is to request a memory region of size max(alignment, size).
+	 * return a memory range aligned on size. 
+	 * The only way to enforce alignment is to request a memory region
+	 * of size max(alignment, size).
 	 */
 	order = max(get_order(size), get_order(alignment));
 	npages = (1 << order);
@@ -245,21 +245,32 @@
 	struct pglist mlist;
 	int curseg, error;
 	int doingrealloc = 0;
+	bus_size_t uboundary;
 
 	/* Always round the size. */
 	size = round_page(size);
 
 	KASSERT((alignment & (alignment - 1)) == 0);
 	KASSE

CVS commit: [netbsd-5] src/sys/arch

2010-11-20 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Nov 21 02:46:24 UTC 2010

Modified Files:
src/sys/arch/i386/i386 [netbsd-5]: autoconf.c
src/sys/arch/x86/conf [netbsd-5]: files.x86
src/sys/arch/x86/x86 [netbsd-5]: intr.c

Log Message:
Pull up following revision(s) (requested by hubertf in ticket #1403):
sys/arch/x86/conf/files.x86: revision 1.49
sys/arch/i386/i386/autoconf.c: revision 1.94
sys/arch/x86/x86/intr.c: revision 1.60
Add opt_intrdebug.h for the INTRDEBUG option, and #include it here and
there.  Fixes GENERIC/i386 compilation with 'options INTRDEBUG'.


To generate a diff of this commit:
cvs rdiff -u -r1.92.8.1 -r1.92.8.2 src/sys/arch/i386/i386/autoconf.c
cvs rdiff -u -r1.44.4.2 -r1.44.4.3 src/sys/arch/x86/conf/files.x86
cvs rdiff -u -r1.57 -r1.57.6.1 src/sys/arch/x86/x86/intr.c

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

Modified files:

Index: src/sys/arch/i386/i386/autoconf.c
diff -u src/sys/arch/i386/i386/autoconf.c:1.92.8.1 src/sys/arch/i386/i386/autoconf.c:1.92.8.2
--- src/sys/arch/i386/i386/autoconf.c:1.92.8.1	Mon Nov 17 18:53:54 2008
+++ src/sys/arch/i386/i386/autoconf.c	Sun Nov 21 02:46:24 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.92.8.1 2008/11/17 18:53:54 snj Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.92.8.2 2010/11/21 02:46:24 riz Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -46,9 +46,10 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.92.8.1 2008/11/17 18:53:54 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.92.8.2 2010/11/21 02:46:24 riz Exp $");
 
 #include "opt_compat_oldboot.h"
+#include "opt_intrdebug.h"
 #include "opt_multiprocessor.h"
 
 #include 
@@ -60,6 +61,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 

Index: src/sys/arch/x86/conf/files.x86
diff -u src/sys/arch/x86/conf/files.x86:1.44.4.2 src/sys/arch/x86/conf/files.x86:1.44.4.3
--- src/sys/arch/x86/conf/files.x86:1.44.4.2	Mon Oct  5 11:37:14 2009
+++ src/sys/arch/x86/conf/files.x86	Sun Nov 21 02:46:23 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: files.x86,v 1.44.4.2 2009/10/05 11:37:14 sborrill Exp $
+#	$NetBSD: files.x86,v 1.44.4.3 2010/11/21 02:46:23 riz Exp $
 
 # options for MP configuration through the MP spec
 defflag opt_mpbios.h MPBIOS MPVERBOSE MPDEBUG MPBIOS_SCANPCI
@@ -6,6 +6,9 @@
 # MTRR support
 defflag MTRR
 
+# Interrupt debug
+defflag opt_intrdebug.h	INTRDEBUG
+
 # PCI fixup options
 defflag opt_pcifixup.h	PCI_ADDR_FIXUP PCI_BUS_FIXUP
 			PCI_INTR_FIXUP PCI_INTR_FIXUP_FORCE

Index: src/sys/arch/x86/x86/intr.c
diff -u src/sys/arch/x86/x86/intr.c:1.57 src/sys/arch/x86/x86/intr.c:1.57.6.1
--- src/sys/arch/x86/x86/intr.c:1.57	Thu Jul  3 15:44:19 2008
+++ src/sys/arch/x86/x86/intr.c	Sun Nov 21 02:46:24 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.c,v 1.57 2008/07/03 15:44:19 drochner Exp $	*/
+/*	$NetBSD: intr.c,v 1.57.6.1 2010/11/21 02:46:24 riz Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
@@ -133,8 +133,9 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.57 2008/07/03 15:44:19 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.57.6.1 2010/11/21 02:46:24 riz Exp $");
 
+#include "opt_intrdebug.h"
 #include "opt_multiprocessor.h"
 #include "opt_acpi.h"
 



CVS commit: [netbsd-5] src/sys/arch

2010-11-21 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Nov 21 17:43:03 UTC 2010

Modified Files:
src/sys/arch/amd64/conf [netbsd-5]: XEN3_DOM0
src/sys/arch/i386/conf [netbsd-5]: XEN2_DOM0

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #1419):
sys/arch/i386/conf/XEN2_DOM0: patch
sys/arch/amd64/conf/XEN3_DOM0: revision 1.55
Sync DKWEDGE options with GENERIC


To generate a diff of this commit:
cvs rdiff -u -r1.33.4.5 -r1.33.4.6 src/sys/arch/amd64/conf/XEN3_DOM0
cvs rdiff -u -r1.53.2.5 -r1.53.2.6 src/sys/arch/i386/conf/XEN2_DOM0

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

Modified files:

Index: src/sys/arch/amd64/conf/XEN3_DOM0
diff -u src/sys/arch/amd64/conf/XEN3_DOM0:1.33.4.5 src/sys/arch/amd64/conf/XEN3_DOM0:1.33.4.6
--- src/sys/arch/amd64/conf/XEN3_DOM0:1.33.4.5	Sun Nov 21 03:05:09 2010
+++ src/sys/arch/amd64/conf/XEN3_DOM0	Sun Nov 21 17:43:03 2010
@@ -1,4 +1,4 @@
-# $NetBSD: XEN3_DOM0,v 1.33.4.5 2010/11/21 03:05:09 riz Exp $
+# $NetBSD: XEN3_DOM0,v 1.33.4.6 2010/11/21 17:43:03 riz Exp $
 
 include 	"arch/amd64/conf/std.xen"
 
@@ -69,6 +69,13 @@
 options 	EXEC_ELF32
 options 	COMPAT_BSDPTY	# /dev/[pt]ty?? ptys.
 
+# Wedge support
+options 	DKWEDGE_AUTODISCOVER	# Automatically add dk(4) instances
+options 	DKWEDGE_METHOD_GPT	# Supports GPT partitions as wedges
+# The following two options can break /etc/fstab, so handle with care
+#options 	DKWEDGE_METHOD_BSDLABEL	# Support disklabel entries as wedges
+#options 	DKWEDGE_METHOD_MBR	# Support MBR partitions as wedges
+
 # File systems
 file-system 	FFS		# UFS
 file-system 	EXT2FS		# second extended file system (linux)

Index: src/sys/arch/i386/conf/XEN2_DOM0
diff -u src/sys/arch/i386/conf/XEN2_DOM0:1.53.2.5 src/sys/arch/i386/conf/XEN2_DOM0:1.53.2.6
--- src/sys/arch/i386/conf/XEN2_DOM0:1.53.2.5	Sun Nov 21 03:05:05 2010
+++ src/sys/arch/i386/conf/XEN2_DOM0	Sun Nov 21 17:43:03 2010
@@ -1,4 +1,4 @@
-# $NetBSD: XEN2_DOM0,v 1.53.2.5 2010/11/21 03:05:05 riz Exp $
+# $NetBSD: XEN2_DOM0,v 1.53.2.6 2010/11/21 17:43:03 riz Exp $
 
 include 	"arch/xen/conf/std.xen"
 
@@ -89,6 +89,13 @@
 #options 	COMPAT_PECOFF	# kernel support to run Win32 apps
 options 	COMPAT_BSDPTY	# /dev/[pt]ty?? ptys.
 
+# Wedge support
+options 	DKWEDGE_AUTODISCOVER	# Automatically add dk(4) instances
+options 	DKWEDGE_METHOD_GPT	# Supports GPT partitions as wedges
+# The following two options can break /etc/fstab, so handle with care
+#options 	DKWEDGE_METHOD_BSDLABEL	# Support disklabel entries as wedges
+#options 	DKWEDGE_METHOD_MBR	# Support MBR partitions as wedges
+
 # File systems
 file-system 	FFS		# UFS
 file-system 	EXT2FS		# second extended file system (linux)



CVS commit: [netbsd-5] src/sys/arch

2015-06-01 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Mon Jun  1 14:38:32 UTC 2015

Modified Files:
src/sys/arch/amd64/amd64 [netbsd-5]: cpufunc.S
src/sys/arch/i386/i386 [netbsd-5]: cpufunc.S
src/sys/arch/x86/include [netbsd-5]: cpufunc.h

Log Message:
Pull up the following revisions(s) (requested by msaitoh in ticket #1969):
sys/arch/x86/include/cpufunc.h: revision 1.13
sys/arch/amd64/amd64/cpufunc.S: revision 1.20-1.21 via patch
sys/arch/i386/i386/cpufunc.S:   revision 1.16-1.17, 1.21 via 
patch

Backport rdmsr_safe() to access MSR safely.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.15.6.1 src/sys/arch/amd64/amd64/cpufunc.S
cvs rdiff -u -r1.13 -r1.13.4.1 src/sys/arch/i386/i386/cpufunc.S
cvs rdiff -u -r1.8.10.3 -r1.8.10.4 src/sys/arch/x86/include/cpufunc.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/amd64/amd64/cpufunc.S
diff -u src/sys/arch/amd64/amd64/cpufunc.S:1.15 src/sys/arch/amd64/amd64/cpufunc.S:1.15.6.1
--- src/sys/arch/amd64/amd64/cpufunc.S:1.15	Tue Jun 24 16:32:53 2008
+++ src/sys/arch/amd64/amd64/cpufunc.S	Mon Jun  1 14:38:31 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpufunc.S,v 1.15 2008/06/24 16:32:53 ad Exp $	*/
+/*	$NetBSD: cpufunc.S,v 1.15.6.1 2015/06/01 14:38:31 sborrill Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2007, 2008 The NetBSD Foundation, Inc.
@@ -33,6 +33,8 @@
  * Functions to provide access to i386-specific instructions.
  */
 
+#include 
+
 #include 
 #include 
 #include 
@@ -215,6 +217,37 @@ ENTRY(wrmsr_locked)
 	wrmsr
 	ret
 
+/*
+ * Support for reading MSRs in the safe manner (returns EFAULT on fault)
+ */
+/* int rdmsr_safe(u_int msr, uint64_t *data) */
+ENTRY(rdmsr_safe)
+	movq	CPUVAR(CURLWP), %r8
+	movq	L_ADDR(%r8), %r8
+	movq	$_C_LABEL(msr_onfault), PCB_ONFAULT(%r8)
+
+	movl	%edi, %ecx /* u_int msr */
+	rdmsr			/* Read MSR pointed by %ecx. Returns
+   hi byte in edx, lo in %eax */
+	salq	$32, %rdx	/* sign-shift %rdx left */
+	movl	%eax, %eax	/* zero-extend %eax -> %rax */
+	orq	%rdx, %rax
+	movq	%rax, (%rsi)  /* *data */
+	xorq	%rax, %rax/* "no error" */
+
+	movq	%rax, PCB_ONFAULT(%r8)
+	ret
+
+/*
+ * MSR operations fault handler
+ */
+NENTRY(msr_onfault)
+	movq	CPUVAR(CURLWP), %r8
+	movq	L_ADDR(%r8), %r8
+	movq	$0, PCB_ONFAULT(%r8)
+	movl	$EFAULT, %eax
+	ret
+
 #ifndef XEN
 ENTRY(wbinvd)
 	wbinvd

Index: src/sys/arch/i386/i386/cpufunc.S
diff -u src/sys/arch/i386/i386/cpufunc.S:1.13 src/sys/arch/i386/i386/cpufunc.S:1.13.4.1
--- src/sys/arch/i386/i386/cpufunc.S:1.13	Tue Sep 23 08:50:11 2008
+++ src/sys/arch/i386/i386/cpufunc.S	Mon Jun  1 14:38:31 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpufunc.S,v 1.13 2008/09/23 08:50:11 ad Exp $	*/
+/*	$NetBSD: cpufunc.S,v 1.13.4.1 2015/06/01 14:38:31 sborrill Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2007 The NetBSD Foundation, Inc.
@@ -35,8 +35,10 @@
  * These are shared with NetBSD/xen.
  */
 
+#include 
+
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpufunc.S,v 1.13 2008/09/23 08:50:11 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpufunc.S,v 1.13.4.1 2015/06/01 14:38:31 sborrill Exp $");
 
 #include "opt_xen.h"
 
@@ -141,6 +143,39 @@ ENTRY(wrmsr_locked)
 	ret
 END(wrmsr_locked)
 
+/*
+ * Support for reading MSRs in the safe manner (returns EFAULT on fault)
+ */
+/* int rdmsr_safe(u_int msr, uint64_t *data) */
+ENTRY(rdmsr_safe)
+	movl	CPUVAR(CURLWP), %ecx
+	movl	L_ADDR(%ecx), %ecx
+	movl	$_C_LABEL(msr_onfault), PCB_ONFAULT(%ecx)
+
+	movl	4(%esp), %ecx /* u_int msr */
+	rdmsr
+	movl	8(%esp), %ecx /* *data */
+	movl	%eax, (%ecx)  /* low-order bits */
+	movl	%edx, 4(%ecx) /* high-order bits */
+	xorl	%eax, %eax/* "no error" */
+
+	movl	CPUVAR(CURLWP), %ecx
+	movl	L_ADDR(%ecx), %ecx
+	movl	%eax, PCB_ONFAULT(%ecx)
+
+	ret
+
+/*
+ * MSR operations fault handler
+ */
+NENTRY(msr_onfault)
+	movl	CPUVAR(CURLWP), %ecx
+	movl	L_ADDR(%ecx), %ecx
+	movl	$0, PCB_ONFAULT(%ecx)
+	movl	$EFAULT, %eax
+	ret
+END(msr_onfault)
+
 ENTRY(cpu_counter)
 	rdtsc
 	addl	CPUVAR(CC_SKEW), %eax

Index: src/sys/arch/x86/include/cpufunc.h
diff -u src/sys/arch/x86/include/cpufunc.h:1.8.10.3 src/sys/arch/x86/include/cpufunc.h:1.8.10.4
--- src/sys/arch/x86/include/cpufunc.h:1.8.10.3	Mon Feb  2 21:38:50 2009
+++ src/sys/arch/x86/include/cpufunc.h	Mon Jun  1 14:38:31 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpufunc.h,v 1.8.10.3 2009/02/02 21:38:50 snj Exp $	*/
+/*	$NetBSD: cpufunc.h,v 1.8.10.4 2015/06/01 14:38:31 sborrill Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2007 The NetBSD Foundation, Inc.
@@ -118,6 +118,7 @@ void	x86_reset(void);
 
 uint64_t	rdmsr(u_int);
 uint64_t	rdmsr_locked(u_int, u_int);
+int		rdmsr_safe(u_int, uint64_t *);
 uint64_t	rdtsc(void);
 uint64_t	rdpmc(u_int);
 void		wrmsr(u_int, uint64_t);



CVS commit: [netbsd-5] src/sys/arch

2013-06-09 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Jun  9 11:44:04 UTC 2013

Modified Files:
src/sys/arch/amd64/conf [netbsd-5]: XEN3_DOMU
src/sys/arch/i386/conf [netbsd-5]: XEN2_DOMU

Log Message:
Apply patch (requested by sborrill in ticket #1858):
sys/arch/amd64/conf/XEN3_DOMU
sys/arch/i386/conf/Attic/XEN2_DOMU
Add wedge support in DOMU kernels.


To generate a diff of this commit:
cvs rdiff -u -r1.13.4.3 -r1.13.4.4 src/sys/arch/amd64/conf/XEN3_DOMU
cvs rdiff -u -r1.19.4.3 -r1.19.4.4 src/sys/arch/i386/conf/XEN2_DOMU

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

Modified files:

Index: src/sys/arch/amd64/conf/XEN3_DOMU
diff -u src/sys/arch/amd64/conf/XEN3_DOMU:1.13.4.3 src/sys/arch/amd64/conf/XEN3_DOMU:1.13.4.4
--- src/sys/arch/amd64/conf/XEN3_DOMU:1.13.4.3	Sun Jan 13 16:46:22 2013
+++ src/sys/arch/amd64/conf/XEN3_DOMU	Sun Jun  9 11:44:04 2013
@@ -1,4 +1,4 @@
-# $NetBSD: XEN3_DOMU,v 1.13.4.3 2013/01/13 16:46:22 bouyer Exp $
+# $NetBSD: XEN3_DOMU,v 1.13.4.4 2013/06/09 11:44:04 msaitoh Exp $
 
 include 	"arch/amd64/conf/std.xen"
 
@@ -68,6 +68,13 @@ options 	COMPAT_LINUX32	# req. COMPAT_LI
 options 	EXEC_ELF32
 options 	COMPAT_BSDPTY	# /dev/[pt]ty?? ptys.
 
+# Wedge support
+options 	DKWEDGE_AUTODISCOVER	# Automatically add dk(4) instances
+options 	DKWEDGE_METHOD_GPT	# Supports GPT partitions as wedges
+# The following two options can break /etc/fstab, so handle with care
+#options 	DKWEDGE_METHOD_BSDLABEL	# Support disklabel entries as wedges
+#options 	DKWEDGE_METHOD_MBR	# Support MBR partitions as wedges
+
 # File systems
 file-system 	FFS		# UFS
 file-system 	EXT2FS		# second extended file system (linux)

Index: src/sys/arch/i386/conf/XEN2_DOMU
diff -u src/sys/arch/i386/conf/XEN2_DOMU:1.19.4.3 src/sys/arch/i386/conf/XEN2_DOMU:1.19.4.4
--- src/sys/arch/i386/conf/XEN2_DOMU:1.19.4.3	Sun Jan 13 16:46:22 2013
+++ src/sys/arch/i386/conf/XEN2_DOMU	Sun Jun  9 11:44:04 2013
@@ -1,4 +1,4 @@
-# $NetBSD: XEN2_DOMU,v 1.19.4.3 2013/01/13 16:46:22 bouyer Exp $
+# $NetBSD: XEN2_DOMU,v 1.19.4.4 2013/06/09 11:44:04 msaitoh Exp $
 
 include 	"arch/xen/conf/std.xen"
 
@@ -86,6 +86,13 @@ options 	COMPAT_FREEBSD	# binary compati
 #options 	COMPAT_PECOFF	# kernel support to run Win32 apps
 options 	COMPAT_BSDPTY	# /dev/[pt]ty?? ptys.
 
+# Wedge support
+options 	DKWEDGE_AUTODISCOVER	# Automatically add dk(4) instances
+options 	DKWEDGE_METHOD_GPT	# Supports GPT partitions as wedges
+# The following two options can break /etc/fstab, so handle with care
+#options 	DKWEDGE_METHOD_BSDLABEL	# Support disklabel entries as wedges
+#options 	DKWEDGE_METHOD_MBR	# Support MBR partitions as wedges
+
 # File systems
 file-system 	FFS		# UFS
 file-system 	EXT2FS		# second extended file system (linux)



CVS commit: [netbsd-5] src/sys/arch/x86

2013-06-19 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Jun 19 07:44:42 UTC 2013

Modified Files:
src/sys/arch/x86/include [netbsd-5]: mtrr.h specialreg.h
src/sys/arch/x86/x86 [netbsd-5]: mtrr_i686.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1847):
sys/arch/x86/include/mtrr.h: revision 1.5
sys/arch/x86/x86/mtrr_i686.c: revision 1.25
sys/arch/x86/include/specialreg.h: revision 1.55
Increase MTRR_I686_NVAR_MAX from 8 to 16. Avoids
"FIXME: more than 8 MTRRs (10)" message on booting Thinkpad W520 and
similar. While here replace a magic number with MTRR_I686_NVAR_MAX * 2


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.6.1 src/sys/arch/x86/include/mtrr.h
cvs rdiff -u -r1.31.4.2 -r1.31.4.3 src/sys/arch/x86/include/specialreg.h
cvs rdiff -u -r1.19.4.1 -r1.19.4.2 src/sys/arch/x86/x86/mtrr_i686.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/x86/include/mtrr.h
diff -u src/sys/arch/x86/include/mtrr.h:1.4 src/sys/arch/x86/include/mtrr.h:1.4.6.1
--- src/sys/arch/x86/include/mtrr.h:1.4	Tue Jul  1 15:27:34 2008
+++ src/sys/arch/x86/include/mtrr.h	Wed Jun 19 07:44:42 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: mtrr.h,v 1.4 2008/07/01 15:27:34 mrg Exp $ */
+/* $NetBSD: mtrr.h,v 1.4.6.1 2013/06/19 07:44:42 bouyer Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 #define MTRR_I686_FIXED_IDX16K	1
 #define MTRR_I686_FIXED_IDX4K	3
 
-#define MTRR_I686_NVAR_MAX	8	/* could be upto 255? */
+#define MTRR_I686_NVAR_MAX	16	/* could be upto 255? */
 
 #define MTRR_I686_64K_START		0x0
 #define MTRR_I686_16K_START		0x8

Index: src/sys/arch/x86/include/specialreg.h
diff -u src/sys/arch/x86/include/specialreg.h:1.31.4.2 src/sys/arch/x86/include/specialreg.h:1.31.4.3
--- src/sys/arch/x86/include/specialreg.h:1.31.4.2	Wed Nov 28 04:39:03 2012
+++ src/sys/arch/x86/include/specialreg.h	Wed Jun 19 07:44:42 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: specialreg.h,v 1.31.4.2 2012/11/28 04:39:03 riz Exp $	*/
+/*	$NetBSD: specialreg.h,v 1.31.4.3 2013/06/19 07:44:42 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 1991 The Regents of the University of California.
@@ -314,6 +314,22 @@
 #define	MSR_MTRRphysMask6	0x20d
 #define	MSR_MTRRphysBase7	0x20e
 #define	MSR_MTRRphysMask7	0x20f
+#define	MSR_MTRRphysBase8	0x210
+#define	MSR_MTRRphysMask8	0x211
+#define	MSR_MTRRphysBase9	0x212
+#define	MSR_MTRRphysMask9	0x213
+#define	MSR_MTRRphysBase10	0x214
+#define	MSR_MTRRphysMask10	0x215
+#define	MSR_MTRRphysBase11	0x216
+#define	MSR_MTRRphysMask11	0x217
+#define	MSR_MTRRphysBase12	0x218
+#define	MSR_MTRRphysMask12	0x219
+#define	MSR_MTRRphysBase13	0x21a
+#define	MSR_MTRRphysMask13	0x21b
+#define	MSR_MTRRphysBase14	0x21c
+#define	MSR_MTRRphysMask14	0x21d
+#define	MSR_MTRRphysBase15	0x21e
+#define	MSR_MTRRphysMask15	0x21f
 #define	MSR_MTRRfix64K_0	0x250
 #define	MSR_MTRRfix16K_8	0x258
 #define	MSR_MTRRfix16K_A	0x259

Index: src/sys/arch/x86/x86/mtrr_i686.c
diff -u src/sys/arch/x86/x86/mtrr_i686.c:1.19.4.1 src/sys/arch/x86/x86/mtrr_i686.c:1.19.4.2
--- src/sys/arch/x86/x86/mtrr_i686.c:1.19.4.1	Wed Feb 16 20:54:13 2011
+++ src/sys/arch/x86/x86/mtrr_i686.c	Wed Jun 19 07:44:42 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: mtrr_i686.c,v 1.19.4.1 2011/02/16 20:54:13 bouyer Exp $ */
+/*	$NetBSD: mtrr_i686.c,v 1.19.4.2 2013/06/19 07:44:42 bouyer Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mtrr_i686.c,v 1.19.4.1 2011/02/16 20:54:13 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mtrr_i686.c,v 1.19.4.2 2013/06/19 07:44:42 bouyer Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -84,6 +84,22 @@ mtrr_raw[] = {
 	{ MSR_MTRRphysMask6, 0 },
 	{ MSR_MTRRphysBase7, 0 },
 	{ MSR_MTRRphysMask7, 0 },
+	{ MSR_MTRRphysBase8, 0 },
+	{ MSR_MTRRphysMask8, 0 },
+	{ MSR_MTRRphysBase9, 0 },
+	{ MSR_MTRRphysMask9, 0 },
+	{ MSR_MTRRphysBase10, 0 },
+	{ MSR_MTRRphysMask10, 0 },
+	{ MSR_MTRRphysBase11, 0 },
+	{ MSR_MTRRphysMask11, 0 },
+	{ MSR_MTRRphysBase12, 0 },
+	{ MSR_MTRRphysMask12, 0 },
+	{ MSR_MTRRphysBase13, 0 },
+	{ MSR_MTRRphysMask13, 0 },
+	{ MSR_MTRRphysBase14, 0 },
+	{ MSR_MTRRphysMask14, 0 },
+	{ MSR_MTRRphysBase15, 0 },
+	{ MSR_MTRRphysMask15, 0 },
 	{ MSR_MTRRfix64K_0, 0 },
 	{ MSR_MTRRfix16K_8, 0 },
 	{ MSR_MTRRfix16K_A, 0 },
@@ -306,8 +322,8 @@ i686_mtrr_init_first(void)
 		MTRR_I686_NVAR_MAX);
 	else if (i686_mtrr_vcnt < MTRR_I686_NVAR_MAX) {
 		for (i = MTRR_I686_NVAR_MAX - i686_mtrr_vcnt; i; i--) {
-			mtrr_raw[16 - (i*2)].msraddr = 0;
-			mtrr_raw[17 - (i*2)].msraddr = 0;
+			mtrr_raw[(MTRR_I686_NVAR_MAX - i) * 2].msraddr = 0;
+			mtrr_raw[(MTRR_I686_NVAR_MAX - i) * 2 + 1].msraddr = 0;
 		}
 	}
 



CVS commit: [netbsd-5] src/sys/arch/i386

2012-03-21 Thread Julian Coleman
Module Name:src
Committed By:   jdc
Date:   Wed Mar 21 21:29:32 UTC 2012

Modified Files:
src/sys/arch/i386/i386 [netbsd-5]: gdt.c machdep.c
src/sys/arch/i386/include [netbsd-5]: segments.h

Log Message:
Apply patch (requested by bouyer in ticket #1738).

Do not special-case XEN and always use the proper selectors for %fs and %gs
in buildcontext() and setregs(). The consequence was that signal handlers
would have the wrong %fs/%gs. Found by running atf tests under Xen/i386.


To generate a diff of this commit:
cvs rdiff -u -r1.45.10.1 -r1.45.10.2 src/sys/arch/i386/i386/gdt.c
cvs rdiff -u -r1.644.4.12 -r1.644.4.13 src/sys/arch/i386/i386/machdep.c
cvs rdiff -u -r1.50.4.1 -r1.50.4.2 src/sys/arch/i386/include/segments.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/i386/i386/gdt.c
diff -u src/sys/arch/i386/i386/gdt.c:1.45.10.1 src/sys/arch/i386/i386/gdt.c:1.45.10.2
--- src/sys/arch/i386/i386/gdt.c:1.45.10.1	Sat Apr  4 17:39:09 2009
+++ src/sys/arch/i386/i386/gdt.c	Wed Mar 21 21:29:31 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: gdt.c,v 1.45.10.1 2009/04/04 17:39:09 snj Exp $	*/
+/*	$NetBSD: gdt.c,v 1.45.10.2 2012/03/21 21:29:31 jdc Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gdt.c,v 1.45.10.1 2009/04/04 17:39:09 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gdt.c,v 1.45.10.2 2012/03/21 21:29:31 jdc Exp $");
 
 #include "opt_multiprocessor.h"
 #include "opt_xen.h"
@@ -66,7 +66,7 @@ void gdt_grow(int);
 int gdt_get_slot1(int);
 void gdt_put_slot1(int, int);
 
-static void
+void
 update_descriptor(union descriptor *table, union descriptor *entry)
 {
 #ifndef XEN

Index: src/sys/arch/i386/i386/machdep.c
diff -u src/sys/arch/i386/i386/machdep.c:1.644.4.12 src/sys/arch/i386/i386/machdep.c:1.644.4.13
--- src/sys/arch/i386/i386/machdep.c:1.644.4.12	Thu Apr 22 20:02:48 2010
+++ src/sys/arch/i386/i386/machdep.c	Wed Mar 21 21:29:31 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.644.4.12 2010/04/22 20:02:48 snj Exp $	*/
+/*	$NetBSD: machdep.c,v 1.644.4.13 2012/03/21 21:29:31 jdc Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.644.4.12 2010/04/22 20:02:48 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.644.4.13 2012/03/21 21:29:31 jdc Exp $");
 
 #include "opt_beep.h"
 #include "opt_compat_ibcs2.h"
@@ -577,6 +577,12 @@ i386_switch_context(lwp_t *l)
 
 	HYPERVISOR_stack_switch(GSEL(GDATA_SEL, SEL_KPL), pcb->pcb_esp0);
 
+	/* Update TLS segment pointers */
+	update_descriptor(&ci->ci_gdt[GUFS_SEL],
+			  (union descriptor *) &pcb->pcb_fsd);
+	update_descriptor(&ci->ci_gdt[GUGS_SEL], 
+			  (union descriptor *) &pcb->pcb_gsd);
+
 #ifdef XEN3
 	struct physdev_op physop;
 	physop.cmd = PHYSDEVOP_SET_IOPL;
@@ -754,13 +760,8 @@ buildcontext(struct lwp *l, int sel, voi
 {
 	struct trapframe *tf = l->l_md.md_regs;
 
-#ifndef XEN
 	tf->tf_gs = GSEL(GUGS_SEL, SEL_UPL);
 	tf->tf_fs = GSEL(GUFS_SEL, SEL_UPL);
-#else
-	tf->tf_gs = GSEL(GUDATA_SEL, SEL_UPL);
-	tf->tf_fs = GSEL(GUDATA_SEL, SEL_UPL);
-#endif
 	tf->tf_es = GSEL(GUDATA_SEL, SEL_UPL);
 	tf->tf_ds = GSEL(GUDATA_SEL, SEL_UPL);
 	tf->tf_eip = (int)catcher;
@@ -1034,13 +1035,8 @@ setregs(struct lwp *l, struct exec_packa
 	memcpy(pcb->pcb_gsd, &gdt[GUDATA_SEL], sizeof(pcb->pcb_gsd));
 
 	tf = l->l_md.md_regs;
-#ifndef XEN
 	tf->tf_gs = GSEL(GUGS_SEL, SEL_UPL);
 	tf->tf_fs = GSEL(GUFS_SEL, SEL_UPL);
-#else
-	tf->tf_gs = LSEL(LUDATA_SEL, SEL_UPL);
-	tf->tf_fs = LSEL(LUDATA_SEL, SEL_UPL);
-#endif
 	tf->tf_es = LSEL(LUDATA_SEL, SEL_UPL);
 	tf->tf_ds = LSEL(LUDATA_SEL, SEL_UPL);
 	tf->tf_edi = 0;

Index: src/sys/arch/i386/include/segments.h
diff -u src/sys/arch/i386/include/segments.h:1.50.4.1 src/sys/arch/i386/include/segments.h:1.50.4.2
--- src/sys/arch/i386/include/segments.h:1.50.4.1	Tue Nov 18 01:56:59 2008
+++ src/sys/arch/i386/include/segments.h	Wed Mar 21 21:29:31 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: segments.h,v 1.50.4.1 2008/11/18 01:56:59 snj Exp $	*/
+/*	$NetBSD: segments.h,v 1.50.4.2 2012/03/21 21:29:31 jdc Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -198,6 +198,7 @@ void setsegment(struct segment_descripto
 void setgdt(int, const void *, size_t, int, int, int, int);
 void unsetgate(struct gate_descriptor *);
 void cpu_init_idt(void);
+void update_descriptor(union descriptor *, union descriptor *);
 
 #if !defined(XEN)
 void idt_init(void);



CVS commit: [netbsd-5] src/sys/arch/amd64

2012-06-12 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Tue Jun 12 20:43:48 UTC 2012

Modified Files:
src/sys/arch/amd64/amd64 [netbsd-5]: trap.c vector.S
src/sys/arch/amd64/include [netbsd-5]: frameasm.h

Log Message:
Pull up following revision(s) (requested by spz in ticket #1772):
sys/arch/amd64/amd64/trap.c: revision 1.71 via patch
sys/arch/amd64/amd64/vector.S: revision 1.41 via patch
sys/arch/amd64/include/frameasm.h: patch

Treat traps in kernel mode during the 'return to user' iret sequence
as user faults.
Based heavily in the i386 code with the correct opcode bytes inserted.
iret path tested, arranging for segment register errors is harder.
User %fs and %gs (32bit apps) are loaded much earlier and any errors
will generate kernel panics - there is probably code to try to stop
the invalid values being set.
If we get a fault setting the user %gs, or on a iret that is returning
to userspace, we must do a 'swapgs' to reload the kernel %gs_base.
Also save the %ds, %es, %fs, %gs selector values in the frame so
they can be restored if we finally return to user (probably after
an application SIGSEGV handler has fixed the error).
Without this any such fault leaves the kernel running with the wrong
%gs offset and it will most likely fault again early in trap().
Repeats until the stack tramples on something important.
iret change works, invalid %gs is a little harder to arrange.


To generate a diff of this commit:
cvs rdiff -u -r1.52.4.2 -r1.52.4.3 src/sys/arch/amd64/amd64/trap.c
cvs rdiff -u -r1.28.6.1 -r1.28.6.2 src/sys/arch/amd64/amd64/vector.S
cvs rdiff -u -r1.12 -r1.12.12.1 src/sys/arch/amd64/include/frameasm.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/amd64/amd64/trap.c
diff -u src/sys/arch/amd64/amd64/trap.c:1.52.4.2 src/sys/arch/amd64/amd64/trap.c:1.52.4.3
--- src/sys/arch/amd64/amd64/trap.c:1.52.4.2	Fri Aug 14 21:25:34 2009
+++ src/sys/arch/amd64/amd64/trap.c	Tue Jun 12 20:43:47 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.52.4.2 2009/08/14 21:25:34 snj Exp $	*/
+/*	$NetBSD: trap.c,v 1.52.4.3 2012/06/12 20:43:47 riz Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.52.4.2 2009/08/14 21:25:34 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.52.4.3 2012/06/12 20:43:47 riz Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -124,6 +124,7 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.5
 #endif
 
 void trap(struct trapframe *);
+void trap_return_fault_return(struct trapframe *) __dead;
 
 const char *trap_type[] = {
 	"privileged instruction fault",		/*  0 T_PRIVINFLT */
@@ -178,16 +179,11 @@ trap(struct trapframe *frame)
 	struct proc *p;
 	int type = (int)frame->tf_trapno;
 	struct pcb *pcb;
-	extern char fusuintrfailure[], kcopy_fault[],
-		resume_iret[];
+	extern char fusuintrfailure[], kcopy_fault[];
 #if defined(COMPAT_10) || defined(COMPAT_IBCS2)
 	extern char IDTVEC(oosyscall)[];
 #endif
-#if 0
-	extern char resume_pop_ds[], resume_pop_es[];
-#endif
 	struct trapframe *vframe;
-	void *resume;
 	void *onfault;
 	int error;
 	uint64_t cr2;
@@ -274,50 +270,78 @@ copyfault:
 
 		/*
 		 * Check for failure during return to user mode.
+		 * This can happen loading invalid values into the segment
+		 * registers, or during the 'iret' itself.
 		 *
-		 * XXXfvdl check for rex prefix?
-		 *
-		 * We do this by looking at the instruction we faulted on.  The
-		 * specific instructions we recognize only happen when
+		 * We do this by looking at the instruction we faulted on.
+		 * The specific instructions we recognize only happen when
 		 * returning from a trap, syscall, or interrupt.
-		 *
-		 * XXX
-		 * The heuristic used here will currently fail for the case of
-		 * one of the 2 pop instructions faulting when returning from a
-		 * a fast interrupt.  This should not be possible.  It can be
-		 * fixed by rearranging the trap frame so that the stack format
-		 * at this point is the same as on exit from a `slow'
-		 * interrupt.
 		 */
-		switch (*(u_char *)frame->tf_rip) {
-		case 0xcf:	/* iret */
-			vframe = (void *)((uint64_t)&frame->tf_rsp - 44);
-			resume = resume_iret;
-			break;
-/*
- * XXXfvdl these are illegal in long mode (not in compat mode, though)
- * and we do not take back the descriptors from the signal context anyway,
- * but may do so later for USER_LDT, in which case we need to intercept
- * other instructions (movl %eax, %Xs).
- */
-#if 0
-		case 0x1f:	/* popl %ds */
-			vframe = (void *)((uint64_t)&frame->tf_rsp - 4);
-			resume = resume_pop_ds;
-			break;
-		case 0x07:	/* popl %es */
-			vframe = (void *)((uint64_t)&frame->tf_rsp - 0);
-			resume = resume_pop_es;
+
+kernelfault:
+#ifdef XEN
+		/*
+		 * XXX: there has to be an equivalent 'problem'
+		 * but I (dsl) don't know exactly what happens!
+		 * For now panic the ker

CVS commit: [netbsd-5] src/sys/arch/atari

2009-03-26 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Thu Mar 26 17:28:48 UTC 2009

Modified Files:
src/sys/arch/atari/atari [netbsd-5]: atari_init.c pmap_bootstrap.c
src/sys/arch/atari/include [netbsd-5]: pmap.h vmparam.h

Log Message:
Pull up following revision(s) (requested by abs in ticket #612):
sys/arch/atari/atari/pmap_bootstrap.c: revision 1.3
sys/arch/atari/atari/atari_init.c: revision 1.76
sys/arch/atari/include/pmap.h: revision 1.40
sys/arch/atari/include/vmparam.h: revision 1.24
Use separate free lists for TT and ST ram, and give TT a lower id
so all TT ram will be used before any ST ram. (free_list param to
uvm_page_physload())
Tested on a TT with and without TT ram.


To generate a diff of this commit:
cvs rdiff -u -r1.67.54.3 -r1.67.54.4 src/sys/arch/atari/atari/atari_init.c
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/arch/atari/atari/pmap_bootstrap.c
cvs rdiff -u -r1.36.20.2 -r1.36.20.3 src/sys/arch/atari/include/pmap.h
cvs rdiff -u -r1.21.88.1 -r1.21.88.2 src/sys/arch/atari/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/atari/atari/atari_init.c
diff -u src/sys/arch/atari/atari/atari_init.c:1.67.54.3 src/sys/arch/atari/atari/atari_init.c:1.67.54.4
--- src/sys/arch/atari/atari/atari_init.c:1.67.54.3	Thu Jan  8 22:47:06 2009
+++ src/sys/arch/atari/atari/atari_init.c	Thu Mar 26 17:28:47 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: atari_init.c,v 1.67.54.3 2009/01/08 22:47:06 snj Exp $	*/
+/*	$NetBSD: atari_init.c,v 1.67.54.4 2009/03/26 17:28:47 snj Exp $	*/
 
 /*
  * Copyright (c) 1995 Leo Weppelman
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: atari_init.c,v 1.67.54.3 2009/01/08 22:47:06 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: atari_init.c,v 1.67.54.4 2009/03/26 17:28:47 snj Exp $");
 
 #include "opt_ddb.h"
 #include "opt_mbtype.h"
@@ -475,8 +475,10 @@
 	 */
 	usable_segs[0].start = 0;
 	usable_segs[0].end   = stphysize;
+	usable_segs[0].free_list = VM_FREELIST_STRAM;
 	usable_segs[1].start = ttphystart;
 	usable_segs[1].end   = ttphystart + ttphysize;
+	usable_segs[1].free_list = VM_FREELIST_TTRAM;
 	usable_segs[2].start = usable_segs[2].end = 0; /* End of segments! */
 
 	if(kbase) {

Index: src/sys/arch/atari/atari/pmap_bootstrap.c
diff -u src/sys/arch/atari/atari/pmap_bootstrap.c:1.1.2.2 src/sys/arch/atari/atari/pmap_bootstrap.c:1.1.2.3
--- src/sys/arch/atari/atari/pmap_bootstrap.c:1.1.2.2	Thu Jan  8 22:45:30 2009
+++ src/sys/arch/atari/atari/pmap_bootstrap.c	Thu Mar 26 17:28:47 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_bootstrap.c,v 1.1.2.2 2009/01/08 22:45:30 snj Exp $	*/
+/*	$NetBSD: pmap_bootstrap.c,v 1.1.2.3 2009/03/26 17:28:47 snj Exp $	*/
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -150,7 +150,7 @@
  atop(usable_segs[i].end),
  atop(usable_segs[i].start),
  atop(usable_segs[i].end),
- VM_FREELIST_DEFAULT);
+ usable_segs[i].free_list);
 
 	avail_start = usable_segs[0].start;
 	avail_end   = usable_segs[i - 1].end;

Index: src/sys/arch/atari/include/pmap.h
diff -u src/sys/arch/atari/include/pmap.h:1.36.20.2 src/sys/arch/atari/include/pmap.h:1.36.20.3
--- src/sys/arch/atari/include/pmap.h:1.36.20.2	Thu Jan  8 22:45:30 2009
+++ src/sys/arch/atari/include/pmap.h	Thu Mar 26 17:28:47 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.36.20.2 2009/01/08 22:45:30 snj Exp $	*/
+/*	$NetBSD: pmap.h,v 1.36.20.3 2009/03/26 17:28:47 snj Exp $	*/
 
 /* 
  * Copyright (c) 1991 Regents of the University of California.
@@ -88,6 +88,7 @@
 	paddr_t start;		/* PA of first page in segment	*/
 	paddr_t end;		/* PA of last  page in segment	*/
 	int first_page;	/* relative page# of 'start'	*/
+	int	free_list;	/* Memory priority, lower = faster */
 };
 
 #ifdef	_KERNEL

Index: src/sys/arch/atari/include/vmparam.h
diff -u src/sys/arch/atari/include/vmparam.h:1.21.88.1 src/sys/arch/atari/include/vmparam.h:1.21.88.2
--- src/sys/arch/atari/include/vmparam.h:1.21.88.1	Thu Jan  8 22:45:30 2009
+++ src/sys/arch/atari/include/vmparam.h	Thu Mar 26 17:28:47 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.21.88.1 2009/01/08 22:45:30 snj Exp $	*/
+/*	$NetBSD: vmparam.h,v 1.21.88.2 2009/03/26 17:28:47 snj Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
@@ -166,8 +166,10 @@
 #define VM_PHYSSEG_STRAT	VM_PSTRAT_RANDOM
 #define VM_PHYSSEG_NOADD
 
-#define	VM_NFREELIST		1
+#define	VM_NFREELIST		2
 #define	VM_FREELIST_DEFAULT	0
+#define	VM_FREELIST_TTRAM	VM_FREELIST_DEFAULT
+#define	VM_FREELIST_STRAM	1
 
 #define	__HAVE_PMAP_PHYSSEG
 



CVS commit: [netbsd-5] src/sys/arch/i386

2009-08-07 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Aug  7 18:28:20 UTC 2009

Modified Files:
src/sys/arch/i386 [netbsd-5]: Makefile

Log Message:
Pull up following revision(s) (requested by sborrill in ticket #904):
sys/arch/i386/Makefile: revision 1.37 via patch
For the 'tags' target, use the right path to the Atheros HAL sources.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.35.4.1 src/sys/arch/i386/Makefile

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

Modified files:

Index: src/sys/arch/i386/Makefile
diff -u src/sys/arch/i386/Makefile:1.35 src/sys/arch/i386/Makefile:1.35.4.1
--- src/sys/arch/i386/Makefile:1.35	Sat Oct 25 22:27:37 2008
+++ src/sys/arch/i386/Makefile	Fri Aug  7 18:28:20 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.35 2008/10/25 22:27:37 apb Exp $
+#	$NetBSD: Makefile,v 1.35.4.1 2009/08/07 18:28:20 snj Exp $
 
 # Makefile for i386 tags file and boot blocks
 
@@ -11,9 +11,9 @@
 	${SYSDIR}/arch/i386/mca/*.[ch] \
 	${SYSDIR}/arch/i386/pci/*.[ch] \
 	${SYSDIR}/arch/i386/pnpbios/*.[ch] \
-	${SYSDIR}/contrib/dev/ath/*.[ch] \
-	${SYSDIR}/contrib/dev/ath/netbsd/*.[ch] \
-	${SYSDIR}/contrib/dev/ath/public/*.[ch]
+	${SYSDIR}/external/isc/atheros_hal/dist/*.[ch] \
+	${SYSDIR}/external/isc/atheros_hal/dist/*/*.[ch] \
+	${SYSDIR}/external/isc/atheros_hal/ic/*.[ch]
 SI386+=	${SYSDIR}/arch/x86/x86/*.[ch] \
 	${SYSDIR}/arch/x86/acpi/*.[ch] \
 	${SYSDIR}/arch/x86/include/*.h \



CVS commit: [netbsd-5] src/sys/arch/macppc

2009-08-14 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Aug 14 21:46:15 UTC 2009

Modified Files:
src/sys/arch/macppc [netbsd-5]: Makefile

Log Message:
Pull up following revision(s) (requested by sborrill in ticket #909):
sys/arch/macppc/Makefile: revision 1.9
Update path to the atheros HAL.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.8.4.1 src/sys/arch/macppc/Makefile

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

Modified files:

Index: src/sys/arch/macppc/Makefile
diff -u src/sys/arch/macppc/Makefile:1.8 src/sys/arch/macppc/Makefile:1.8.4.1
--- src/sys/arch/macppc/Makefile:1.8	Sat Oct 25 22:27:37 2008
+++ src/sys/arch/macppc/Makefile	Fri Aug 14 21:46:15 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.8 2008/10/25 22:27:37 apb Exp $
+#	$NetBSD: Makefile,v 1.8.4.1 2009/08/14 21:46:15 snj Exp $
 
 # Makefile for macppc tags file
 
@@ -7,9 +7,9 @@
 		${SYSDIR}/arch/macppc/include/*.h \
 		${SYSDIR}/arch/macppc/dev/*.[ch] \
 		${SYSDIR}/arch/macppc/pci/*.[ch] \
-		${SYSDIR}/contrib/dev/ath/*.[ch] \
-		${SYSDIR}/contrib/dev/ath/netbsd/*.[ch] \
-		${SYSDIR}/contrib/dev/ath/public/*.[ch]
+		${SYSDIR}/external/isc/atheros_hal/dist/*.[ch] \
+		${SYSDIR}/external/isc/atheros_hal/dist/*/*.[ch] \
+		${SYSDIR}/external/isc/atheros_hal/ic/*.[ch]
 SIMACPPC+=	${SYSDIR}/arch/powerpc/powerpc/*.[ch] \
 		${SYSDIR}/arch/powerpc/include/*.h \
 		${SYSDIR}/arch/powerpc/pci/*.[ch]



CVS commit: [netbsd-5] src/sys/arch/cobalt

2009-09-15 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Sep 16 03:40:41 UTC 2009

Modified Files:
src/sys/arch/cobalt/cobalt [netbsd-5]: bus.c
src/sys/arch/cobalt/include [netbsd-5]: bus.h

Log Message:
Pull up following revision(s) (requested by mrg in ticket #952):
sys/arch/cobalt/cobalt/bus.c: revision 1.36
sys/arch/cobalt/include/bus.h: revision 1.23
Add an empty bus_space_mmap(9) function as a workaround
for MI pci(4) mmap function in sys/dev/pci/pci_usrreq.c.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.35.8.1 src/sys/arch/cobalt/cobalt/bus.c
cvs rdiff -u -r1.22 -r1.22.10.1 src/sys/arch/cobalt/include/bus.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/cobalt/cobalt/bus.c
diff -u src/sys/arch/cobalt/cobalt/bus.c:1.35 src/sys/arch/cobalt/cobalt/bus.c:1.35.8.1
--- src/sys/arch/cobalt/cobalt/bus.c:1.35	Wed Jun  4 12:41:40 2008
+++ src/sys/arch/cobalt/cobalt/bus.c	Wed Sep 16 03:40:41 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus.c,v 1.35 2008/06/04 12:41:40 ad Exp $	*/
+/*	$NetBSD: bus.c,v 1.35.8.1 2009/09/16 03:40:41 snj Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.35 2008/06/04 12:41:40 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.35.8.1 2009/09/16 03:40:41 snj Exp $");
 
 #include 
 #include 
@@ -117,6 +117,15 @@
 	return 0;
 }
 
+paddr_t
+bus_space_mmap(bus_space_tag_t t, bus_addr_t addr, off_t off, int prot,
+int flags)
+{
+
+	/* XXX not implemented */
+	return -1;
+}
+
 /*
  * Common function for DMA map creation.  May be called by bus-specific
  * DMA map creation functions.

Index: src/sys/arch/cobalt/include/bus.h
diff -u src/sys/arch/cobalt/include/bus.h:1.22 src/sys/arch/cobalt/include/bus.h:1.22.10.1
--- src/sys/arch/cobalt/include/bus.h:1.22	Mon Apr 28 20:23:16 2008
+++ src/sys/arch/cobalt/include/bus.h	Wed Sep 16 03:40:41 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus.h,v 1.22 2008/04/28 20:23:16 martin Exp $	*/
+/*	$NetBSD: bus.h,v 1.22.10.1 2009/09/16 03:40:41 snj Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -88,6 +88,16 @@
 	bus_size_t offset, bus_size_t size, bus_space_handle_t *nbshp);
 
 /*
+ *	paddr_t bus_space_mmap(bus_space_tag_t t,
+ *  bus_addr_t addr, off_t offset, int prot, int flags);
+ *
+ * Mmap bus space for a user application.
+ */
+
+paddr_t	bus_space_mmap(bus_space_tag_t t, bus_addr_t addr, off_t off, int prot,
+int flags);
+
+/*
  *	int bus_space_alloc(bus_space_tag_t t, bus_addr_t, rstart,
  *	bus_addr_t rend, bus_size_t size, bus_size_t align,
  *	bus_size_t boundary, int flags, bus_addr_t *addrp,



CVS commit: [netbsd-5] src/sys/arch/dreamcast

2009-09-15 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Sep 16 03:41:58 UTC 2009

Modified Files:
src/sys/arch/dreamcast/dev/g2 [netbsd-5]: g2bus_bus_mem.c
src/sys/arch/dreamcast/include [netbsd-5]: bus.h

Log Message:
Pull up following revision(s) (requested by mrg in ticket #952):
sys/arch/dreamcast/dev/g2/g2bus_bus_mem.c: revision 1.15
sys/arch/dreamcast/include/bus.h: revision 1.15
Add an empty bus_space_mmap(9) function as a workaround
for MI pci(4) mmap function in sys/dev/pci/pci_usrreq.c.
XXX: no bus_space_subregion(9) for g2bus.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.14.10.1 src/sys/arch/dreamcast/dev/g2/g2bus_bus_mem.c
cvs rdiff -u -r1.14 -r1.14.10.1 src/sys/arch/dreamcast/include/bus.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/dreamcast/dev/g2/g2bus_bus_mem.c
diff -u src/sys/arch/dreamcast/dev/g2/g2bus_bus_mem.c:1.14 src/sys/arch/dreamcast/dev/g2/g2bus_bus_mem.c:1.14.10.1
--- src/sys/arch/dreamcast/dev/g2/g2bus_bus_mem.c:1.14	Mon Apr 28 20:23:16 2008
+++ src/sys/arch/dreamcast/dev/g2/g2bus_bus_mem.c	Wed Sep 16 03:41:57 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: g2bus_bus_mem.c,v 1.14 2008/04/28 20:23:16 martin Exp $	*/
+/*	$NetBSD: g2bus_bus_mem.c,v 1.14.10.1 2009/09/16 03:41:57 snj Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
  */
 
 #include 			/* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: g2bus_bus_mem.c,v 1.14 2008/04/28 20:23:16 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: g2bus_bus_mem.c,v 1.14.10.1 2009/09/16 03:41:57 snj Exp $");
 
 #include 
 #include 
@@ -53,6 +53,7 @@
 int	g2bus_bus_mem_map(void *, bus_addr_t, bus_size_t, int,
 	bus_space_handle_t *);
 void	g2bus_bus_mem_unmap(void *, bus_space_handle_t, bus_size_t);
+paddr_t	g2bus_bus_mem_mmap(void *, bus_addr_t, off_t, int, int);
 
 uint8_t g2bus_bus_mem_read_1(void *, bus_space_handle_t, bus_size_t);
 uint16_t g2bus_bus_mem_read_2(void *, bus_space_handle_t, bus_size_t);
@@ -114,6 +115,7 @@
 
 	t->dbs_map = g2bus_bus_mem_map;
 	t->dbs_unmap = g2bus_bus_mem_unmap;
+	t->dbs_mmap = g2bus_bus_mem_mmap;
 
 	t->dbs_r_1 = g2bus_bus_mem_read_1;
 	t->dbs_r_2 = g2bus_bus_mem_read_2;
@@ -153,6 +155,14 @@
 	/* Nothing to do. */
 }
 
+paddr_t
+g2bus_bus_mem_mmap(void *v, bus_addr_t addr, off_t offset, int prot, int flags)
+{
+
+	/* XXX not implemented */
+	return -1;
+}
+
 /*
  * G2 bus cycles must not be interrupted by IRQs or G2 DMA.
  * The following paired macros will take the necessary precautions.

Index: src/sys/arch/dreamcast/include/bus.h
diff -u src/sys/arch/dreamcast/include/bus.h:1.14 src/sys/arch/dreamcast/include/bus.h:1.14.10.1
--- src/sys/arch/dreamcast/include/bus.h:1.14	Mon Apr 28 20:23:16 2008
+++ src/sys/arch/dreamcast/include/bus.h	Wed Sep 16 03:41:58 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus.h,v 1.14 2008/04/28 20:23:16 martin Exp $	*/
+/*	$NetBSD: bus.h,v 1.14.10.1 2009/09/16 03:41:58 snj Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 2000, 2001 The NetBSD Foundation, Inc.
@@ -121,6 +121,7 @@
 			bus_size_t);
 	int		(*dbs_subregion)(void *, bus_space_handle_t,
 			bus_size_t, bus_size_t, bus_space_handle_t *);
+	paddr_t		(*dbs_mmap)(void *, bus_addr_t, off_t, int, int);
 
 	/* allocation/deallocation */
 	int		(*dbs_alloc)(void *, bus_addr_t, bus_addr_t,
@@ -270,6 +271,8 @@
 	(*(t)->dbs_unmap)((t)->dbs_cookie, (h), (s))
 #define	bus_space_subregion(t, h, o, s, hp)\
 	(*(t)->dbs_subregion)((t)->dbs_cookie, (h), (o), (s), (hp))
+#define	bus_space_mmap(t, a, o, p, f)\
+	(*(t)->dbs_mmap)((t)->dbs_cookie, (a), (o), (p), (f))
 
 #endif /* _KERNEL */
 



CVS commit: [netbsd-5] src/sys/arch/hp700

2009-09-29 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Sep 29 22:56:48 UTC 2009

Modified Files:
src/sys/arch/hp700/dev [netbsd-5]: dino.c
src/sys/arch/hp700/hp700 [netbsd-5]: mainbus.c
src/sys/arch/hp700/include [netbsd-5]: bus.h

Log Message:
Pull up following revision(s) (requested by skrll in ticket #1035):
sys/arch/hp700/dev/dino.c: revision 1.14 via patch
sys/arch/hp700/hp700/mainbus.c: revision 1.53
sys/arch/hp700/include/bus.h: revision 1.14
Provide bus_space_mmap. Still needs implementing.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.6.4.1 src/sys/arch/hp700/dev/dino.c
cvs rdiff -u -r1.45 -r1.45.6.1 src/sys/arch/hp700/hp700/mainbus.c
cvs rdiff -u -r1.12 -r1.12.54.1 src/sys/arch/hp700/include/bus.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/hp700/dev/dino.c
diff -u src/sys/arch/hp700/dev/dino.c:1.6 src/sys/arch/hp700/dev/dino.c:1.6.4.1
--- src/sys/arch/hp700/dev/dino.c:1.6	Thu Aug 28 08:25:46 2008
+++ src/sys/arch/hp700/dev/dino.c	Tue Sep 29 22:56:48 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: dino.c,v 1.6 2008/08/28 08:25:46 skrll Exp $ */
+/*	$NetBSD: dino.c,v 1.6.4.1 2009/09/29 22:56:48 snj Exp $ */
 
 /*	$OpenBSD: dino.c,v 1.5 2004/02/13 20:39:31 mickey Exp $	*/
 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.6 2008/08/28 08:25:46 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.6.4.1 2009/09/29 22:56:48 snj Exp $");
 
 /* #include "cardbus.h" */
 
@@ -160,6 +160,8 @@
 void dino_free(void *, bus_space_handle_t, bus_size_t);
 void dino_barrier(void *, bus_space_handle_t, bus_size_t, bus_size_t, int);
 void *dino_vaddr(void *, bus_space_handle_t);
+paddr_t dino_mmap(void *, bus_addr_t, off_t, int, int);
+
 u_int8_t dino_r1(void *, bus_space_handle_t, bus_size_t);
 u_int16_t dino_r2(void *, bus_space_handle_t, bus_size_t);
 u_int32_t dino_r4(void *, bus_space_handle_t, bus_size_t);
@@ -568,6 +570,12 @@
 	return bus_space_vaddr(sc->sc_bt, h);
 }
 
+paddr_t
+dino_mmap(void *v, bus_addr_t addr, off_t off, int prot, int flags)
+{
+	return -1;
+}
+
 u_int8_t
 dino_r1(void *v, bus_space_handle_t h, bus_size_t o)
 {
@@ -1399,7 +1407,7 @@
 	NULL,
 
 	NULL, dino_unmap, dino_subregion, NULL, dino_free,
-	dino_barrier, dino_vaddr,
+	dino_barrier, dino_vaddr, dino_mmap,
 	dino_r1,dino_r2,dino_r4,dino_r8,
 	dino_w1,dino_w2,dino_w4,dino_w8,
 	dino_rm_1,  dino_rm_2,  dino_rm_4,  dino_rm_8,

Index: src/sys/arch/hp700/hp700/mainbus.c
diff -u src/sys/arch/hp700/hp700/mainbus.c:1.45 src/sys/arch/hp700/hp700/mainbus.c:1.45.6.1
--- src/sys/arch/hp700/hp700/mainbus.c:1.45	Fri Jun 13 09:41:44 2008
+++ src/sys/arch/hp700/hp700/mainbus.c	Tue Sep 29 22:56:48 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: mainbus.c,v 1.45 2008/06/13 09:41:44 cegger Exp $	*/
+/*	$NetBSD: mainbus.c,v 1.45.6.1 2009/09/29 22:56:48 snj Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.45 2008/06/13 09:41:44 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.45.6.1 2009/09/29 22:56:48 snj Exp $");
 
 #include "locators.h"
 #include "opt_power_switch.h"
@@ -156,6 +156,7 @@
 int mbus_subregion(void *, bus_space_handle_t, bus_size_t, bus_size_t, bus_space_handle_t *);
 void mbus_barrier(void *, bus_space_handle_t, bus_size_t, bus_size_t, int);
 void *mbus_vaddr(void *, bus_space_handle_t);
+paddr_t mbus_mmap(void *, bus_addr_t, off_t, int, int);
 
 int mbus_dmamap_create(void *, bus_size_t, int, bus_size_t, bus_size_t, int, bus_dmamap_t *);
 void mbus_dmamap_destroy(void *, bus_dmamap_t);
@@ -456,6 +457,13 @@
 	return (void*)h;
 }
 
+paddr_t
+mbus_mmap(void *v, bus_addr_t addr, off_t off, int prot, int flags)
+{
+
+	return -1;
+}
+
 u_int8_t
 mbus_r1(void *v, bus_space_handle_t h, bus_size_t o)
 {
@@ -810,7 +818,7 @@
 	NULL,
 
 	mbus_map, mbus_unmap, mbus_subregion, mbus_alloc, mbus_free,
-	mbus_barrier, mbus_vaddr,
+	mbus_barrier, mbus_vaddr, mbus_mmap,
 	mbus_r1,mbus_r2,   mbus_r4,   mbus_r8,
 	mbus_w1,mbus_w2,   mbus_w4,   mbus_w8,
 	mbus_rm_1,  mbus_rm_2, mbus_rm_4, mbus_rm_8,

Index: src/sys/arch/hp700/include/bus.h
diff -u src/sys/arch/hp700/include/bus.h:1.12 src/sys/arch/hp700/include/bus.h:1.12.54.1
--- src/sys/arch/hp700/include/bus.h:1.12	Sun Mar  4 05:59:51 2007
+++ src/sys/arch/hp700/include/bus.h	Tue Sep 29 22:56:48 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus.h,v 1.12 2007/03/04 05:59:51 christos Exp $	*/
+/*	$NetBSD: bus.h,v 1.12.54.1 2009/09/29 22:56:48 snj Exp $	*/
 
 /*	$OpenBSD: bus.h,v 1.13 2001/07/30 14:15:59 art Exp $	*/
 
@@ -64,6 +64,7 @@
 	void (*hbt_barrier)(void *v, bus_space_handle_t h,
  bus_size_t o, bus_size_t l, int op);
 	void *(*hbt_vaddr)(void *, bus_space_handle_t);
+	paddr_t (*hbt_mmap)(void *, bus_addr_t, off_t, int, int);
 
 	u_int8_t  (*hbt_r1)(void *, bus_space_handle_t, bus_size_t);
 	u

CVS commit: [netbsd-5] src/sys/arch/x86

2009-09-29 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Sep 29 23:53:14 UTC 2009

Modified Files:
src/sys/arch/x86/include [netbsd-5]: bus.h isa_machdep.h
src/sys/arch/x86/x86 [netbsd-5]: bus_space.c

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #1040):
sys/arch/x86/include/bus.h: revision 1.18
sys/arch/x86/include/isa_machdep.h: revision 1.7
sys/arch/x86/x86/bus_space.c: revision 1.21
Apply patch proposed on port-amd64/port-i386, allowing to use a 64bit
bus_addr_t on i386PAE kernels:
change bus_addr_t to be a paddr_t (so its size follows paddr_t depending
   on options PAE)
remplace bus_addr_t with vaddr_t where the value is used as a virtual address.
Difference with the proposed patch: cast to uintmax_t and use %jx in
printf() as suggested by Joerg.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.16.10.1 src/sys/arch/x86/include/bus.h
cvs rdiff -u -r1.6 -r1.6.6.1 src/sys/arch/x86/include/isa_machdep.h
cvs rdiff -u -r1.20.4.1 -r1.20.4.2 src/sys/arch/x86/x86/bus_space.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/x86/include/bus.h
diff -u src/sys/arch/x86/include/bus.h:1.16 src/sys/arch/x86/include/bus.h:1.16.10.1
--- src/sys/arch/x86/include/bus.h:1.16	Mon Apr 28 20:23:40 2008
+++ src/sys/arch/x86/include/bus.h	Tue Sep 29 23:53:14 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus.h,v 1.16 2008/04/28 20:23:40 martin Exp $	*/
+/*	$NetBSD: bus.h,v 1.16.10.1 2009/09/29 23:53:14 snj Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -77,11 +77,11 @@
 /*
  * Bus address and size types
  */
-typedef u_long bus_addr_t;
-typedef u_long bus_size_t;
+typedef paddr_t bus_addr_t;
+typedef paddr_t bus_size_t;
 
 typedef	int bus_space_tag_t;
-typedef	u_long bus_space_handle_t;
+typedef	vaddr_t bus_space_handle_t;
 
 int	_x86_memio_map(bus_space_tag_t t, bus_addr_t addr,
 	bus_size_t size, int flags, bus_space_handle_t *bshp);

Index: src/sys/arch/x86/include/isa_machdep.h
diff -u src/sys/arch/x86/include/isa_machdep.h:1.6 src/sys/arch/x86/include/isa_machdep.h:1.6.6.1
--- src/sys/arch/x86/include/isa_machdep.h:1.6	Fri Jun 27 11:03:13 2008
+++ src/sys/arch/x86/include/isa_machdep.h	Tue Sep 29 23:53:14 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: isa_machdep.h,v 1.6 2008/06/27 11:03:13 cegger Exp $	*/
+/*	$NetBSD: isa_machdep.h,v 1.6.6.1 2009/09/29 23:53:14 snj Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -202,19 +202,19 @@
  * function definitions, invoked through the softc.
  */
 
-extern u_long atdevbase;   /* kernel virtual address of "hole" */
+extern vaddr_t atdevbase; /* kernel virtual address of "hole" */
 
 /*
  * Given a kernel virtual address for some location
  * in the "hole" I/O space, return a physical address.
  */
-#define ISA_PHYSADDR(v) ((void *) ((u_long)(v) - atdevbase + IOM_BEGIN))
+#define ISA_PHYSADDR(v) ((bus_addr_t)(v) - atdevbase + IOM_BEGIN)
 
 /*
  * Given a physical address in the "hole",
  * return a kernel virtual address.
  */
-#define ISA_HOLE_VADDR(p)  ((void *) ((u_long)(p) - IOM_BEGIN + atdevbase))
+#define ISA_HOLE_VADDR(p)  ((void *) ((vaddr_t)(p) - IOM_BEGIN + atdevbase))
 
 
 /*

Index: src/sys/arch/x86/x86/bus_space.c
diff -u src/sys/arch/x86/x86/bus_space.c:1.20.4.1 src/sys/arch/x86/x86/bus_space.c:1.20.4.2
--- src/sys/arch/x86/x86/bus_space.c:1.20.4.1	Wed Sep 16 03:45:45 2009
+++ src/sys/arch/x86/x86/bus_space.c	Tue Sep 29 23:53:14 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_space.c,v 1.20.4.1 2009/09/16 03:45:45 snj Exp $	*/
+/*	$NetBSD: bus_space.c,v 1.20.4.2 2009/09/29 23:53:14 snj Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.20.4.1 2009/09/16 03:45:45 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_space.c,v 1.20.4.2 2009/09/29 23:53:14 snj Exp $");
 
 #include 
 #include 
@@ -199,8 +199,8 @@
 	if (error) {
 		if (extent_free(ex, bpa, size, EX_NOWAIT |
 		(ioport_malloc_safe ? EX_MALLOCOK : 0))) {
-			printf("x86_memio_map: pa 0x%lx, size 0x%lx\n",
-			bpa, size);
+			printf("x86_memio_map: pa 0x%jx, size 0x%jx\n",
+			(uintmax_t)bpa, (uintmax_t)size);
 			printf("x86_memio_map: can't free region\n");
 		}
 	}
@@ -286,8 +286,8 @@
 	if (error) {
 		if (extent_free(iomem_ex, bpa, size, EX_NOWAIT |
 		(ioport_malloc_safe ? EX_MALLOCOK : 0))) {
-			printf("x86_memio_alloc: pa 0x%lx, size 0x%lx\n",
-			bpa, size);
+			printf("x86_memio_alloc: pa 0x%jx, size 0x%jx\n",
+			(uintmax_t)bpa, (uintmax_t)size);
 			printf("x86_memio_alloc: can't free region\n");
 		}
 	}
@@ -464,8 +464,9 @@
 ok:
 	if (extent_free(ex, bpa, size,
 	EX_NOWAIT | (ioport_malloc_safe ? EX_MALLOCOK : 0))) {
-		printf("x86_memio_unmap: %s 0x%lx, size 0x%lx\n",
-		(t == X86_BUS_SPACE_IO) ? "port" : "pa", bpa, size);
+

CVS commit: [netbsd-5] src/sys/arch/xen

2009-10-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Oct  3 23:54:05 UTC 2009

Modified Files:
src/sys/arch/xen/conf [netbsd-5]: files.xen
src/sys/arch/xen/include [netbsd-5]: pci_machdep.h xen.h
src/sys/arch/xen/xen [netbsd-5]: hypervisor.c pci_intr_machdep.c
xen_machdep.c
Added Files:
src/sys/arch/xen/xen [netbsd-5]: pciback.c xpci_xenbus.c

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #1054):
sys/arch/xen/conf/files.xen: revision 1.93
sys/arch/xen/include/pci_machdep.h: revision 1.11
sys/arch/xen/include/xen.h: revision 1.31
sys/arch/xen/xen/hypervisor.c: revision 1.44
sys/arch/xen/xen/pci_intr_machdep.c: revision 1.8
sys/arch/xen/xen/pciback.c: revision 1.1
sys/arch/xen/xen/xen_machdep.c: revision 1.5
sys/arch/xen/xen/xpci_xenbus.c: revision 1.1
Work in progress on PCI front-end/back-end support
front-end:
- add a xpci* at xenbus? which provides pci busses from the dom0
  xpci provides support routines for PCI config space operations and
  enumeration in xpci_xenbus.c
- hypervisor.c: do dom0-style PCI attach only ifdef DOM0OPS
- pci_intr_machdep.c:  check line value only if DOM0OPS
back-end:
- add a pciback* at pci? device which takes precedences over all
  other PCI devices (match return 500) and matches all devices passed
  to pciback.hide option on boot command line.
  It exports the PCI device informations to files in /kern/xen/pci/
- hypervisor.c: create /kern/xen earlier so pciback can create its
  entries while PCI devices are probed
- xen_machdep.c: add handling for pciback.hide=
frontend is know working on Xen 3.1.x dom0 with ahc(4) and pciide(4)
devices. uhci(4) fail when trying to allocate a large contigous DMA
buffer.
backend is work in progress; support in xentools is not there yet.


To generate a diff of this commit:
cvs rdiff -u -r1.88.4.4 -r1.88.4.5 src/sys/arch/xen/conf/files.xen
cvs rdiff -u -r1.10 -r1.10.8.1 src/sys/arch/xen/include/pci_machdep.h
cvs rdiff -u -r1.30 -r1.30.4.1 src/sys/arch/xen/include/xen.h
cvs rdiff -u -r1.42.4.1 -r1.42.4.2 src/sys/arch/xen/xen/hypervisor.c
cvs rdiff -u -r1.7 -r1.7.6.1 src/sys/arch/xen/xen/pci_intr_machdep.c
cvs rdiff -u -r0 -r1.4.6.2 src/sys/arch/xen/xen/pciback.c
cvs rdiff -u -r1.4 -r1.4.8.1 src/sys/arch/xen/xen/xen_machdep.c
cvs rdiff -u -r0 -r1.2.6.2 src/sys/arch/xen/xen/xpci_xenbus.c

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

Modified files:

Index: src/sys/arch/xen/conf/files.xen
diff -u src/sys/arch/xen/conf/files.xen:1.88.4.4 src/sys/arch/xen/conf/files.xen:1.88.4.5
--- src/sys/arch/xen/conf/files.xen:1.88.4.4	Fri Jun 19 21:22:11 2009
+++ src/sys/arch/xen/conf/files.xen	Sat Oct  3 23:54:04 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: files.xen,v 1.88.4.4 2009/06/19 21:22:11 snj Exp $
+#	$NetBSD: files.xen,v 1.88.4.5 2009/10/03 23:54:04 snj Exp $
 #	NetBSD: files.x86,v 1.10 2003/10/08 17:30:00 bouyer Exp 
 #	NetBSD: files.i386,v 1.254 2004/03/25 23:32:10 jmc Exp 
 
@@ -67,7 +67,7 @@
 file	crypto/blowfish/arch/i386/bf_enc.S	blowfish
 file	crypto/blowfish/arch/i386/bf_cbc.S	blowfish
 elifdef amd64
-file	arch/amd64/amd64/busfunc.S		dom0ops
+file	arch/amd64/amd64/busfunc.S
 file	arch/amd64/amd64/cpufunc.S
 file	arch/amd64/amd64/cpu_in_cksum.S		(inet | inet6) & cpu_in_cksum
 file	arch/amd64/amd64/db_disasm.c		ddb
@@ -216,6 +216,11 @@
 #file	arch/xen/xen/xbd.c		xbd | xbd_hypervisor | xbd_xenbus needs-flag
 file	arch/xen/xen/xbd.c		xbd_hypervisor needs-flag
 
+# PCI frontend
+device xpci: pcibus
+attach xpci at xenbus with xpci_xenbus
+file	arch/xen/xen/xpci_xenbus.c	xpci_xenbus
+
 # Non-Xen specific devices and options
 
 include	"dev/pckbport/files.pckbport"
@@ -228,6 +233,11 @@
 include "dev/pci/files.agp"
 file	arch/xen/xen/pciide_machdep.c	pciide_common
 
+device	pciback {unit = -1}
+attach	pciback at pci
+file	arch/xen/xen/pciback.c		pciback
+
+
 # x86 specific PCI hardware
 include "arch/x86/pci/files.pci"
 
@@ -381,7 +391,7 @@
 file	arch/xen/xen/xbdback.c		dom0ops & !xen3
 file	arch/xen/xen/xennetback.c	dom0ops & !xen3
 file	arch/xen/xen/pci_machdep.c	hypervisor & pci & !xen3
-file	arch/x86/pci/pci_machdep.c	hypervisor & pci & xen3
+file	arch/x86/pci/pci_machdep.c	hypervisor & pci & xen3 & dom0ops
 file	arch/xen/xen/pci_intr_machdep.c	hypervisor & pci
 file	arch/xen/xen/isa_machdep.c	hypervisor & dom0ops
 file	arch/xen/xen/xenevt.c		xenevt & dom0ops

Index: src/sys/arch/xen/include/pci_machdep.h
diff -u src/sys/arch/xen/include/pci_machdep.h:1.10 src/sys/arch/xen/include/pci_machdep.h:1.10.8.1
--- src/sys/arch/xen/include/pci_machdep.h:1.10	Fri May 30 16:22:51 2008
+++ src/sys/arch/xen/include/pci_machdep.h	Sat Oct  3 23:54:05 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_machdep.h,v 1.10 2008/05/30 16:22:51 cegger Exp $ */
+/* $NetBSD: pci_machdep.h,v 1.10.8.1 2009/10/03 23:54:05 snj Exp $ */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -64,6 +64,

CVS commit: [netbsd-5] src/sys/arch/xen

2009-10-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Oct  4 00:03:20 UTC 2009

Modified Files:
src/sys/arch/xen/x86 [netbsd-5]: intr.c
src/sys/arch/xen/xen [netbsd-5]: isa_machdep.c pci_intr_machdep.c
pciide_machdep.c

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #1054):
sys/arch/xen/x86/intr.c: revision 1.22
sys/arch/xen/xen/isa_machdep.c: revision 1.14
sys/arch/xen/xen/pci_intr_machdep.c: revision 1.9
sys/arch/xen/xen/pciide_machdep.c: revision 1.12
When ioapic is used, for ISA interrupts, reuse the legacy ISA interrupt
number instead of allocating a new one. Force allocating a new interrupt number
for PCI devices, as the number stored in the PCI interrupt register
may be wrong.
This should help using a pciide controller in compat mode or ISA devices
in a non-0 domain.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.21.4.1 src/sys/arch/xen/x86/intr.c
cvs rdiff -u -r1.12 -r1.12.6.1 src/sys/arch/xen/xen/isa_machdep.c
cvs rdiff -u -r1.7.6.1 -r1.7.6.2 src/sys/arch/xen/xen/pci_intr_machdep.c
cvs rdiff -u -r1.11 -r1.11.6.1 src/sys/arch/xen/xen/pciide_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/xen/x86/intr.c
diff -u src/sys/arch/xen/x86/intr.c:1.21 src/sys/arch/xen/x86/intr.c:1.21.4.1
--- src/sys/arch/xen/x86/intr.c:1.21	Fri Sep  5 13:37:24 2008
+++ src/sys/arch/xen/x86/intr.c	Sun Oct  4 00:03:19 2009
@@ -103,7 +103,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.21 2008/09/05 13:37:24 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.21.4.1 2009/10/04 00:03:19 snj Exp $");
 
 #include "opt_multiprocessor.h"
 #include "opt_xen.h"
@@ -268,12 +268,14 @@
 		irq = vect2irq[ioapic->sc_pins[pin].ip_vector];
 		if (ioapic->sc_pins[pin].ip_vector == 0 || irq == 0) {
 			/* allocate IRQ */
-			irq = xen_next_irq--;
+			irq = APIC_IRQ_LEGACY_IRQ(*pirq);
+			if (irq <= 0 || irq > 15)
+irq = xen_next_irq--;
 			/* allocate vector and route interrupt */
 			op.cmd = PHYSDEVOP_ASSIGN_VECTOR;
 			op.u.irq_op.irq = irq;
 			if (HYPERVISOR_physdev_op(&op) < 0)
-panic("PHYSDEVOP_ASSIGN_VECTOR");
+panic("PHYSDEVOP_ASSIGN_VECTOR irq %d", irq);
 			irq2vect[irq] = op.u.irq_op.vector;
 			vect2irq[op.u.irq_op.vector] = irq;
 			pic->pic_addroute(pic, &phycpu_info_primary, pin,

Index: src/sys/arch/xen/xen/isa_machdep.c
diff -u src/sys/arch/xen/xen/isa_machdep.c:1.12 src/sys/arch/xen/xen/isa_machdep.c:1.12.6.1
--- src/sys/arch/xen/xen/isa_machdep.c:1.12	Thu Jul  3 15:44:19 2008
+++ src/sys/arch/xen/xen/isa_machdep.c	Sun Oct  4 00:03:20 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: isa_machdep.c,v 1.12 2008/07/03 15:44:19 drochner Exp $	*/
+/*	$NetBSD: isa_machdep.c,v 1.12.6.1 2009/10/04 00:03:20 snj Exp $	*/
 /*	NetBSD isa_machdep.c,v 1.11 2004/06/20 18:04:08 thorpej Exp 	*/
 
 /*-
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: isa_machdep.c,v 1.12 2008/07/03 15:44:19 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isa_machdep.c,v 1.12.6.1 2009/10/04 00:03:20 snj Exp $");
 
 #include 
 #include 
@@ -159,7 +159,7 @@
 	struct ioapic_softc *pic = NULL;
 #endif
 
-	ih.pirq = irq;
+	ih.pirq = 0;
 
 #if NIOAPIC > 0
 	if (mp_busses != NULL) {
@@ -178,6 +178,7 @@
 			printf("isa_intr_establish: no MP mapping found\n");
 	}
 #endif
+	ih.pirq |= (irq & 0xff);
 
 	evtch = xen_intr_map(&ih.pirq, type);
 	if (evtch == -1)

Index: src/sys/arch/xen/xen/pci_intr_machdep.c
diff -u src/sys/arch/xen/xen/pci_intr_machdep.c:1.7.6.1 src/sys/arch/xen/xen/pci_intr_machdep.c:1.7.6.2
--- src/sys/arch/xen/xen/pci_intr_machdep.c:1.7.6.1	Sat Oct  3 23:54:05 2009
+++ src/sys/arch/xen/xen/pci_intr_machdep.c	Sun Oct  4 00:03:20 2009
@@ -1,4 +1,4 @@
-/*  $NetBSD: pci_intr_machdep.c,v 1.7.6.1 2009/10/03 23:54:05 snj Exp $  */
+/*  $NetBSD: pci_intr_machdep.c,v 1.7.6.2 2009/10/04 00:03:20 snj Exp $  */
 
 /*
  * Copyright (c) 2005 Manuel Bouyer.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_intr_machdep.c,v 1.7.6.1 2009/10/03 23:54:05 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_intr_machdep.c,v 1.7.6.2 2009/10/04 00:03:20 snj Exp $");
 
 #include 
 #include 
@@ -109,8 +109,8 @@
 	pci_decompose_tag(pc, pa->pa_tag, &bus, &dev, &func);
 	if (mp_busses != NULL) {
 		if (intr_find_mpmapping(bus, (dev<<2)|(rawpin-1), ihp) == 0) {
-			if ((ihp->pirq & 0xff) == 0)
-ihp->pirq |= line;
+			/* make sure a new IRQ will be allocated */
+			ihp->pirq &= ~0xff;
 			goto end;
 		}
 		/*

Index: src/sys/arch/xen/xen/pciide_machdep.c
diff -u src/sys/arch/xen/xen/pciide_machdep.c:1.11 src/sys/arch/xen/xen/pciide_machdep.c:1.11.6.1
--- src/sys/arch/xen/xen/pciide_machdep.c:1.11	Thu Jul  3 15:44:19 2008
+++ src/sys/arch/xen/xen/pciide_machdep.c	Sun Oct  4 00:03:20 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pciide_machdep.c,v 1.11 2008/07/03 15:44:19 drochner Exp $	*/
+/*	$NetBSD: pciide_machdep.c

CVS commit: [netbsd-5] src/sys/arch/x86

2009-10-05 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Mon Oct  5 10:34:07 UTC 2009

Modified Files:
src/sys/arch/x86/include [netbsd-5]: cpuvar.h
src/sys/arch/x86/x86 [netbsd-5]: est.c intel_busclock.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #1059):
sys/arch/x86/include/cpuvar.h:  1.30
sys/arch/x86/x86/est.c: 1.12
sys/arch/x86/x86/intel_busclock.c: 1.8

Use the TSC and current multiplier to calculate bus clock on VIA C7 Esther.
Probably needed for all C7 and Nano processors, but to be safe only use this
alternate method on Esther for now.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.27.8.1 src/sys/arch/x86/include/cpuvar.h
cvs rdiff -u -r1.9 -r1.9.10.1 src/sys/arch/x86/x86/est.c
cvs rdiff -u -r1.5.10.1 -r1.5.10.2 src/sys/arch/x86/x86/intel_busclock.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/x86/include/cpuvar.h
diff -u src/sys/arch/x86/include/cpuvar.h:1.27 src/sys/arch/x86/include/cpuvar.h:1.27.8.1
--- src/sys/arch/x86/include/cpuvar.h:1.27	Tue May 13 22:39:17 2008
+++ src/sys/arch/x86/include/cpuvar.h	Mon Oct  5 10:34:07 2009
@@ -1,4 +1,4 @@
-/* 	$NetBSD: cpuvar.h,v 1.27 2008/05/13 22:39:17 ad Exp $ */
+/* 	$NetBSD: cpuvar.h,v 1.27.8.1 2009/10/05 10:34:07 sborrill Exp $ */
 
 /*-
  * Copyright (c) 2000, 2007 The NetBSD Foundation, Inc.
@@ -127,6 +127,7 @@
 #ifdef ENHANCED_SPEEDSTEP
 void	est_init(int);
 int	via_get_bus_clock(struct cpu_info *);
+int	viac7_get_bus_clock(struct cpu_info *);
 int	p3_get_bus_clock(struct cpu_info *);
 int	p4_get_bus_clock(struct cpu_info *);
 #endif

Index: src/sys/arch/x86/x86/est.c
diff -u src/sys/arch/x86/x86/est.c:1.9 src/sys/arch/x86/x86/est.c:1.9.10.1
--- src/sys/arch/x86/x86/est.c:1.9	Mon Apr 28 20:23:40 2008
+++ src/sys/arch/x86/x86/est.c	Mon Oct  5 10:34:07 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: est.c,v 1.9 2008/04/28 20:23:40 martin Exp $	*/
+/*	$NetBSD: est.c,v 1.9.10.1 2009/10/05 10:34:07 sborrill Exp $	*/
 /*
  * Copyright (c) 2003 Michael Eriksson.
  * All rights reserved.
@@ -81,7 +81,7 @@
 /* #define EST_DEBUG */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: est.c,v 1.9 2008/04/28 20:23:40 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: est.c,v 1.9.10.1 2009/10/05 10:34:07 sborrill Exp $");
 
 #include 
 #include 
@@ -1088,9 +1088,17 @@
 	if (CPUID2FAMILY(curcpu()->ci_signature) == 15)
 		bus_clock = p4_get_bus_clock(curcpu());
 	else if (CPUID2FAMILY(curcpu()->ci_signature) == 6) {
-		if (vendor == CPUVENDOR_IDT)
-			bus_clock = via_get_bus_clock(curcpu());
-		else
+		if (vendor == CPUVENDOR_IDT) {
+			switch (CPUID2MODEL(curcpu()->ci_signature)) {
+			case 0xa: /* C7 Esther */
+			case 0xd: /* C7 Esther */
+bus_clock = viac7_get_bus_clock(curcpu());
+break;
+			default:
+bus_clock = via_get_bus_clock(curcpu());
+break;
+			}
+		} else
 			bus_clock = p3_get_bus_clock(curcpu());
 	}
 

Index: src/sys/arch/x86/x86/intel_busclock.c
diff -u src/sys/arch/x86/x86/intel_busclock.c:1.5.10.1 src/sys/arch/x86/x86/intel_busclock.c:1.5.10.2
--- src/sys/arch/x86/x86/intel_busclock.c:1.5.10.1	Fri Nov 14 02:49:37 2008
+++ src/sys/arch/x86/x86/intel_busclock.c	Mon Oct  5 10:34:07 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: intel_busclock.c,v 1.5.10.1 2008/11/14 02:49:37 snj Exp $	*/
+/*	$NetBSD: intel_busclock.c,v 1.5.10.2 2009/10/05 10:34:07 sborrill Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intel_busclock.c,v 1.5.10.1 2008/11/14 02:49:37 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_busclock.c,v 1.5.10.2 2009/10/05 10:34:07 sborrill Exp $");
 
 #include 
 #include 
@@ -72,6 +72,21 @@
 }
 
 int
+viac7_get_bus_clock(struct cpu_info *ci)
+{
+	uint64_t msr;
+	int mult;
+
+	msr = rdmsr(MSR_PERF_STATUS);
+	mult = (msr >> 8) & 0xff;
+	if (mult == 0)
+		return 0;
+
+	return ((ci->ci_data.cpu_cc_freq + 1000) / 1000 * 1000) /
+		 mult / 1;
+}
+
+int
 p3_get_bus_clock(struct cpu_info *ci)
 {
 	uint64_t msr;



CVS commit: [netbsd-5] src/sys/arch/sparc

2009-10-18 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Oct 18 13:43:46 UTC 2009

Modified Files:
src/sys/arch/sparc/include [netbsd-5]: bus.h
src/sys/arch/sparc/sparc [netbsd-5]: machdep.c

Log Message:
Pull up following revision(s) (requested by macallan in ticket #969):
sys/arch/sparc/include/bus.h: revision 1.56
sys/arch/sparc/sparc/machdep.c: revision 1.294
do as phone suggested - remove sparc_bus_map_large() again and use a =20=
flag
instead ( BUS_SPACE_MAP_LARGE )


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.54.10.1 src/sys/arch/sparc/include/bus.h
cvs rdiff -u -r1.282.4.1 -r1.282.4.2 src/sys/arch/sparc/sparc/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/sparc/include/bus.h
diff -u src/sys/arch/sparc/include/bus.h:1.54 src/sys/arch/sparc/include/bus.h:1.54.10.1
--- src/sys/arch/sparc/include/bus.h:1.54	Mon Apr 28 20:23:36 2008
+++ src/sys/arch/sparc/include/bus.h	Sun Oct 18 13:43:45 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus.h,v 1.54 2008/04/28 20:23:36 martin Exp $	*/
+/*	$NetBSD: bus.h,v 1.54.10.1 2009/10/18 13:43:45 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -245,6 +245,7 @@
 void (*)(void));	/*optional fast vector*/
 
 
+
 static __inline int
 bus_space_map(t, a, s, f, hp)
 	bus_space_tag_t	t;
@@ -352,7 +353,7 @@
 #define BUS_SPACE_MAP_BUS1	0x0100	/* placeholders for bus functions... */
 #define BUS_SPACE_MAP_BUS2	0x0200
 #define BUS_SPACE_MAP_BUS3	0x0400
-#define BUS_SPACE_MAP_BUS4	0x0800
+#define BUS_SPACE_MAP_LARGE	0x0800	/* map outside IODEV range */
 
 
 /* flags for bus_space_barrier() */

Index: src/sys/arch/sparc/sparc/machdep.c
diff -u src/sys/arch/sparc/sparc/machdep.c:1.282.4.1 src/sys/arch/sparc/sparc/machdep.c:1.282.4.2
--- src/sys/arch/sparc/sparc/machdep.c:1.282.4.1	Mon Feb  2 03:30:33 2009
+++ src/sys/arch/sparc/sparc/machdep.c	Sun Oct 18 13:43:45 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.282.4.1 2009/02/02 03:30:33 snj Exp $ */
+/*	$NetBSD: machdep.c,v 1.282.4.2 2009/10/18 13:43:45 bouyer Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.282.4.1 2009/02/02 03:30:33 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.282.4.2 2009/10/18 13:43:45 bouyer Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_compat_sunos.h"
@@ -2127,8 +2127,8 @@
 	return (EINVAL);
 }
 
-int
-sparc_bus_map(bus_space_tag_t t, bus_addr_t ba, bus_size_t size, int flags,
+static int
+sparc_bus_map_iodev(bus_space_tag_t t, bus_addr_t ba, bus_size_t size, int flags,
 	  vaddr_t va, bus_space_handle_t *hp)
 {
 	vaddr_t v;
@@ -2194,11 +2194,44 @@
 	return (0);
 }
 
+static int
+sparc_bus_map_large(bus_space_tag_t t, bus_addr_t ba,
+		bus_size_t size, int flags, bus_space_handle_t *hp)
+{
+	vaddr_t v = 0;
+
+	if (uvm_map(kernel_map, &v, size, NULL, 0, PAGE_SIZE,
+	UVM_MAPFLAG(UVM_PROT_RW, UVM_PROT_RW, UVM_INH_SHARE, UVM_ADV_NORMAL,
+			0)) == 0) {
+		return sparc_bus_map_iodev(t, ba, size, flags, v, hp);
+	}
+	return -1;
+}
+
+int
+sparc_bus_map(bus_space_tag_t t, bus_addr_t ba,
+		bus_size_t size, int flags, vaddr_t va,
+		bus_space_handle_t *hp)
+{
+
+	if (flags & BUS_SPACE_MAP_LARGE) {
+		return sparc_bus_map_large(t, ba, size, flags, hp);
+	} else
+		return sparc_bus_map_iodev(t, ba, size, flags, va, hp);
+		
+}
+
 int
 sparc_bus_unmap(bus_space_tag_t t, bus_space_handle_t bh, bus_size_t size)
 {
 	vaddr_t va = trunc_page((vaddr_t)bh);
 
+	/*
+	 * XXX
+	 * mappings with BUS_SPACE_MAP_LARGE need additional care here
+	 * we can just check if the VA is in the IODEV range
+	 */
+
 	pmap_kremove(va, round_page(size));
 	pmap_update(pmap_kernel());
 	return (0);



CVS commit: [netbsd-5] src/sys/arch/sparc

2009-10-18 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Oct 18 14:40:40 UTC 2009

Modified Files:
src/sys/arch/sparc/include [netbsd-5]: bus.h
src/sys/arch/sparc/sparc [netbsd-5]: machdep.c

Log Message:
Back out ticket 969


To generate a diff of this commit:
cvs rdiff -u -r1.54.10.1 -r1.54.10.2 src/sys/arch/sparc/include/bus.h
cvs rdiff -u -r1.282.4.2 -r1.282.4.3 src/sys/arch/sparc/sparc/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/sparc/include/bus.h
diff -u src/sys/arch/sparc/include/bus.h:1.54.10.1 src/sys/arch/sparc/include/bus.h:1.54.10.2
--- src/sys/arch/sparc/include/bus.h:1.54.10.1	Sun Oct 18 13:43:45 2009
+++ src/sys/arch/sparc/include/bus.h	Sun Oct 18 14:40:40 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus.h,v 1.54.10.1 2009/10/18 13:43:45 bouyer Exp $	*/
+/*	$NetBSD: bus.h,v 1.54.10.2 2009/10/18 14:40:40 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -245,7 +245,6 @@
 void (*)(void));	/*optional fast vector*/
 
 
-
 static __inline int
 bus_space_map(t, a, s, f, hp)
 	bus_space_tag_t	t;
@@ -353,7 +352,7 @@
 #define BUS_SPACE_MAP_BUS1	0x0100	/* placeholders for bus functions... */
 #define BUS_SPACE_MAP_BUS2	0x0200
 #define BUS_SPACE_MAP_BUS3	0x0400
-#define BUS_SPACE_MAP_LARGE	0x0800	/* map outside IODEV range */
+#define BUS_SPACE_MAP_BUS4	0x0800
 
 
 /* flags for bus_space_barrier() */

Index: src/sys/arch/sparc/sparc/machdep.c
diff -u src/sys/arch/sparc/sparc/machdep.c:1.282.4.2 src/sys/arch/sparc/sparc/machdep.c:1.282.4.3
--- src/sys/arch/sparc/sparc/machdep.c:1.282.4.2	Sun Oct 18 13:43:45 2009
+++ src/sys/arch/sparc/sparc/machdep.c	Sun Oct 18 14:40:40 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.282.4.2 2009/10/18 13:43:45 bouyer Exp $ */
+/*	$NetBSD: machdep.c,v 1.282.4.3 2009/10/18 14:40:40 bouyer Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.282.4.2 2009/10/18 13:43:45 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.282.4.3 2009/10/18 14:40:40 bouyer Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_compat_sunos.h"
@@ -2127,8 +2127,8 @@
 	return (EINVAL);
 }
 
-static int
-sparc_bus_map_iodev(bus_space_tag_t t, bus_addr_t ba, bus_size_t size, int flags,
+int
+sparc_bus_map(bus_space_tag_t t, bus_addr_t ba, bus_size_t size, int flags,
 	  vaddr_t va, bus_space_handle_t *hp)
 {
 	vaddr_t v;
@@ -2194,44 +2194,11 @@
 	return (0);
 }
 
-static int
-sparc_bus_map_large(bus_space_tag_t t, bus_addr_t ba,
-		bus_size_t size, int flags, bus_space_handle_t *hp)
-{
-	vaddr_t v = 0;
-
-	if (uvm_map(kernel_map, &v, size, NULL, 0, PAGE_SIZE,
-	UVM_MAPFLAG(UVM_PROT_RW, UVM_PROT_RW, UVM_INH_SHARE, UVM_ADV_NORMAL,
-			0)) == 0) {
-		return sparc_bus_map_iodev(t, ba, size, flags, v, hp);
-	}
-	return -1;
-}
-
-int
-sparc_bus_map(bus_space_tag_t t, bus_addr_t ba,
-		bus_size_t size, int flags, vaddr_t va,
-		bus_space_handle_t *hp)
-{
-
-	if (flags & BUS_SPACE_MAP_LARGE) {
-		return sparc_bus_map_large(t, ba, size, flags, hp);
-	} else
-		return sparc_bus_map_iodev(t, ba, size, flags, va, hp);
-		
-}
-
 int
 sparc_bus_unmap(bus_space_tag_t t, bus_space_handle_t bh, bus_size_t size)
 {
 	vaddr_t va = trunc_page((vaddr_t)bh);
 
-	/*
-	 * XXX
-	 * mappings with BUS_SPACE_MAP_LARGE need additional care here
-	 * we can just check if the VA is in the IODEV range
-	 */
-
 	pmap_kremove(va, round_page(size));
 	pmap_update(pmap_kernel());
 	return (0);



CVS commit: [netbsd-5] src/sys/arch/sparc64

2009-10-19 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Mon Oct 19 07:25:45 UTC 2009

Modified Files:
src/sys/arch/sparc64/include [netbsd-5]: userret.h
src/sys/arch/sparc64/sparc64 [netbsd-5]: trap.c

Log Message:
Pull up the following revisions(s) (requested by nakayama in ticket #1103):
sys/arch/sparc64/include/userret.h: revision 1.9
sys/arch/sparc64/sparc64/trap.c:revision 1.158

Merge want_ast check in userret() into trap handler, and repeat preempt()
call while want_resched is true.  While there remove unnecessary #if 1. This
should fix a performance degradation of disk I/O on heavy load.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.8.6.1 src/sys/arch/sparc64/include/userret.h
cvs rdiff -u -r1.155 -r1.155.4.1 src/sys/arch/sparc64/sparc64/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/sparc64/include/userret.h
diff -u src/sys/arch/sparc64/include/userret.h:1.8 src/sys/arch/sparc64/include/userret.h:1.8.6.1
--- src/sys/arch/sparc64/include/userret.h:1.8	Mon Jun 30 14:12:20 2008
+++ src/sys/arch/sparc64/include/userret.h	Mon Oct 19 07:25:44 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: userret.h,v 1.8 2008/06/30 14:12:20 nakayama Exp $ */
+/*	$NetBSD: userret.h,v 1.8.6.1 2009/10/19 07:25:44 sborrill Exp $ */
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath.  All rights reserved.
@@ -63,14 +63,6 @@
 
 	mi_userret(l);
 
-	if (want_ast) {
-		want_ast = 0;
-		if (l->l_pflag & LP_OWEUPC) {
-			l->l_pflag &= ~LP_OWEUPC;
-			ADDUPROF(l);
-		}
-	}
-
 	/*
 	 * If profiling, charge recent system time to the trapped pc.
 	 */

Index: src/sys/arch/sparc64/sparc64/trap.c
diff -u src/sys/arch/sparc64/sparc64/trap.c:1.155 src/sys/arch/sparc64/sparc64/trap.c:1.155.4.1
--- src/sys/arch/sparc64/sparc64/trap.c:1.155	Wed Oct 15 06:51:19 2008
+++ src/sys/arch/sparc64/sparc64/trap.c	Mon Oct 19 07:25:44 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.155 2008/10/15 06:51:19 wrstuden Exp $ */
+/*	$NetBSD: trap.c,v 1.155.4.1 2009/10/19 07:25:44 sborrill Exp $ */
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath.  All rights reserved.
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.155 2008/10/15 06:51:19 wrstuden Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.155.4.1 2009/10/19 07:25:44 sborrill Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -618,12 +618,14 @@
 #endif
 
 	case T_AST:
-#if 1
-		if (want_resched)
+		if (l->l_pflag & LP_OWEUPC) {
+			l->l_pflag &= ~LP_OWEUPC;
+			ADDUPROF(l);
+		}
+		while (want_resched)
 			preempt();
 		want_ast = 0;
-#endif
-		break;	/* the work is all in userret() */
+		break;
 
 	case T_ILLINST:
 	case T_INST_EXCEPT:



CVS commit: [netbsd-5] src/sys/arch/sparc64

2009-06-05 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Jun  5 18:28:34 UTC 2009

Modified Files:
src/sys/arch/sparc64/include [netbsd-5]: cpu.h
src/sys/arch/sparc64/sparc64 [netbsd-5]: locore.s vm_machdep.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #786):
sys/arch/sparc64/include/cpu.h: revision 1.86
sys/arch/sparc64/sparc64/locore.s: revision 1.291
sys/arch/sparc64/sparc64/vm_machdep.c: revision 1.89
cpu_setfunc() can not use lwp_trampoline, as that has additional lwp startup
semantics. Use a simpler setfunc_trampoline instead.


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.84.4.1 src/sys/arch/sparc64/include/cpu.h
cvs rdiff -u -r1.286 -r1.286.2.1 src/sys/arch/sparc64/sparc64/locore.s
cvs rdiff -u -r1.84.4.1 -r1.84.4.2 src/sys/arch/sparc64/sparc64/vm_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/sparc64/include/cpu.h
diff -u src/sys/arch/sparc64/include/cpu.h:1.84 src/sys/arch/sparc64/include/cpu.h:1.84.4.1
--- src/sys/arch/sparc64/include/cpu.h:1.84	Sun Oct  5 01:53:05 2008
+++ src/sys/arch/sparc64/include/cpu.h	Fri Jun  5 18:28:34 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.84 2008/10/05 01:53:05 nakayama Exp $ */
+/*	$NetBSD: cpu.h,v 1.84.4.1 2009/06/05 18:28:34 snj Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -338,7 +338,6 @@
 #define	 write_all_windows() __asm volatile("flushw" : : )
 #define	 write_user_windows() __asm volatile("flushw" : : )
 
-void 	lwp_trampoline(void);
 struct pcb;
 void	snapshot(struct pcb *);
 struct frame *getfp(void);

Index: src/sys/arch/sparc64/sparc64/locore.s
diff -u src/sys/arch/sparc64/sparc64/locore.s:1.286 src/sys/arch/sparc64/sparc64/locore.s:1.286.2.1
--- src/sys/arch/sparc64/sparc64/locore.s:1.286	Thu Oct 30 12:29:45 2008
+++ src/sys/arch/sparc64/sparc64/locore.s	Fri Jun  5 18:28:34 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.286 2008/10/30 12:29:45 nakayama Exp $	*/
+/*	$NetBSD: locore.s,v 1.286.2.1 2009/06/05 18:28:34 snj Exp $	*/
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath
@@ -6814,6 +6814,16 @@
 	ba,a,pt	%icc, return_from_trap
 	 nop
 
+	/*
+	 * Like lwp_trampoline, but for cpu_setfunc(), i.e. without newlwp
+	 * arguement and will not call lwp_startup.
+	 */
+ENTRY(setfunc_trampoline)
+	call	%l0			! re-use current frame
+	 mov	%l1, %o0
+	ba,a,pt	%icc, return_from_trap
+	 nop
+
 /*
  * {fu,su}{,i}{byte,word}
  */

Index: src/sys/arch/sparc64/sparc64/vm_machdep.c
diff -u src/sys/arch/sparc64/sparc64/vm_machdep.c:1.84.4.1 src/sys/arch/sparc64/sparc64/vm_machdep.c:1.84.4.2
--- src/sys/arch/sparc64/sparc64/vm_machdep.c:1.84.4.1	Tue May 26 19:19:53 2009
+++ src/sys/arch/sparc64/sparc64/vm_machdep.c	Fri Jun  5 18:28:34 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm_machdep.c,v 1.84.4.1 2009/05/26 19:19:53 snj Exp $ */
+/*	$NetBSD: vm_machdep.c,v 1.84.4.2 2009/06/05 18:28:34 snj Exp $ */
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath.  All rights reserved.
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.84.4.1 2009/05/26 19:19:53 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.84.4.2 2009/06/05 18:28:34 snj Exp $");
 
 #include "opt_multiprocessor.h"
 #include "opt_coredump.h"
@@ -162,6 +162,7 @@
 char cpu_forkname[] = "cpu_lwp_fork()";
 #endif
 
+void setfunc_trampoline(void);
 inline void
 cpu_setfunc(struct lwp *l, void (*func)(void *), void *arg)
 {
@@ -171,9 +172,8 @@
 	rp = (struct rwindow *)((u_long)npcb + TOPFRAMEOFF);
 	rp->rw_local[0] = (long)func;		/* Function to call */
 	rp->rw_local[1] = (long)arg;		/* and its argument */
-	rp->rw_local[2] = (long)l;		/* new lwp */
 
-	npcb->pcb_pc = (long)lwp_trampoline - 8;
+	npcb->pcb_pc = (long)setfunc_trampoline - 8;
 	npcb->pcb_sp = (long)rp - STACK_OFFSET;
 }
 
@@ -195,6 +195,7 @@
  * in both the stack and stacksize args), set up the user stack pointer
  * accordingly.
  */
+void lwp_trampoline(void);
 void
 cpu_lwp_fork(l1, l2, stack, stacksize, func, arg)
 	register struct lwp *l1, *l2;
@@ -284,7 +285,12 @@
 	rp = (struct rwindow *)((u_long)npcb + TOPFRAMEOFF);
 	*rp = *(struct rwindow *)((u_long)opcb + TOPFRAMEOFF);
 
-	cpu_setfunc(l2, func, arg);
+	rp->rw_local[0] = (long)func;	/* Function to call */
+	rp->rw_local[1] = (long)arg;	/* and its argument */
+	rp->rw_local[2] = (long)l2;	/* new lwp */
+
+	npcb->pcb_pc = (long)lwp_trampoline - 8;
+	npcb->pcb_sp = (long)rp - STACK_OFFSET;
 }
 
 static inline void



CVS commit: [netbsd-5] src/sys/arch/m68k

2009-06-05 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Jun  5 18:34:47 UTC 2009

Modified Files:
src/sys/arch/m68k/include [netbsd-5]: m68k.h
src/sys/arch/m68k/m68k [netbsd-5]: switch_subr.s vm_machdep.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #787):
sys/arch/m68k/include/m68k.h: revision 1.14
sys/arch/m68k/m68k/switch_subr.s: revision 1.22
sys/arch/m68k/m68k/vm_machdep.c: revision 1.28
Do not use lwp_trampoline for cpu_setfunc, we do not want to call
lwp_startup() after a setfunc. Grow a simplified setfunc_trampoline
instead.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.13.30.1 src/sys/arch/m68k/include/m68k.h
cvs rdiff -u -r1.21 -r1.21.30.1 src/sys/arch/m68k/m68k/switch_subr.s
cvs rdiff -u -r1.26 -r1.26.30.1 src/sys/arch/m68k/m68k/vm_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/m68k/include/m68k.h
diff -u src/sys/arch/m68k/include/m68k.h:1.13 src/sys/arch/m68k/include/m68k.h:1.13.30.1
--- src/sys/arch/m68k/include/m68k.h:1.13	Wed Oct 17 19:55:05 2007
+++ src/sys/arch/m68k/include/m68k.h	Fri Jun  5 18:34:46 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: m68k.h,v 1.13 2007/10/17 19:55:05 garbled Exp $	*/
+/*	$NetBSD: m68k.h,v 1.13.30.1 2009/06/05 18:34:46 snj Exp $	*/
 
 /*
  * Copyright (c) 1982, 1990, 1993
@@ -144,7 +144,6 @@
 int 	getsfc(void);
 
 /* switch_subr.s */
-void	lwp_trampoline(void);
 void	savectx(struct pcb *);
 
 /* w16copy.s */

Index: src/sys/arch/m68k/m68k/switch_subr.s
diff -u src/sys/arch/m68k/m68k/switch_subr.s:1.21 src/sys/arch/m68k/m68k/switch_subr.s:1.21.30.1
--- src/sys/arch/m68k/m68k/switch_subr.s:1.21	Wed Oct 17 19:55:12 2007
+++ src/sys/arch/m68k/m68k/switch_subr.s	Fri Jun  5 18:34:47 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: switch_subr.s,v 1.21 2007/10/17 19:55:12 garbled Exp $	*/
+/*	$NetBSD: switch_subr.s,v 1.21.30.1 2009/06/05 18:34:47 snj Exp $	*/
 
 /*
  * Copyright (c) 2001 The NetBSD Foundation.
@@ -397,4 +397,17 @@
 	addql	#8,%sp			| toss SP and stack adjust
 	jra	_ASM_LABEL(rei)		| and return
 
+/*
+ * Very similar to lwp_trampoline, but do not call lwp_startup
+ */
+ENTRY_NOPROFILE(setfunc_trampoline)
+	movl	%a3,%...@-		| push function arg
+	jbsr	%a2@			| call function
+	addql	#4,%sp			| pop arg
+	movl	%sp@(FR_SP),%a0		| grab and load
+	movl	%a0,%usp		|   user SP
+	moveml	%...@+,#0x7FFF		| restore most user regs
+	addql	#8,%sp			| toss SP and stack adjust
+	jra	_ASM_LABEL(rei)		| and return
+
 

Index: src/sys/arch/m68k/m68k/vm_machdep.c
diff -u src/sys/arch/m68k/m68k/vm_machdep.c:1.26 src/sys/arch/m68k/m68k/vm_machdep.c:1.26.30.1
--- src/sys/arch/m68k/m68k/vm_machdep.c:1.26	Wed Oct 17 19:55:12 2007
+++ src/sys/arch/m68k/m68k/vm_machdep.c	Fri Jun  5 18:34:47 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm_machdep.c,v 1.26 2007/10/17 19:55:12 garbled Exp $	*/
+/*	$NetBSD: vm_machdep.c,v 1.26.30.1 2009/06/05 18:34:47 snj Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -77,7 +77,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.26 2007/10/17 19:55:12 garbled Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.26.30.1 2009/06/05 18:34:47 snj Exp $");
 
 #include "opt_coredump.h"
 
@@ -131,6 +131,7 @@
 	struct trapframe *tf;
 	struct switchframe *sf;
 	extern struct pcb *curpcb;
+	extern void lwp_trampoline(void);
 
 	l2->l_md.md_flags = l1->l_md.md_flags;
 
@@ -173,8 +174,9 @@
 	struct pcb *pcb = &l->l_addr->u_pcb;
 	struct trapframe *tf = (struct trapframe *)l->l_md.md_regs;
 	struct switchframe *sf = (struct switchframe *)tf - 1;
+	extern void setfunc_trampoline(void);
 
-	sf->sf_pc = (u_int)lwp_trampoline;
+	sf->sf_pc = (u_int)setfunc_trampoline;
 	pcb->pcb_regs[6] = (int)func;		/* A2 */
 	pcb->pcb_regs[7] = (int)arg;		/* A3 */
 	pcb->pcb_regs[11] = (int)sf;		/* SSP */



CVS commit: [netbsd-5] src/sys/arch/alpha

2009-06-09 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jun  9 17:38:39 UTC 2009

Modified Files:
src/sys/arch/alpha/alpha [netbsd-5]: locore.s vm_machdep.c
src/sys/arch/alpha/include [netbsd-5]: alpha.h

Log Message:
Pull up following revision(s) (requested by martin in ticket #798):
sys/arch/alpha/alpha/locore.s: revision 1.114
sys/arch/alpha/alpha/vm_machdep.c: revision 1.100
sys/arch/alpha/include/alpha.h: revision 1.24
Do not use lwp_trampoline for cpu_setfunc, but a simplified setfunc_trampoline
that does not call lwp_startup() instead.


To generate a diff of this commit:
cvs rdiff -u -r1.113 -r1.113.10.1 src/sys/arch/alpha/alpha/locore.s
cvs rdiff -u -r1.96 -r1.96.30.1 src/sys/arch/alpha/alpha/vm_machdep.c
cvs rdiff -u -r1.23 -r1.23.28.1 src/sys/arch/alpha/include/alpha.h

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

Modified files:

Index: src/sys/arch/alpha/alpha/locore.s
diff -u src/sys/arch/alpha/alpha/locore.s:1.113 src/sys/arch/alpha/alpha/locore.s:1.113.10.1
--- src/sys/arch/alpha/alpha/locore.s:1.113	Mon Apr 28 20:23:10 2008
+++ src/sys/arch/alpha/alpha/locore.s	Tue Jun  9 17:38:38 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.s,v 1.113 2008/04/28 20:23:10 martin Exp $ */
+/* $NetBSD: locore.s,v 1.113.10.1 2009/06/09 17:38:38 snj Exp $ */
 
 /*-
  * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: locore.s,v 1.113 2008/04/28 20:23:10 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: locore.s,v 1.113.10.1 2009/06/09 17:38:38 snj Exp $");
 
 #include "assym.h"
 
@@ -748,6 +748,16 @@
 	jmp	zero, (pv)
 	END(lwp_trampoline)
 
+/*
+ * Simplified version of above: don't call lwp_startup()
+ */
+LEAF_NOPROFILE(setfunc_trampoline, 0)
+	mov	s0, pv
+	mov	s1, ra
+	mov	s2, a0
+	jmp	zero, (pv)
+	END(setfunc_trampoline)
+
 /**/
 
 /*

Index: src/sys/arch/alpha/alpha/vm_machdep.c
diff -u src/sys/arch/alpha/alpha/vm_machdep.c:1.96 src/sys/arch/alpha/alpha/vm_machdep.c:1.96.30.1
--- src/sys/arch/alpha/alpha/vm_machdep.c:1.96	Wed Oct 17 19:52:56 2007
+++ src/sys/arch/alpha/alpha/vm_machdep.c	Tue Jun  9 17:38:39 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: vm_machdep.c,v 1.96 2007/10/17 19:52:56 garbled Exp $ */
+/* $NetBSD: vm_machdep.c,v 1.96.30.1 2009/06/09 17:38:39 snj Exp $ */
 
 /*
  * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -29,7 +29,7 @@
 
 #include 			/* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.96 2007/10/17 19:52:56 garbled Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.96.30.1 2009/06/09 17:38:39 snj Exp $");
 #include "opt_coredump.h"
 
 #include 
@@ -129,6 +129,7 @@
 void (*func)(void *), void *arg)
 {
 	struct user *up = l2->l_addr;
+	extern void lwp_trampoline(void);
 
 	l2->l_md.md_tf = l1->l_md.md_tf;
 	l2->l_md.md_flags = l1->l_md.md_flags & (MDP_FPUSED | MDP_FP_C);
@@ -194,7 +195,19 @@
 		l2tf->tf_regs[FRAME_A3] = 0;		/* no error */
 		l2tf->tf_regs[FRAME_A4] = 1;		/* is child */
 
-		cpu_setfunc(l2, func, arg);
+		up = l2->l_addr;
+		up->u_pcb.pcb_hw.apcb_ksp =
+		(u_int64_t)l2->l_md.md_tf;
+		up->u_pcb.pcb_context[0] =
+		(u_int64_t)func;			/* s0: pc */
+		up->u_pcb.pcb_context[1] =
+		(u_int64_t)exception_return;	/* s1: ra */
+		up->u_pcb.pcb_context[2] =
+		(u_int64_t)arg;			/* s2: arg */
+		up->u_pcb.pcb_context[3] =
+		(u_int64_t)l2;			/* s3: lwp */
+		up->u_pcb.pcb_context[7] =
+		(u_int64_t)lwp_trampoline;		/* ra: assembly magic */
 	}
 }
 
@@ -205,6 +218,7 @@
 	void *arg;
 {
 	struct user *up = l->l_addr;
+	extern void setfunc_trampoline(void);
 
 	up->u_pcb.pcb_hw.apcb_ksp =
 	(u_int64_t)l->l_md.md_tf;
@@ -214,10 +228,8 @@
 	(u_int64_t)exception_return;	/* s1: ra */
 	up->u_pcb.pcb_context[2] =
 	(u_int64_t)arg;			/* s2: arg */
-	up->u_pcb.pcb_context[3] =
-	(u_int64_t)l;			/* s3: lwp */
 	up->u_pcb.pcb_context[7] =
-	(u_int64_t)lwp_trampoline;		/* ra: assembly magic */
+	(u_int64_t)setfunc_trampoline;	/* ra: assembly magic */
 }	
 
 /*

Index: src/sys/arch/alpha/include/alpha.h
diff -u src/sys/arch/alpha/include/alpha.h:1.23 src/sys/arch/alpha/include/alpha.h:1.23.28.1
--- src/sys/arch/alpha/include/alpha.h:1.23	Wed Nov 28 17:40:03 2007
+++ src/sys/arch/alpha/include/alpha.h	Tue Jun  9 17:38:39 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: alpha.h,v 1.23 2007/11/28 17:40:03 ad Exp $ */
+/* $NetBSD: alpha.h,v 1.23.28.1 2009/06/09 17:38:39 snj Exp $ */
 
 /*
  * Copyright (c) 1982, 1990, 1993
@@ -139,7 +139,6 @@
 void	regdump(struct trapframe *);
 void	regtoframe(const struct reg *, struct trapframe *);
 void	savectx(struct pcb *);
-void	lwp_trampoline(void);	/* MAGIC */
 void	trap(unsigned long, unsigned long, unsigned long, unsigned long,
 	struct trapframe *);
 void	trap_init(void);



CVS commit: [netbsd-5] src/sys/arch/mips

2009-06-09 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jun  9 17:45:01 UTC 2009

Modified Files:
src/sys/arch/mips/include [netbsd-5]: locore.h
src/sys/arch/mips/mips [netbsd-5]: locore_mips1.S mipsX_subr.S
mips_machdep.c vm_machdep.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #799):
sys/arch/mips/include/locore.h: revision 1.79
sys/arch/mips/mips/locore_mips1.S: revision 1.65
sys/arch/mips/mips/mipsX_subr.S: revision 1.28
sys/arch/mips/mips/mips_machdep.c: revision 1.211
sys/arch/mips/mips/vm_machdep.c: revision 1.123
Do not use the same trampoline for cpu_lwp_fork and cpu_setfunc - only
the former needs to call lwp_startup().


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.78.30.1 src/sys/arch/mips/include/locore.h
cvs rdiff -u -r1.64 -r1.64.20.1 src/sys/arch/mips/mips/locore_mips1.S
cvs rdiff -u -r1.26 -r1.26.30.1 src/sys/arch/mips/mips/mipsX_subr.S
cvs rdiff -u -r1.205.4.1 -r1.205.4.2 src/sys/arch/mips/mips/mips_machdep.c
cvs rdiff -u -r1.121 -r1.121.4.1 src/sys/arch/mips/mips/vm_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/mips/include/locore.h
diff -u src/sys/arch/mips/include/locore.h:1.78 src/sys/arch/mips/include/locore.h:1.78.30.1
--- src/sys/arch/mips/include/locore.h:1.78	Wed Oct 17 19:55:36 2007
+++ src/sys/arch/mips/include/locore.h	Tue Jun  9 17:45:00 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.h,v 1.78 2007/10/17 19:55:36 garbled Exp $ */
+/* $NetBSD: locore.h,v 1.78.30.1 2009/06/09 17:45:00 snj Exp $ */
 
 /*
  * Copyright 1996 The Board of Trustees of The Leland Stanford
@@ -53,6 +53,7 @@
 int	mips1_TLBUpdate(u_int, u_int);
 void	mips1_wbflush(void);
 void	mips1_lwp_trampoline(void);
+void	mips1_setfunc_trampoline(void);
 void	mips1_cpu_switch_resume(void);
 
 uint32_t tx3900_cp0_config_read(void);
@@ -68,6 +69,7 @@
 void	mips3_TLBWriteIndexedVPS(int, struct tlb *);
 void	mips3_wbflush(void);
 void	mips3_lwp_trampoline(void);
+void	mips3_setfunc_trampoline(void);
 void	mips3_cpu_switch_resume(void);
 void	mips3_pagezero(void *dst);
 
@@ -81,6 +83,7 @@
 void	mips5900_TLBWriteIndexedVPS(int, struct tlb *);
 void	mips5900_wbflush(void);
 void	mips5900_lwp_trampoline(void);
+void	mips5900_setfunc_trampoline(void);
 void	mips5900_cpu_switch_resume(void);
 void	mips5900_pagezero(void *dst);
 #endif
@@ -96,6 +99,7 @@
 void	mips32_TLBWriteIndexedVPS(int, struct tlb *);
 void	mips32_wbflush(void);
 void	mips32_lwp_trampoline(void);
+void	mips32_setfunc_trampoline(void);
 void	mips32_cpu_switch_resume(void);
 #endif
 
@@ -109,6 +113,7 @@
 void	mips64_TLBWriteIndexedVPS(int, struct tlb *);
 void	mips64_wbflush(void);
 void	mips64_lwp_trampoline(void);
+void	mips64_setfunc_trampoline(void);
 void	mips64_cpu_switch_resume(void);
 void	mips64_pagezero(void *dst);
 #endif
@@ -235,6 +240,7 @@
 #define MachTLBUpdate		mips1_TLBUpdate
 #define wbflush()		mips1_wbflush()
 #define lwp_trampoline		mips1_lwp_trampoline
+#define setfunc_trampoline	mips1_setfunc_trampoline
 #elif !defined(MIPS1) &&  defined(MIPS3) && !defined(MIPS32) && !defined(MIPS64) && !defined(MIPS3_5900)
 #define MachSetPID		mips3_SetPID
 #define MIPS_TBIAP()		mips3_TBIAP(mips_num_tlb_entries)
@@ -242,6 +248,7 @@
 #define MachTLBUpdate		mips3_TLBUpdate
 #define MachTLBWriteIndexedVPS	mips3_TLBWriteIndexedVPS
 #define lwp_trampoline		mips3_lwp_trampoline
+#define setfunc_trampoline	mips3_setfunc_trampoline
 #define wbflush()		mips3_wbflush()
 #elif !defined(MIPS1) && !defined(MIPS3) &&  defined(MIPS32) && !defined(MIPS64)
 #define MachSetPID		mips32_SetPID
@@ -250,6 +257,7 @@
 #define MachTLBUpdate		mips32_TLBUpdate
 #define MachTLBWriteIndexedVPS	mips32_TLBWriteIndexedVPS
 #define lwp_trampoline		mips32_lwp_trampoline
+#define setfunc_trampoline	mips32_setfunc_trampoline
 #define wbflush()		mips32_wbflush()
 #elif !defined(MIPS1) && !defined(MIPS3) && !defined(MIPS32) &&  defined(MIPS64)
  /* all common with mips3 */
@@ -259,6 +267,7 @@
 #define MachTLBUpdate		mips64_TLBUpdate
 #define MachTLBWriteIndexedVPS	mips64_TLBWriteIndexedVPS
 #define lwp_trampoline		mips64_lwp_trampoline
+#define setfunc_trampoline	mips64_setfunc_trampoline
 #define wbflush()		mips64_wbflush()
 #elif !defined(MIPS1) &&  defined(MIPS3) && !defined(MIPS32) && !defined(MIPS64) && defined(MIPS3_5900)
 #define MachSetPID		mips5900_SetPID
@@ -267,6 +276,7 @@
 #define MachTLBUpdate		mips5900_TLBUpdate
 #define MachTLBWriteIndexedVPS	mips5900_TLBWriteIndexedVPS
 #define lwp_trampoline		mips5900_lwp_trampoline
+#define setfunc_trampoline	mips5900_setfunc_trampoline
 #define wbflush()		mips5900_wbflush()
 #else
 #define MachSetPID		(*(mips_locore_jumpvec.setTLBpid))
@@ -275,6 +285,7 @@
 #define MachTLBUpdate		(*(mips_locore_jumpvec.tlbUpdate))
 #define wbflush()		(*(mips_locore_jumpvec.wbflush))()
 #define lwp_trampoline		(mips_locoresw[1])
+#define

CVS commit: [netbsd-5] src/sys/arch/x86

2009-06-15 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jun 16 02:19:44 UTC 2009

Modified Files:
src/sys/arch/x86/conf [netbsd-5]: files.x86
src/sys/arch/x86/include [netbsd-5]: cpu.h
src/sys/arch/x86/x86 [netbsd-5]: identcpu.c
Added Files:
src/sys/arch/x86/x86 [netbsd-5]: cpu_topology.c

Log Message:
Pull up following revision(s) (requested by rmind in ticket #782):
sys/arch/x86/conf/files.x86: revision 1.52 via patch
sys/arch/x86/include/cpu.h: revision 1.17
sys/arch/x86/x86/cpu_topology.c: revision 1.1
sys/arch/x86/x86/identcpu.c: revision 1.16 via patch
Move x86 CPU topology detection code into the separate file (as it was
originally).
OK by .


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.44.4.1 src/sys/arch/x86/conf/files.x86
cvs rdiff -u -r1.9 -r1.9.4.1 src/sys/arch/x86/include/cpu.h
cvs rdiff -u -r0 -r1.2.2.2 src/sys/arch/x86/x86/cpu_topology.c
cvs rdiff -u -r1.10.4.2 -r1.10.4.3 src/sys/arch/x86/x86/identcpu.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/x86/conf/files.x86
diff -u src/sys/arch/x86/conf/files.x86:1.44 src/sys/arch/x86/conf/files.x86:1.44.4.1
--- src/sys/arch/x86/conf/files.x86:1.44	Sun Aug  3 19:32:03 2008
+++ src/sys/arch/x86/conf/files.x86	Tue Jun 16 02:19:44 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: files.x86,v 1.44 2008/08/03 19:32:03 joerg Exp $
+#	$NetBSD: files.x86,v 1.44.4.1 2009/06/16 02:19:44 snj Exp $
 
 # options for MP configuration through the MP spec
 defflag opt_mpbios.h MPBIOS MPVERBOSE MPDEBUG MPBIOS_SCANPCI
@@ -45,6 +45,7 @@
 file	arch/x86/x86/bus_dma.c
 file	arch/x86/x86/bus_space.c
 file	arch/x86/x86/consinit.c
+file	arch/x86/x86/cpu_topology.c
 file	arch/x86/x86/errata.c
 file	arch/x86/x86/identcpu.c
 file	arch/x86/x86/i8259.c

Index: src/sys/arch/x86/include/cpu.h
diff -u src/sys/arch/x86/include/cpu.h:1.9 src/sys/arch/x86/include/cpu.h:1.9.4.1
--- src/sys/arch/x86/include/cpu.h:1.9	Sat Oct 25 19:13:40 2008
+++ src/sys/arch/x86/include/cpu.h	Tue Jun 16 02:19:44 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.9 2008/10/25 19:13:40 mrg Exp $	*/
+/*	$NetBSD: cpu.h,v 1.9.4.1 2009/06/16 02:19:44 snj Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -337,6 +337,9 @@
 void 	cpu_probe(struct cpu_info *);
 void	cpu_identify(struct cpu_info *);
 
+/* cpu_topology.c */
+void	x86_cpu_toplogy(struct cpu_info *);
+
 /* vm_machdep.c */
 void	cpu_proc_fork(struct proc *, struct proc *);
 

Index: src/sys/arch/x86/x86/identcpu.c
diff -u src/sys/arch/x86/x86/identcpu.c:1.10.4.2 src/sys/arch/x86/x86/identcpu.c:1.10.4.3
--- src/sys/arch/x86/x86/identcpu.c:1.10.4.2	Mon Feb  2 18:50:01 2009
+++ src/sys/arch/x86/x86/identcpu.c	Tue Jun 16 02:19:44 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: identcpu.c,v 1.10.4.2 2009/02/02 18:50:01 snj Exp $	*/
+/*	$NetBSD: identcpu.c,v 1.10.4.3 2009/06/16 02:19:44 snj Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -29,34 +29,8 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*-
- * Copyright (c)2008 YAMAMOTO Takashi,
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *notice, this list of conditions and the following disclaimer in the
- *documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
 #include 
-__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.10.4.2 2009/02/02 18:50:01 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.10.4.3 2009/06/16 02:19:44 snj Exp $");
 
 #include "opt_enhanced_speedstep.h"
 #include "opt_intel_odcm.h"
@@ -70,7 +44,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include 
 
@@ -132,56 +105,6 @@
 }
 
 static void
-cpu_probe_p6(struct cpu_info *ci)
-{
-	u_int lp_max = 1;	/* logical processors per package */
-	u_int smt_max;		/* smt

CVS commit: [netbsd-5] src/sys/arch/x86

2009-06-15 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jun 16 02:23:31 UTC 2009

Modified Files:
src/sys/arch/x86/include [netbsd-5]: specialreg.h
src/sys/arch/x86/x86 [netbsd-5]: cpu_topology.c

Log Message:
Pull up following revision(s) (requested by rmind in ticket #789):
sys/arch/x86/include/specialreg.h: revision 1.36
sys/arch/x86/x86/cpu_topology.c: revision 1.2
Add CPU topology detection support for AMD processors.
Tested on the following AMD CPUs:
- Family 15, model 65
- Family 15, model 67
- Family 15, model 75
- Family 16, model 2
- Family 17, model 3
Reviewed (slightly older version of patch) by .


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.31.4.1 src/sys/arch/x86/include/specialreg.h
cvs rdiff -u -r1.2.2.2 -r1.2.2.3 src/sys/arch/x86/x86/cpu_topology.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/x86/include/specialreg.h
diff -u src/sys/arch/x86/include/specialreg.h:1.31 src/sys/arch/x86/include/specialreg.h:1.31.4.1
--- src/sys/arch/x86/include/specialreg.h:1.31	Tue Oct 14 15:49:04 2008
+++ src/sys/arch/x86/include/specialreg.h	Tue Jun 16 02:23:31 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: specialreg.h,v 1.31 2008/10/14 15:49:04 cegger Exp $	*/
+/*	$NetBSD: specialreg.h,v 1.31.4.1 2009/06/16 02:23:31 snj Exp $	*/
 
 /*-
  * Copyright (c) 1991 The Regents of the University of California.
@@ -410,6 +410,7 @@
 #define	MSR_NB_CFG	0xc001001f
 #define		NB_CFG_DISIOREQLOCK	0x0004ULL
 #define		NB_CFG_DISDATMSK	0x0010ULL
+#define		NB_CFG_INITAPICCPUIDLO	(1ULL << 54)
 
 #define	MSR_LS_CFG	0xc0011020
 #define		LS_CFG_DIS_LS2_SQUISH	0x0200

Index: src/sys/arch/x86/x86/cpu_topology.c
diff -u src/sys/arch/x86/x86/cpu_topology.c:1.2.2.2 src/sys/arch/x86/x86/cpu_topology.c:1.2.2.3
--- src/sys/arch/x86/x86/cpu_topology.c:1.2.2.2	Tue Jun 16 02:19:44 2009
+++ src/sys/arch/x86/x86/cpu_topology.c	Tue Jun 16 02:23:31 2009
@@ -1,7 +1,8 @@
-/*	$NetBSD: cpu_topology.c,v 1.2.2.2 2009/06/16 02:19:44 snj Exp $	*/
+/*	$NetBSD: cpu_topology.c,v 1.2.2.3 2009/06/16 02:23:31 snj Exp $	*/
 
 /*-
- * Copyright (c)2008 YAMAMOTO Takashi,
+ * Copyright (c) 2009 Mindaugas Rasiukevicius ,
+ * Copyright (c) 2008 YAMAMOTO Takashi,
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -26,8 +27,16 @@
  * SUCH DAMAGE.
  */
 
+/*
+ * x86 CPU topology detection.
+ *
+ * References:
+ * - 53668.pdf (7.10.2), 276613.pdf
+ * - 31116.pdf, 41256.pdf, 25481.pdf
+ */
+
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu_topology.c,v 1.2.2.2 2009/06/16 02:19:44 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_topology.c,v 1.2.2.3 2009/06/16 02:23:31 snj Exp $");
 
 #include 
 #include 
@@ -42,49 +51,123 @@
 void
 x86_cpu_toplogy(struct cpu_info *ci)
 {
-	u_int lp_max = 1;	/* logical processors per package */
-	u_int smt_max;		/* smt per core */
-	u_int core_max = 1;	/* core per package */
-	int smt_bits, core_bits;
-	uint32_t descs[4];
+	u_int lp_max;		/* Logical processors per package */
+	u_int core_max;		/* Core per package */
+	int n, cpu_family, apic_id, smt_bits, core_bits = 0;
+	uint32_t descs[4], lextmode;
+
+	apic_id = ci->ci_initapicid;
+	cpu_family = CPUID2FAMILY(ci->ci_signature);
+
+	/* Initial values. */
+	ci->ci_packageid = apic_id;
+	ci->ci_coreid = 0;
+	ci->ci_smtid = 0;
 
-	if (cpu_vendor != CPUVENDOR_INTEL ||
-	CPUID2FAMILY(ci->ci_signature) < 6)
+	switch (cpu_vendor) {
+	case CPUVENDOR_INTEL:
+		if (cpu_family < 6)
+			return;
+		break;
+	case CPUVENDOR_AMD:
+		if (cpu_family < 0xf)
+			return;
+		break;
+	default:
 		return;
+	}
 
 	/* Determine the extended feature flags. */
 	x86_cpuid(0x8000, descs);
-	if (descs[0] >= 0x8001) {
+	lextmode = descs[0];
+	if (lextmode >= 0x8001) {
 		x86_cpuid(0x8001, descs);
-		ci->ci_feature3_flags |= descs[3]; /* %edx */
+		ci->ci_feature3_flags |= descs[3]; /* edx */
 	}
 
-	/* Determine topology. 253668.pdf 7.10.2. */
-	ci->ci_packageid = ci->ci_initapicid;
-	ci->ci_coreid = 0;
-	ci->ci_smtid = 0;
+	/* Check for HTT support.  See notes below regarding AMD. */
 	if ((ci->ci_feature_flags & CPUID_HTT) != 0) {
+		/* Maximum number of LPs sharing a cache (ebx[23:16]). */
 		x86_cpuid(1, descs);
 		lp_max = (descs[1] >> 16) & 0xff;
+	} else {
+		lp_max = 1;
 	}
-	x86_cpuid(0, descs);
-	if (descs[0] >= 4) {
-		x86_cpuid2(4, 0, descs);
-		core_max = (descs[0] >> 26) + 1;
+
+	switch (cpu_vendor) {
+	case CPUVENDOR_INTEL:
+		/* Check for leaf 4 support. */
+		x86_cpuid(0, descs);
+		if (descs[0] >= 4) {
+			/* Maximum number of Cores per package (eax[31:26]). */
+			x86_cpuid2(4, 0, descs);
+			core_max = (descs[0] >> 26) + 1;
+		} else {
+			core_max = 1;
+		}
+		break;
+	case CPUVENDOR_AMD:
+		/* In a case of AMD, HTT flag means CMP support. */
+		if ((ci->ci_feature_flags & CPUID_HTT) == 0) {
+			core_max = 1;
+			break;
+		}
+		/* Legacy Method, LPs represent Co

CVS commit: [netbsd-5] src/sys/arch/sparc

2011-03-08 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Tue Mar  8 17:29:46 UTC 2011

Modified Files:
src/sys/arch/sparc/dev [netbsd-5]: zs.c
src/sys/arch/sparc/include [netbsd-5]: cpu.h z8530var.h
src/sys/arch/sparc/sparc [netbsd-5]: cpu.c cpuvar.h db_interface.c
genassym.cf intr.c locore.s machdep.c timer.c timer_sun4m.c
timervar.h trap.c vm_machdep.c

Log Message:
Apply patches (requested by mrg in ticket #1564):
sys/arch/sparc/dev/zs.c:patch
sys/arch/sparc/include/cpu.h:   patch
sys/arch/sparc/include/z8530var.h:  patch
sys/arch/sparc/sparc/cpu.c: patch
sys/arch/sparc/sparc/cpuvar.h:  patch
sys/arch/sparc/sparc/db_interface.c:patch
sys/arch/sparc/sparc/genassym.cf:   patch
sys/arch/sparc/sparc/intr.c:patch
sys/arch/sparc/sparc/locore.s:  patch
sys/arch/sparc/sparc/machdep.c: patch
sys/arch/sparc/sparc/timer.c:   patch
sys/arch/sparc/sparc/timer_sun4m.c: patch
sys/arch/sparc/sparc/timervar.h:patch
sys/arch/sparc/sparc/trap.c:patch
sys/arch/sparc/sparc/vm_machdep.c:  patch

- fix a panic in savefpstate.  idea, and code suggestions from uwe
- convert xpmsg_lock to IPL_SCHED.  the old spl/simple_lock code ran at
  splsched(), and this significantly helps with stability under load when
  running with multiple active CPUs
- in strayintr() don't print about stray zs inters in MP case
- fix a deadlock in xcall()
- consolidate the interrupt evcnt(9) into a full set of per-IPL per-CPU
  soft/hard counters
- fix xcall() failure messages in some cases
- addd new ddb command "mach xcall"
- use schedintr() (not schedintr_4m()) on MP or single CPU configurations
- call hardclock() the same way on cpu0 in MP and !MP cases
- request the appropriate stack space for nmi_sun4m, in particular,
  make sure we have space for %g2...%g5.  now entering ddb via eg,
  serial break no longer causes cpu1 to fault.
- give memfault_sun*() some entry points that both gdb and ddb will find.
from tsutsui:
- fix panic in interrupt handlers in zs


To generate a diff of this commit:
cvs rdiff -u -r1.111.6.3 -r1.111.6.4 src/sys/arch/sparc/dev/zs.c
cvs rdiff -u -r1.84.14.1 -r1.84.14.2 src/sys/arch/sparc/include/cpu.h
cvs rdiff -u -r1.9 -r1.9.14.1 src/sys/arch/sparc/include/z8530var.h
cvs rdiff -u -r1.211.8.4 -r1.211.8.5 src/sys/arch/sparc/sparc/cpu.c
cvs rdiff -u -r1.75.10.4 -r1.75.10.5 src/sys/arch/sparc/sparc/cpuvar.h
cvs rdiff -u -r1.79.4.2 -r1.79.4.3 src/sys/arch/sparc/sparc/db_interface.c
cvs rdiff -u -r1.56.4.1 -r1.56.4.2 src/sys/arch/sparc/sparc/genassym.cf
cvs rdiff -u -r1.100.20.2 -r1.100.20.3 src/sys/arch/sparc/sparc/intr.c
cvs rdiff -u -r1.244.8.3 -r1.244.8.4 src/sys/arch/sparc/sparc/locore.s
cvs rdiff -u -r1.282.4.3 -r1.282.4.4 src/sys/arch/sparc/sparc/machdep.c
cvs rdiff -u -r1.23 -r1.23.28.1 src/sys/arch/sparc/sparc/timer.c
cvs rdiff -u -r1.16.56.2 -r1.16.56.3 src/sys/arch/sparc/sparc/timer_sun4m.c
cvs rdiff -u -r1.8 -r1.8.74.1 src/sys/arch/sparc/sparc/timervar.h
cvs rdiff -u -r1.176 -r1.176.4.1 src/sys/arch/sparc/sparc/trap.c
cvs rdiff -u -r1.95.4.2 -r1.95.4.3 src/sys/arch/sparc/sparc/vm_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/sparc/dev/zs.c
diff -u src/sys/arch/sparc/dev/zs.c:1.111.6.3 src/sys/arch/sparc/dev/zs.c:1.111.6.4
--- src/sys/arch/sparc/dev/zs.c:1.111.6.3	Sun Jan 16 12:54:42 2011
+++ src/sys/arch/sparc/dev/zs.c	Tue Mar  8 17:29:45 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: zs.c,v 1.111.6.3 2011/01/16 12:54:42 bouyer Exp $	*/
+/*	$NetBSD: zs.c,v 1.111.6.4 2011/03/08 17:29:45 riz Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.111.6.3 2011/01/16 12:54:42 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.111.6.4 2011/03/08 17:29:45 riz Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -171,12 +171,8 @@
 
 extern struct cfdriver zs_cd;
 
-/* softintr(9) cookie, shared by all instances of this driver */
-static void *zs_sicookie;
-
 /* Interrupt handlers. */
 static int zshard(void *);
-static void zssoft(void *);
 
 static int zs_get_speed(struct zs_chanstate *);
 
@@ -396,7 +392,6 @@
 	struct zsc_attach_args zsc_args;
 	struct zs_chanstate *cs;
 	int channel;
-	static int didintr, prevpri;
 #if (NKBD > 0) || (NMS > 0)
 	int ch0_is_cons = 0;
 #endif
@@ -407,12 +402,11 @@
 		return;
 	}
 
-	if (!didintr) {
-		zs_sicookie = softint_establish(SOFTINT_SERIAL, zssoft, NULL);
-		if (zs_sicookie == NULL) {
-			aprint_error(": cannot establish soft int handler\n");
-			return;
-		}
+	zsc->zsc_sicookie = softint_establish(SOFTINT_SERIAL,
+	(void (*)(void *))zsc_intr_soft, zsc);
+	if (zsc->zsc_sicookie == NULL) {
+		aprint_error("

CVS commit: [netbsd-5] src/sys/arch/xen

2011-09-23 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Fri Sep 23 12:44:52 UTC 2011

Modified Files:
src/sys/arch/xen/conf [netbsd-5]: files.xen
src/sys/arch/xen/xen [netbsd-5]: hypervisor.c
src/sys/arch/xen/xenbus [netbsd-5]: xenbus_dev.c xenbus_probe.c

Log Message:
Pull up the following revisions(s) (requested by jym in ticket #1672):
sys/arch/xen/conf/files.xen:revision 1.123 via patch
sys/arch/xen/xen/hypervisor.c:  revision 1.58 via patch
sys/arch/xen/xenbus/xenbus_dev.c:   revision 1.9
sys/arch/xen/xenbus/xenbus_probe.c: revision 1.35

Expose Xen kernfs entries inside a domU to make it possible to use pkgsrc's
sysutils/xentools inside a domU to query XenStore entries (or even modify
part of it if the domain has enough rights).


To generate a diff of this commit:
cvs rdiff -u -r1.88.4.6 -r1.88.4.7 src/sys/arch/xen/conf/files.xen
cvs rdiff -u -r1.42.4.3 -r1.42.4.4 src/sys/arch/xen/xen/hypervisor.c
cvs rdiff -u -r1.7 -r1.7.28.1 src/sys/arch/xen/xenbus/xenbus_dev.c
cvs rdiff -u -r1.26.2.3 -r1.26.2.4 src/sys/arch/xen/xenbus/xenbus_probe.c

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

Modified files:

Index: src/sys/arch/xen/conf/files.xen
diff -u src/sys/arch/xen/conf/files.xen:1.88.4.6 src/sys/arch/xen/conf/files.xen:1.88.4.7
--- src/sys/arch/xen/conf/files.xen:1.88.4.6	Fri Jan  7 01:42:55 2011
+++ src/sys/arch/xen/conf/files.xen	Fri Sep 23 12:44:51 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: files.xen,v 1.88.4.6 2011/01/07 01:42:55 riz Exp $
+#	$NetBSD: files.xen,v 1.88.4.7 2011/09/23 12:44:51 sborrill Exp $
 #	NetBSD: files.x86,v 1.10 2003/10/08 17:30:00 bouyer Exp 
 #	NetBSD: files.i386,v 1.254 2004/03/25 23:32:10 jmc Exp 
 
@@ -181,7 +181,7 @@
 attach xenbus at xendevbus
 file arch/xen/xenbus/xenbus_client.c xenbus & xen3 needs-flag
 file arch/xen/xenbus/xenbus_comms.c xenbus & xen3 needs-flag
-file arch/xen/xenbus/xenbus_dev.c xenbus & xen3 & dom0ops needs-flag
+file arch/xen/xenbus/xenbus_dev.c xenbus & xen3 needs-flag
 file arch/xen/xenbus/xenbus_probe.c xenbus & xen3 needs-flag
 file arch/xen/xenbus/xenbus_xs.c xenbus & xen3 needs-flag
 

Index: src/sys/arch/xen/xen/hypervisor.c
diff -u src/sys/arch/xen/xen/hypervisor.c:1.42.4.3 src/sys/arch/xen/xen/hypervisor.c:1.42.4.4
--- src/sys/arch/xen/xen/hypervisor.c:1.42.4.3	Sun Oct  4 00:02:00 2009
+++ src/sys/arch/xen/xen/hypervisor.c	Fri Sep 23 12:44:51 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: hypervisor.c,v 1.42.4.3 2009/10/04 00:02:00 snj Exp $ */
+/* $NetBSD: hypervisor.c,v 1.42.4.4 2011/09/23 12:44:51 sborrill Exp $ */
 
 /*
  * Copyright (c) 2005 Manuel Bouyer.
@@ -63,7 +63,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hypervisor.c,v 1.42.4.3 2009/10/04 00:02:00 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hypervisor.c,v 1.42.4.4 2011/09/23 12:44:51 sborrill Exp $");
 
 #include 
 #include 
@@ -240,11 +240,8 @@
 #endif /* NPCI */
 	union hypervisor_attach_cookie hac;
 
-#ifdef DOM0OPS
-	if (xendomain_is_privileged()) {
-		xenkernfs_init();
-	}
-#endif
+	xenkernfs_init();
+
 #ifdef XEN3
 	xen_version = HYPERVISOR_xen_version(XENVER_version, NULL);
 	aprint_normal(": Xen version %d.%d\n", (xen_version & 0x) >> 16,
@@ -408,8 +405,6 @@
 	return (UNCONF);
 }
 
-#if defined(DOM0OPS)
-
 #define DIR_MODE	(S_IRUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)
 
 kernfs_parentdir_t *kernxen_pkt;
@@ -424,7 +419,6 @@
 	kernfs_addentry(NULL, dkt);
 	kernxen_pkt = KERNFS_ENTOPARENTDIR(dkt);
 }
-#endif /* DOM0OPS */
 
 #ifndef XEN3
 /* handler for the shutdown messages */

Index: src/sys/arch/xen/xenbus/xenbus_dev.c
diff -u src/sys/arch/xen/xenbus/xenbus_dev.c:1.7 src/sys/arch/xen/xenbus/xenbus_dev.c:1.7.28.1
--- src/sys/arch/xen/xenbus/xenbus_dev.c:1.7	Tue Nov 27 11:37:27 2007
+++ src/sys/arch/xen/xenbus/xenbus_dev.c	Fri Sep 23 12:44:52 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: xenbus_dev.c,v 1.7 2007/11/27 11:37:27 pooka Exp $ */
+/* $NetBSD: xenbus_dev.c,v 1.7.28.1 2011/09/23 12:44:52 sborrill Exp $ */
 /*
  * xenbus_dev.c
  * 
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xenbus_dev.c,v 1.7 2007/11/27 11:37:27 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xenbus_dev.c,v 1.7.28.1 2011/09/23 12:44:52 sborrill Exp $");
 
 #include "opt_xen.h"
 
@@ -92,10 +92,13 @@
 	PRIVCMD_MODE);
 	kernfs_addentry(kernxen_pkt, dkt);
 
-	kfst = KERNFS_ALLOCTYPE(xsd_port_fileops);
-	KERNFS_ALLOCENTRY(dkt, M_TEMP, M_WAITOK);
-	KERNFS_INITENTRY(dkt, DT_REG, "xsd_port", NULL, kfst, VREG, XSD_MODE);
-	kernfs_addentry(kernxen_pkt, dkt);
+	if (xendomain_is_dom0()) {
+		kfst = KERNFS_ALLOCTYPE(xsd_port_fileops);
+		KERNFS_ALLOCENTRY(dkt, M_TEMP, M_WAITOK);
+		KERNFS_INITENTRY(dkt, DT_REG, "xsd_port", NULL,
+		kfst, VREG, XSD_MODE);
+		kernfs_addentry(kernxen_pkt, dkt);
+	}
 }
 
 struct xenbus_dev_data {

Index: src/sys/arch/xen/xenbus/xenbus_probe.c
diff -u src/sys/arch/xen/xenbus/xenbus_probe.c:1.26.2.3 src/sys/arch/xen/xenbu

CVS commit: [netbsd-5] src/sys/arch/vax

2011-01-06 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Fri Jan  7 01:01:44 UTC 2011

Modified Files:
src/sys/arch/vax/include [netbsd-5]: clock.h
src/sys/arch/vax/vax [netbsd-5]: clock.c

Log Message:
Pull up following revision(s) (requested by uwe in ticket #1500):
sys/arch/vax/vax/clock.c: revision 1.54
sys/arch/vax/include/clock.h: revision 1.8
Correct definition of leap year.  Make yeartonum and numtoyear use
full years so that year 2000 is correctly counted as a leap year.
Now NetBSD under SIMH picks up correct time-of-day clock value.  It
used to be a day behind, since 2000 - 1900 = 100 and naive leap year
test wouldn't count it as a leap year.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.6.70.1 src/sys/arch/vax/include/clock.h
cvs rdiff -u -r1.49.20.1 -r1.49.20.2 src/sys/arch/vax/vax/clock.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/vax/include/clock.h
diff -u src/sys/arch/vax/include/clock.h:1.6 src/sys/arch/vax/include/clock.h:1.6.70.1
--- src/sys/arch/vax/include/clock.h:1.6	Tue Sep  5 19:32:57 2006
+++ src/sys/arch/vax/include/clock.h	Fri Jan  7 01:01:44 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock.h,v 1.6 2006/09/05 19:32:57 matt Exp $ */
+/*	$NetBSD: clock.h,v 1.6.70.1 2011/01/07 01:01:44 riz Exp $ */
 /*
  * Copyright (c) 1996 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -37,7 +37,7 @@
 /*
  * Time constants. These are unlikely to change.
  */
-#define IS_LEAPYEAR(y) (((y % 4) == 0) && (y % 100))
+#define IS_LEAPYEAR(y) y % 4) == 0) && ((y % 100) != 0)) || ((y % 400) == 0))
 
 #define SEC_PER_MIN	(60)
 #define SEC_PER_HOUR	(SEC_PER_MIN * 60)

Index: src/sys/arch/vax/vax/clock.c
diff -u src/sys/arch/vax/vax/clock.c:1.49.20.1 src/sys/arch/vax/vax/clock.c:1.49.20.2
--- src/sys/arch/vax/vax/clock.c:1.49.20.1	Wed Sep 16 04:46:14 2009
+++ src/sys/arch/vax/vax/clock.c	Fri Jan  7 01:01:44 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock.c,v 1.49.20.1 2009/09/16 04:46:14 snj Exp $	 */
+/*	$NetBSD: clock.c,v 1.49.20.2 2011/01/07 01:01:44 riz Exp $	 */
 /*
  * Copyright (c) 1995 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.49.20.1 2009/09/16 04:46:14 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.49.20.2 2011/01/07 01:01:44 riz Exp $");
 
 #include 
 #include 
@@ -194,18 +194,18 @@
 {
 	int n;
 
-	for (n = 0, y -= 1; y > 69; y--)
+	for (n = 0, y -= 1; y > 1969; y--)
 		n += SECPERYEAR(y);
 	return n;
 }
 
 /* 
- * Converts tick number to a year 70 ->
+ * Converts tick number to a year 1970 ->
  */
 int
 numtoyear(int num)
 {
-	int y = 70, j;
+	int y = 1970, j;
 	while(num >= (j = SECPERYEAR(y))) {
 		y++;
 		num -= j;



CVS commit: [netbsd-5] src/sys/arch/amd64

2009-12-01 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Dec  1 19:29:54 UTC 2009

Modified Files:
src/sys/arch/amd64/amd64 [netbsd-5]: machdep.c
src/sys/arch/amd64/include [netbsd-5]: vmparam.h

Log Message:
Apply patch (requested by bouyer in ticket 1158):
On amd64, add a third free list distinct from the default free list, holding
RAM between 16Mb and 4Gb. This helps preventing bus_dma(9) memory
allocation failures for 32bit DMA on large-memory machines.


To generate a diff of this commit:
cvs rdiff -u -r1.102.4.11 -r1.102.4.12 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.18 -r1.18.20.1 src/sys/arch/amd64/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/amd64/amd64/machdep.c
diff -u src/sys/arch/amd64/amd64/machdep.c:1.102.4.11 src/sys/arch/amd64/amd64/machdep.c:1.102.4.12
--- src/sys/arch/amd64/amd64/machdep.c:1.102.4.11	Sat Oct  3 23:49:50 2009
+++ src/sys/arch/amd64/amd64/machdep.c	Tue Dec  1 19:29:54 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.102.4.11 2009/10/03 23:49:50 snj Exp $	*/
+/*	$NetBSD: machdep.c,v 1.102.4.12 2009/12/01 19:29:54 snj Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008
@@ -112,7 +112,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.102.4.11 2009/10/03 23:49:50 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.102.4.12 2009/12/01 19:29:54 snj Exp $");
 
 /* #define XENDEBUG_LOW  */
 
@@ -1375,7 +1375,7 @@
 	struct mem_segment_descriptor *ldt_segp;
 	int x;
 #ifndef XEN
-	int first16q, ist;
+	int first16q, first4gq, ist;
 	extern struct extent *iomem_ex;
 	uint64_t seg_start, seg_end;
 	uint64_t seg_start1, seg_end1;
@@ -1585,11 +1585,19 @@
 	 * all of the ISA DMA'able memory won't be eaten up
 	 * first-off).
 	 */
-	if (avail_end <= (16 * 1024 * 1024))
+#define ADDR_16M (16 * 1024 * 1024)
+#define ADDR_4G (4ULL * 1024 * 1024 * 1024)
+
+	if (avail_end <= ADDR_16M)
 		first16q = VM_FREELIST_DEFAULT;
 	else
 		first16q = VM_FREELIST_FIRST16;
 
+	if (avail_end <= ADDR_4G)
+		first4gq = VM_FREELIST_DEFAULT;
+	else
+		first4gq = VM_FREELIST_FIRST4G;
+
 	/* Make sure the end of the space used by the kernel is rounded. */
 	first_avail = round_page(first_avail);
 
@@ -1636,19 +1644,19 @@
 
 		/* First hunk */
 		if (seg_start != seg_end) {
-			if (seg_start < (16 * 1024 * 1024) &&
+			if (seg_start < ADDR_16M &&
 			first16q != VM_FREELIST_DEFAULT) {
 uint64_t tmp;
 
-if (seg_end > (16 * 1024 * 1024))
-	tmp = (16 * 1024 * 1024);
+if (seg_end > ADDR_16M)
+	tmp = ADDR_16M;
 else
 	tmp = seg_end;
 
 if (tmp != seg_start) {
 #ifdef DEBUG_MEMLOAD
-	printf("loading 0x%"PRIx64"-0x%"PRIx64
-	" (0x%lx-0x%lx)\n",
+	printf("loading first16q 0x%"PRIx64
+	"-0x%"PRIx64" (0x%lx-0x%lx)\n",
 	seg_start, tmp,
 	atop(seg_start), atop(tmp));
 #endif
@@ -1658,10 +1666,32 @@
 }
 seg_start = tmp;
 			}
+			if (seg_start < ADDR_4G &&
+			first4gq != VM_FREELIST_DEFAULT) {
+uint64_t tmp;
+
+if (seg_end > ADDR_4G)
+	tmp = ADDR_4G;
+else
+	tmp = seg_end;
+
+if (tmp != seg_start) {
+#ifdef DEBUG_MEMLOAD
+	printf("loading first4gq 0x%"PRIx64
+	"-0x%"PRIx64" (0x%lx-0x%lx)\n",
+	seg_start, tmp,
+	atop(seg_start), atop(tmp));
+#endif
+	uvm_page_physload(atop(seg_start),
+	atop(tmp), atop(seg_start),
+	atop(tmp), first4gq);
+}
+seg_start = tmp;
+			}
 
 			if (seg_start != seg_end) {
 #ifdef DEBUG_MEMLOAD
-printf("loading 0x%"PRIx64"-0x%"PRIx64
+printf("loading default 0x%"PRIx64"-0x%"PRIx64
 " (0x%lx-0x%lx)\n",
 seg_start, seg_end,
 atop(seg_start), atop(seg_end));
@@ -1674,19 +1704,19 @@
 
 		/* Second hunk */
 		if (seg_start1 != seg_end1) {
-			if (seg_start1 < (16 * 1024 * 1024) &&
+			if (seg_start1 < ADDR_16M &&
 			first16q != VM_FREELIST_DEFAULT) {
 uint64_t tmp;
 
-if (seg_end1 > (16 * 1024 * 1024))
-	tmp = (16 * 1024 * 1024);
+if (seg_end1 > ADDR_16M)
+	tmp = ADDR_16M;
 else
 	tmp = seg_end1;
 
 if (tmp != seg_start1) {
 #ifdef DEBUG_MEMLOAD
-	printf("loading 0x%"PRIx64"-0x%"PRIx64
-	" (0x%lx-0x%lx)\n",
+	printf("loading first16q 0x%"PRIx64
+	"-0x%"PRIx64" (0x%lx-0x%lx)\n",
 	seg_start1, tmp,
 	atop(seg_start1), atop(tmp));
 #endif
@@ -1696,10 +1726,32 @@
 }
 seg_start1 = tmp;
 			}
+			if (seg_start1 < ADDR_4G &&
+			first4gq != VM_FREELIST_DEFAULT) {
+uint64_t tmp;
+
+if (seg_end1 > ADDR_4G)
+	tmp = ADDR_4G;
+else
+	tmp = seg_end1;
+
+if (tmp != seg_start1) {
+#ifdef DEBUG_MEMLOAD
+	printf("loading first4gq 0x%"PRIx64
+	"-0x%"PRIx64" (0x%lx-0x%lx)\n",
+	seg_start1, tmp,
+	atop(seg_start1), atop(tmp));
+#endif
+	uvm_page_physload(atop(seg_start1),
+	atop(tmp), atop

CVS commit: [netbsd-5] src/sys/arch/sparc

2010-01-08 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Jan  9 01:43:51 UTC 2010

Modified Files:
src/sys/arch/sparc/include [netbsd-5]: cpu.h
src/sys/arch/sparc/sparc [netbsd-5]: locore.s vm_machdep.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1223):
sys/arch/sparc/include/cpu.h: revision 1.86
sys/arch/sparc/sparc/locore.s: revision 1.246
sys/arch/sparc/sparc/vm_machdep.c: revision 1.100
fix up cpu_setfunc() as noted by uwe:
- don't call lwp_startup for cpu_setfunc() users
- introduce lwp_setfunc_trampoline instead
- no need to set the "new" lwp for setfunc


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.84.14.1 src/sys/arch/sparc/include/cpu.h
cvs rdiff -u -r1.244 -r1.244.8.1 src/sys/arch/sparc/sparc/locore.s
cvs rdiff -u -r1.95.4.1 -r1.95.4.2 src/sys/arch/sparc/sparc/vm_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/sparc/include/cpu.h
diff -u src/sys/arch/sparc/include/cpu.h:1.84 src/sys/arch/sparc/include/cpu.h:1.84.14.1
--- src/sys/arch/sparc/include/cpu.h:1.84	Wed Feb 27 18:26:16 2008
+++ src/sys/arch/sparc/include/cpu.h	Sat Jan  9 01:43:51 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.84 2008/02/27 18:26:16 xtraeme Exp $ */
+/*	$NetBSD: cpu.h,v 1.84.14.1 2010/01/09 01:43:51 snj Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -197,6 +197,7 @@
 void	write_all_windows(void);
 void	write_user_windows(void);
 void 	lwp_trampoline(void);
+void 	lwp_setfunc_trampoline(void);
 struct pcb;
 void	snapshot(struct pcb *);
 struct frame *getfp(void);

Index: src/sys/arch/sparc/sparc/locore.s
diff -u src/sys/arch/sparc/sparc/locore.s:1.244 src/sys/arch/sparc/sparc/locore.s:1.244.8.1
--- src/sys/arch/sparc/sparc/locore.s:1.244	Sun May 25 15:56:12 2008
+++ src/sys/arch/sparc/sparc/locore.s	Sat Jan  9 01:43:51 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.244 2008/05/25 15:56:12 chs Exp $	*/
+/*	$NetBSD: locore.s,v 1.244.8.1 2010/01/09 01:43:51 snj Exp $	*/
 
 /*
  * Copyright (c) 1996 Paul Kranenburg
@@ -5044,6 +5044,9 @@
  *
  * If were setting up a kernel thread, the function *(%l0) will not
  * return.
+ *
+ * For KERN_SA applications, we provide an alternate entry point for
+ * cpu_setfunc() to use.
  */
 ENTRY(lwp_trampoline)
 	/*
@@ -5056,6 +5059,7 @@
 	call	lwp_startup
 	 mov	%l2, %o1
 
+_ENTRY(lwp_setfunc_trampoline)
 	call	%l0
 	 mov	%l1, %o0
 

Index: src/sys/arch/sparc/sparc/vm_machdep.c
diff -u src/sys/arch/sparc/sparc/vm_machdep.c:1.95.4.1 src/sys/arch/sparc/sparc/vm_machdep.c:1.95.4.2
--- src/sys/arch/sparc/sparc/vm_machdep.c:1.95.4.1	Sat Jan  9 01:41:57 2010
+++ src/sys/arch/sparc/sparc/vm_machdep.c	Sat Jan  9 01:43:51 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm_machdep.c,v 1.95.4.1 2010/01/09 01:41:57 snj Exp $ */
+/*	$NetBSD: vm_machdep.c,v 1.95.4.2 2010/01/09 01:43:51 snj Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -49,7 +49,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.95.4.1 2010/01/09 01:41:57 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.95.4.2 2010/01/09 01:43:51 snj Exp $");
 
 #include "opt_multiprocessor.h"
 #include "opt_coredump.h"
@@ -276,8 +276,15 @@
 
 	/* Construct kernel frame to return to in cpu_switch() */
 	rp = (struct rwindow *)((u_int)npcb + TOPFRAMEOFF);
+	/**rp = *(struct rwindow *)((u_int)opcb + TOPFRAMEOFF);*/
+	rp->rw_local[0] = (int)func;		/* Function to call */
+	rp->rw_local[1] = (int)arg;		/* and its argument */
+	rp->rw_local[2] = (int)l2;		/* new LWP */
 
-	cpu_setfunc(l2, func, arg);
+	npcb->pcb_pc = (int)lwp_trampoline - 8;
+	npcb->pcb_sp = (int)rp;
+	npcb->pcb_psr &= ~PSR_CWP;	/* Run in window #0 */
+	npcb->pcb_wim = 1;		/* Fence at window #1 */
 }
 
 /*
@@ -330,9 +337,8 @@
 	rp = (struct rwindow *)((u_int)pcb + TOPFRAMEOFF);
 	rp->rw_local[0] = (int)func;		/* Function to call */
 	rp->rw_local[1] = (int)arg;		/* and its argument */
-	rp->rw_local[2] = (int)l;		/* new lwp */
 
-	pcb->pcb_pc = (int)lwp_trampoline - 8;
+	pcb->pcb_pc = (int)lwp_setfunc_trampoline - 8;
 	pcb->pcb_sp = (int)rp;
 	pcb->pcb_psr &= ~PSR_CWP;	/* Run in window #0 */
 	pcb->pcb_wim = 1;		/* Fence at window #1 */



CVS commit: [netbsd-5] src/sys/arch/amiga

2010-07-16 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Fri Jul 16 18:26:13 UTC 2010

Modified Files:
src/sys/arch/amiga/amiga [netbsd-5]: amiga_init.c locore.s
src/sys/arch/amiga/dev [netbsd-5]: clock.c kbd.c

Log Message:
Pull up following revision(s) (requested by phx in ticket #1412):
sys/arch/amiga/dev/clock.c: revision 1.51
sys/arch/amiga/amiga/locore.s: revision 1.149 via patch
sys/arch/amiga/dev/kbd.c: revision 1.53
sys/arch/amiga/amiga/amiga_init.c: revision 1.118
Reverted the CIA-timer based delay() to the pre-5.0 method of a calibrated
delay loop.
This fixes keyboard handshaking problems with some A1200 models since 5.0
and restores the precision for short delays on DraCo systems (the QuickLogic
timer has only a seventh of the CIA precision).
Changed the keyboard handshaking delay from 2000 back to 200ms, although
even the recommended 85ms were successfully tested on the most problematic
A1200 keyboards.
All those changes were tested on an A3000 and A1200 with 68060/50 CPU, and
previously discussed on the port-amiga ML.


To generate a diff of this commit:
cvs rdiff -u -r1.99 -r1.99.20.1 src/sys/arch/amiga/amiga/amiga_init.c
cvs rdiff -u -r1.145 -r1.145.20.1 src/sys/arch/amiga/amiga/locore.s
cvs rdiff -u -r1.47.20.3 -r1.47.20.4 src/sys/arch/amiga/dev/clock.c
cvs rdiff -u -r1.50 -r1.50.20.1 src/sys/arch/amiga/dev/kbd.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/amiga/amiga/amiga_init.c
diff -u src/sys/arch/amiga/amiga/amiga_init.c:1.99 src/sys/arch/amiga/amiga/amiga_init.c:1.99.20.1
--- src/sys/arch/amiga/amiga/amiga_init.c:1.99	Sun Jan  6 18:50:29 2008
+++ src/sys/arch/amiga/amiga/amiga_init.c	Fri Jul 16 18:26:13 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: amiga_init.c,v 1.99 2008/01/06 18:50:29 mhitch Exp $	*/
+/*	$NetBSD: amiga_init.c,v 1.99.20.1 2010/07/16 18:26:13 riz Exp $	*/
 
 /*
  * Copyright (c) 1994 Michael L. Hitch
@@ -36,7 +36,7 @@
 #include "opt_devreload.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amiga_init.c,v 1.99 2008/01/06 18:50:29 mhitch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amiga_init.c,v 1.99.20.1 2010/07/16 18:26:13 riz Exp $");
 
 #include 
 #include 
@@ -765,6 +765,7 @@
 void
 start_c_finish()
 {
+	extern u_int32_t delaydivisor;
 #ifdef	P5PPC68KBOARD
 struct cfdev *cdp, *ecdp;
 #endif
@@ -900,6 +901,21 @@
 			}
 }
 #endif
+	/*
+	 * preliminary delay divisor value
+	 */
+
+	if (machineid & AMIGA_68060)
+		delaydivisor = (1024 * 1) / 80;	/* 80 MHz 68060 w. BTC */
+
+	else if (machineid & AMIGA_68040)
+		delaydivisor = (1024 * 3) / 40;	/* 40 MHz 68040 */
+
+	else if (machineid & AMIGA_68030)
+		delaydivisor = (1024 * 8) / 50;	/* 50 MHz 68030 */
+
+	else
+		delaydivisor = (1024 * 8) / 33; /* 33 MHz 68020 */
 }
 
 void

Index: src/sys/arch/amiga/amiga/locore.s
diff -u src/sys/arch/amiga/amiga/locore.s:1.145 src/sys/arch/amiga/amiga/locore.s:1.145.20.1
--- src/sys/arch/amiga/amiga/locore.s:1.145	Sun Jan  6 18:50:30 2008
+++ src/sys/arch/amiga/amiga/locore.s	Fri Jul 16 18:26:12 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.145 2008/01/06 18:50:30 mhitch Exp $	*/
+/*	$NetBSD: locore.s,v 1.145.20.1 2010/07/16 18:26:12 riz Exp $	*/
 
 /*
  * Copyright (c) 1980, 1990 The Regents of the University of California.
@@ -1577,6 +1577,16 @@
 	.align 2
 #endif
 	nop
+ENTRY_NOPROFILE(delay)
+ENTRY_NOPROFILE(DELAY)
+	movql #10,%d1		| 2 +2
+	movl %sp@(4),%d0	| 4 +4
+	lsll %d1,%d0		| 8 +2
+	movl _C_LABEL(delaydivisor),%d1	| A +6
+Ldelay:| longword aligned again.
+	subl %d1,%d0
+	jcc Ldelay
+	rts
 
 #ifdef M68060
 ENTRY_NOPROFILE(intemu60)
@@ -1607,6 +1617,11 @@
 	.long	FPU_NONE
 GLOBAL(protorp)
 	.long	0x8002,0	| prototype root pointer
+GLOBAL(delaydivisor)
+	.long	12		| should be enough for 80 MHz 68060
+| will be adapted to other CPUs in
+| start_c_cleanup and calibrated
+| at clock attach time.
 
 GLOBAL(proc0paddr)
 	.long	0		| KVA of proc0 u-area

Index: src/sys/arch/amiga/dev/clock.c
diff -u src/sys/arch/amiga/dev/clock.c:1.47.20.3 src/sys/arch/amiga/dev/clock.c:1.47.20.4
--- src/sys/arch/amiga/dev/clock.c:1.47.20.3	Sat Oct  3 23:37:31 2009
+++ src/sys/arch/amiga/dev/clock.c	Fri Jul 16 18:26:12 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock.c,v 1.47.20.3 2009/10/03 23:37:31 snj Exp $ */
+/*	$NetBSD: clock.c,v 1.47.20.4 2010/07/16 18:26:12 riz Exp $ */
 
 /*
  * Copyright (c) 1982, 1990 The Regents of the University of California.
@@ -77,7 +77,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.47.20.3 2009/10/03 23:37:31 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.47.20.4 2010/07/16 18:26:12 riz Exp $");
 
 #include 
 #include 
@@ -100,26 +100,6 @@
 #include 
 #endif
 
-/* the clocks run at NTSC: 715.909kHz or PAL: 709.379kHz.
-   We're using a 100 Hz clock. */
-int amiga_clk_interval;
-int eclockfreq;
-unsigned int fast_delay_limit;
-struct CIA *clockcia;
-
-static u_int clk_getcounter(struct

CVS commit: [netbsd-5] src/sys/arch/amd64

2010-09-07 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Tue Sep  7 19:38:21 UTC 2010

Modified Files:
src/sys/arch/amd64/amd64 [netbsd-5]: netbsd32_machdep.c
src/sys/arch/amd64/include [netbsd-5]: segments.h

Log Message:
Pull up following revision(s) (requested by chs in ticket #1449):
sys/arch/amd64/amd64/netbsd32_machdep.c: revisions 1.66, 1.67
sys/arch/amd64/include/segments.h: revision 1.21
in check_mcontext32(), accept the LDT selector for 32-bit user code
as well as the GDT selector.  fixes PR 43835.
accept the LDT selector in check_sigcontext32() too.


To generate a diff of this commit:
cvs rdiff -u -r1.55.4.2 -r1.55.4.3 \
src/sys/arch/amd64/amd64/netbsd32_machdep.c
cvs rdiff -u -r1.19 -r1.19.4.1 src/sys/arch/amd64/include/segments.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/amd64/amd64/netbsd32_machdep.c
diff -u src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.55.4.2 src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.55.4.3
--- src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.55.4.2	Fri Jul 16 18:40:39 2010
+++ src/sys/arch/amd64/amd64/netbsd32_machdep.c	Tue Sep  7 19:38:20 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep.c,v 1.55.4.2 2010/07/16 18:40:39 riz Exp $	*/
+/*	$NetBSD: netbsd32_machdep.c,v 1.55.4.3 2010/09/07 19:38:20 bouyer Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.55.4.2 2010/07/16 18:40:39 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.55.4.3 2010/09/07 19:38:20 bouyer Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_coredump.h"
@@ -944,7 +944,7 @@
 {
 
 	if (((scp->sc_eflags ^ tf->tf_rflags) & PSL_USERSTATIC) != 0 ||
-	scp->sc_cs != GSEL(GUCODE32_SEL, SEL_UPL))
+	!VALID_USER_CSEL32(scp->sc_cs))
 		return EINVAL;
 	if (scp->sc_fs != 0 && !VALID_USER_DSEL32(scp->sc_fs))
 		return EINVAL;
@@ -967,7 +967,7 @@
 	gr = mcp->__gregs;
 
 	if (((gr[_REG32_EFL] ^ tf->tf_rflags) & PSL_USERSTATIC) != 0 ||
-	gr[_REG32_CS] != GSEL(GUCODE32_SEL, SEL_UPL))
+	!VALID_USER_CSEL32(gr[_REG32_CS]))
 		return EINVAL;
 	if (gr[_REG32_FS] != 0 && !VALID_USER_DSEL32(gr[_REG32_FS]))
 		return EINVAL;

Index: src/sys/arch/amd64/include/segments.h
diff -u src/sys/arch/amd64/include/segments.h:1.19 src/sys/arch/amd64/include/segments.h:1.19.4.1
--- src/sys/arch/amd64/include/segments.h:1.19	Sun Oct 26 00:08:15 2008
+++ src/sys/arch/amd64/include/segments.h	Tue Sep  7 19:38:21 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: segments.h,v 1.19 2008/10/26 00:08:15 mrg Exp $	*/
+/*	$NetBSD: segments.h,v 1.19.4.1 2010/09/07 19:38:21 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -382,10 +382,8 @@
 #define VALID_USER_DSEL32(s) \
 (((s) & 0x) == GSEL(GUDATA32_SEL, SEL_UPL) || \
  ((s) & 0x) == LSEL(LUDATA32_SEL, SEL_UPL))
-#if 0 /* not used */
 #define VALID_USER_CSEL32(s) \
 ((s) == GSEL(GUCODE32_SEL, SEL_UPL) || (s) == LSEL(LUCODE32_SEL, SEL_UPL))
-#endif
 
 #define VALID_USER_CSEL(s) \
 ((s) == GSEL(GUCODE_SEL, SEL_UPL) || (s) == LSEL(LUCODE_SEL, SEL_UPL))



CVS commit: [netbsd-5] src/sys/arch/xen

2010-01-30 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Jan 30 19:14:21 UTC 2010

Modified Files:
src/sys/arch/xen/x86 [netbsd-5]: xen_bus_dma.c
src/sys/arch/xen/xen [netbsd-5]: xengnt.c xennetback_xenbus.c

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #1271):
sys/arch/xen/x86/xen_bus_dma.c: revision 1.16
sys/arch/xen/xen/xengnt.c: revision 1.17 via patch
sys/arch/xen/xen/xennetback_xenbus.c: revision 1.33
fix address overflow with 32bit PAE.
Reported and tested by Mark Davies on port-...@.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.11.8.1 src/sys/arch/xen/x86/xen_bus_dma.c
cvs rdiff -u -r1.10 -r1.10.4.1 src/sys/arch/xen/xen/xengnt.c
cvs rdiff -u -r1.24.4.2 -r1.24.4.3 src/sys/arch/xen/xen/xennetback_xenbus.c

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

Modified files:

Index: src/sys/arch/xen/x86/xen_bus_dma.c
diff -u src/sys/arch/xen/x86/xen_bus_dma.c:1.11 src/sys/arch/xen/x86/xen_bus_dma.c:1.11.8.1
--- src/sys/arch/xen/x86/xen_bus_dma.c:1.11	Wed Jun  4 12:41:42 2008
+++ src/sys/arch/xen/x86/xen_bus_dma.c	Sat Jan 30 19:14:20 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: xen_bus_dma.c,v 1.11 2008/06/04 12:41:42 ad Exp $	*/
+/*	$NetBSD: xen_bus_dma.c,v 1.11.8.1 2010/01/30 19:14:20 snj Exp $	*/
 /*	NetBSD bus_dma.c,v 1.21 2005/04/16 07:53:35 yamt Exp */
 
 /*-
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xen_bus_dma.c,v 1.11 2008/06/04 12:41:42 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_bus_dma.c,v 1.11.8.1 2010/01/30 19:14:20 snj Exp $");
 
 #include 
 #include 
@@ -85,8 +85,8 @@
 	KASSERT(npages >= npagesreq);
 
 	/* get npages from UWM, and give them back to the hypervisor */
-	error = uvm_pglistalloc(npages << PAGE_SHIFT, 0, avail_end, 0, 0,
-	mlistp, npages, (flags & BUS_DMA_NOWAIT) == 0);
+	error = uvm_pglistalloc(((psize_t)npages) << PAGE_SHIFT,
+0, avail_end, 0, 0, mlistp, npages, (flags & BUS_DMA_NOWAIT) == 0);
 	if (error)
 		return (error);
 
@@ -161,7 +161,7 @@
 		pa = VM_PAGE_TO_PHYS(pg);
 		xpmap_phys_to_machine_mapping[
 		(pa - XPMAP_OFFSET) >> PAGE_SHIFT] = mfn+i;
-		xpq_queue_machphys_update((mfn+i) << PAGE_SHIFT, pa);
+		xpq_queue_machphys_update(((paddr_t)(mfn+i)) << PAGE_SHIFT, pa);
 		/* while here, give extra pages back to UVM */
 		if (i >= npagesreq) {
 			TAILQ_REMOVE(mlistp, pg, pageq.queue);
@@ -217,7 +217,7 @@
 		pa = VM_PAGE_TO_PHYS(pg);
 		xpmap_phys_to_machine_mapping[
 		(pa - XPMAP_OFFSET) >> PAGE_SHIFT] = mfn;
-		xpq_queue_machphys_update((mfn) << PAGE_SHIFT, pa);
+		xpq_queue_machphys_update(((paddr_t)mfn) << PAGE_SHIFT, pa);
 		TAILQ_REMOVE(mlistp, pg, pageq.queue);
 		uvm_pagefree(pg);
 	}

Index: src/sys/arch/xen/xen/xengnt.c
diff -u src/sys/arch/xen/xen/xengnt.c:1.10 src/sys/arch/xen/xen/xengnt.c:1.10.4.1
--- src/sys/arch/xen/xen/xengnt.c:1.10	Sat Oct 25 17:12:29 2008
+++ src/sys/arch/xen/xen/xengnt.c	Sat Jan 30 19:14:20 2010
@@ -1,4 +1,4 @@
-/*  $NetBSD: xengnt.c,v 1.10 2008/10/25 17:12:29 jym Exp $  */
+/*  $NetBSD: xengnt.c,v 1.10.4.1 2010/01/30 19:14:20 snj Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xengnt.c,v 1.10 2008/10/25 17:12:29 jym Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xengnt.c,v 1.10.4.1 2010/01/30 19:14:20 snj Exp $");
 
 #include 
 #include 
@@ -125,14 +125,14 @@
 xengnt_more_entries()
 {
 	gnttab_setup_table_t setup;
-	unsigned long *pages;
+	u_long *pages;
 	int nframes_new = gnt_nr_grant_frames + 1;
 	int i;
 
 	if (gnt_nr_grant_frames == gnt_max_grant_frames)
 		return ENOMEM;
 
-	pages = malloc(nframes_new * sizeof(long), M_DEVBUF, M_NOWAIT);
+	pages = malloc(nframes_new * sizeof(u_long), M_DEVBUF, M_NOWAIT);
 	if (pages == NULL)
 		return ENOMEM;
 
@@ -163,7 +163,7 @@
 	 * the grant table frames
 	 */
 	pmap_kenter_ma(((vaddr_t)grant_table) + gnt_nr_grant_frames * PAGE_SIZE,
-	pages[gnt_nr_grant_frames] << PAGE_SHIFT, VM_PROT_WRITE);
+	((paddr_t)pages[gnt_nr_grant_frames]) << PAGE_SHIFT, VM_PROT_WRITE);
 
 	/*
 	 * add the grant entries associated to the last grant table frame

Index: src/sys/arch/xen/xen/xennetback_xenbus.c
diff -u src/sys/arch/xen/xen/xennetback_xenbus.c:1.24.4.2 src/sys/arch/xen/xen/xennetback_xenbus.c:1.24.4.3
--- src/sys/arch/xen/xen/xennetback_xenbus.c:1.24.4.2	Mon Sep 28 01:47:49 2009
+++ src/sys/arch/xen/xen/xennetback_xenbus.c	Sat Jan 30 19:14:20 2010
@@ -1,4 +1,4 @@
-/*  $NetBSD: xennetback_xenbus.c,v 1.24.4.2 2009/09/28 01:47:49 snj Exp $  */
+/*  $NetBSD: xennetback_xenbus.c,v 1.24.4.3 2010/01/30 19:14:20 snj Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -604,7 +604,7 @@
 		 */
 		return -1;
 
-	*map = mcl_pages[mcl_pages_alloc] << PAGE_SHIFT;
+	*map = ((paddr_t)mcl_pages[mcl_pages_alloc]) << PAGE_SHIFT;
 	mcl_pages_alloc--;
 	return 0;
 	



CVS commit: [netbsd-5] src/sys/arch/sparc64

2010-03-16 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Mar 17 03:10:40 UTC 2010

Modified Files:
src/sys/arch/sparc64/include [netbsd-5]: pmap.h
src/sys/arch/sparc64/sparc64 [netbsd-5]: cache.h ipifuncs.c locore.s
machdep.c pmap.c

Log Message:
Apply patch (requested by mrg in ticket #1343):
- flush the dcache around pmap_{zero,copy}_page()
- convert all blast_dcache() / dcache_flush_page() calls to
  properly handle flushes in all cpus as necessary


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.40.14.1 src/sys/arch/sparc64/include/pmap.h
cvs rdiff -u -r1.10 -r1.10.66.1 src/sys/arch/sparc64/sparc64/cache.h
cvs rdiff -u -r1.22 -r1.22.8.1 src/sys/arch/sparc64/sparc64/ipifuncs.c
cvs rdiff -u -r1.286.2.1 -r1.286.2.2 src/sys/arch/sparc64/sparc64/locore.s
cvs rdiff -u -r1.227.4.1 -r1.227.4.2 src/sys/arch/sparc64/sparc64/machdep.c
cvs rdiff -u -r1.225.4.1 -r1.225.4.2 src/sys/arch/sparc64/sparc64/pmap.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/include/pmap.h
diff -u src/sys/arch/sparc64/include/pmap.h:1.40 src/sys/arch/sparc64/include/pmap.h:1.40.14.1
--- src/sys/arch/sparc64/include/pmap.h:1.40	Fri Mar 14 15:40:02 2008
+++ src/sys/arch/sparc64/include/pmap.h	Wed Mar 17 03:10:39 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.40 2008/03/14 15:40:02 nakayama Exp $	*/
+/*	$NetBSD: pmap.h,v 1.40.14.1 2010/03/17 03:10:39 snj Exp $	*/
 
 /*-
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -212,6 +212,9 @@
 void sp_tlb_flush_ctx(int);
 void sp_tlb_flush_all(void);
 
+void		pmap_copy_page_phys(paddr_t, paddr_t);
+void		pmap_zero_page_phys(paddr_t);
+
 #ifdef MULTIPROCESSOR
 void smp_tlb_flush_pte(vaddr_t, pmap_t);
 void smp_tlb_flush_ctx(pmap_t);

Index: src/sys/arch/sparc64/sparc64/cache.h
diff -u src/sys/arch/sparc64/sparc64/cache.h:1.10 src/sys/arch/sparc64/sparc64/cache.h:1.10.66.1
--- src/sys/arch/sparc64/sparc64/cache.h:1.10	Sat Oct 21 23:49:29 2006
+++ src/sys/arch/sparc64/sparc64/cache.h	Wed Mar 17 03:10:39 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: cache.h,v 1.10 2006/10/21 23:49:29 mrg Exp $ */
+/*	$NetBSD: cache.h,v 1.10.66.1 2010/03/17 03:10:39 snj Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -75,11 +75,21 @@
 /* The following are for I$ and D$ flushes and are in locore.s */
 void 	dcache_flush_page(paddr_t);	/* flush page from D$ */
 void 	icache_flush_page(paddr_t);	/* flush page from I$ */
-void 	blast_dcache(void);		/* Clear entire D$ */
+void 	sp_blast_dcache(void);		/* Clear entire D$ */
 void 	blast_icache(void);		/* Clear entire I$ */
 
 /* The following flush a range from the D$ and I$ but not E$. */
 void	cache_flush_phys(paddr_t, psize_t, int);
 
+#ifdef MULTIPROCESSOR
+void smp_blast_dcache(sparc64_cpuset_t);
+void smp_dcache_flush_page_all(paddr_t pa);
+#define dcache_flush_page_all(pa)	smp_dcache_flush_page_all(pa)
+#define blast_dcache()  smp_blast_dcache(cpus_active)
+#else
+#define dcache_flush_page_all(pa)	dcache_flush_page(pa)
+#define blast_dcache()			sp_blast_dcache()
+#endif
+
 /* Smallest E$ line size. */
 extern	int	ecache_min_line_size;

Index: src/sys/arch/sparc64/sparc64/ipifuncs.c
diff -u src/sys/arch/sparc64/sparc64/ipifuncs.c:1.22 src/sys/arch/sparc64/sparc64/ipifuncs.c:1.22.8.1
--- src/sys/arch/sparc64/sparc64/ipifuncs.c:1.22	Sat May 31 08:00:34 2008
+++ src/sys/arch/sparc64/sparc64/ipifuncs.c	Wed Mar 17 03:10:39 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipifuncs.c,v 1.22 2008/05/31 08:00:34 nakayama Exp $ */
+/*	$NetBSD: ipifuncs.c,v 1.22.8.1 2010/03/17 03:10:39 snj Exp $ */
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ipifuncs.c,v 1.22 2008/05/31 08:00:34 nakayama Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipifuncs.c,v 1.22.8.1 2010/03/17 03:10:39 snj Exp $");
 
 #include "opt_ddb.h"
 
@@ -44,6 +44,8 @@
 #include 
 #include 
 
+#include 
+
 #if defined(DDB) || defined(KGDB)
 #ifdef DDB
 #include 
@@ -69,6 +71,8 @@
 void	sparc64_ipi_flush_pte(void *);
 void	sparc64_ipi_flush_ctx(void *);
 void	sparc64_ipi_flush_all(void *);
+void	sparc64_ipi_dcache_flush_page(void *);
+void	sparc64_ipi_blast_dcache(void *);
 
 /*
  * Process cpu stop-self event.
@@ -412,6 +416,34 @@
 	sparc64_broadcast_ipi(sparc64_ipi_flush_all, 0, 0);
 }
 
+/* XXX Spitfire specific for netbsd-5 branch */
+#define dcache_line_size	32
+#define dcache_size		(16 * 1024)
+
+/*
+ * Make sure this page is flushed from all CPUs.
+ */
+void
+smp_dcache_flush_page_all(paddr_t pa)
+{
+
+	sparc64_broadcast_ipi(sparc64_ipi_dcache_flush_page, pa,
+			  dcache_line_size);
+	dcache_flush_page(pa);
+}
+
+/*
+ * Flush the D$ on this set of CPUs.
+ */
+void
+smp_blast_dcache(sparc64_cpuset_t activecpus)
+{
+
+	sparc64_multicast_ipi(activecpus, sparc64_ipi_blast_dcache,
+			  dcache_size, dcache_line_size);
+	sp_blast_dcache();
+}
+
 /*
  * Print an error message.
  */

Index: src/sys/arch/spar

CVS commit: [netbsd-5] src/sys/arch/atari

2010-11-19 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sat Nov 20 00:47:56 UTC 2010

Modified Files:
src/sys/arch/atari/conf [netbsd-5]: GENERIC.in
src/sys/arch/atari/dev [netbsd-5]: ser.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1368):
sys/arch/atari/dev/ser.c: revision 1.49
sys/arch/atari/conf/GENERIC.in: revision 1.86
Make options SERCONSOLE (force serial console if DCD is detected)
patchable by binpatch(8) like:
---
serconsole(0x23bac4): 0x0001 (1), at offset 0x23bb44 in /netbsd
new value: 0x (0)
---
May work around PR port-atari/39849
(netbsd-ATARITT kernel fails with serial port connected)
and some old TT030 with early revision boards.
Disable options SERCONSOLE (force serial console if DCD is detected)
because now it's patchable by binpatch(8).
Enabling serial console by DCD signal could be problematic
on some earlier TT030 (with revision A board), and it's also
annoying for users who connect an active device on the serial port
as mentioned in PR port-atari/39849.
XXX: Eventually serial console should be enabled by MD bootloader flags,
XXX: but I have no idea how to build bootloader binaries for TOS.


To generate a diff of this commit:
cvs rdiff -u -r1.73.4.7 -r1.73.4.8 src/sys/arch/atari/conf/GENERIC.in
cvs rdiff -u -r1.39 -r1.39.6.1 src/sys/arch/atari/dev/ser.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/atari/conf/GENERIC.in
diff -u src/sys/arch/atari/conf/GENERIC.in:1.73.4.7 src/sys/arch/atari/conf/GENERIC.in:1.73.4.8
--- src/sys/arch/atari/conf/GENERIC.in:1.73.4.7	Sat Nov 20 00:33:46 2010
+++ src/sys/arch/atari/conf/GENERIC.in	Sat Nov 20 00:47:55 2010
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC.in,v 1.73.4.7 2010/11/20 00:33:46 riz Exp $
+#	$NetBSD: GENERIC.in,v 1.73.4.8 2010/11/20 00:47:55 riz Exp $
 #
 # Generic atari
 #
@@ -231,7 +231,7 @@
 options 	DISKLABEL_AHDI		# NetBSD/AHDI disklabels
 #if !defined(SMALL030_KERNEL)
 #if !defined(FALCON_KERNEL)
-options 	SERCONSOLE		# modem1 console support, breaks Falcon
+#options 	SERCONSOLE		# modem1 console support, breaks Falcon
 #endif /* !FALCON_KERNEL */
 options 	RELOC_KERNEL		# TT/Falcon: relocate kernel to TT-RAM
 options 	MSGBUFSIZE=32768# size of kernel msg. buffer

Index: src/sys/arch/atari/dev/ser.c
diff -u src/sys/arch/atari/dev/ser.c:1.39 src/sys/arch/atari/dev/ser.c:1.39.6.1
--- src/sys/arch/atari/dev/ser.c:1.39	Wed Jun 11 14:35:53 2008
+++ src/sys/arch/atari/dev/ser.c	Sat Nov 20 00:47:55 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ser.c,v 1.39 2008/06/11 14:35:53 tsutsui Exp $	*/
+/*	$NetBSD: ser.c,v 1.39.6.1 2010/11/20 00:47:55 riz Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -93,7 +93,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ser.c,v 1.39 2008/06/11 14:35:53 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ser.c,v 1.39.6.1 2010/11/20 00:47:55 riz Exp $");
 
 #include "opt_ddb.h"
 #include "opt_mbtype.h"
@@ -262,6 +262,11 @@
 	serstop, sertty, serpoll, nommap, ttykqfilter, D_TTY
 };
 
+#ifndef SERCONSOLE
+#define SERCONSOLE	0
+#endif
+int serconsole = SERCONSOLE;	/* patchable */
+
 /*ARGSUSED*/
 static	int
 sermatch(pdp, cfp, auxp)
@@ -316,13 +321,13 @@
 
 	callout_init(&sc->sc_diag_ch, 0);
 
-#if SERCONSOLE > 0
-	/*
-	 * Activate serial console when DCD present...
-	 */
-	if (!(MFP->mf_gpip & MCR_DCD))
-		SET(sc->sc_hwflags, SER_HW_CONSOLE);
-#endif /* SERCONSOLE > 0 */
+	if (serconsole) {
+		/*
+		 * Activate serial console when DCD present...
+		 */
+		if (!(MFP->mf_gpip & MCR_DCD))
+			SET(sc->sc_hwflags, SER_HW_CONSOLE);
+	}
 
 	printf("\n");
 	if (ISSET(sc->sc_hwflags, SER_HW_CONSOLE)) {
@@ -1416,11 +1421,10 @@
 	/* initialize required fields */
 	/* XXX: LWP What unit? */
 	cp->cn_dev = makedev(cdevsw_lookup_major(&ser_cdevsw), 0);
-#if SERCONSOLE > 0
-	cp->cn_pri = CN_REMOTE;	/* Force a serial port console */
-#else
-	cp->cn_pri = CN_NORMAL;
-#endif /* SERCONSOLE > 0 */
+	if (serconsole)
+		cp->cn_pri = CN_REMOTE;	/* Force a serial port console */
+	else
+		cp->cn_pri = CN_NORMAL;
 }
 
 void



CVS commit: [netbsd-5] src/sys/arch/sparc

2015-04-18 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun Apr 19 06:11:17 UTC 2015

Modified Files:
src/sys/arch/sparc/include [netbsd-5]: openfirm.h
src/sys/arch/sparc/stand/ofwboot [netbsd-5]: Locore.c
loadfile_machdep.c openfirm.h

Log Message:
Pullup another commit for ticket #1958 requested by martin:

sys/arch/sparc/include/openfirm.h   1.7
sys/arch/sparc/stand/ofwboot/Locore.c   1.11
sys/arch/sparc/stand/ofwboot/loadfile_machdep.c 1.7
sys/arch/sparc/stand/ofwboot/openfirm.h 1.4

Make ofwboot can handle over 4GB physical memory by using OpenFirmware
calls properly, and some cosmetic changes.  Idea from OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.6.82.1 src/sys/arch/sparc/include/openfirm.h
cvs rdiff -u -r1.10.30.1 -r1.10.30.2 \
src/sys/arch/sparc/stand/ofwboot/Locore.c
cvs rdiff -u -r1.6 -r1.6.4.1 \
src/sys/arch/sparc/stand/ofwboot/loadfile_machdep.c
cvs rdiff -u -r1.3 -r1.3.72.1 src/sys/arch/sparc/stand/ofwboot/openfirm.h

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

Modified files:

Index: src/sys/arch/sparc/include/openfirm.h
diff -u src/sys/arch/sparc/include/openfirm.h:1.6 src/sys/arch/sparc/include/openfirm.h:1.6.82.1
--- src/sys/arch/sparc/include/openfirm.h:1.6	Sat Mar  4 02:56:21 2006
+++ src/sys/arch/sparc/include/openfirm.h	Sun Apr 19 06:11:17 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: openfirm.h,v 1.6 2006/03/04 02:56:21 uwe Exp $	*/
+/*	$NetBSD: openfirm.h,v 1.6.82.1 2015/04/19 06:11:17 msaitoh Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -49,6 +49,9 @@ typedef uint64_t cell_t;
 #define HDL2CELL(x)	(cell_t)(u_int)(int)(x)
 #define ADR2CELL(x)	(cell_t)(u_int)(int)(x)
 #endif
+#define HDQ2CELL_HI(x)	(cell_t)(0)
+#define HDQ2CELL_LO(x)	(cell_t)(x)
+#define CELL2HDQ(hi,lo)	(lo)
 #else /* SUN4U */
 /* All cells are 4 byte slots */
 typedef uint32_t cell_t;

Index: src/sys/arch/sparc/stand/ofwboot/Locore.c
diff -u src/sys/arch/sparc/stand/ofwboot/Locore.c:1.10.30.1 src/sys/arch/sparc/stand/ofwboot/Locore.c:1.10.30.2
--- src/sys/arch/sparc/stand/ofwboot/Locore.c:1.10.30.1	Fri Apr 17 10:49:16 2015
+++ src/sys/arch/sparc/stand/ofwboot/Locore.c	Sun Apr 19 06:11:17 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: Locore.c,v 1.10.30.1 2015/04/17 10:49:16 msaitoh Exp $	*/
+/*	$NetBSD: Locore.c,v 1.10.30.2 2015/04/19 06:11:17 msaitoh Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -36,15 +36,6 @@
 
 #include 
 
-vaddr_t	OF_claim_virt(vaddr_t, int);
-vaddr_t	OF_alloc_virt(int, int);
-int	OF_free_virt(vaddr_t, int);
-int	OF_unmap_virt(vaddr_t, int);
-vaddr_t	OF_map_phys(paddr_t, off_t, vaddr_t, int);
-paddr_t	OF_alloc_phys(int, int);
-paddr_t	OF_claim_phys(paddr_t, int);
-int	OF_free_phys(paddr_t, int);
-
 extern int openfirmware(void *);
 
 
@@ -450,9 +441,9 @@ OF_claim_virt(vaddr_t vaddr, int len)
 	args.align = 0;
 	args.len = len;
 	args.vaddr = ADR2CELL(vaddr);
-	if(openfirmware(&args) != 0)
+	if (openfirmware(&args) != 0)
 		return -1LL;
-	return args.retaddr; /* Kluge till we go 64-bit */
+	return (vaddr_t)args.retaddr;
 }
 
 /* 
@@ -486,13 +477,13 @@ OF_alloc_virt(int len, int align)
 	args.nargs = 4;
 	args.nreturns = 2;
 	args.method = ADR2CELL("claim");
-	args.ihandle = mmuh;
+	args.ihandle = HDL2CELL(mmuh);
 	args.align = align;
 	args.len = len;
 	args.retaddr = ADR2CELL(&retaddr);
-	if(openfirmware(&args) != 0)
+	if (openfirmware(&args) != 0)
 		return -1LL;
-	return (vaddr_t)args.retaddr; /* Kluge till we go 64-bit */
+	return (vaddr_t)args.retaddr;
 }
 
 /* 
@@ -601,8 +592,8 @@ OF_map_phys(paddr_t paddr, off_t size, v
 	args.mode = mode;
 	args.size = size;
 	args.vaddr = ADR2CELL(vaddr);
-	args.paddr_hi = ADR2CELL(paddr>>32);
-	args.paddr_lo = ADR2CELL(paddr);
+	args.paddr_hi = HDQ2CELL_HI(paddr);
+	args.paddr_lo = HDQ2CELL_LO(paddr);
 
 	if (openfirmware(&args) == -1)
 		return -1;
@@ -620,7 +611,6 @@ OF_map_phys(paddr_t paddr, off_t size, v
 paddr_t
 OF_alloc_phys(int len, int align)
 {
-	paddr_t paddr;
 	struct {
 		cell_t name;
 		cell_t nargs;
@@ -647,10 +637,9 @@ OF_alloc_phys(int len, int align)
 	args.ihandle = HDL2CELL(memh);
 	args.align = align;
 	args.len = len;
-	if(openfirmware(&args) != 0)
+	if (openfirmware(&args) != 0)
 		return -1LL;
-	paddr = (paddr_t)(args.phys_hi<<32)|((unsigned int)(args.phys_lo));
-	return paddr; /* Kluge till we go 64-bit */
+	return (paddr_t)CELL2HDQ(args.phys_hi, args.phys_lo);
 }
 
 /* 
@@ -661,7 +650,6 @@ OF_alloc_phys(int len, int align)
 paddr_t
 OF_claim_phys(paddr_t phys, int len)
 {
-	paddr_t paddr;
 	struct {
 		cell_t name;
 		cell_t nargs;
@@ -691,12 +679,11 @@ OF_claim_phys(paddr_t phys, int len)
 	args.ihandle = HDL2CELL(memh);
 	args.align = 0;
 	args.len = len;
-	args.phys_hi = HDL2CELL(phys>>32);
-	args.phys_lo = HDL2CELL(phys);
-	if(openfirmware(&args) != 0)
+	args.phys_hi = HDQ2CELL_HI(phys);
+	args.phys_lo = HDQ2CELL_LO(phys);
+	if (open

CVS commit: [netbsd-5] src/sys/arch/arm/arm32

2013-01-20 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 20 12:13:28 UTC 2013

Modified Files:
src/sys/arch/arm/arm32 [netbsd-5]: cpu.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1841):
sys/arch/arm/arm32/cpu.c: revision 1.89
S/,/;/


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.71.4.1 src/sys/arch/arm/arm32/cpu.c

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

Modified files:

Index: src/sys/arch/arm/arm32/cpu.c
diff -u src/sys/arch/arm/arm32/cpu.c:1.71 src/sys/arch/arm/arm32/cpu.c:1.71.4.1
--- src/sys/arch/arm/arm32/cpu.c:1.71	Sat Oct 25 18:15:19 2008
+++ src/sys/arch/arm/arm32/cpu.c	Sun Jan 20 12:13:28 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.71 2008/10/25 18:15:19 matt Exp $	*/
+/*	$NetBSD: cpu.c,v 1.71.4.1 2013/01/20 12:13:28 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1995 Mark Brinicombe.
@@ -46,7 +46,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.71 2008/10/25 18:15:19 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.71.4.1 2013/01/20 12:13:28 bouyer Exp $");
 
 #include 
 #include 
@@ -486,7 +486,7 @@ identify_arm_cpu(struct device *dv, stru
 		if (cpuids[i].cpuid == (cpuid & CPU_ID_CPU_MASK)) {
 			cpu_class = cpuids[i].cpu_class;
 			steppingstr = cpuids[i].cpu_steppings[cpuid &
-			CPU_ID_REVISION_MASK],
+			CPU_ID_REVISION_MASK];
 			sprintf(cpu_model, "%s%s%s (%s core)",
 			cpuids[i].cpu_name,
 			steppingstr[0] == '*' ? "" : " ",



CVS commit: [netbsd-5] src/sys/arch/xen/xen

2012-02-24 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Fri Feb 24 17:45:29 UTC 2012

Modified Files:
src/sys/arch/xen/xen [netbsd-5]: if_xennet_xenbus.c

Log Message:
Pull up the following revisions(s) (requested by bouyer in ticket #1730):
sys/arch/xen/xen/if_xennet_xenbus.c:revision 1.59 via patch

Fix receive stall on the domU side when buffers stay a long time in the
network stack or socket buffers.


To generate a diff of this commit:
cvs rdiff -u -r1.29.2.6 -r1.29.2.7 src/sys/arch/xen/xen/if_xennet_xenbus.c

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

Modified files:

Index: src/sys/arch/xen/xen/if_xennet_xenbus.c
diff -u src/sys/arch/xen/xen/if_xennet_xenbus.c:1.29.2.6 src/sys/arch/xen/xen/if_xennet_xenbus.c:1.29.2.7
--- src/sys/arch/xen/xen/if_xennet_xenbus.c:1.29.2.6	Thu May 19 21:13:07 2011
+++ src/sys/arch/xen/xen/if_xennet_xenbus.c	Fri Feb 24 17:45:29 2012
@@ -1,4 +1,4 @@
-/*  $NetBSD: if_xennet_xenbus.c,v 1.29.2.6 2011/05/19 21:13:07 bouyer Exp $  */
+/*  $NetBSD: if_xennet_xenbus.c,v 1.29.2.7 2012/02/24 17:45:29 sborrill Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_xennet_xenbus.c,v 1.29.2.6 2011/05/19 21:13:07 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_xennet_xenbus.c,v 1.29.2.7 2012/02/24 17:45:29 sborrill Exp $");
 
 #include "opt_xen.h"
 #include "opt_nfs_boot.h"
@@ -130,7 +130,6 @@ int xennet_debug = 0xff;
 #endif
 
 #define GRANT_INVALID_REF -1 /* entry is free */
-#define GRANT_STACK_REF   -2 /* entry owned by the network stack */
 
 #define NET_TX_RING_SIZE __RING_SIZE((netif_tx_sring_t *)0, PAGE_SIZE)
 #define NET_RX_RING_SIZE __RING_SIZE((netif_rx_sring_t *)0, PAGE_SIZE)
@@ -192,6 +191,9 @@ struct xennet_xenbus_softc {
 static multicall_entry_t rx_mcl[NET_RX_RING_SIZE+1];
 static u_long xennet_pages[NET_RX_RING_SIZE];
 
+static pool_cache_t if_xennetrxbuf_cache;
+static int if_xennetrxbuf_cache_inited=0;
+
 static int  xennet_xenbus_match(device_t, cfdata_t, void *);
 static void xennet_xenbus_attach(device_t, device_t, void *);
 static int  xennet_xenbus_detach(device_t, int);
@@ -202,6 +204,7 @@ static void xennet_alloc_rx_buffer(struc
 static void xennet_free_rx_buffer(struct xennet_xenbus_softc *);
 static void xennet_tx_complete(struct xennet_xenbus_softc *);
 static void xennet_rx_mbuf_free(struct mbuf *, void *, size_t, void *);
+static void xennet_rx_free_req(struct xennet_rxreq *);
 static int  xennet_handler(void *);
 static int  xennet_talk_to_backend(struct xennet_xenbus_softc *);
 #ifdef XENNET_DEBUG_DUMP
@@ -278,6 +281,14 @@ xennet_xenbus_attach(device_t parent, de
 	sc->sc_xbusd = xa->xa_xbusd;
 	sc->sc_xbusd->xbusd_otherend_changed = xennet_backend_changed;
 
+	/* xenbus ensure 2 devices can't be probed at the same time */
+	if (if_xennetrxbuf_cache_inited == 0) {
+		if_xennetrxbuf_cache = pool_cache_init(PAGE_SIZE, 0, 0, 0,
+		"xnfrx", NULL, IPL_VM, NULL, NULL, NULL);
+		if_xennetrxbuf_cache_inited = 1;
+	}
+		
+
 	/* initialize free RX and RX request lists */
 	SLIST_INIT(&sc->sc_txreq_head);
 	for (i = 0; i < NET_TX_RING_SIZE; i++) {
@@ -291,13 +302,10 @@ xennet_xenbus_attach(device_t parent, de
 		struct xennet_rxreq *rxreq = &sc->sc_rxreqs[i];
 		rxreq->rxreq_id = i;
 		rxreq->rxreq_sc = sc;
-		rxreq->rxreq_va = uvm_km_alloc(kernel_map,
-		PAGE_SIZE, PAGE_SIZE, UVM_KMF_WIRED | UVM_KMF_ZERO);
+		rxreq->rxreq_va = (vaddr_t)pool_cache_get_paddr(
+		if_xennetrxbuf_cache, PR_WAITOK, &rxreq->rxreq_pa);
 		if (rxreq->rxreq_va == 0)
 			break;
-		if (!pmap_extract(pmap_kernel(), rxreq->rxreq_va,
-		&rxreq->rxreq_pa))
-			panic("%s: no pa for mapped va ?", device_xname(self));
 		rxreq->rxreq_gntref = GRANT_INVALID_REF;
 		SLIST_INSERT_HEAD(&sc->sc_rxreq_head, rxreq, rxreq_next);
 	}
@@ -560,7 +568,7 @@ xennet_alloc_rx_buffer(struct xennet_xen
 	RING_IDX i;
 	struct xennet_rxreq *req;
 	struct xen_memory_reservation reservation;
-	int s1, s2, otherend_id;
+	int s1, s2, otherend_id, notify;
 	paddr_t pfn;
 
 	otherend_id = sc->sc_xbusd->xbusd_otherend_id;
@@ -647,9 +655,10 @@ out_loop:
 	}
 
 	sc->sc_rx_ring.req_prod_pvt = req_prod + i;
-	RING_PUSH_REQUESTS(&sc->sc_rx_ring);
-
+	RING_PUSH_REQUESTS_AND_CHECK_NOTIFY(&sc->sc_rx_ring, notify);
 	splx(s1);
+	if (notify)
+		hypervisor_notify_via_evtchn(sc->sc_evtchn);
 	return;
 }
 
@@ -669,14 +678,6 @@ xennet_free_rx_buffer(struct xennet_xenb
 	for (i = 0; i < NET_RX_RING_SIZE; i++) {
 		struct xennet_rxreq *rxreq = &sc->sc_rxreqs[i];
 
-		/*
-		 * if the buffer is in transit in the network stack, wait for
-		 * the network stack to free it.
-		 */
-		while ((volatile grant_ref_t)rxreq->rxreq_gntref ==
-		GRANT_STACK_REF)
-			tsleep(xennet_xenbus_detach, PRIBIO, "xnet_free", hz/2);
-
 		if (rxreq->rxreq_gntref != GRANT_INVALID_REF) {
 			/*
 			 * this req is still granted. Get back the page or
@@ -746,7 +747,20 @@ xen

CVS commit: [netbsd-5] src/sys/arch/x68k/stand

2012-03-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Mar 17 18:38:57 UTC 2012

Modified Files:
src/sys/arch/x68k/stand [netbsd-5]: Makefile.booters
src/sys/arch/x68k/stand/boot [netbsd-5]: version
src/sys/arch/x68k/stand/boot_ufs [netbsd-5]: Makefile
src/sys/arch/x68k/stand/boot_ustar [netbsd-5]: Makefile
src/sys/arch/x68k/stand/libsa [netbsd-5]: Makefile

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1731):
sys/arch/x68k/stand/boot_ufs/Makefile: revision 1.26 via patch
sys/arch/x68k/stand/boot/version: revision 1.4 via patch
sys/arch/x68k/stand/libsa/Makefile: revision 1.27 via patch
sys/arch/x68k/stand/Makefile.booters: revision 1.7 via patch
sys/arch/x68k/stand/boot_ustar/Makefile: revision 1.19 via patch
Fix "Error occurs, please reset" boot problem on
X68030 + 060turbo in 060 mode, found on NetBSD booth
at OSC 2011 Hiroshima:
- use -D__daddr_t=int32_t for all bootloader files
  to avoid 64 bit ops in FFS
- explicitly specify -m68020-60 to avoid 64 bit mulsl/mulul
  instructions which need to be handled by 060SP emulation
  but not available in 060turbo IPL ROM
  (LFS still has uint64_t members even with 32bit daddr_t)
The problem was investigated (at least 1.6.2 bootloaders worked)
by Yasushi Oshima at OSC booth, and fixes have been confirmed
by Y.Sugahara on his 060turbo.  Thanks everyone!
Should also be pulled up to netbsd-5.
Bump version to denote 060turbo boot fix.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.88.1 src/sys/arch/x68k/stand/Makefile.booters
cvs rdiff -u -r1.2 -r1.2.136.1 src/sys/arch/x68k/stand/boot/version
cvs rdiff -u -r1.23 -r1.23.4.1 src/sys/arch/x68k/stand/boot_ufs/Makefile
cvs rdiff -u -r1.15 -r1.15.4.1 src/sys/arch/x68k/stand/boot_ustar/Makefile
cvs rdiff -u -r1.22 -r1.22.28.1 src/sys/arch/x68k/stand/libsa/Makefile

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

Modified files:

Index: src/sys/arch/x68k/stand/Makefile.booters
diff -u src/sys/arch/x68k/stand/Makefile.booters:1.4 src/sys/arch/x68k/stand/Makefile.booters:1.4.88.1
--- src/sys/arch/x68k/stand/Makefile.booters:1.4	Sun Dec 11 12:19:44 2005
+++ src/sys/arch/x68k/stand/Makefile.booters	Sat Mar 17 18:38:57 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.booters,v 1.4 2005/12/11 12:19:44 christos Exp $
+#	$NetBSD: Makefile.booters,v 1.4.88.1 2012/03/17 18:38:57 bouyer Exp $
 
 S?=	${.CURDIR}/../../../..
 
@@ -6,6 +6,8 @@ S?=	${.CURDIR}/../../../..
 
 CFLAGS+= -ffreestanding
 
+CPPFLAGS+=	-D__daddr_t=int32_t
+
 machine-links:
 	-rm -f machine && \
 	ln -s $S/arch/${MACHINE}/include machine

Index: src/sys/arch/x68k/stand/boot/version
diff -u src/sys/arch/x68k/stand/boot/version:1.2 src/sys/arch/x68k/stand/boot/version:1.2.136.1
--- src/sys/arch/x68k/stand/boot/version:1.2	Fri Nov  9 19:53:16 2001
+++ src/sys/arch/x68k/stand/boot/version	Sat Mar 17 18:38:56 2012
@@ -1,4 +1,4 @@
-$NetBSD: version,v 1.2 2001/11/09 19:53:16 scw Exp $
+$NetBSD: version,v 1.2.136.1 2012/03/17 18:38:56 bouyer Exp $
 
 NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE.  The format of this
 file is important - make sure the entries are appended on end, last item
@@ -7,3 +7,4 @@ is taken as the current.
 0.3:	xxboot, ancient monolithic bootstrap program.
 1.0:	Initial version of the libsa-based bootstrap loader.
 1.1:	loadfile() update to avoid backwards seeks for ELF Program Headers.
+1.1.1:	Avoid exception on 68060 in UFS ops.

Index: src/sys/arch/x68k/stand/boot_ufs/Makefile
diff -u src/sys/arch/x68k/stand/boot_ufs/Makefile:1.23 src/sys/arch/x68k/stand/boot_ufs/Makefile:1.23.4.1
--- src/sys/arch/x68k/stand/boot_ufs/Makefile:1.23	Sat Oct 25 22:27:38 2008
+++ src/sys/arch/x68k/stand/boot_ufs/Makefile	Sat Mar 17 18:38:56 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.23 2008/10/25 22:27:38 apb Exp $
+#	$NetBSD: Makefile,v 1.23.4.1 2012/03/17 18:38:56 bouyer Exp $
 
 NOMAN=		# defined
 
@@ -37,12 +37,13 @@ vers.c:	${VERSIONFILE}
 	${HOST_SH} ${S}/conf/newvers_stand.sh -DM ${.ALLSRC} ${MACHINE} ${NEWVERSWHAT}
 
 CFLAGS=	-Os -fomit-frame-pointer
+CFLAGS+= -m68020-60
 CFLAGS+= -W -Wall -Wstrict-prototypes -Wmissing-prototypes
 CPPFLAGS+= -DTEXTADDR="0x$(TEXT)" -DBOOT_TEXTADDR="0x$(BOOT_TEXT)"
 CPPFLAGS+= -DBOOT=\"$(BOOT)\" -DBOOT_VERS=\"$(VERSION)\"
 CPPFLAGS+= -DSCSI_ADHOC_BOOTPART
 #CPPFLAGS+= -DBOOT_DEBUG
-CPPFLAGS+= -DUSE_FFS -DUSE_LFS -DUSE_UFS1 -DUSE_UFS2 -D__daddr_t=int32_t
+CPPFLAGS+= -DUSE_FFS -DUSE_LFS -DUSE_UFS1 -DUSE_UFS2
 CPPFLAGS+= -I${COMMONDIR} -I${LIBIOCS} -I${S} -I. -D_STANDALONE
 AFLAGS=	   ${CFLAGS:M-[ID]*}
 .if ${OBJECT_FMT} == "ELF"

Index: src/sys/arch/x68k/stand/boot_ustar/Makefile
diff -u src/sys/arch/x68k/stand/boot_ustar/Makefile:1.15 src/sys/arch/x68k/stand/boot_ustar/Makefile:1.15.4.1
--- src/sys/arch/x68k/stand/boot_ustar/Makefile:1.15	Sat Oct 25 22:27:38 2008
+++ src/sys/arch/x68k/stand/boot_ustar/Makefile	Sat Mar 17 18:38:57 2012

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

2012-03-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Mar 17 18:40:20 UTC 2012

Modified Files:
src/sys/arch/x68k/dev [netbsd-5]: kbd.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1732):
sys/arch/x68k/dev/kbd.c: revision 1.37
Calling psignal(9) (via EV_WAKEUP()) in interrupt handlers
could cause mutex error panic, so defer it via softint(9).
This should fix panic on heavy key strokes during running Xserver.
Should be pulled up to netbsd-5.
XXX: amiga and atari might have the similar problem?


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.35.6.1 src/sys/arch/x68k/dev/kbd.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/x68k/dev/kbd.c
diff -u src/sys/arch/x68k/dev/kbd.c:1.35 src/sys/arch/x68k/dev/kbd.c:1.35.6.1
--- src/sys/arch/x68k/dev/kbd.c:1.35	Wed Jun 25 08:14:59 2008
+++ src/sys/arch/x68k/dev/kbd.c	Sat Mar 17 18:40:20 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: kbd.c,v 1.35 2008/06/25 08:14:59 isaki Exp $	*/
+/*	$NetBSD: kbd.c,v 1.35.6.1 2012/03/17 18:40:20 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kbd.c,v 1.35 2008/06/25 08:14:59 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kbd.c,v 1.35.6.1 2012/03/17 18:40:20 bouyer Exp $");
 
 #include "ite.h"
 #include "bell.h"
@@ -350,7 +350,7 @@ kbdintr(void *arg)
 	fe->value = KEY_UP(c) ? VKEY_UP : VKEY_DOWN;
 	getmicrotime(&fe->time);
 	sc->sc_events.ev_put = put;
-	EV_WAKEUP(&sc->sc_events);
+	softint_schedule(sc->sc_softintr_cookie);
 
 	return 0;
 }
@@ -358,10 +358,14 @@ kbdintr(void *arg)
 void
 kbdsoftint(void *arg)			/* what if ite is not configured? */
 {
+	struct kbd_softc *sc = arg;
 	int s;
 
 	s = spltty();
 
+	if (sc->sc_event_mode)
+		EV_WAKEUP(&sc->sc_events);
+
 	while(kbdgetoff < kbdputoff)
 		ite_filter(kbdbuf[kbdgetoff++ & KBDBUFMASK]);
 	kbdgetoff = kbdputoff = 0;



CVS commit: [netbsd-5] src/sys/arch/hp700/hp700

2012-03-30 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Fri Mar 30 19:29:24 UTC 2012

Modified Files:
src/sys/arch/hp700/hp700 [netbsd-5]: intr.c

Log Message:
Pull up following revision(s) (requested by skrll in ticket #1745):
sys/arch/hp700/hp700/intr.c: revision 1.38
Check for HPPA_SID_KERNEL when checking for interrupt in the
mutex_enter critical section.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.15.10.1 src/sys/arch/hp700/hp700/intr.c

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

Modified files:

Index: src/sys/arch/hp700/hp700/intr.c
diff -u src/sys/arch/hp700/hp700/intr.c:1.15 src/sys/arch/hp700/hp700/intr.c:1.15.10.1
--- src/sys/arch/hp700/hp700/intr.c:1.15	Mon Apr 28 20:23:19 2008
+++ src/sys/arch/hp700/hp700/intr.c	Fri Mar 30 19:29:24 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.c,v 1.15 2008/04/28 20:23:19 martin Exp $	*/
+/*	$NetBSD: intr.c,v 1.15.10.1 2012/03/30 19:29:24 bouyer Exp $	*/
 
 /*
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.15 2008/04/28 20:23:19 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.15.10.1 2012/03/30 19:29:24 bouyer Exp $");
 
 #define __MUTEX_PRIVATE
 
@@ -399,7 +399,8 @@ hppa_intr(struct trapframe *frame)
 	 * handlers need to aquire the mutex, they could
 	 * deadlock if the owner value is left unset.
 	 */
-	if (frame->tf_iioq_head >= (u_int)mutex_enter_crit_start &&
+	if (frame->tf_iisq_head == HPPA_SID_KERNEL &&
+	frame->tf_iioq_head >= (u_int)mutex_enter_crit_start &&
 	frame->tf_iioq_head <= (u_int)mutex_enter_crit_end &&
 	frame->tf_ret0 != 0)
 		((kmutex_t *)frame->tf_arg0)->mtx_owner = (uintptr_t)curlwp;



CVS commit: [netbsd-5] src/sys/arch/x86/x86

2012-04-21 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sat Apr 21 16:00:47 UTC 2012

Modified Files:
src/sys/arch/x86/x86 [netbsd-5]: ioapic.c

Log Message:
Pull up following revision(s) (requested by jakllsch in ticket #1747):
sys/arch/x86/x86/ioapic.c: revision 1.46
sys/arch/x86/x86/ioapic.c: revision 1.47
Mask all i8259 interrupts in ioapic_enable().
Should fix PR kern/45160.
Need i8259.h for previous.


To generate a diff of this commit:
cvs rdiff -u -r1.38.6.1 -r1.38.6.2 src/sys/arch/x86/x86/ioapic.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/x86/x86/ioapic.c
diff -u src/sys/arch/x86/x86/ioapic.c:1.38.6.1 src/sys/arch/x86/x86/ioapic.c:1.38.6.2
--- src/sys/arch/x86/x86/ioapic.c:1.38.6.1	Tue Sep 29 23:55:49 2009
+++ src/sys/arch/x86/x86/ioapic.c	Sat Apr 21 16:00:47 2012
@@ -1,4 +1,4 @@
-/* 	$NetBSD: ioapic.c,v 1.38.6.1 2009/09/29 23:55:49 snj Exp $	*/
+/* 	$NetBSD: ioapic.c,v 1.38.6.2 2012/04/21 16:00:47 riz Exp $	*/
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ioapic.c,v 1.38.6.1 2009/09/29 23:55:49 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ioapic.c,v 1.38.6.2 2012/04/21 16:00:47 riz Exp $");
 
 #include "opt_ddb.h"
 
@@ -83,6 +83,7 @@ __KERNEL_RCSID(0, "$NetBSD: ioapic.c,v 1
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -461,6 +462,8 @@ ioapic_enable(void)
 	if (ioapics == NULL)
 		return;
 
+	i8259_setmask(0x);
+
 	if (ioapics->sc_flags & IOAPIC_PICMODE) {
 		aprint_debug_dev(ioapics->sc_dev,
  "writing to IMCR to disable pics\n");



CVS commit: [netbsd-5] src/sys/arch/xen/xen

2012-05-08 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Tue May  8 12:11:46 UTC 2012

Modified Files:
src/sys/arch/xen/xen [netbsd-5]: hypervisor.c

Log Message:
Pull up the following revisions(s) (requested by riz in ticket #1748):
sys/arch/xen/xen/hypervisor.c:  revision 1.62 via patch

Retrieve and print the hypervisor "extra" (teeny) version.


To generate a diff of this commit:
cvs rdiff -u -r1.42.4.5 -r1.42.4.6 src/sys/arch/xen/xen/hypervisor.c

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

Modified files:

Index: src/sys/arch/xen/xen/hypervisor.c
diff -u src/sys/arch/xen/xen/hypervisor.c:1.42.4.5 src/sys/arch/xen/xen/hypervisor.c:1.42.4.6
--- src/sys/arch/xen/xen/hypervisor.c:1.42.4.5	Mon Sep 26 09:56:54 2011
+++ src/sys/arch/xen/xen/hypervisor.c	Tue May  8 12:11:45 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: hypervisor.c,v 1.42.4.5 2011/09/26 09:56:54 sborrill Exp $ */
+/* $NetBSD: hypervisor.c,v 1.42.4.6 2012/05/08 12:11:45 sborrill Exp $ */
 
 /*
  * Copyright (c) 2005 Manuel Bouyer.
@@ -63,7 +63,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hypervisor.c,v 1.42.4.5 2011/09/26 09:56:54 sborrill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hypervisor.c,v 1.42.4.6 2012/05/08 12:11:45 sborrill Exp $");
 
 #include 
 #include 
@@ -239,13 +239,17 @@ hypervisor_attach(device_t parent, devic
 
 #endif /* NPCI */
 	union hypervisor_attach_cookie hac;
+	char xen_extra_version[XEN_EXTRAVERSION_LEN];
 
 	xenkernfs_init();
 
 #ifdef XEN3
 	xen_version = HYPERVISOR_xen_version(XENVER_version, NULL);
-	aprint_normal(": Xen version %d.%d\n", (xen_version & 0x) >> 16,
-	   xen_version & 0x);
+	memset(xen_extra_version, 0, sizeof(xen_extra_version));
+	HYPERVISOR_xen_version(XENVER_extraversion, xen_extra_version);
+	aprint_normal(": Xen version %d.%d%s\n",
+		(xen_version & 0x) >> 16, xen_version & 0x,
+		 xen_extra_version);
 
 	xengnt_init();
 



CVS commit: [netbsd-5] src/sys/arch/xen/xen

2012-05-08 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Tue May  8 15:51:14 UTC 2012

Modified Files:
src/sys/arch/xen/xen [netbsd-5]: hypervisor.c

Log Message:
Fix XEN2 build after last pullup


To generate a diff of this commit:
cvs rdiff -u -r1.42.4.6 -r1.42.4.7 src/sys/arch/xen/xen/hypervisor.c

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

Modified files:

Index: src/sys/arch/xen/xen/hypervisor.c
diff -u src/sys/arch/xen/xen/hypervisor.c:1.42.4.6 src/sys/arch/xen/xen/hypervisor.c:1.42.4.7
--- src/sys/arch/xen/xen/hypervisor.c:1.42.4.6	Tue May  8 12:11:45 2012
+++ src/sys/arch/xen/xen/hypervisor.c	Tue May  8 15:51:13 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: hypervisor.c,v 1.42.4.6 2012/05/08 12:11:45 sborrill Exp $ */
+/* $NetBSD: hypervisor.c,v 1.42.4.7 2012/05/08 15:51:13 sborrill Exp $ */
 
 /*
  * Copyright (c) 2005 Manuel Bouyer.
@@ -63,7 +63,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hypervisor.c,v 1.42.4.6 2012/05/08 12:11:45 sborrill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hypervisor.c,v 1.42.4.7 2012/05/08 15:51:13 sborrill Exp $");
 
 #include 
 #include 
@@ -230,6 +230,7 @@ hypervisor_attach(device_t parent, devic
 {
 #ifdef XEN3
 	int xen_version;
+	char xen_extra_version[XEN_EXTRAVERSION_LEN];
 #endif
 #if NPCI >0
 #ifndef XEN3
@@ -239,7 +240,6 @@ hypervisor_attach(device_t parent, devic
 
 #endif /* NPCI */
 	union hypervisor_attach_cookie hac;
-	char xen_extra_version[XEN_EXTRAVERSION_LEN];
 
 	xenkernfs_init();
 



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

2012-05-19 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sat May 19 16:39:24 UTC 2012

Modified Files:
src/sys/arch/x86/pci [netbsd-5]: pci_machdep.c

Log Message:
Pull up following revision(s) (requested by gendalia in ticket #1755):
sys/arch/x86/pci/pci_machdep.c: revision 1.36
add SIS 740 to the list of chipsets known to implement PCI configuration
mode 1 incorrectly, from Jason White
(see thread "ACPI issue with old Shuttle system" on port-i386)


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.34.10.1 src/sys/arch/x86/pci/pci_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/x86/pci/pci_machdep.c
diff -u src/sys/arch/x86/pci/pci_machdep.c:1.34 src/sys/arch/x86/pci/pci_machdep.c:1.34.10.1
--- src/sys/arch/x86/pci/pci_machdep.c:1.34	Mon Apr 28 20:23:40 2008
+++ src/sys/arch/x86/pci/pci_machdep.c	Sat May 19 16:39:24 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_machdep.c,v 1.34 2008/04/28 20:23:40 martin Exp $	*/
+/*	$NetBSD: pci_machdep.c,v 1.34.10.1 2012/05/19 16:39:24 riz Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.34 2008/04/28 20:23:40 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.34.10.1 2012/05/19 16:39:24 riz Exp $");
 
 #include 
 #include 
@@ -168,6 +168,8 @@ struct {
 	/* Parallels Desktop for Mac */
 	_qe(0, 2, 0, PCI_VENDOR_PARALLELS, PCI_PRODUCT_PARALLELS_VIDEO),
 	_qe(0, 3, 0, PCI_VENDOR_PARALLELS, PCI_PRODUCT_PARALLELS_TOOLS),
+	/* SIS 740 */
+	_qe(0, 0, 0, PCI_VENDOR_SIS, PCI_PRODUCT_SIS_740),
 	/* SIS 741 */
 	_qe(0, 0, 0, PCI_VENDOR_SIS, PCI_PRODUCT_SIS_741),
 	{0, 0x} /* patchable */



CVS commit: [netbsd-5] src/sys/arch/xen/xen

2012-10-26 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Fri Oct 26 11:31:50 UTC 2012

Modified Files:
src/sys/arch/xen/xen [netbsd-5]: xengnt.c

Log Message:
Pull up the following revisions(s) (requested by royger in ticket #1805):
sys/arch/xen/xen/xengnt.c:  revision 1.25 via patch

Prevents a memory corruption issue that freezes a Xen DomU and can also
cause fs corruption. Addresses PR port-xen/47057 and port-xen/47056


To generate a diff of this commit:
cvs rdiff -u -r1.10.4.1 -r1.10.4.2 src/sys/arch/xen/xen/xengnt.c

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

Modified files:

Index: src/sys/arch/xen/xen/xengnt.c
diff -u src/sys/arch/xen/xen/xengnt.c:1.10.4.1 src/sys/arch/xen/xen/xengnt.c:1.10.4.2
--- src/sys/arch/xen/xen/xengnt.c:1.10.4.1	Sat Jan 30 19:14:20 2010
+++ src/sys/arch/xen/xen/xengnt.c	Fri Oct 26 11:31:50 2012
@@ -1,4 +1,4 @@
-/*  $NetBSD: xengnt.c,v 1.10.4.1 2010/01/30 19:14:20 snj Exp $  */
+/*  $NetBSD: xengnt.c,v 1.10.4.2 2012/10/26 11:31:50 sborrill Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xengnt.c,v 1.10.4.1 2010/01/30 19:14:20 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xengnt.c,v 1.10.4.2 2012/10/26 11:31:50 sborrill Exp $");
 
 #include 
 #include 
@@ -55,6 +55,9 @@ __KERNEL_RCSID(0, "$NetBSD: xengnt.c,v 1
 
 #define NR_GRANT_ENTRIES_PER_PAGE (PAGE_SIZE / sizeof(grant_entry_t))
 
+/* External tools reserve first few grant table entries. */
+#define NR_RESERVED_ENTRIES 8
+
 int gnt_nr_grant_frames;
 int gnt_max_grant_frames;
 
@@ -127,7 +130,7 @@ xengnt_more_entries()
 	gnttab_setup_table_t setup;
 	u_long *pages;
 	int nframes_new = gnt_nr_grant_frames + 1;
-	int i;
+	int i, start_gnt;
 
 	if (gnt_nr_grant_frames == gnt_max_grant_frames)
 		return ENOMEM;
@@ -167,9 +170,14 @@ xengnt_more_entries()
 
 	/*
 	 * add the grant entries associated to the last grant table frame
-	 * and mark them as free
+	 * and mark them as free. Prevent using the first grants (from 0 to 8)
+	 * since they are used by the tools.
 	 */
-	for (i = gnt_nr_grant_frames * NR_GRANT_ENTRIES_PER_PAGE;
+	start_gnt = (gnt_nr_grant_frames * NR_GRANT_ENTRIES_PER_PAGE) <
+	(NR_RESERVED_ENTRIES + 1) ?
+	(NR_RESERVED_ENTRIES + 1) :
+	(gnt_nr_grant_frames * NR_GRANT_ENTRIES_PER_PAGE);
+	for (i = start_gnt;
 	i < nframes_new * NR_GRANT_ENTRIES_PER_PAGE;
 	i++) {
 		KASSERT(gnt_entries[last_gnt_entry] == XENGNT_NO_ENTRY);
@@ -206,7 +214,7 @@ xengnt_get_entry()
 	entry = gnt_entries[last_gnt_entry];
 	gnt_entries[last_gnt_entry] = XENGNT_NO_ENTRY;
 	splx(s);
-	KASSERT(entry != XENGNT_NO_ENTRY);
+	KASSERT(entry != XENGNT_NO_ENTRY && entry > NR_RESERVED_ENTRIES);
 	KASSERT(last_gnt_entry >= 0 && last_gnt_entry <= gnt_max_grant_frames * NR_GRANT_ENTRIES_PER_PAGE);
 	return entry;
 }
@@ -218,6 +226,7 @@ static void
 xengnt_free_entry(grant_ref_t entry)
 {
 	int s = splvm();
+	KASSERT(entry > NR_RESERVED_ENTRIES);
 	KASSERT(gnt_entries[last_gnt_entry] == XENGNT_NO_ENTRY);
 	KASSERT(last_gnt_entry >= 0 && last_gnt_entry <= gnt_max_grant_frames * NR_GRANT_ENTRIES_PER_PAGE);
 	gnt_entries[last_gnt_entry] = entry;



CVS commit: [netbsd-5] src/sys/arch/i386/i386

2012-10-31 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Oct 31 15:34:58 UTC 2012

Modified Files:
src/sys/arch/i386/i386 [netbsd-5]: locore.S

Log Message:
Pull up following revision(s) (requested by chs in ticket #1810):
sys/arch/i386/i386/locore.S: revision 1.103
in osyscall, set the PSL_I bit into the correct field of the trapframe.
it was going into tf_eip instead of tf_eflags, which would sometimes
corrupt %eip and always return to user mode with interrupts disabled.
this was found with a netbsd 1.0 binary, and dsl@ points out that
this should also fix PR 41342.


To generate a diff of this commit:
cvs rdiff -u -r1.78.4.3 -r1.78.4.4 src/sys/arch/i386/i386/locore.S

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

Modified files:

Index: src/sys/arch/i386/i386/locore.S
diff -u src/sys/arch/i386/i386/locore.S:1.78.4.3 src/sys/arch/i386/i386/locore.S:1.78.4.4
--- src/sys/arch/i386/i386/locore.S:1.78.4.3	Sat Apr  4 17:39:09 2009
+++ src/sys/arch/i386/i386/locore.S	Wed Oct 31 15:34:58 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.78.4.3 2009/04/04 17:39:09 snj Exp $	*/
+/*	$NetBSD: locore.S,v 1.78.4.4 2012/10/31 15:34:58 riz Exp $	*/
 
 /*
  * Copyright-o-rama!
@@ -134,7 +134,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.78.4.3 2009/04/04 17:39:09 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.78.4.4 2012/10/31 15:34:58 riz Exp $");
 
 #include "opt_compat_oldboot.h"
 #include "opt_ddb.h"
@@ -1081,7 +1081,7 @@ IDTVEC(osyscall)
 	cli			# must be first instruction
 	pushfl			# set eflags in trap frame
 	popl	8(%esp)
-	orl	$PSL_I,(%esp)	# re-enable ints on return to user
+	orl	$PSL_I,8(%esp)	# re-enable ints on return to user
 	pushl	$7		# size of instruction for restart
 	jmp	syscall1
 IDTVEC_END(osyscall)



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

2012-11-06 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Tue Nov  6 20:10:49 UTC 2012

Modified Files:
src/sys/arch/macppc/dev [netbsd-5]: awacs.c

Log Message:
Pull up following revision(s) (requested by phx in ticket #1816):
sys/arch/macppc/dev/awacs.c: revision 1.43
My PowerMac3,1 is using gpio4 to detect a connected headphone, and I would bet
that the same is true for PowerMac3,2.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.35.4.1 src/sys/arch/macppc/dev/awacs.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/macppc/dev/awacs.c
diff -u src/sys/arch/macppc/dev/awacs.c:1.35 src/sys/arch/macppc/dev/awacs.c:1.35.4.1
--- src/sys/arch/macppc/dev/awacs.c:1.35	Wed Aug 27 14:31:46 2008
+++ src/sys/arch/macppc/dev/awacs.c	Tue Nov  6 20:10:49 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: awacs.c,v 1.35 2008/08/27 14:31:46 jmcneill Exp $	*/
+/*	$NetBSD: awacs.c,v 1.35.4.1 2012/11/06 20:10:49 riz Exp $	*/
 
 /*-
  * Copyright (c) 2000 Tsubai Masanari.  All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: awacs.c,v 1.35 2008/08/27 14:31:46 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: awacs.c,v 1.35.4.1 2012/11/06 20:10:49 riz Exp $");
 
 #include 
 #include 
@@ -281,7 +281,9 @@ static const char *detect_reversed[] = {
 	"AAPL,3500",
 	NULL};
 
-static const char *use_gpio4[] = {	"PowerMac3,3",
+static const char *use_gpio4[] = {	"PowerMac3,1",
+	"PowerMac3,2",
+	"PowerMac3,3",
 	NULL};
 
 /*



CVS commit: [netbsd-5] src/sys/arch/x86/x86

2012-11-26 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Mon Nov 26 19:44:27 UTC 2012

Modified Files:
src/sys/arch/x86/x86 [netbsd-5]: identcpu.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #1819):
sys/arch/x86/x86/identcpu.c: revision 1.31
PR/41267: Andrius V: 5.0 RC4 does not detect second CPU in VIA. VIA Eden cpuid
lies about it's ability to do cmpxchg8b. Turn the feature on using the FCR MSR.
Needs pullup to both 5 and 6.


To generate a diff of this commit:
cvs rdiff -u -r1.10.4.6 -r1.10.4.7 src/sys/arch/x86/x86/identcpu.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/x86/x86/identcpu.c
diff -u src/sys/arch/x86/x86/identcpu.c:1.10.4.6 src/sys/arch/x86/x86/identcpu.c:1.10.4.7
--- src/sys/arch/x86/x86/identcpu.c:1.10.4.6	Thu Apr 22 20:02:48 2010
+++ src/sys/arch/x86/x86/identcpu.c	Mon Nov 26 19:44:26 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: identcpu.c,v 1.10.4.6 2010/04/22 20:02:48 snj Exp $	*/
+/*	$NetBSD: identcpu.c,v 1.10.4.7 2012/11/26 19:44:26 riz Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.10.4.6 2010/04/22 20:02:48 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.10.4.7 2012/11/26 19:44:26 riz Exp $");
 
 #include "opt_enhanced_speedstep.h"
 #include "opt_intel_odcm.h"
@@ -387,13 +387,31 @@ static void
 cpu_probe_winchip(struct cpu_info *ci)
 {
 
-	if (cpu_vendor != CPUVENDOR_IDT ||
-	CPUID2FAMILY(ci->ci_signature) != 5)
+	if (cpu_vendor != CPUVENDOR_IDT)
 		return;
 
-	if (CPUID2MODEL(ci->ci_signature) == 4) {
-		/* WinChip C6 */
-		ci->ci_feature_flags &= ~CPUID_TSC;
+	switch (CPUID2FAMILY(ci->ci_signature)) {
+	case 5:
+ 		/* WinChip C6 */
+		if (CPUID2MODEL(ci->ci_signature) == 4)
+			ci->ci_feature_flags &= ~CPUID_TSC;
+		break;
+	case 6:
+		/*
+		 * VIA Eden ESP 
+		 *
+		 * Quoting from page 3-4 of: "VIA Eden ESP Processor Datasheet"
+		 * http://www.via.com.tw/download/mainboards/6/14/Eden20v115.pdf
+		 * 
+		 * 1. The CMPXCHG8B instruction is provided and always enabled,
+		 *however, it appears disabled in the corresponding CPUID
+		 *function bit 0 to avoid a bug in an early version of
+		 *Windows NT. However, this default can be changed via a
+		 *bit in the FCR MSR.
+		 */
+		ci->ci_feature_flags |= CPUID_CX8;
+		wrmsr(MSR_VIA_FCR, rdmsr(MSR_VIA_FCR) | 0x0001);
+		break;
 	}
 }
 



CVS commit: [netbsd-5] src/sys/arch/x86/include

2012-11-27 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Nov 28 04:39:03 UTC 2012

Modified Files:
src/sys/arch/x86/include [netbsd-5]: specialreg.h

Log Message:
Pull up following revision(s) (requested by christos in ticket #1819):
sys/arch/x86/include/specialreg.h: revision 1.58
Add VIA Eden FCR MSR.


To generate a diff of this commit:
cvs rdiff -u -r1.31.4.1 -r1.31.4.2 src/sys/arch/x86/include/specialreg.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/x86/include/specialreg.h
diff -u src/sys/arch/x86/include/specialreg.h:1.31.4.1 src/sys/arch/x86/include/specialreg.h:1.31.4.2
--- src/sys/arch/x86/include/specialreg.h:1.31.4.1	Tue Jun 16 02:23:31 2009
+++ src/sys/arch/x86/include/specialreg.h	Wed Nov 28 04:39:03 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: specialreg.h,v 1.31.4.1 2009/06/16 02:23:31 snj Exp $	*/
+/*	$NetBSD: specialreg.h,v 1.31.4.2 2012/11/28 04:39:03 riz Exp $	*/
 
 /*-
  * Copyright (c) 1991 The Regents of the University of California.
@@ -360,6 +360,11 @@
 #define MSR_VIA_ACE_ENABLE	0x1000
 
 /*
+ * VIA "Eden" MSRs
+ */
+#define MSR_VIA_FCR 		MSR_VIA_ACE
+
+/*
  * AMD K6/K7 MSRs.
  */
 #define	MSR_K6_UWCCR		0xc085



CVS commit: [netbsd-5] src/sys/arch/i386/conf

2012-02-04 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sat Feb  4 17:04:09 UTC 2012

Modified Files:
src/sys/arch/i386/conf [netbsd-5]: INSTALL_FLOPPY

Log Message:
Pull up following revision(s) (requested by hannken in ticket #1719):
sys/arch/i386/conf/INSTALL_FLOPPY: revision 1.15
Add virtio driver to INSTALL_FLOPPY.
Requested by Matthias Scheler  for particular cases like
http://mail-index.netbsd.org/netbsd-users/2011/09/13/msg009128.html


To generate a diff of this commit:
cvs rdiff -u -r1.1.16.2 -r1.1.16.3 src/sys/arch/i386/conf/INSTALL_FLOPPY

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/INSTALL_FLOPPY
diff -u src/sys/arch/i386/conf/INSTALL_FLOPPY:1.1.16.2 src/sys/arch/i386/conf/INSTALL_FLOPPY:1.1.16.3
--- src/sys/arch/i386/conf/INSTALL_FLOPPY:1.1.16.2	Tue Nov 18 01:56:58 2008
+++ src/sys/arch/i386/conf/INSTALL_FLOPPY	Sat Feb  4 17:04:09 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: INSTALL_FLOPPY,v 1.1.16.2 2008/11/18 01:56:58 snj Exp $
+#	$NetBSD: INSTALL_FLOPPY,v 1.1.16.3 2012/02/04 17:04:09 bouyer Exp $
 #
 #	INSTALL - Installation kernel.
 #
@@ -742,6 +742,11 @@ url*	at uhub? port ?		# Realtek RTL8150L
 # Planetconnect Satellite receiver driver.
 #satlink0 at isa? port 0x300 drq 1
 
+# Virtio devices
+virtio*	at pci? dev ? function ?	# Virtio PCI device
+viomb*	at virtio?			# Virtio memory balloon device
+ld*	at virtio?			# Virtio disk device
+vioif*	at virtio?			# Virtio network device
 
 # Pull in optional local configuration
 cinclude "arch/i386/conf/INSTALL.local"



CVS commit: [netbsd-5] src/sys/arch/x68k/x68k

2012-06-03 Thread Julian Coleman
Module Name:src
Committed By:   jdc
Date:   Sun Jun  3 08:46:36 UTC 2012

Modified Files:
src/sys/arch/x68k/x68k [netbsd-5]: clock.c

Log Message:
Pull up revision 1.34 (requested by isaki in ticket #1765).

With the freerunnnig mode, set 0 (=256count) not 0xff (=255count)
in Timer-D.  It fixes the clock ticked faster when timecounter uses
"mfp" (as default choice).  It was introduced in rev 1.24 in 2006.
Thanks tsutsui@ for many comments.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.28.6.1 src/sys/arch/x68k/x68k/clock.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/x68k/x68k/clock.c
diff -u src/sys/arch/x68k/x68k/clock.c:1.28 src/sys/arch/x68k/x68k/clock.c:1.28.6.1
--- src/sys/arch/x68k/x68k/clock.c:1.28	Wed Jun 25 08:14:59 2008
+++ src/sys/arch/x68k/x68k/clock.c	Sun Jun  3 08:46:36 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock.c,v 1.28 2008/06/25 08:14:59 isaki Exp $	*/
+/*	$NetBSD: clock.c,v 1.28.6.1 2012/06/03 08:46:36 jdc Exp $	*/
 
 /*
  * Copyright (c) 1982, 1990, 1993
@@ -77,7 +77,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.28 2008/06/25 08:14:59 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.28.6.1 2012/06/03 08:46:36 jdc Exp $");
 
 #include "clock.h"
 
@@ -182,7 +182,7 @@ cpu_initclocks(void)
 	mfp_set_tcdr(CLOCKS_PER_SEC / hz);
 	mfp_bit_set_ierb(MFP_INTR_TIMER_C);
 
-	mfp_set_tddr(0xff);	/* maximum free run -- only 8 bits wide */
+	mfp_set_tddr(0);	/* maximum free run -- only 8 bits wide */
 	mfp_set_tcdcr(mfp_get_tcdcr() | 0x07);	/* 1/200 prescaler */
 
 	tc_init(&tc);



CVS commit: [netbsd-5] src/sys/arch/xen/xenbus

2012-06-12 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Tue Jun 12 20:48:58 UTC 2012

Modified Files:
src/sys/arch/xen/xenbus [netbsd-5]: xenbus_probe.c

Log Message:
Pull up following revision(s) (requested by sborrill in ticket #1768):
sys/arch/xen/xenbus/xenbus_probe.c: revision 1.36
sys/arch/xen/xenbus/xenbus_probe.c: revision 1.37
Sort vif and vbd device IDs numerically so that attach order does not depend
on the order they are passed in through xenstore. While this works for
hand-crafted Xen configuration files, it does not work for XenServer, XCP or
EC2 instances. This means that adding an extra virtual disk can make the
domU unbootable.
ID is actually based on the Linux device major/minor so this approach isn't
entirely correct (for instance, you can specify devices to be non-contiguous
which doesn't fit too well with our autoconf approach), but it works as a
first approximation.
Tested by me on XenServer and riz@ on EC2. OK bouyer@
Fix problem where devices with ID 0 were skipped as invalid as it didn't
distinguish between numerical zero and invalid numeric string.


To generate a diff of this commit:
cvs rdiff -u -r1.26.2.4 -r1.26.2.5 src/sys/arch/xen/xenbus/xenbus_probe.c

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

Modified files:

Index: src/sys/arch/xen/xenbus/xenbus_probe.c
diff -u src/sys/arch/xen/xenbus/xenbus_probe.c:1.26.2.4 src/sys/arch/xen/xenbus/xenbus_probe.c:1.26.2.5
--- src/sys/arch/xen/xenbus/xenbus_probe.c:1.26.2.4	Fri Sep 23 12:44:52 2011
+++ src/sys/arch/xen/xenbus/xenbus_probe.c	Tue Jun 12 20:48:58 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: xenbus_probe.c,v 1.26.2.4 2011/09/23 12:44:52 sborrill Exp $ */
+/* $NetBSD: xenbus_probe.c,v 1.26.2.5 2012/06/12 20:48:58 riz Exp $ */
 /**
  * Talks to Xen Store to figure out what devices we have.
  *
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xenbus_probe.c,v 1.26.2.4 2011/09/23 12:44:52 sborrill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xenbus_probe.c,v 1.26.2.5 2012/06/12 20:48:58 riz Exp $");
 
 #if 0
 #define DPRINTK(fmt, args...) \
@@ -269,7 +269,8 @@ static int
 xenbus_probe_device_type(const char *path, const char *type,
 int (*create)(struct xenbus_device *))
 {
-	int err, i, msize;
+	int err, i, pos, msize;
+	int *lookup = NULL;
 	unsigned long state;
 	char **dir;
 	unsigned int dir_n = 0;
@@ -283,8 +284,62 @@ xenbus_probe_device_type(const char *pat
 	if (err)
 		return err;
 
-	for (i = 0; i < dir_n; i++) {
+	/* Only sort frontend devices i.e. create == NULL*/
+	if (dir_n > 1 && create == NULL) {
+		int minp;
+		unsigned long minv;
+		unsigned long *id;
+
+		lookup = malloc(sizeof(int) * dir_n, M_DEVBUF,
+		M_WAITOK | M_ZERO);
+		if (lookup == NULL)
+			panic("can't malloc lookup");
+
+		id = malloc(sizeof(unsigned long) * dir_n, M_DEVBUF,
+		M_WAITOK | M_ZERO);
+		if (id == NULL)
+			panic("can't malloc id");
+
+		/* Convert string values to numeric; skip invalid */
+		for (i = 0; i < dir_n; i++) {
+			/*
+			 * Add one to differentiate numerical zero from invalid
+			 * string. Has no effect on sort order.
+			 */
+			id[i] = strtoul(dir[i], &ep, 10) + 1;
+			if (dir[i][0] == '\0' || *ep != '\0')
+id[i] = 0;
+		}
+		
+		/* Build lookup table in ascending order */
+		for (pos = 0; pos < dir_n; ) {
+			minv = UINT32_MAX;
+			minp = -1;
+			for (i = 0; i < dir_n; i++) {
+if (id[i] < minv && id[i] > 0) {
+	minv = id[i];
+	minp = i;
+}
+			}
+			if (minp >= 0) {
+lookup[pos++] = minp;
+id[minp] = 0;
+			}
+			else
+break;
+		}
+		
+		free(id, M_DEVBUF);
+		/* Adjust in case we had to skip non-numeric entries */
+		dir_n = pos;
+	}
+
+	for (pos = 0; pos < dir_n; pos++) {
 		err = 0;
+		if (lookup)
+			i = lookup[pos];
+		else
+			i = pos;
 		/*
 		 * add size of path to size of xenbus_device. xenbus_device
 		 * already has room for one char in xbusd_path.
@@ -361,6 +416,9 @@ xenbus_probe_device_type(const char *pat
 		talk_to_otherend(xbusd);
 	}
 	free(dir, M_DEVBUF);
+	if (lookup)
+		free(lookup, M_DEVBUF);
+	
 	return err;
 }
 



CVS commit: [netbsd-5] src/sys/arch/amd64/amd64

2012-06-12 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Tue Jun 12 23:18:13 UTC 2012

Modified Files:
src/sys/arch/amd64/amd64 [netbsd-5]: machdep.c netbsd32_machdep.c

Log Message:
Pull up following revision(s) (requested by spz in ticket #1773):
sys/arch/amd64/amd64/machdep.c: revision 1.184
sys/arch/amd64/amd64/netbsd32_machdep.c: revision 1.77
If the user process provided a bogus signal handler address, kill it
now instead of trying to jump to the bogus address.


To generate a diff of this commit:
cvs rdiff -u -r1.102.4.13 -r1.102.4.14 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.55.4.3 -r1.55.4.4 \
src/sys/arch/amd64/amd64/netbsd32_machdep.c

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

Modified files:

Index: src/sys/arch/amd64/amd64/machdep.c
diff -u src/sys/arch/amd64/amd64/machdep.c:1.102.4.13 src/sys/arch/amd64/amd64/machdep.c:1.102.4.14
--- src/sys/arch/amd64/amd64/machdep.c:1.102.4.13	Thu Apr 22 20:02:48 2010
+++ src/sys/arch/amd64/amd64/machdep.c	Tue Jun 12 23:18:13 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.102.4.13 2010/04/22 20:02:48 snj Exp $	*/
+/*	$NetBSD: machdep.c,v 1.102.4.14 2012/06/12 23:18:13 riz Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008
@@ -112,7 +112,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.102.4.13 2010/04/22 20:02:48 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.102.4.14 2012/06/12 23:18:13 riz Exp $");
 
 /* #define XENDEBUG_LOW  */
 
@@ -634,6 +634,16 @@ sendsig(const ksiginfo_t *ksi, const sig
 	/* Remember that we're now on the signal stack. */
 	if (onstack)
 		l->l_sigstk.ss_flags |= SS_ONSTACK;
+
+	if ((vaddr_t)catcher >= VM_MAXUSER_ADDRESS) {
+		/* 
+		 * process has given an invalid address for the
+		 * handler. Stop it, but do not do it before so
+		 * we can return the right info to userland (or in core dump)
+		 */
+		sigexit(l, SIGILL);
+		/* NOTREACHED */
+	}
 }
 
 void 

Index: src/sys/arch/amd64/amd64/netbsd32_machdep.c
diff -u src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.55.4.3 src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.55.4.4
--- src/sys/arch/amd64/amd64/netbsd32_machdep.c:1.55.4.3	Tue Sep  7 19:38:20 2010
+++ src/sys/arch/amd64/amd64/netbsd32_machdep.c	Tue Jun 12 23:18:13 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep.c,v 1.55.4.3 2010/09/07 19:38:20 bouyer Exp $	*/
+/*	$NetBSD: netbsd32_machdep.c,v 1.55.4.4 2012/06/12 23:18:13 riz Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.55.4.3 2010/09/07 19:38:20 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.55.4.4 2012/06/12 23:18:13 riz Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_coredump.h"
@@ -278,6 +278,16 @@ netbsd32_sendsig_sigcontext(const ksigin
 	/* Remember that we're now on the signal stack. */
 	if (onstack)
 		l->l_sigstk.ss_flags |= SS_ONSTACK;
+
+	if ((vaddr_t)catcher >= VM_MAXUSER_ADDRESS32) {
+		/*
+		 * process has given an invalid address for the
+		 * handler. Stop it, but do not do it before so
+		 * we can return the right info to userland (or in core dump)
+		 */
+		sigexit(l, SIGILL);
+		/* NOTREACHED */
+	}
 }
 #endif
 
@@ -366,6 +376,16 @@ netbsd32_sendsig_siginfo(const ksiginfo_
 	/* Remember that we're now on the signal stack. */
 	if (onstack)
 		l->l_sigstk.ss_flags |= SS_ONSTACK;
+
+	if ((vaddr_t)catcher >= VM_MAXUSER_ADDRESS32) {
+		/*
+		 * process has given an invalid address for the
+		 * handler. Stop it, but do not do it before so
+		 * we can return the right info to userland (or in core dump)
+		 */
+		sigexit(l, SIGILL);
+		/* NOTREACHED */
+	}
 }
 
 void



CVS commit: [netbsd-5] src/sys/arch/amd64/amd64

2012-06-15 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Fri Jun 15 09:20:00 UTC 2012

Modified Files:
src/sys/arch/amd64/amd64 [netbsd-5]: trap.c

Log Message:
Fix build fallout from ticket #1772 for Xen kernels


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

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

Modified files:

Index: src/sys/arch/amd64/amd64/trap.c
diff -u src/sys/arch/amd64/amd64/trap.c:1.52.4.3 src/sys/arch/amd64/amd64/trap.c:1.52.4.4
--- src/sys/arch/amd64/amd64/trap.c:1.52.4.3	Tue Jun 12 20:43:47 2012
+++ src/sys/arch/amd64/amd64/trap.c	Fri Jun 15 09:20:00 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.52.4.3 2012/06/12 20:43:47 riz Exp $	*/
+/*	$NetBSD: trap.c,v 1.52.4.4 2012/06/15 09:20:00 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.52.4.3 2012/06/12 20:43:47 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.52.4.4 2012/06/15 09:20:00 bouyer Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -183,7 +183,9 @@ trap(struct trapframe *frame)
 #if defined(COMPAT_10) || defined(COMPAT_IBCS2)
 	extern char IDTVEC(oosyscall)[];
 #endif
+#ifndef XEN
 	struct trapframe *vframe;
+#endif
 	void *onfault;
 	int error;
 	uint64_t cr2;



CVS commit: [netbsd-5] src/sys/arch/vax/include

2012-08-22 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Aug 22 20:59:47 UTC 2012

Modified Files:
src/sys/arch/vax/include [netbsd-5]: cpu.h

Log Message:
Pull up following revision(s) (requested by abs in ticket #1780):
sys/arch/vax/include/cpu.h: revision 1.94 via patch
Change cpu_idle to be an inline which sets IPL to 1 and then back to 0
so simh can recognize the kernel is idle.


To generate a diff of this commit:
cvs rdiff -u -r1.85 -r1.85.14.1 src/sys/arch/vax/include/cpu.h

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

Modified files:

Index: src/sys/arch/vax/include/cpu.h
diff -u src/sys/arch/vax/include/cpu.h:1.85 src/sys/arch/vax/include/cpu.h:1.85.14.1
--- src/sys/arch/vax/include/cpu.h:1.85	Tue Mar 11 05:34:02 2008
+++ src/sys/arch/vax/include/cpu.h	Wed Aug 22 20:59:47 2012
@@ -1,4 +1,4 @@
-/*  $NetBSD: cpu.h,v 1.85 2008/03/11 05:34:02 matt Exp $  */
+/*  $NetBSD: cpu.h,v 1.85.14.1 2012/08/22 20:59:47 bouyer Exp $  */
 
 /*
  * Copyright (c) 1994 Ludd, University of Lule}, Sweden
@@ -165,7 +165,18 @@ extern int cpu_printfataltraps;
 #define	cpu_proc_fork(x, y)	do { } while (/*CONSCOND*/0)
 #define	cpu_lwp_free(l, f)	do { } while (/*CONSCOND*/0)
 #define	cpu_lwp_free2(l)	do { } while (/*CONSCOND*/0)
-#define	cpu_idle()		do { } while (/*CONSCOND*/0)
+
+/*
+ * This allows SIMH to recognize the kernel wants to sleep.
+ */
+static inline void
+cpu_idle(void)
+{
+	int ipl = mfpr(PR_IPL);
+	mtpr(1, PR_IPL);
+	mtpr(ipl, PR_IPL);
+}
+
 static inline bool
 cpu_intr_p(void)
 {



CVS commit: [netbsd-5] src/sys/arch/x86/x86

2012-08-22 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Aug 22 21:18:20 UTC 2012

Modified Files:
src/sys/arch/x86/x86 [netbsd-5]: intel_busclock.c

Log Message:
sys/arch/x86/x86/intel_busclock.c   patch

Add support for Xeon E5
[sborrill, ticket #1787]


To generate a diff of this commit:
cvs rdiff -u -r1.5.10.4 -r1.5.10.5 src/sys/arch/x86/x86/intel_busclock.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/x86/x86/intel_busclock.c
diff -u src/sys/arch/x86/x86/intel_busclock.c:1.5.10.4 src/sys/arch/x86/x86/intel_busclock.c:1.5.10.5
--- src/sys/arch/x86/x86/intel_busclock.c:1.5.10.4	Tue Aug 31 10:50:22 2010
+++ src/sys/arch/x86/x86/intel_busclock.c	Wed Aug 22 21:18:19 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: intel_busclock.c,v 1.5.10.4 2010/08/31 10:50:22 bouyer Exp $	*/
+/*	$NetBSD: intel_busclock.c,v 1.5.10.5 2012/08/22 21:18:19 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intel_busclock.c,v 1.5.10.4 2010/08/31 10:50:22 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_busclock.c,v 1.5.10.5 2012/08/22 21:18:19 bouyer Exp $");
 
 #include 
 #include 
@@ -98,7 +98,7 @@ p3_get_bus_clock(struct cpu_info *ci)
 		break;
 	case 0xc: /* Core i7, Atom, model 1 */
 		/*
-		 * XXX (See also case 0xe)
+		 * XXX (See also case 0xe and 0xd)
 		 * Some core i7 CPUs can report model 0xc.
 		 * Newer CPUs will GP when attemping to access MSR_FSB_FREQ.
 		 * In the long-term, use ACPI instead of all this.
@@ -121,7 +121,19 @@ p3_get_bus_clock(struct cpu_info *ci)
 			goto print_msr;
 		}
 		break;
-	case 0xd: /* Pentium M (90 nm, Dothan) */
+	case 0xd: /* Pentium M (90 nm, Dothan), some Xeons */
+		/*
+		 * XXX (See also case 0xc and 0xd)
+		 * Some Xeons can report model 0xd, e.g. E5-2630
+		 * Newer CPUs will GP when attemping to access MSR_FSB_FREQ.
+		 * In the long-term, use ACPI instead of all this.
+		 */
+		switch (CPUID2EXTMODEL(ci->ci_signature)) {
+		case 0x2:
+			aprint_debug("%s: unable to determine bus speed",
+			device_xname(ci->ci_dev));
+			goto print_msr;
+		}
 		msr = rdmsr(MSR_FSB_FREQ);
 		bus = (msr >> 0) & 0x7;
 		switch (bus) {



CVS commit: [netbsd-5] src/sys/arch/hp700/hp700

2013-10-20 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Oct 20 14:05:36 UTC 2013

Modified Files:
src/sys/arch/hp700/hp700 [netbsd-5]: autoconf.c

Log Message:
Pull up following revision(s) (requested by skrll in ticket #1886):
sys/arch/hp700/hp700/autoconf.c: revision 1.51
Remember to unmap pagezero once we've finished with it. Found by gcc 4.8.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.26.14.1 src/sys/arch/hp700/hp700/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/hp700/hp700/autoconf.c
diff -u src/sys/arch/hp700/hp700/autoconf.c:1.26 src/sys/arch/hp700/hp700/autoconf.c:1.26.14.1
--- src/sys/arch/hp700/hp700/autoconf.c:1.26	Sun Mar 30 12:39:32 2008
+++ src/sys/arch/hp700/hp700/autoconf.c	Sun Oct 20 14:05:36 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.26 2008/03/30 12:39:32 skrll Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.26.14.1 2013/10/20 14:05:36 bouyer Exp $	*/
 
 /*	$OpenBSD: autoconf.c,v 1.15 2001/06/25 00:43:10 mickey Exp $	*/
 
@@ -86,7 +86,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.26 2008/03/30 12:39:32 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.26.14.1 2013/10/20 14:05:36 bouyer Exp $");
 
 #include "opt_kgdb.h"
 #include "opt_useleds.h"
@@ -446,6 +446,8 @@ cpu_rootconf(void)
 	}
 	printf("dp_flags 0x%x pz_class 0x%x\n", PAGE0->mem_boot.pz_dp.dp_flags,
 	PAGE0->mem_boot.pz_class);
+
+	hp700_pagezero_unmap(pagezero_cookie);
 #endif /* DEBUG */
 
 	if (boot_device != NULL)



CVS commit: [netbsd-5] src/sys/arch/xen/xen

2013-12-11 Thread Stephen Borrill
Module Name:src
Committed By:   sborrill
Date:   Wed Dec 11 16:00:46 UTC 2013

Modified Files:
src/sys/arch/xen/xen [netbsd-5]: evtchn.c

Log Message:
Pull up the following revisions(s) (requested by bouyer in ticket #1890):
sys/arch/xen/xen/evtchn.c:  revision 1.70

Remove the "evtchn_do_event: handler %p didn't lower ipl %d %d\n" printf
as analysis shows it actually isn't a bug in the handler, but related to
spin mutexes. Fixes port-xen/46313


To generate a diff of this commit:
cvs rdiff -u -r1.39.4.2 -r1.39.4.3 src/sys/arch/xen/xen/evtchn.c

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

Modified files:

Index: src/sys/arch/xen/xen/evtchn.c
diff -u src/sys/arch/xen/xen/evtchn.c:1.39.4.2 src/sys/arch/xen/xen/evtchn.c:1.39.4.3
--- src/sys/arch/xen/xen/evtchn.c:1.39.4.2	Fri Nov 14 02:59:39 2008
+++ src/sys/arch/xen/xen/evtchn.c	Wed Dec 11 16:00:46 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: evtchn.c,v 1.39.4.2 2008/11/14 02:59:39 snj Exp $	*/
+/*	$NetBSD: evtchn.c,v 1.39.4.3 2013/12/11 16:00:46 sborrill Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -64,7 +64,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: evtchn.c,v 1.39.4.2 2008/11/14 02:59:39 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: evtchn.c,v 1.39.4.3 2013/12/11 16:00:46 sborrill Exp $");
 
 #include "opt_xen.h"
 #include "isa.h"
@@ -301,13 +301,6 @@ splx:
 	ih_fun = (void *)ih->ih_fun;
 	ih_fun(ih->ih_arg, regs);
 	cli();
-	if (ci->ci_ilevel != i) {
-		printf("evtchn_do_event: "
-		"handler %p didn't lower "
-		"ipl %d %d\n",
-		ih_fun, ci->ci_ilevel, i);
-		ci->ci_ilevel = i;
-	}
 }
 hypervisor_enable_ipl(i);
 /* more pending IPLs may have been registered */



CVS commit: [netbsd-5] src/sys/arch/x86/acpi

2009-03-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Mar 24 20:20:57 UTC 2009

Modified Files:
src/sys/arch/x86/acpi [netbsd-5]: acpi_wakeup.c

Log Message:
Pull up following revision(s) (requested by drochner in ticket #589):
sys/arch/x86/acpi/acpi_wakeup.c: revision 1.12
sync TSC on resume (because CPUs were switched off in the meantime),
otherwise we get diverging timecounters leading to eg the monotonic
clock jump backwards
(pullup candidate)


To generate a diff of this commit:
cvs rdiff -u -r1.10.4.1 -r1.10.4.2 src/sys/arch/x86/acpi/acpi_wakeup.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/x86/acpi/acpi_wakeup.c
diff -u src/sys/arch/x86/acpi/acpi_wakeup.c:1.10.4.1 src/sys/arch/x86/acpi/acpi_wakeup.c:1.10.4.2
--- src/sys/arch/x86/acpi/acpi_wakeup.c:1.10.4.1	Tue Nov 25 18:22:37 2008
+++ src/sys/arch/x86/acpi/acpi_wakeup.c	Tue Mar 24 20:20:57 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_wakeup.c,v 1.10.4.1 2008/11/25 18:22:37 snj Exp $	*/
+/*	$NetBSD: acpi_wakeup.c,v 1.10.4.2 2009/03/24 20:20:57 snj Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_wakeup.c,v 1.10.4.1 2008/11/25 18:22:37 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_wakeup.c,v 1.10.4.2 2009/03/24 20:20:57 snj Exp $");
 
 /*-
  * Copyright (c) 2001 Takanori Watanabe 
@@ -101,6 +101,7 @@
 #include 
 
 #include 
+#include 
 
 #include "acpi_wakecode.h"
 
@@ -307,6 +308,8 @@
 
 	atomic_or_32(&ci->ci_flags, CPUF_RUNNING);
 	atomic_or_32(&cpus_running, ci->ci_cpumask);
+	tsc_sync_ap(ci);
+	tsc_sync_ap(ci);
 
 	x86_enable_intr();
 }
@@ -391,6 +394,9 @@
 
 		while ((ci->ci_flags & CPUF_RUNNING) == 0)
 			x86_pause();
+
+		tsc_sync_bp(ci);
+		tsc_sync_bp(ci);
 	}
 #endif
 



CVS commit: [netbsd-5] src/sys/arch/sh3/include

2009-03-24 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Mar 24 20:24:38 UTC 2009

Modified Files:
src/sys/arch/sh3/include [netbsd-5]: intr.h

Log Message:
Pull up following revision(s) (requested by uwe in ticket #591):
sys/arch/sh3/include/intr.h: revision 1.26
Interrupt handling changes (revision 1.23) bumped down _IPL_N to 8 for
some reason.  Restore it to correct 16.
HTF did hpcsh work all this time with hd6446x_imask[_IPL_N] indexed
with IPLs 0..15 is a mistery...  Discovered by accidentally triggering
hd64461 timer interrupt that is not enabled and should have been
masked.
_IPL_N used to be *also incorrect* 15 before Andy's change, which
makes one wonder if dumb luck is severly underappreciated.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.25.10.1 src/sys/arch/sh3/include/intr.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/sh3/include/intr.h
diff -u src/sys/arch/sh3/include/intr.h:1.25 src/sys/arch/sh3/include/intr.h:1.25.10.1
--- src/sys/arch/sh3/include/intr.h:1.25	Mon Apr 28 20:23:35 2008
+++ src/sys/arch/sh3/include/intr.h	Tue Mar 24 20:24:38 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.h,v 1.25 2008/04/28 20:23:35 martin Exp $	*/
+/*	$NetBSD: intr.h,v 1.25.10.1 2009/03/24 20:24:38 snj Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 #define	IST_LEVEL		3	/* level-triggered */
 
 /* Interrupt priority levels */
-#define	_IPL_N		8
+#define	_IPL_N		16
 #define	_IPL_NSOFT	4
 
 #define	IPL_NONE	0	/* nothing */



CVS commit: [netbsd-5] src/sys/arch/i386/i386

2009-03-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Mar 27 17:25:15 UTC 2009

Modified Files:
src/sys/arch/i386/i386 [netbsd-5]: trap.c vector.S

Log Message:
Pull up following revision(s) (requested by mrg in ticket #609):
sys/arch/i386/i386/vector.S: revision 1.44
sys/arch/i386/i386/trap.c: revision 1.244
remove a bunch of special casing to handle improperly set segment
registers.  if we faulted trying to set them, just fall into
"we_re_toast", and arrange for a SEGV to be delivered to the
userland process.  fixes kernel mode faults.
from andrew doran.


To generate a diff of this commit:
cvs rdiff -u -r1.241 -r1.241.4.1 src/sys/arch/i386/i386/trap.c
cvs rdiff -u -r1.42 -r1.42.6.1 src/sys/arch/i386/i386/vector.S

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

Modified files:

Index: src/sys/arch/i386/i386/trap.c
diff -u src/sys/arch/i386/i386/trap.c:1.241 src/sys/arch/i386/i386/trap.c:1.241.4.1
--- src/sys/arch/i386/i386/trap.c:1.241	Wed Oct 15 06:51:17 2008
+++ src/sys/arch/i386/i386/trap.c	Fri Mar 27 17:25:15 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.241 2008/10/15 06:51:17 wrstuden Exp $	*/
+/*	$NetBSD: trap.c,v 1.241.4.1 2009/03/27 17:25:15 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.241 2008/10/15 06:51:17 wrstuden Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.241.4.1 2009/03/27 17:25:15 msaitoh Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -276,13 +276,9 @@
 	struct proc *p;
 	int type = frame->tf_trapno;
 	struct pcb *pcb;
-	extern char fusubail[], kcopy_fault[],
-		resume_iret[], resume_pop_ds[], resume_pop_es[],
-		resume_pop_fs[], resume_pop_gs[],
-		IDTVEC(osyscall)[];
+	extern char fusubail[], kcopy_fault[], trapreturn[], IDTVEC(osyscall)[];
 	struct trapframe *vframe;
 	ksiginfo_t ksi;
-	int resume;
 	void *onfault;
 	int error;
 	uint32_t cr2;
@@ -397,52 +393,25 @@
 		/*
 		 * Check for failure during return to user mode.
 		 *
-		 * We do this by looking at the instruction we faulted on.  The
-		 * specific instructions we recognize only happen when
+		 * We do this by looking at the instruction we faulted on.
+		 * The specific instructions we recognize only happen when
 		 * returning from a trap, syscall, or interrupt.
 		 *
 		 * At this point, there are (at least) two trap frames on
 		 * the kernel stack; we presume here that we faulted while
 		 * loading our registers out of the outer one.
-		 *
-		 * The inner frame does not involve a ring crossing, so it
-		 * ends right before &frame.tf_esp.  The outer frame has
-		 * been partially consumed by the INTRFASTEXIT; exactly
-		 * how much depends which register we were popping when we
-		 * faulted, so we compute the outer frame address based on
-		 * register-dependant offsets computed from &frame.tf_esp
-		 * below.  To decide whether this was a kernel-mode or
-		 * user-mode error, we look at this outer frame's tf_cs
-		 * and tf_eflags, which are (fortunately) not consumed until
-		 * the final instruction of INTRFASTEXIT.
-		 *
-		 * XXX
-		 * The heuristic used here will currently fail for the case of
-		 * one of the 2 pop instructions faulting when returning from a
-		 * a fast interrupt.  This should not be possible.  It can be
-		 * fixed by rearranging the trap frame so that the stack format
-		 * at this point is the same as on exit from a `slow'
-		 * interrupt.
 		 */
 		switch (*(u_char *)frame->tf_eip) {
 		case 0xcf:	/* iret */
 			vframe = (void *)((int)&frame->tf_esp -
 			offsetof(struct trapframe, tf_eip));
-			resume = (int)resume_iret;
 			break;
 		case 0x8e:
 			switch (*(uint32_t *)frame->tf_eip) {
 			case 0x0c245c8e:	/* movl 0xc(%esp,1),%ds */
-resume = (int)resume_pop_ds;
-break;
 			case 0x0824448e:	/* movl 0x8(%esp,1),%es */
-resume = (int)resume_pop_es;
-break;
 			case 0x0424648e:	/* movl 0x4(%esp,1),%fs */
-resume = (int)resume_pop_fs;
-break;
 			case 0x00246c8e:	/* movl 0x0(%esp,1),%gs */
-resume = (int)resume_pop_gs;
 break;
 			default:
 goto we_re_toast;
@@ -455,18 +424,34 @@
 		if (KERNELMODE(vframe->tf_cs, vframe->tf_eflags))
 			goto we_re_toast;
 
-		frame->tf_eip = resume;
-
 		/*
-		 * clear PSL_NT.  it can be set by userland because setting it
-		 * isn't a privileged operation.
+		 * Arrange to signal the thread, which will reset its
+		 * registers in the outer frame.  This also allows us to
+		 * capture the invalid register state in sigcontext,
+		 * packaged up with the signal delivery.  We restart
+		 * on return at 'trapreturn', acting as if nothing
+		 * happened, restarting the return to user with our new
+		 * set of registers.
+		 *
+		 * Clear PSL_NT.  It can be set by userland because setting
+		 * it isn't a privileged operation.
 		 *
-		 * set PSL_I.  otherwise, if SIG

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

2009-03-31 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Apr  1 00:32:09 UTC 2009

Modified Files:
src/sys/arch/sgimips/dev [netbsd-5]: crmfbreg.h

Log Message:
Pull up following revision(s) (requested by macallan in ticket #625):
sys/arch/sgimips/dev/crmfbreg.h: revision 1.10
add a few more register definitions, needed by the latest crime_drv.


To generate a diff of this commit:
cvs rdiff -u -r1.8.8.1 -r1.8.8.2 src/sys/arch/sgimips/dev/crmfbreg.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/sgimips/dev/crmfbreg.h
diff -u src/sys/arch/sgimips/dev/crmfbreg.h:1.8.8.1 src/sys/arch/sgimips/dev/crmfbreg.h:1.8.8.2
--- src/sys/arch/sgimips/dev/crmfbreg.h:1.8.8.1	Wed Feb 25 20:16:54 2009
+++ src/sys/arch/sgimips/dev/crmfbreg.h	Wed Apr  1 00:32:09 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: crmfbreg.h,v 1.8.8.1 2009/02/25 20:16:54 snj Exp $ */
+/* $NetBSD: crmfbreg.h,v 1.8.8.2 2009/04/01 00:32:09 snj Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill 
@@ -206,6 +206,18 @@
 
 /* clip mode */
 #define DE_CLIPMODE_ENABLE	0x0800
+/* enable testing against mask register n */
+#define DE_CLIPMODE_MASK0_EN	0x0200
+#define DE_CLIPMODE_MASK1_EN	0x0100
+#define DE_CLIPMODE_MASK2_EN	0x0080
+#define DE_CLIPMODE_MASK3_EN	0x0040
+#define DE_CLIPMODE_MASK4_EN	0x0020
+/* let pixels pass if inside mask n, otherwise outside */
+#define DE_CLIPMODE_MASK0_IN	0x0010
+#define DE_CLIPMODE_MASK1_IN	0x0008
+#define DE_CLIPMODE_MASK2_IN	0x0004
+#define DE_CLIPMODE_MASK3_IN	0x0002
+#define DE_CLIPMODE_MASK4_IN	0x0001
 
 /* draw mode */
 #define DE_DRAWMODE_NO_CONF	0x0080	/* disable coherency testing */
@@ -270,6 +282,17 @@
 /* status register */
 #define CRIME_DE_STATUS		0x4000
 #define CRIME_DE_IDLE		0x1000
-#define CRIME_DE_READY		0x0200
+#define CRIME_DE_SETUP_IDLE	0x0800
+#define CRIME_DE_PIXPIPE_IDLE	0x0400
+#define CRIME_DE_MTE_IDLE	0x0200
+#define CRIME_DE_LEVEL_MASK	0x01fc
+#define CRIME_DE_RD_PTR_MASK	0x0003f000
+#define CRIME_DE_WR_PTR_MASK	0x0fc0
+#define CRIME_DE_BUF_START	0x003f
+
+#define CRIME_DE_LEVEL_SHIFT	18
+#define CRIME_DE_LEVEL_MAX	0x7f
+#define CRIME_PIPE_LEVEL(x)	((x & CRIME_DE_LEVEL_MASK) >>  \
+  CRIME_DE_LEVEL_SHIFT)
 
 #endif /* CRMFBREG_H */



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

2009-04-07 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Apr  7 23:28:30 UTC 2009

Modified Files:
src/sys/arch/x86/pci [netbsd-5]: ichlpcib.c

Log Message:
Pull up following revision(s) (requested by joerg in ticket #669):
sys/arch/x86/pci/ichlpcib.c: revision 1.16
Restore SpeedStep settings on shutdown. Some BIOSes don't like it, if
SpeedStep is enabled and powerdown fails otherwise. Fixes PR kern/40487.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.14.4.1 src/sys/arch/x86/pci/ichlpcib.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/x86/pci/ichlpcib.c
diff -u src/sys/arch/x86/pci/ichlpcib.c:1.14 src/sys/arch/x86/pci/ichlpcib.c:1.14.4.1
--- src/sys/arch/x86/pci/ichlpcib.c:1.14	Mon Oct 13 15:10:51 2008
+++ src/sys/arch/x86/pci/ichlpcib.c	Tue Apr  7 23:28:30 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ichlpcib.c,v 1.14 2008/10/13 15:10:51 joerg Exp $	*/
+/*	$NetBSD: ichlpcib.c,v 1.14.4.1 2009/04/07 23:28:30 snj Exp $	*/
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ichlpcib.c,v 1.14 2008/10/13 15:10:51 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ichlpcib.c,v 1.14.4.1 2009/04/07 23:28:30 snj Exp $");
 
 #include 
 #include 
@@ -86,6 +86,9 @@
 	uint32_t		sc_hpet_reg;
 #endif
 
+	/* Speedstep */
+	pcireg_t		sc_pmcon_orig;
+
 	/* Power management */
 	pcireg_t		sc_pirq[2];
 	pcireg_t		sc_pmcon;
@@ -96,6 +99,7 @@
 static void lpcibattach(device_t, device_t, void *);
 static bool lpcib_suspend(device_t PMF_FN_PROTO);
 static bool lpcib_resume(device_t PMF_FN_PROTO);
+static bool lpcib_shutdown(device_t, int);
 
 static void pmtimer_configure(device_t);
 
@@ -205,6 +209,9 @@
 		return;
 	}
 
+	sc->sc_pmcon_orig = pci_conf_read(sc->sc_pcib.sc_pc, sc->sc_pcib.sc_tag,
+	LPCIB_PCI_GEN_PMCON_1);
+
 	/* For ICH6 and later, always enable RCBA */
 	if (sc->sc_has_rcba) {
 		pcireg_t rcba;
@@ -241,11 +248,23 @@
 #endif
 
 	/* Install power handler */
-	if (!pmf_device_register(self, lpcib_suspend, lpcib_resume))
+	if (!pmf_device_register1(self, lpcib_suspend, lpcib_resume,
+	lpcib_shutdown))
 		aprint_error_dev(self, "couldn't establish power handler\n");
 }
 
 static bool
+lpcib_shutdown(device_t dv, int howto)
+{
+	struct lpcib_softc *sc = device_private(dv);
+
+	pci_conf_write(sc->sc_pcib.sc_pc, sc->sc_pcib.sc_tag,
+	LPCIB_PCI_GEN_PMCON_1, sc->sc_pmcon_orig);
+
+	return true;
+}
+
+static bool
 lpcib_suspend(device_t dv PMF_FN_ARGS)
 {
 	struct lpcib_softc *sc = device_private(dv);



CVS commit: [netbsd-5] src/sys/arch/i386/i386

2009-04-10 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Apr 10 18:10:46 UTC 2009

Modified Files:
src/sys/arch/i386/i386 [netbsd-5]: kvm86.c

Log Message:
Pull up following revision(s) (requested by sborrill in ticket #683):
sys/arch/i386/i386/kvm86.c: revision 1.18
Add missing cpu.h include required by last commit.


To generate a diff of this commit:
cvs rdiff -u -r1.15.12.1 -r1.15.12.2 src/sys/arch/i386/i386/kvm86.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/i386/i386/kvm86.c
diff -u src/sys/arch/i386/i386/kvm86.c:1.15.12.1 src/sys/arch/i386/i386/kvm86.c:1.15.12.2
--- src/sys/arch/i386/i386/kvm86.c:1.15.12.1	Sat Apr  4 17:39:09 2009
+++ src/sys/arch/i386/i386/kvm86.c	Fri Apr 10 18:10:46 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: kvm86.c,v 1.15.12.1 2009/04/04 17:39:09 snj Exp $ */
+/* $NetBSD: kvm86.c,v 1.15.12.2 2009/04/10 18:10:46 snj Exp $ */
 
 /*
  * Copyright (c) 2002
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kvm86.c,v 1.15.12.1 2009/04/04 17:39:09 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kvm86.c,v 1.15.12.2 2009/04/10 18:10:46 snj Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -37,6 +37,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 



CVS commit: [netbsd-5] src/sys/arch/vax/vax

2009-04-10 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Apr 11 06:32:37 UTC 2009

Modified Files:
src/sys/arch/vax/vax [netbsd-5]: subr.S

Log Message:
Pull up following revision(s) (requested by mhitch in ticket #686):
sys/arch/vax/vax/subr.S: revision 1.26
Apply patch from mhitch@:
Make copyin(9) and copyout(9) work with 64KB or larger data blocks.
Fixes broken pipe(2) problem mentioned in PR port-vax/41139. Ok'ed by ra...@.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.25.4.1 src/sys/arch/vax/vax/subr.S

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

Modified files:

Index: src/sys/arch/vax/vax/subr.S
diff -u src/sys/arch/vax/vax/subr.S:1.25 src/sys/arch/vax/vax/subr.S:1.25.4.1
--- src/sys/arch/vax/vax/subr.S:1.25	Fri Aug 29 18:25:02 2008
+++ src/sys/arch/vax/vax/subr.S	Sat Apr 11 06:32:37 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr.S,v 1.25 2008/08/29 18:25:02 matt Exp $	   */
+/*	$NetBSD: subr.S,v 1.25.4.1 2009/04/11 06:32:37 snj Exp $	   */
 
 /*
  * Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@@ -440,7 +440,7 @@
 #
 
 ENTRY(copyout, 0)
-	movl	8(%ap),%r2
+	movl	8(%ap),%r3
 	blss	3f		# kernel space
 	movl	4(%ap),%r1
 	brb	2f
@@ -448,13 +448,18 @@
 ENTRY(copyin, 0)
 	movl	4(%ap),%r1
 	blss	3f		# kernel space
-	movl	8(%ap),%r2
-2:	mfpr	$PR_ESP,%r3
-	movab	1f,(%r3)
-	movc3	12(%ap),(%r1),(%r2)
-1:	mfpr	$PR_ESP,%r3
-	clrl	(%r3)
+	movl	8(%ap),%r3
+2:	mfpr	$PR_ESP,%r2
+	movab	1f,(%r2)
+4:	tstw	14(%ap)		# check if >= 64K
+	bneq	5f
+	movc3	12(%ap),(%r1),(%r3)
+1:	mfpr	$PR_ESP,%r2
+	clrl	(%r2)
 	ret
+5:	movc3	$0xfffc,(%r1),(%r3)
+	subl2	$0xfffc,12(%ap)
+	brb	4b
 
 3:	mnegl	$1,%r0
 	ret



CVS commit: [netbsd-5] src/sys/arch/mvme68k/stand

2009-04-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Apr 12 02:19:56 UTC 2009

Modified Files:
src/sys/arch/mvme68k/stand [netbsd-5]: Makefile.booters
src/sys/arch/mvme68k/stand/bootst [netbsd-5]: dev_tape.c version

Log Message:
Pull up following revision(s) (requested by scw in ticket #688):
sys/arch/mvme68k/stand/Makefile.booters: revision 1.18
sys/arch/mvme68k/stand/bootst/dev_tape.c: revision 1.11
sys/arch/mvme68k/stand/bootst/version: revision 1.5
Fix for install/40961: The RAMDISK kernel has grown significantly
since bootst was written. Grab 3MB of the kernel image from tape
in hackprom_diskrd() instead of 2MB.
Bump bootst version on account of the above fix.
While here, use -Os instead of -O2 to compile mvme68k stand code.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.14.88.1 src/sys/arch/mvme68k/stand/Makefile.booters
cvs rdiff -u -r1.10 -r1.10.10.1 src/sys/arch/mvme68k/stand/bootst/dev_tape.c
cvs rdiff -u -r1.4 -r1.4.132.1 src/sys/arch/mvme68k/stand/bootst/version

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/mvme68k/stand/Makefile.booters
diff -u src/sys/arch/mvme68k/stand/Makefile.booters:1.14 src/sys/arch/mvme68k/stand/Makefile.booters:1.14.88.1
--- src/sys/arch/mvme68k/stand/Makefile.booters:1.14	Sat Dec 24 22:22:33 2005
+++ src/sys/arch/mvme68k/stand/Makefile.booters	Sun Apr 12 02:19:56 2009
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile.booters,v 1.14 2005/12/24 22:22:33 tsutsui Exp $
+#	$NetBSD: Makefile.booters,v 1.14.88.1 2009/04/12 02:19:56 snj Exp $
 
 S?=		${.CURDIR}/../../../..
 MDEC_DIR?=	/usr/mdec
 RELOC?=		0x3F
-COPTS?=		-O2 -Wall -Wno-main -Wmissing-prototypes -Wstrict-prototypes \
-		-ffreestanding
+COPTS?=		-Os -Wall -Wno-main -Wmissing-prototypes -Wstrict-prototypes \
+		-ffreestanding -fomit-frame-pointer
 DEFS?= 
 STRIPFLAG?=
 

Index: src/sys/arch/mvme68k/stand/bootst/dev_tape.c
diff -u src/sys/arch/mvme68k/stand/bootst/dev_tape.c:1.10 src/sys/arch/mvme68k/stand/bootst/dev_tape.c:1.10.10.1
--- src/sys/arch/mvme68k/stand/bootst/dev_tape.c:1.10	Mon Apr 28 20:23:29 2008
+++ src/sys/arch/mvme68k/stand/bootst/dev_tape.c	Sun Apr 12 02:19:56 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: dev_tape.c,v 1.10 2008/04/28 20:23:29 martin Exp $	*/
+/*	$NetBSD: dev_tape.c,v 1.10.10.1 2009/04/12 02:19:56 snj Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -169,7 +169,7 @@
 	static int blkoffset = 0;
 
 #define	hackload_addr	((char *)0x08)	/* Load tape segment here */
-#define hackload_blocks 0x2000			/* 2Mb worth */
+#define hackload_blocks 0x3000			/* 3Mb worth */
 
 	if ((ti->flag & IGNORE_FILENUM) == 0) {
 		/*

Index: src/sys/arch/mvme68k/stand/bootst/version
diff -u src/sys/arch/mvme68k/stand/bootst/version:1.4 src/sys/arch/mvme68k/stand/bootst/version:1.4.132.1
--- src/sys/arch/mvme68k/stand/bootst/version:1.4	Fri Nov  9 19:53:14 2001
+++ src/sys/arch/mvme68k/stand/bootst/version	Sun Apr 12 02:19:56 2009
@@ -1,7 +1,8 @@
-$NetBSD: version,v 1.4 2001/11/09 19:53:14 scw Exp $
+$NetBSD: version,v 1.4.132.1 2009/04/12 02:19:56 snj Exp $
 
 1.1:	Initial bootst (from Dale Rahn)
 1.2:	Update based on sun3 tapeboot (by Chuck Cranor)
 1.3:	Support verbose/quiet boot.
 1.4:	loadfile() update:  ELF symbols no longer need backward seeks.
 1.5:	loadfile() update to avoid backwards seeks for ELF Program Headers.
+1.6:	hackprom_diskrd() needs loads up to 3MB from tape for current kernels.



CVS commit: [netbsd-5] src/sys/arch/amd64/amd64

2009-07-20 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Jul 21 00:40:13 UTC 2009

Modified Files:
src/sys/arch/amd64/amd64 [netbsd-5]: trap.c

Log Message:
Pull up following revision(s) (requested by rmind in ticket #865):
sys/arch/amd64/amd64/trap.c: revisions 1.56, 1.57
handle protection fault properly.


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

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

Modified files:

Index: src/sys/arch/amd64/amd64/trap.c
diff -u src/sys/arch/amd64/amd64/trap.c:1.52 src/sys/arch/amd64/amd64/trap.c:1.52.4.1
--- src/sys/arch/amd64/amd64/trap.c:1.52	Wed Oct 15 06:51:17 2008
+++ src/sys/arch/amd64/amd64/trap.c	Tue Jul 21 00:40:13 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.52 2008/10/15 06:51:17 wrstuden Exp $	*/
+/*	$NetBSD: trap.c,v 1.52.4.1 2009/07/21 00:40:13 snj Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.52 2008/10/15 06:51:17 wrstuden Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.52.4.1 2009/07/21 00:40:13 snj Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -325,26 +325,35 @@
 	case T_STKFLT|T_USER:
 	case T_ALIGNFLT|T_USER:
 #ifdef TRAP_SIGDEBUG
-		printf("pid %d (%s): BUS (%x) at rip %lx addr %lx\n",
+		printf("pid %d (%s): BUS/SEGV (%x) at rip %lx addr %lx\n",
 		p->p_pid, p->p_comm, type, frame->tf_rip, rcr2());
 		frame_dump(frame);
 #endif
 		KSI_INIT_TRAP(&ksi);
-		ksi.ksi_signo = SIGBUS;
 		ksi.ksi_trap = type & ~T_USER;
 		ksi.ksi_addr = (void *)rcr2();
 		switch (type) {
 		case T_SEGNPFLT|T_USER:
 		case T_STKFLT|T_USER:
+			ksi.ksi_signo = SIGBUS;
 			ksi.ksi_code = BUS_ADRERR;
 			break;
 		case T_TSSFLT|T_USER:
+			ksi.ksi_signo = SIGBUS;
 			ksi.ksi_code = BUS_OBJERR;
 			break;
 		case T_ALIGNFLT|T_USER:
+			ksi.ksi_signo = SIGBUS;
 			ksi.ksi_code = BUS_ADRALN;
 			break;
+		case T_PROTFLT|T_USER:
+			ksi.ksi_signo = SIGSEGV;
+			ksi.ksi_code = SEGV_ACCERR;
+			break;
 		default:
+#ifdef DIAGNOSTIC
+			panic("unhandled type %x\n", type);
+#endif
 			break;
 		}
 		goto trapsignal;
@@ -368,6 +377,9 @@
 			ksi.ksi_code = ILL_COPROC;
 			break;
 		default:
+#ifdef DIAGNOSTIC
+			panic("unhandled type %x\n", type);
+#endif
 			break;
 		}
 		goto trapsignal;
@@ -414,6 +426,9 @@
 			ksi.ksi_code = FPE_FLTDIV;
 			break;
 		default:
+#ifdef DIAGNOSTIC
+			panic("unhandled type %x\n", type);
+#endif
 			break;
 		}
 		goto trapsignal;



CVS commit: [netbsd-5] src/sys/arch/pmax/pmax

2009-07-26 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Jul 26 18:45:44 UTC 2009

Modified Files:
src/sys/arch/pmax/pmax [netbsd-5]: machdep.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #869):
sys/arch/pmax/pmax/machdep.c: revision 1.233
Fix an #ifdef botch in rev 1.214 that causes
[ Kernel symbol table invalid! ] message at boot,
which means no ksyms(4) support even on GENERIC kernel.
Should be pulled up to netbsd-4 and netbsd-5.


To generate a diff of this commit:
cvs rdiff -u -r1.223 -r1.223.6.1 src/sys/arch/pmax/pmax/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/pmax/pmax/machdep.c
diff -u src/sys/arch/pmax/pmax/machdep.c:1.223 src/sys/arch/pmax/pmax/machdep.c:1.223.6.1
--- src/sys/arch/pmax/pmax/machdep.c:1.223	Wed Jul  2 17:28:56 2008
+++ src/sys/arch/pmax/pmax/machdep.c	Sun Jul 26 18:45:44 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.223 2008/07/02 17:28:56 ad Exp $	*/
+/*	$NetBSD: machdep.c,v 1.223.6.1 2009/07/26 18:45:44 snj Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -77,7 +77,7 @@
  */
 
 #include 			/* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.223 2008/07/02 17:28:56 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.223.6.1 2009/07/26 18:45:44 snj Exp $");
 
 #include "fs_mfs.h"
 #include "opt_ddb.h"
@@ -234,13 +234,13 @@
 		esym = (void *)bi_syms->esym;
 		kernend = (void *)mips_round_page(esym);
 		memset(edata, 0, end - edata);
-	}
+	} else
+#ifdef EXEC_AOUT
 	/* XXX: Backwards compatibility with old bootblocks - this should
 	 * go soon...
 	 */
-#ifdef EXEC_AOUT
 	/* Exec header and symbols? */
-	else if (aout->a_midmag == 0x07018b00 && (i = aout->a_syms) != 0) {
+	if (aout->a_midmag == 0x07018b00 && (i = aout->a_syms) != 0) {
 		ssym = end;
 		i += (*(long *)(end + i + 4) + 3) & ~3;		/* strings */
 		esym = end + i + 4;



CVS commit: [netbsd-5] src/sys/arch/mips/atheros

2009-08-06 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Aug  7 06:50:48 UTC 2009

Modified Files:
src/sys/arch/mips/atheros [netbsd-5]: ar5312_board.c ar5315.c
ar5315_board.c
src/sys/arch/mips/atheros/dev [netbsd-5]: if_ath_arbus.c
src/sys/arch/mips/atheros/include [netbsd-5]: ar5312reg.h

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #775):
sys/arch/mips/atheros/ar5312_board.c: revision 1.2
sys/arch/mips/atheros/ar5315.c: revision 1.6
sys/arch/mips/atheros/ar5315_board.c: revision 1.2
sys/arch/mips/atheros/dev/if_ath_arbus.c: revision 1.16
sys/arch/mips/atheros/include/ar5312reg.h: revision 1.3
Update reference to the Atheros HAL exported headers.
`external/isc/atheros_hal/dist', former `contrib/dev/ath/' is now in cpp(1)'s
include path.
Fix build of MERAKI kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.1.72.1 src/sys/arch/mips/atheros/ar5312_board.c \
src/sys/arch/mips/atheros/ar5315_board.c
cvs rdiff -u -r1.5 -r1.5.20.1 src/sys/arch/mips/atheros/ar5315.c
cvs rdiff -u -r1.15 -r1.15.4.1 src/sys/arch/mips/atheros/dev/if_ath_arbus.c
cvs rdiff -u -r1.2 -r1.2.74.1 src/sys/arch/mips/atheros/include/ar5312reg.h

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

Modified files:

Index: src/sys/arch/mips/atheros/ar5312_board.c
diff -u src/sys/arch/mips/atheros/ar5312_board.c:1.1 src/sys/arch/mips/atheros/ar5312_board.c:1.1.72.1
--- src/sys/arch/mips/atheros/ar5312_board.c:1.1	Tue Sep 26 06:37:32 2006
+++ src/sys/arch/mips/atheros/ar5312_board.c	Fri Aug  7 06:50:47 2009
@@ -1,4 +1,4 @@
-/* $Id: ar5312_board.c,v 1.1 2006/09/26 06:37:32 gdamore Exp $ */
+/* $Id: ar5312_board.c,v 1.1.72.1 2009/08/07 06:50:47 snj Exp $ */
 /*
  * Copyright (c) 2006 Urbana-Champaign Independent Media Center.
  * Copyright (c) 2006 Garrett D'Amore.
@@ -40,7 +40,7 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ar5312_board.c,v 1.1 2006/09/26 06:37:32 gdamore Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ar5312_board.c,v 1.1.72.1 2009/08/07 06:50:47 snj Exp $");
 
 #include 
 #include 
@@ -50,7 +50,7 @@
 #include 
 #include 
 
-#include 
+#include 
 
 extern const char *ether_sprintf(const uint8_t *);
 
Index: src/sys/arch/mips/atheros/ar5315_board.c
diff -u src/sys/arch/mips/atheros/ar5315_board.c:1.1 src/sys/arch/mips/atheros/ar5315_board.c:1.1.72.1
--- src/sys/arch/mips/atheros/ar5315_board.c:1.1	Tue Sep 26 06:37:32 2006
+++ src/sys/arch/mips/atheros/ar5315_board.c	Fri Aug  7 06:50:48 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: ar5315_board.c,v 1.1 2006/09/26 06:37:32 gdamore Exp $ */
+/* $NetBSD: ar5315_board.c,v 1.1.72.1 2009/08/07 06:50:48 snj Exp $ */
 
 /*
  * Copyright (c) 2006 Urbana-Champaign Independent Media Center.
@@ -46,7 +46,7 @@
  * information data in flash for the AR5315.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ar5315_board.c,v 1.1 2006/09/26 06:37:32 gdamore Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ar5315_board.c,v 1.1.72.1 2009/08/07 06:50:48 snj Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -66,7 +66,7 @@
 #include 
 #include 
 
-#include 	/* XXX really doesn't belong in hal */
+#include 	/* XXX really doesn't belong in hal */
 
 #include 
 #include 

Index: src/sys/arch/mips/atheros/ar5315.c
diff -u src/sys/arch/mips/atheros/ar5315.c:1.5 src/sys/arch/mips/atheros/ar5315.c:1.5.20.1
--- src/sys/arch/mips/atheros/ar5315.c:1.5	Wed Jan 23 05:23:59 2008
+++ src/sys/arch/mips/atheros/ar5315.c	Fri Aug  7 06:50:48 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: ar5315.c,v 1.5 2008/01/23 05:23:59 dyoung Exp $ */
+/* $NetBSD: ar5315.c,v 1.5.20.1 2009/08/07 06:50:48 snj Exp $ */
 
 /*
  * Copyright (c) 2006 Urbana-Champaign Independent Media Center.
@@ -48,7 +48,7 @@
  * family.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ar5315.c,v 1.5 2008/01/23 05:23:59 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ar5315.c,v 1.5.20.1 2009/08/07 06:50:48 snj Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -69,7 +69,7 @@
 
 #include 
 
-#include 	/* XXX really doesn't belong in hal */
+#include 	/* XXX really doesn't belong in hal */
 
 #include 
 #include 

Index: src/sys/arch/mips/atheros/dev/if_ath_arbus.c
diff -u src/sys/arch/mips/atheros/dev/if_ath_arbus.c:1.15 src/sys/arch/mips/atheros/dev/if_ath_arbus.c:1.15.4.1
--- src/sys/arch/mips/atheros/dev/if_ath_arbus.c:1.15	Wed Jul  9 19:47:23 2008
+++ src/sys/arch/mips/atheros/dev/if_ath_arbus.c	Fri Aug  7 06:50:48 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ath_arbus.c,v 1.15 2008/07/09 19:47:23 joerg Exp $ */
+/* $NetBSD: if_ath_arbus.c,v 1.15.4.1 2009/08/07 06:50:48 snj Exp $ */
 
 /*-
  * Copyright (c) 2006 Jared D. McNeill 
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ath_arbus.c,v 1.15 2008/07/09 19:47:23 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ath_arbus.c,v 1.15.4.1 2009/08/07 06:50:48 snj Exp $");
 
 #include 
 #include 
@@ -64

CVS commit: [netbsd-5] src/sys/arch/sparc64/conf

2009-08-07 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Aug  7 23:00:02 UTC 2009

Modified Files:
src/sys/arch/sparc64/conf [netbsd-5]: std.sparc64-32

Log Message:
Pull up following revision(s) (requested by nakayama in ticket #906):
sys/arch/sparc64/conf/std.sparc64-32: revision 1.3
Revert previous.
This file is included after std.sparc64, so no need to include Atheros HAL
options in this file.


To generate a diff of this commit:
cvs rdiff -u -r1.1.80.1 -r1.1.80.2 src/sys/arch/sparc64/conf/std.sparc64-32

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/conf/std.sparc64-32
diff -u src/sys/arch/sparc64/conf/std.sparc64-32:1.1.80.1 src/sys/arch/sparc64/conf/std.sparc64-32:1.1.80.2
--- src/sys/arch/sparc64/conf/std.sparc64-32:1.1.80.1	Fri Aug  7 06:43:26 2009
+++ src/sys/arch/sparc64/conf/std.sparc64-32	Fri Aug  7 23:00:02 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: std.sparc64-32,v 1.1.80.1 2009/08/07 06:43:26 snj Exp $
+#	$NetBSD: std.sparc64-32,v 1.1.80.2 2009/08/07 23:00:02 snj Exp $
 
 #
 # Unneeded NetBSD/sparc64 kernel options when building 32-bit kernels.
@@ -10,6 +10,3 @@
 makeoptions	LP64="no"
 
 no options 	EXEC_ELF64
-
-# Atheros HAL options
-include "external/isc/atheros_hal/conf/std.ath_hal"



CVS commit: [netbsd-5] src/sys/arch/amd64/amd64

2009-08-14 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Aug 14 21:25:34 UTC 2009

Modified Files:
src/sys/arch/amd64/amd64 [netbsd-5]: trap.c

Log Message:
Pull up following revision(s) (requested by rmidn in ticket #897):
sys/arch/amd64/amd64/trap.c: revision 1.58
T_ASTFLT|T_USER: check for LP_OWEUPC in l_lpflag, not l_flag.  Also, flag
unset was on p->p_flag.  Luckily, it did not corrupt the p_flag, because
we don't have LW_ flag matching LP_OWEUPC.


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

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

Modified files:

Index: src/sys/arch/amd64/amd64/trap.c
diff -u src/sys/arch/amd64/amd64/trap.c:1.52.4.1 src/sys/arch/amd64/amd64/trap.c:1.52.4.2
--- src/sys/arch/amd64/amd64/trap.c:1.52.4.1	Tue Jul 21 00:40:13 2009
+++ src/sys/arch/amd64/amd64/trap.c	Fri Aug 14 21:25:34 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.52.4.1 2009/07/21 00:40:13 snj Exp $	*/
+/*	$NetBSD: trap.c,v 1.52.4.2 2009/08/14 21:25:34 snj Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.52.4.1 2009/07/21 00:40:13 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.52.4.2 2009/08/14 21:25:34 snj Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -387,10 +387,11 @@
 	case T_ARITHTRAP|T_USER:
 	case T_XMM|T_USER:
 		/* Already handled by fputrap(), fall through. */
-	case T_ASTFLT|T_USER:		/* Allow process switch */
+	case T_ASTFLT|T_USER:
+		/* Allow process switch. */
 		uvmexp.softs++;
-		if (l->l_flag & LP_OWEUPC) {
-			p->p_flag &= ~LP_OWEUPC;
+		if (l->l_pflag & LP_OWEUPC) {
+			l->l_pflag &= ~LP_OWEUPC;
 			ADDUPROF(l);
 		}
 		/* Allow a forced task switch. */



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

2009-08-15 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Aug 16 00:16:28 UTC 2009

Modified Files:
src/sys/arch/x86/pci [netbsd-5]: ichlpcib.c

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #912):
sys/arch/x86/pci/ichlpcib.c: revision 1.18
Fix watchdog code:
- the timer bound constants are in tick, so convert period to tick before
  checking it against the bounds
- for ICH5 or older, fix code that would have always written a 0 period
  to the register.


To generate a diff of this commit:
cvs rdiff -u -r1.14.4.1 -r1.14.4.2 src/sys/arch/x86/pci/ichlpcib.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/x86/pci/ichlpcib.c
diff -u src/sys/arch/x86/pci/ichlpcib.c:1.14.4.1 src/sys/arch/x86/pci/ichlpcib.c:1.14.4.2
--- src/sys/arch/x86/pci/ichlpcib.c:1.14.4.1	Tue Apr  7 23:28:30 2009
+++ src/sys/arch/x86/pci/ichlpcib.c	Sun Aug 16 00:16:28 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ichlpcib.c,v 1.14.4.1 2009/04/07 23:28:30 snj Exp $	*/
+/*	$NetBSD: ichlpcib.c,v 1.14.4.2 2009/08/16 00:16:28 snj Exp $	*/
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ichlpcib.c,v 1.14.4.1 2009/04/07 23:28:30 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ichlpcib.c,v 1.14.4.2 2009/08/16 00:16:28 snj Exp $");
 
 #include 
 #include 
@@ -413,6 +413,7 @@
 	struct lpcib_softc *sc = smw->smw_cookie;
 	unsigned int period;
 	uint16_t ich6period = 0;
+	uint8_t ich5period = 0;
 
 	if ((smw->smw_mode & WDOG_MODE_MASK) == WDOG_MODE_DISARMED) {
 		/* Stop the TCO timer. */
@@ -422,16 +423,16 @@
 		 * ICH6 or newer are limited to 2s min and 613s max.
 		 * ICH5 or older are limited to 4s min and 39s max.
 		 */
+		period = lpcib_tcotimer_second_to_tick(smw->smw_period);
 		if (sc->sc_has_rcba) {
-			if (smw->smw_period < LPCIB_TCOTIMER2_MIN_TICK ||
-			smw->smw_period > LPCIB_TCOTIMER2_MAX_TICK)
+			if (period < LPCIB_TCOTIMER2_MIN_TICK ||
+			period > LPCIB_TCOTIMER2_MAX_TICK)
 return EINVAL;
 		} else {
-			if (smw->smw_period < LPCIB_TCOTIMER_MIN_TICK ||
-			smw->smw_period > LPCIB_TCOTIMER_MAX_TICK)
+			if (period < LPCIB_TCOTIMER_MIN_TICK ||
+			period > LPCIB_TCOTIMER_MAX_TICK)
 return EINVAL;
 		}
-		period = lpcib_tcotimer_second_to_tick(smw->smw_period);
 		
 		/* Stop the TCO timer, */
 		tcotimer_stop(sc);
@@ -446,11 +447,11 @@
 	  LPCIB_TCO_TMR2, ich6period | period);
 		} else {
 			/* ICH5 or older */
-			period |= bus_space_read_1(sc->sc_iot, sc->sc_ioh,
+			ich5period = bus_space_read_1(sc->sc_iot, sc->sc_ioh,
 		   LPCIB_TCO_TMR);
-			period &= 0xc0;
+			ich5period &= 0xc0;
 			bus_space_write_1(sc->sc_iot, sc->sc_ioh,
-	  LPCIB_TCO_TMR, period);
+	  LPCIB_TCO_TMR, ich5period | period);
 		}
 
 		/* and start/reload the timer. */



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

2009-08-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Aug 25 18:28:04 UTC 2009

Modified Files:
src/sys/arch/macppc/dev [netbsd-5]: pbms.c

Log Message:
Pull up following revision(s) (requested by aymeric in ticket #916):
sys/arch/macppc/dev/pbms.c: revision 1.8
. use device_private() (led to immediate crash during attach)
. while there, fix the aspect ratio of the trackpad on the geyser2 model


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.7.30.1 src/sys/arch/macppc/dev/pbms.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/macppc/dev/pbms.c
diff -u src/sys/arch/macppc/dev/pbms.c:1.7 src/sys/arch/macppc/dev/pbms.c:1.7.30.1
--- src/sys/arch/macppc/dev/pbms.c:1.7	Wed Oct 17 19:55:19 2007
+++ src/sys/arch/macppc/dev/pbms.c	Tue Aug 25 18:28:03 2009
@@ -1,4 +1,4 @@
-/* $Id: pbms.c,v 1.7 2007/10/17 19:55:19 garbled Exp $ */
+/* $Id: pbms.c,v 1.7.30.1 2009/08/25 18:28:03 snj Exp $ */
 
 /*
  * Copyright (c) 2005, Johan Wallén
@@ -243,7 +243,7 @@
/* 15 inch PowerBooks */
POWERBOOK_TOUCHPAD(15, 0x020e, 85, 16, 57), /* XXX Not tested. */
POWERBOOK_TOUCHPAD(15, 0x020f, 85, 16, 57),
-   POWERBOOK_TOUCHPAD(15, 0x0215, 64, 16, 43),
+   POWERBOOK_TOUCHPAD(15, 0x0215, 90, 15, 107),
/* 17 inch PowerBooks */
POWERBOOK_TOUCHPAD(17, 0x020d, 71, 26, 68)  /* XXX Not tested. */
 #undef POWERBOOK_TOUCHPAD
@@ -348,7 +348,7 @@
 	struct wsmousedev_attach_args a;
 	struct uhidev_attach_arg *uha = aux;
 	struct pbms_dev *pd;
-	struct pbms_softc *sc = (struct pbms_softc *)self;
+	struct pbms_softc *sc = device_private(self);
 	usb_device_descriptor_t *udd;
 	int i;
 	uint16_t vendor, product;
@@ -374,11 +374,10 @@
 sc->sc_x_sensors = pd->x_sensors;
 sc->sc_y_factor = pd->y_factor;
 sc->sc_y_sensors = pd->y_sensors;
-if (product == 0x215) {
+if (product == 0x0215) {
 	sc->is_geyser2 = 1;
-	sc->sc_x_sensors = 15;
-	sc->sc_y_sensors = 9;
 	sc->sc_datalen = 64;
+	sc->sc_y_sensors = 9;
 }
 break;
 			}



CVS commit: [netbsd-5] src/sys/arch/hpcmips/vr

2009-08-25 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Aug 25 18:40:32 UTC 2009

Modified Files:
src/sys/arch/hpcmips/vr [netbsd-5]: vr.c

Log Message:
Pull up following revision(s) (requested by jun in ticket #918):
sys/arch/hpcmips/vr/vr.c: revision 1.54
Fix #41863, Missing "}".


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.51.14.1 src/sys/arch/hpcmips/vr/vr.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/hpcmips/vr/vr.c
diff -u src/sys/arch/hpcmips/vr/vr.c:1.51 src/sys/arch/hpcmips/vr/vr.c:1.51.14.1
--- src/sys/arch/hpcmips/vr/vr.c:1.51	Fri Apr  4 12:36:06 2008
+++ src/sys/arch/hpcmips/vr/vr.c	Tue Aug 25 18:40:32 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: vr.c,v 1.51 2008/04/04 12:36:06 tsutsui Exp $	*/
+/*	$NetBSD: vr.c,v 1.51.14.1 2009/08/25 18:40:32 snj Exp $	*/
 
 /*-
  * Copyright (c) 1999-2002
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vr.c,v 1.51 2008/04/04 12:36:06 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vr.c,v 1.51.14.1 2009/08/25 18:40:32 snj Exp $");
 
 #include "opt_vr41xx.h"
 #include "opt_tx39xx.h"
@@ -428,6 +428,7 @@
 			printf("%s(%d): can't init kgdb's serial port",
 			__FILE__, __LINE__);
 		}
+	}
 #else /* KGDB */
 	if (com_info->attach != NULL && (bootinfo->bi_cnuse&BI_CNUSE_SERIAL)) {
 		/* Serial console */



CVS commit: [netbsd-5] src/sys/arch/i386/conf

2009-09-13 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Sep 13 22:11:14 UTC 2009

Modified Files:
src/sys/arch/i386/conf [netbsd-5]: ALL GENERIC

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #943):
sys/arch/i386/conf/ALL: revision 1.186
sys/arch/i386/conf/GENERIC: revision 1.921
add options PMS_ELANTECH_TOUCHPAD


To generate a diff of this commit:
cvs rdiff -u -r1.183.4.2 -r1.183.4.3 src/sys/arch/i386/conf/ALL
cvs rdiff -u -r1.915.2.5 -r1.915.2.6 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/ALL
diff -u src/sys/arch/i386/conf/ALL:1.183.4.2 src/sys/arch/i386/conf/ALL:1.183.4.3
--- src/sys/arch/i386/conf/ALL:1.183.4.2	Fri May  1 01:20:41 2009
+++ src/sys/arch/i386/conf/ALL	Sun Sep 13 22:11:14 2009
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.183.4.2 2009/05/01 01:20:41 snj Exp $
+# $NetBSD: ALL,v 1.183.4.3 2009/09/13 22:11:14 snj Exp $
 # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp
 #
 # ALL machine description file
@@ -17,7 +17,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"ALL-$Revision: 1.183.4.2 $"
+#ident 		"ALL-$Revision: 1.183.4.3 $"
 
 maxusers	32		# estimated number of users
 
@@ -519,6 +519,7 @@
 pms*		at pckbc?		# PS/2 mouse for wsmouse
 options 	PMS_DISABLE_POWERHOOK	# Disable PS/2 reset on resume
 options 	PMS_SYNAPTICS_TOUCHPAD	# Enable support for Synaptics Touchpads
+options 	PMS_ELANTECH_TOUCHPAD	# Enable support for Elantech Touchpads
 vga0		at isa?
 vga*		at pci? dev ? function ?
 pcdisplay0	at isa?			# CGA, MDA, EGA, HGA

Index: src/sys/arch/i386/conf/GENERIC
diff -u src/sys/arch/i386/conf/GENERIC:1.915.2.5 src/sys/arch/i386/conf/GENERIC:1.915.2.6
--- src/sys/arch/i386/conf/GENERIC:1.915.2.5	Sun May  3 23:45:46 2009
+++ src/sys/arch/i386/conf/GENERIC	Sun Sep 13 22:11:14 2009
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.915.2.5 2009/05/03 23:45:46 snj Exp $
+# $NetBSD: GENERIC,v 1.915.2.6 2009/09/13 22:11:14 snj Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.915.2.5 $"
+#ident 		"GENERIC-$Revision: 1.915.2.6 $"
 
 maxusers	64		# estimated number of users
 
@@ -528,6 +528,7 @@
 pms*		at pckbc?		# PS/2 mouse for wsmouse
 #options 	PMS_DISABLE_POWERHOOK	# Disable PS/2 reset on resume
 options 	PMS_SYNAPTICS_TOUCHPAD	# Enable support for Synaptics Touchpads
+options 	PMS_ELANTECH_TOUCHPAD	# Enable support for Elantech Touchpads
 vga0		at isa?
 vga*		at pci? dev ? function ?
 pcdisplay0	at isa?			# CGA, MDA, EGA, HGA



CVS commit: [netbsd-5] src/sys/arch/amd64/conf

2009-09-13 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Sep 13 22:12:12 UTC 2009

Modified Files:
src/sys/arch/amd64/conf [netbsd-5]: GENERIC

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #943):
sys/arch/amd64/conf/GENERIC: revision 1.235
add options PMS_ELANTECH_TOUCHPAD


To generate a diff of this commit:
cvs rdiff -u -r1.231.4.3 -r1.231.4.4 src/sys/arch/amd64/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/amd64/conf/GENERIC
diff -u src/sys/arch/amd64/conf/GENERIC:1.231.4.3 src/sys/arch/amd64/conf/GENERIC:1.231.4.4
--- src/sys/arch/amd64/conf/GENERIC:1.231.4.3	Sun May  3 23:45:46 2009
+++ src/sys/arch/amd64/conf/GENERIC	Sun Sep 13 22:12:12 2009
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.231.4.3 2009/05/03 23:45:46 snj Exp $
+# $NetBSD: GENERIC,v 1.231.4.4 2009/09/13 22:12:12 snj Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.231.4.3 $"
+#ident 		"GENERIC-$Revision: 1.231.4.4 $"
 
 maxusers	64		# estimated number of users
 
@@ -355,6 +355,7 @@
 pms*		at pckbc?		# PS/2 mouse for wsmouse
 #options 	PMS_DISABLE_POWERHOOK	# Disable PS/2 reset on resume
 options 	PMS_SYNAPTICS_TOUCHPAD	# Enable support for Synaptics Touchpads
+options 	PMS_ELANTECH_TOUCHPAD	# Enable support for Elantech Touchpads
 vga*		at pci? dev ? function ?
 wsdisplay*	at vga? console ?
 wskbd*		at pckbd? console ?



  1   2   3   >