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

2015-04-19 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 machine/cpu.h
 
-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(paddr32);
-	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_hi32)|((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(phys32);
-	args.phys_lo = HDL2CELL(phys);
-	if(openfirmware(args) != 0)
+	args.phys_hi = HDQ2CELL_HI(phys);
+	args.phys_lo = HDQ2CELL_LO(phys);
+	if 

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

2015-04-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Apr 17 10:49:16 UTC 2015

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

Log Message:
Pull up following revision(s) (requested by nakayama in ticket #1958):
sys/arch/sparc/stand/ofwboot/Locore.c: revision 1.14
Fix kernel loading failures from partitions started from over first
4GB of disks on sparc64.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.10.30.1 src/sys/arch/sparc/stand/ofwboot/Locore.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/stand/ofwboot/Locore.c
diff -u src/sys/arch/sparc/stand/ofwboot/Locore.c:1.10 src/sys/arch/sparc/stand/ofwboot/Locore.c:1.10.30.1
--- src/sys/arch/sparc/stand/ofwboot/Locore.c:1.10	Wed Oct 17 19:57:16 2007
+++ src/sys/arch/sparc/stand/ofwboot/Locore.c	Fri Apr 17 10:49:16 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: Locore.c,v 1.10 2007/10/17 19:57:16 garbled Exp $	*/
+/*	$NetBSD: Locore.c,v 1.10.30.1 2015/04/17 10:49:16 msaitoh Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -311,8 +311,8 @@ OF_seek(int handle, u_quad_t pos)
 	args.nargs = 3;
 	args.nreturns = 1;
 	args.handle = HDL2CELL(handle);
-	args.poshi = HDL2CELL(pos  32);
-	args.poslo = HDL2CELL(pos);
+	args.poshi = HDQ2CELL_HI(pos);
+	args.poslo = HDQ2CELL_LO(pos);
 	if (openfirmware(args) == -1) {
 		return -1;
 	}



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 sys/cdefs.h
-__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/sparc/sparc

2011-02-16 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Feb 16 21:33:25 UTC 2011

Modified Files:
src/sys/arch/sparc/sparc [netbsd-5]: cpu.c cpuvar.h pmap.c
timer_sun4m.c

Log Message:
Apply patch, requested my mrg in ticket 1553:
sys/arch/sparc/sparc/cpu.c: patch
sys/arch/sparc/sparc/cpuvar.h:  patch
sys/arch/sparc/sparc/pmap.c:patch
sys/arch/sparc/sparc/timer_sun4m.c: patch
- print the curpcb in ddb mach cpu output as well.
- bump the size of cpus[] by one, so we have a NULL pointer at the end,
  from tsutsui
- for MP kernels, copy the loop to find the bootcpu in mainbus_attach()
  into getcacheinfo_obp() so we can get cache properties on the bootcpu
  before calling main()
- in getcpuinfo(), move the call of getmid() before the call to
  getcacheinfo() so that the above change to getcacheinfo_obp() can work
- move the struct cpu_info setup to the end of the initial kernel page
  setup and don't access this space until after we have switched to the
  kernel pagetables
- revive most of the old CPUINFO_VA alignment/congruency code from the
  old alloc_cpuinfo_global_va() function, and ensure that all cpuinfo
  structures are sanely aligned.  this makes hypersparc work again
- introduce a new way to free the wasted pages back to UVM, as we can't
  simply uvm_unmap() them this early in bootstrap
- make sure to initialise the cpuinfo sz in all cases.  noted by martin.
- add per-cpu event counters for lev10 and lev14 interrupts.
- make CPU_INFO_FOREACH() set the iterator count to '0' in the !MP case.
- add some disabled MP code to poke other cpus on level 14 interrupts.
- add a diagnostic to ensure that cpus[0] == cpu0's cpu_info-ci_self
- if a cpu doesn't have any mappings allocated, don't copy them.  this
  occurs if a cpu isn't attached (such as a MP kernel with only cpu0
  listed in the config file..)
- fix the previous to compile !MULTIPROCESSOR.


To generate a diff of this commit:
cvs rdiff -u -r1.211.8.3 -r1.211.8.4 src/sys/arch/sparc/sparc/cpu.c
cvs rdiff -u -r1.75.10.3 -r1.75.10.4 src/sys/arch/sparc/sparc/cpuvar.h
cvs rdiff -u -r1.322.20.4 -r1.322.20.5 src/sys/arch/sparc/sparc/pmap.c
cvs rdiff -u -r1.16.56.1 -r1.16.56.2 src/sys/arch/sparc/sparc/timer_sun4m.c

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

Modified files:

Index: src/sys/arch/sparc/sparc/cpu.c
diff -u src/sys/arch/sparc/sparc/cpu.c:1.211.8.3 src/sys/arch/sparc/sparc/cpu.c:1.211.8.4
--- src/sys/arch/sparc/sparc/cpu.c:1.211.8.3	Fri Jan 28 07:16:13 2011
+++ src/sys/arch/sparc/sparc/cpu.c	Wed Feb 16 21:33:25 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.211.8.3 2011/01/28 07:16:13 snj Exp $ */
+/*	$NetBSD: cpu.c,v 1.211.8.4 2011/02/16 21:33:25 bouyer Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -52,7 +52,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.211.8.3 2011/01/28 07:16:13 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.211.8.4 2011/02/16 21:33:25 bouyer Exp $);
 
 #include opt_multiprocessor.h
 #include opt_lockdebug.h
@@ -102,7 +102,7 @@
 extern char machine_model[];
 
 int	sparc_ncpus;			/* # of CPUs detected by PROM */
-struct cpu_info *cpus[_MAXNCPU];	/* we only support 4 CPUs. */
+struct cpu_info *cpus[_MAXNCPU+1];	/* we only support 4 CPUs. */
 
 /* The CPU configuration driver. */
 static void cpu_mainbus_attach(struct device *, struct device *, void *);
@@ -424,7 +424,7 @@
 	}
 
 	/*
-	 * Note: `eintstack' is set in init_cpuinfo() above.
+	 * Note: `eintstack' is set in cpu_attach_non_boot() above.
 	 * The %wim register will be initialized in cpu_hatch().
 	 */
 	cpi-ci_curlwp = cpi-ci_data.cpu_idlelwp;
@@ -1123,6 +1123,35 @@
 	struct cacheinfo *ci = sc-cacheinfo;
 	int i, l;
 
+#if defined(MULTIPROCESSOR)
+	/*
+	 * We really really want the cache info early for MP systems,
+	 * so figure out the boot node, if we can.
+	 *
+	 * XXX this loop stolen from mainbus_attach()
+	 */
+	if (node == 0  CPU_ISSUN4M  bootmid != 0) {
+		const char *cp;
+		char namebuf[32];
+		int mid, node2;
+
+		for (node2 = firstchild(findroot());
+		 node2;
+		 node2 = nextsibling(node2)) {
+			cp = prom_getpropstringA(node2, device_type,
+	namebuf, sizeof namebuf);
+			if (strcmp(cp, cpu) != 0)
+continue;
+
+			mid = prom_getpropint(node2, mid, -1);
+			if (mid == bootmid) {
+node = node2;
+break;
+			}
+		}
+	}
+#endif
+
 	if (node == 0)
 		/* Bootstrapping */
 		return;
@@ -1862,6 +1891,9 @@
 		if (sc-cacheinfo.c_vactype == VAC_UNKNOWN)
 			sc-cacheinfo.c_vactype = mp-minfo-vactype;
 
+		if (sc-master  mp-minfo-getmid != NULL)
+			bootmid = mp-minfo-getmid();
+
 		mp-minfo-getcacheinfo(sc, node);
 
 		if (node  sc-hz == 0  !CPU_ISSUN4/*XXX*/) {
@@ -1875,9 +1907,6 @@
 			}
 		}
 
-		if (sc-master  mp-minfo-getmid != NULL)
-			bootmid = mp-minfo-getmid();
-
 		/*
 		 * Copy CPU/MMU/Cache specific routines into cpu_info.
 		 */
@@ -2015,16 +2044,17 @@
 	struct 

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

2011-01-27 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Jan 28 07:16:14 UTC 2011

Modified Files:
src/sys/arch/sparc/sparc [netbsd-5]: cpu.c cpuvar.h genassym.cf intr.c
locore.s pmap.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1532):
sys/arch/sparc/sparc/cpu.c: revision 1.215 via patch
sys/arch/sparc/sparc/cpuvar.h: revision 1.78 via patch
sys/arch/sparc/sparc/genassym.cf: revision 1.57 via patch
sys/arch/sparc/sparc/intr.c: revision 1.103-1.105 via patch
sys/arch/sparc/sparc/locore.s: revision 1.247, 1.250 via patch
sys/arch/sparc/sparc/pmap.c: revision 1.329 via patch

- print the cpu_number() when we get a strayintr().

- use _MAXNCPU instead of 4
- convert xpmsg_lock from a simplelock to a kmutex
- don't wait for sparc_noop IPI calls
- remove xmpsg_func's retval parameter and usage
- remove the IPI at high IPL message
- rework cpu_attach() a bunch, refactoring calls to getcpuinfo() and setting
 of cpi, and split most of the non-boot CPU handling into a new function
- make CPU_INFO_FOREACH() work whether modular or not
- move the MP cpu_info pages earlier
- move a few things in cpu.c around to colsolidate the MP code together
- remove useless if (cpus == NULL) tests -- cpus is an array now

with these changes, and an additional change to crazyintr() to not printf(),
i can get to single user shell on my SS20 again.  i can run a few commands
but some of them cause hangs.  ps auxw works, but top -b does not.

convert sparc intrcnt counters to evcnt(9) style.  XXX some of the names
could be better, but i just copied them from the old intrnames in locore.

i benchmarked this with a simple test of ircii ./configure  make, to see
if the additional load/store  arith would cause any noticeable degradation
as the change also converts 32 bit counters to 64 bits.  amusingly, the
only trend i saw in this was that for both portions, i see a consistent
(across at least 8 runs) benefit of about 0.8% improvement.  ie, the newer
larger code size / counter size code actually runs faster for some reason..
maybe there's a cacheline effect in the size of the code?

XXX the current implementation depends on a couple of things:
XXX   - ev_count member of evcnt{} is first and has offset 0
XXX   - that sizeof(struct evcnt) equals 32
XXX if these are not true, locore.s has #error's to catch it

- remove unused ft_want_ast()
- give nmi_sun* ENTRY() points so they show up in symbols properly
- add some disabled code to use this cpu's idlelwp area when hatching
 a cpu, but right now it makes this worse not better...


To generate a diff of this commit:
cvs rdiff -u -r1.211.8.2 -r1.211.8.3 src/sys/arch/sparc/sparc/cpu.c
cvs rdiff -u -r1.75.10.2 -r1.75.10.3 src/sys/arch/sparc/sparc/cpuvar.h
cvs rdiff -u -r1.56 -r1.56.4.1 src/sys/arch/sparc/sparc/genassym.cf
cvs rdiff -u -r1.100.20.1 -r1.100.20.2 src/sys/arch/sparc/sparc/intr.c
cvs rdiff -u -r1.244.8.2 -r1.244.8.3 src/sys/arch/sparc/sparc/locore.s
cvs rdiff -u -r1.322.20.3 -r1.322.20.4 src/sys/arch/sparc/sparc/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/sparc/sparc/cpu.c
diff -u src/sys/arch/sparc/sparc/cpu.c:1.211.8.2 src/sys/arch/sparc/sparc/cpu.c:1.211.8.3
--- src/sys/arch/sparc/sparc/cpu.c:1.211.8.2	Sun Jan 16 12:58:23 2011
+++ src/sys/arch/sparc/sparc/cpu.c	Fri Jan 28 07:16:13 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.211.8.2 2011/01/16 12:58:23 bouyer Exp $ */
+/*	$NetBSD: cpu.c,v 1.211.8.3 2011/01/28 07:16:13 snj Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -52,7 +52,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.211.8.2 2011/01/16 12:58:23 bouyer Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.211.8.3 2011/01/28 07:16:13 snj Exp $);
 
 #include opt_multiprocessor.h
 #include opt_lockdebug.h
@@ -102,10 +102,7 @@
 extern char machine_model[];
 
 int	sparc_ncpus;			/* # of CPUs detected by PROM */
-#ifdef MULTIPROCESSOR
-struct cpu_info *cpus[4];		/* we only support 4 CPUs. */
-u_int	cpu_ready_mask;			/* the set of CPUs marked as READY */
-#endif
+struct cpu_info *cpus[_MAXNCPU];	/* we only support 4 CPUs. */
 
 /* The CPU configuration driver. */
 static void cpu_mainbus_attach(struct device *, struct device *, void *);
@@ -136,43 +133,6 @@
 #define SRMMU_VERS(mmusr)	(((mmusr)  24)  0xf)
 
 int bootmid;		/* Module ID of boot CPU */
-#if defined(MULTIPROCESSOR)
-void cpu_spinup(struct cpu_info *);
-static void init_cpuinfo(struct cpu_info *, int);
-
-int go_smp_cpus = 0;	/* non-primary CPUs wait for this to go */
-
-/* lock this to send IPI's */
-struct simplelock xpmsg_lock = SIMPLELOCK_INITIALIZER;
-
-static void
-init_cpuinfo(struct cpu_info *cpi, int node)
-{
-	vaddr_t intstack, va;
-
-	/*
-	 * Finish initialising this cpu_info.
-	 */
-	getcpuinfo(cpi, node);
-
-	/*
-	 * Arrange interrupt stack.  This cpu will also abuse the bottom
-	 * half 

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

2011-01-16 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Sun Jan 16 12:58:24 UTC 2011

Modified Files:
src/sys/arch/sparc/sparc [netbsd-5]: cpu.c cpuvar.h db_interface.c
locore.s pmap.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1527):
sys/arch/sparc/sparc/pmap.c: revision 1.327, 1.328
sys/arch/sparc/sparc/cpuvar.h: revision 1.77
sys/arch/sparc/sparc/locore.s: revision 1.245
sys/arch/sparc/sparc/cpu.c: revision 1.214
sys/arch/sparc/sparc/db_interface.c: revision 1.84
- retire union cpu_info_pg
- allocate space for each cpu_info{} in pmap_bootstrap
- remap cpu0's space into the PA currently in CPUINFO_VA
- cpus[] becomes an array of pointers to cpu_info{}, easy to traverse
- only call kernel lock for IPL_VM interrupts (?  as implemented on
  x86 and sparc64)
- revert a minor part of locore.s:1.241
- in cpu_hatch(), set %sp to near the middle of the interrupt stack.
  we only need a %sp until we get to run an MI thread (own idlelwp or
  real code)
we still waste one page of space, but this gets SMP much closer to
actually working again.
fix a LOCKDEBUG problem from the previous: need to call pmap_kremove()
on a pre-existing mapping, before installing a new one.


To generate a diff of this commit:
cvs rdiff -u -r1.211.8.1 -r1.211.8.2 src/sys/arch/sparc/sparc/cpu.c
cvs rdiff -u -r1.75.10.1 -r1.75.10.2 src/sys/arch/sparc/sparc/cpuvar.h
cvs rdiff -u -r1.79.4.1 -r1.79.4.2 src/sys/arch/sparc/sparc/db_interface.c
cvs rdiff -u -r1.244.8.1 -r1.244.8.2 src/sys/arch/sparc/sparc/locore.s
cvs rdiff -u -r1.322.20.2 -r1.322.20.3 src/sys/arch/sparc/sparc/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/sparc/sparc/cpu.c
diff -u src/sys/arch/sparc/sparc/cpu.c:1.211.8.1 src/sys/arch/sparc/sparc/cpu.c:1.211.8.2
--- src/sys/arch/sparc/sparc/cpu.c:1.211.8.1	Sat May 30 16:57:18 2009
+++ src/sys/arch/sparc/sparc/cpu.c	Sun Jan 16 12:58:23 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.211.8.1 2009/05/30 16:57:18 snj Exp $ */
+/*	$NetBSD: cpu.c,v 1.211.8.2 2011/01/16 12:58:23 bouyer Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -52,7 +52,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.211.8.1 2009/05/30 16:57:18 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.211.8.2 2011/01/16 12:58:23 bouyer Exp $);
 
 #include opt_multiprocessor.h
 #include opt_lockdebug.h
@@ -103,7 +103,7 @@
 
 int	sparc_ncpus;			/* # of CPUs detected by PROM */
 #ifdef MULTIPROCESSOR
-union cpu_info_pg *cpus;
+struct cpu_info *cpus[4];		/* we only support 4 CPUs. */
 u_int	cpu_ready_mask;			/* the set of CPUs marked as READY */
 #endif
 
@@ -156,10 +156,10 @@
 	getcpuinfo(cpi, node);
 
 	/*
-	 * Arrange pcb and interrupt stack.
+	 * Arrange interrupt stack.  This cpu will also abuse the bottom
+	 * half of the interrupt stack before it gets to run its idle LWP.
 	 */
-	intstack = uvm_km_alloc(kernel_map, INT_STACK_SIZE,
-		0, UVM_KMF_WIRED);
+	intstack = uvm_km_alloc(kernel_map, INT_STACK_SIZE, 0, UVM_KMF_WIRED);
 	if (intstack == 0)
 		panic(%s: no uspace/intstack, __func__);
 	cpi-eintstack = (void*)(intstack + INT_STACK_SIZE);
@@ -339,7 +339,7 @@
 		getcpuinfo(cpuinfo, node);
 
 #if defined(MULTIPROCESSOR)
-		cpi = sc-sc_cpuinfo = cpuinfo.ci_self;
+		cpi = sc-sc_cpuinfo = cpus[idx];
 #else
 		/* The `local' VA is global for uniprocessor. */
 		cpi = sc-sc_cpuinfo = (struct cpu_info *)CPUINFO_VA;
@@ -362,7 +362,7 @@
 		/*
 		 * Initialise this cpu's cpu_info.
 		 */
-		cpi = sc-sc_cpuinfo = cpus[idx].ci;
+		cpi = sc-sc_cpuinfo = cpus[idx];
 		init_cpuinfo(cpi, node);
 
 		/*

Index: src/sys/arch/sparc/sparc/cpuvar.h
diff -u src/sys/arch/sparc/sparc/cpuvar.h:1.75.10.1 src/sys/arch/sparc/sparc/cpuvar.h:1.75.10.2
--- src/sys/arch/sparc/sparc/cpuvar.h:1.75.10.1	Sat May 30 16:57:18 2009
+++ src/sys/arch/sparc/sparc/cpuvar.h	Sun Jan 16 12:58:23 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpuvar.h,v 1.75.10.1 2009/05/30 16:57:18 snj Exp $ */
+/*	$NetBSD: cpuvar.h,v 1.75.10.2 2011/01/16 12:58:23 bouyer Exp $ */
 
 /*
  *  Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -416,7 +416,7 @@
 
 #define CPU_INFO_ITERATOR		int
 #ifdef MULTIPROCESSOR
-#define CPU_INFO_FOREACH(cii, cp)	cii = 0; cp = cpus[cii].ci, cii  sparc_ncpus; cii++
+#define CPU_INFO_FOREACH(cii, cp)	cii = 0; cp = cpus[cii], cii  sparc_ncpus; cii++
 #else
 #define	CPU_INFO_FOREACH(cii, cp)	(void)cii, cp = curcpu(); cp != NULL; cp = NULL
 #endif
@@ -473,11 +473,7 @@
 #define CPU_MID2CPUNO(mid)		((mid) != 0 ? (mid) - 8 : 0)
 
 #ifdef MULTIPROCESSOR
-union cpu_info_pg {
-	struct cpu_info ci;	/* cpu info (aliased (per cpu) to CPUINFO_VA */
-	char pad[32 * 1024];	/* XXX: force 32K alignment for now */
-};/* SMP capable cpu types */
-extern union cpu_info_pg *cpus;
+extern struct cpu_info *cpus[];
 extern u_int cpu_ready_mask;		/* the set of CPUs marked as READY */
 #endif
 

Index: 

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

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

Modified Files:
src/sys/arch/sparc/sparc [netbsd-5]: vm_machdep.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1223):
sys/arch/sparc/sparc/vm_machdep.c: revision 1.99
sync this a little with sparc64: use cpu_setfunc() at the end of cpu_lwp_fork()


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.95.4.1 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/sparc/vm_machdep.c
diff -u src/sys/arch/sparc/sparc/vm_machdep.c:1.95 src/sys/arch/sparc/sparc/vm_machdep.c:1.95.4.1
--- src/sys/arch/sparc/sparc/vm_machdep.c:1.95	Thu Oct 16 19:28:52 2008
+++ src/sys/arch/sparc/sparc/vm_machdep.c	Sat Jan  9 01:41:57 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm_machdep.c,v 1.95 2008/10/16 19:28:52 martin Exp $ */
+/*	$NetBSD: vm_machdep.c,v 1.95.4.1 2010/01/09 01:41:57 snj Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -49,7 +49,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vm_machdep.c,v 1.95 2008/10/16 19:28:52 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: vm_machdep.c,v 1.95.4.1 2010/01/09 01:41:57 snj Exp $);
 
 #include opt_multiprocessor.h
 #include opt_coredump.h
@@ -208,6 +208,10 @@
 		write_user_windows();
 		opcb-pcb_psr = getpsr();
 	}
+#ifdef DIAGNOSTIC
+	else if (l1 != lwp0)	/* XXX is this valid? */
+		panic(cpu_lwp_fork: curlwp);
+#endif
 
 	bcopy((void *)opcb, (void *)npcb, sizeof(struct pcb));
 	if (l1-l_md.md_fpstate != NULL) {
@@ -272,14 +276,8 @@
 
 	/* Construct kernel frame to return to in cpu_switch() */
 	rp = (struct rwindow *)((u_int)npcb + 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;		/* the new LWP */
 
-	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 */
+	cpu_setfunc(l2, func, arg);
 }
 
 /*



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 sys/cdefs.h
-__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/sparc/conf

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

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

Log Message:
Pull up following revision(s) (requested by macallan in ticket #965):
sys/arch/sparc/conf/GENERIC: revision 1.208
wscons here we come!
(finally)


To generate a diff of this commit:
cvs rdiff -u -r1.205.4.1 -r1.205.4.2 src/sys/arch/sparc/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/sparc/conf/GENERIC
diff -u src/sys/arch/sparc/conf/GENERIC:1.205.4.1 src/sys/arch/sparc/conf/GENERIC:1.205.4.2
--- src/sys/arch/sparc/conf/GENERIC:1.205.4.1	Fri Oct 16 06:30:01 2009
+++ src/sys/arch/sparc/conf/GENERIC	Sun Oct 18 13:33:29 2009
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.205.4.1 2009/10/16 06:30:01 snj Exp $
+# $NetBSD: GENERIC,v 1.205.4.2 2009/10/18 13:33:29 bouyer Exp $
 #
 # GENERIC machine description file
 # 
@@ -22,7 +22,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		GENERIC-$Revision: 1.205.4.1 $
+#ident 		GENERIC-$Revision: 1.205.4.2 $
 
 maxusers	32
 
@@ -45,14 +45,30 @@
 
 ## Use a faster console than the PROM's slow drawing routines.  Not needed
 ## for headless (no framebuffer) machines.
-options 	RASTERCONSOLE		# fast rasterop console
-options 	FONT_GALLANT12x22	# the console font
-#options 	FONT_BOLD8x16		# a somewhat smaller font
-## default console colors: black-on-white; this can be changed
-## using the following two options.
+## These is obsolete for wscons kernels
+#options 	RASTERCONSOLE		# fast rasterop console
 #options 	RASTERCONSOLE_FGCOL=WSCOL_BLACK
 #options 	RASTERCONSOLE_BGCOL=WSCOL_WHITE
 
+# wscons stuff
+options		WSEMUL_SUN
+#options		WSEMUL_VT100
+options		WSDISPLAY_COMPAT_RAWKBD
+options		WSDISPLAY_CUSTOM_OUTPUT
+options		WS_DEFAULT_FG=WSCOL_BLACK
+options		WS_DEFAULT_BG=WSCOL_LIGHT_WHITE
+options		WS_KERNEL_FG=WSCOL_GREEN
+options		WS_KERNEL_BG=WSCOL_LIGHT_WHITE
+options		WSDISPLAY_COMPAT_PCVT
+options 	WSDISPLAY_COMPAT_SYSCONS
+options		WSDISPLAY_COMPAT_USL
+
+options		WSDISPLAY_SCROLLSUPPORT
+
+# generic options vlid for both wscons and RASTERCONSOLE
+options 	FONT_GALLANT12x22	# the console font
+#options 	FONT_BOLD8x16		# a somewhat smaller font
+
  System options that are the same for all ports
 
 ## Root device configuration: change the ?'s if you are going to use a
@@ -316,16 +332,23 @@
 zs0	at obio0 addr 0xf100 level 12		# sun4/200 and sun4/300
 zs0	at obio0 addr 0x0100 level 12		# sun4/100
 zs0	at bootbus0	# sun4d
-zstty0	at zs0 channel 0# ttya
-zstty1	at zs0 channel 1# ttyb
 
 zs1	at mainbus0	# sun4c
 zs1	at obio0	# sun4m
 zs1	at obio0 addr 0xf000 level 12		# sun4/200 and sun4/300
 zs1	at obio0 addr 0x level 12		# sun4/100
 zs1	at bootbus0	# sun4d
-kbd0	at zs1 channel 0# keyboard
-ms0	at zs1 channel 1# mouse
+
+# old kbd and mouse attachments
+#kbd0	at zs1 channel 0# keyboard
+#ms0	at zs1 channel 1# mouse
+zstty*	at zs?
+
+# these are for wscons
+kbd0	at zstty?
+ms0	at zstty?
+wskbd*	at wskbddev?
+wsmouse* 	at wsmousedev?
 
 zs2	at obio0 addr 0xe000 level 12		# sun4/300
 zstty2	at zs2 channel 0# ttyc
@@ -637,7 +660,8 @@
 bwtwo0		at obio0 addr 0x0b30 level 4	# sun4/100 in P4 slot
 
 ## Sun cgtwo VME color framebuffer
-cgtwo0		at vme0 addr 0x40 irq ? vect 0xa8
+# XXX no wsdisplay support
+#cgtwo0		at vme0 addr 0x40 irq ? vect 0xa8
 
 ## Sun cgthree Sbus color framebuffer
 cgthree0	at sbus? slot ? offset ?
@@ -646,8 +670,9 @@
 
 ## Sun cgfour color framebuffer with overlay plane.  See above comment
 ## regarding overlay plane.
-cgfour0		at obio0 addr 0xfb30 level 4	# sun4/300 P4
-cgfour0		at obio0 addr 0x0b30 level 4	# sun4/100 P4
+# XXX no wsdisplay support
+#cgfour0		at obio0 addr 0xfb30 level 4	# sun4/300 P4
+#cgfour0		at obio0 addr 0x0b30 level 4	# sun4/100 P4
 
 ## Sun cgsix accelerated color framebuffer.
 cgsix0		at sbus? slot ? offset ?
@@ -656,21 +681,31 @@
 cgsix0		at obio0 addr 0x0b00 level 4	# sun4/100 P4
 
 ## Sun cgeight 24-bit framebuffer
-cgeight0 	at obio0 addr 0xfb30 level 4	# sun4/300 P4
-cgeight0	at obio0 addr 0x0b30 level 4	# sun4/100 P4
+# XXX no wsdisplay support
+#cgeight0 	at obio0 addr 0xfb30 level 4	# sun4/300 P4
+#cgeight0	at obio0 addr 0x0b30 level 4	# sun4/100 P4
 
 ## Sun tcx accelerated color framebuffer.
-tcx0		at sbus? slot ? offset ?
-tcx*		at sbus? slot ? offset ?
+# XXX no wsdisplay support
+#tcx0		at sbus? slot ? offset ?
+#tcx*		at sbus? slot ? offset ?
 
 # Sun cgfourteen accelerated 24-bit framebuffer.
-cgfourteen0	at obio0			# sun4m
+cgfourteen*	at obio0			# sun4m
 
 # P9100-based display on Tadpole SPARCbook 3.
 pnozz0		at sbus? slot ? offset ?
 
 # Sun ZX/Leo 24-bit framebuffer
-zx*		at sbus? slot ? offset ?
+# XXX no wsdisplay support
+#zx*		at sbus? slot ? offset ?
+
+# Fujitsu AG-10e 

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

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

Modified Files:
src/sys/arch/sparc/conf [netbsd-5]: INSTALL

Log Message:
Pull up following revision(s) (requested by macallan in ticket #968):
sys/arch/sparc/conf/INSTALL: revision 1.64
convert to wscons, while there add some missing wsdisplay drivers


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.62.4.1 src/sys/arch/sparc/conf/INSTALL

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/conf/INSTALL
diff -u src/sys/arch/sparc/conf/INSTALL:1.62 src/sys/arch/sparc/conf/INSTALL:1.62.4.1
--- src/sys/arch/sparc/conf/INSTALL:1.62	Thu Jul 31 07:41:07 2008
+++ src/sys/arch/sparc/conf/INSTALL	Sun Oct 18 13:35:29 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: INSTALL,v 1.62 2008/07/31 07:41:07 simonb Exp $
+#	$NetBSD: INSTALL,v 1.62.4.1 2009/10/18 13:35:29 bouyer Exp $
 #
 # from: NetBSD: GENERIC,v 1.84 1999/06/06 13:00:03 mrg Exp
 #
@@ -47,6 +47,16 @@
 #options 	RASTERCONSOLE_FGCOL=WSCOL_BLACK
 #options 	RASTERCONSOLE_BGCOL=WSCOL_WHITE
 
+# wscons stuff
+options		WSEMUL_SUN
+#options		WSEMUL_VT100
+options		WSDISPLAY_COMPAT_RAWKBD
+options		WSDISPLAY_CUSTOM_OUTPUT
+options		WS_DEFAULT_FG=WSCOL_BLACK
+options		WS_DEFAULT_BG=WSCOL_LIGHT_WHITE
+options		WS_KERNEL_FG=WSCOL_GREEN
+options		WS_KERNEL_BG=WSCOL_LIGHT_WHITE
+
  System options that are the same for all ports
 
 ## Root device configuration: change the ?'s if you are going to use a
@@ -270,20 +280,21 @@
 zs0	at obio0	# sun4m
 zs0	at obio0 addr 0xf100 level 12 flags 0x103	# sun4/200 and sun4/300
 zs0	at obio0 addr 0x0100 level 12 flags 0x103	# sun4/100
-zstty0	at zs0 channel 0	# ttya
-zstty1	at zs0 channel 1	# ttyb
 
 zs1	at mainbus0	# sun4c
 zs1	at obio0	# sun4m
 zs1	at obio0 addr 0xf000 level 12 flags 0x103	# sun4/200 and sun4/300
 zs1	at obio0 addr 0x level 12 flags 0x103	# sun4/100
-kbd0	at zs1 channel 0	# keyboard
-ms0	at zs1 channel 1	# mouse
 
-zs2	at obio0 addr 0xe000 level 12 flags 0x103	# sun4/300
-zstty2	at zs2 channel 0	# ttyc
-zstty3	at zs2 channel 1	# ttyd
+zs2	at obio0 addr 0xe000 level 12		# sun4/300
+
+zstty*	at zs?
 
+# these are for wscons
+kbd0	at zstty?
+ms0	at zstty?
+wskbd*	at wskbddev?
+wsmouse* 	at wsmousedev?
 
 ## Magma Serial/Parallel driver
 #magma*	at sbus? slot ? offset ?
@@ -545,12 +556,28 @@
 #cgeight0	at obio0 addr 0x0b30 level 4	# sun4/100 P4
 
 ## Sun tcx accelerated color framebuffer.
-tcx0		at sbus? slot ? offset ?
-tcx*		at sbus? slot ? offset ?
+#tcx0		at sbus? slot ? offset ?
+#tcx*		at sbus? slot ? offset ?
 
 # Sun cgfourteen accelerated 24-bit framebuffer.
-cgfourteen0	at obio0			# sun4m
+cgfourteen*	at obio0			# sun4m
+
+# P9100-based display on Tadpole SPARCbook 3.
+pnozz0		at sbus? slot ? offset ?
+
+# Sun ZX/Leo 24-bit framebuffer
+# XXX no wsdisplay support
+#zx*		at sbus? slot ? offset ?
 
+# Fujitsu AG-10e accelerated graphics 8/24-bit board
+agten*	at sbus? slot ? offset ?
+
+# generic framebuffer console
+genfb*	at sbus? slot ? offset ?
+
+# make sure wsdisplay0 is the console
+wsdisplay0	at wsemuldisplaydev? console 1
+wsdisplay*	at wsemuldisplaydev?
 
  Other device configuration
 
@@ -563,3 +590,6 @@
 
 pseudo-device	rnd
 #pseudo-device	fss		4	# file system snapshot device
+
+pseudo-device	wsmux			# mouse and keyboard multiplexor
+pseudo-device	wsfont



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 sys/cdefs.h
-__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/conf

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

Modified Files:
src/sys/arch/sparc/conf [netbsd-5]: MRCOFFEE

Log Message:
Pull up following revision(s) (requested by macallan in ticket #990):
sys/arch/sparc/conf/MRCOFFEE: revision 1.29
add the missing wscons bits so this kernel builds again
needs testing on actual hardware which I don't have.


To generate a diff of this commit:
cvs rdiff -u -r1.23.20.1 -r1.23.20.2 src/sys/arch/sparc/conf/MRCOFFEE

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/conf/MRCOFFEE
diff -u src/sys/arch/sparc/conf/MRCOFFEE:1.23.20.1 src/sys/arch/sparc/conf/MRCOFFEE:1.23.20.2
--- src/sys/arch/sparc/conf/MRCOFFEE:1.23.20.1	Fri Oct 16 06:30:02 2009
+++ src/sys/arch/sparc/conf/MRCOFFEE	Sun Oct 18 14:01:49 2009
@@ -1,4 +1,4 @@
-# $NetBSD: MRCOFFEE,v 1.23.20.1 2009/10/16 06:30:02 snj Exp $
+# $NetBSD: MRCOFFEE,v 1.23.20.2 2009/10/18 14:01:49 bouyer Exp $
 # From: NetBSD: GENERIC,v 1.197 2006/12/04 23:43:35 elad Exp
 #
 # Mr.Coffee (JavaStation 1) machine description file
@@ -12,7 +12,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		MRCOFFEE-$Revision: 1.23.20.1 $
+#ident 		MRCOFFEE-$Revision: 1.23.20.2 $
 
 maxusers	32
 
@@ -29,16 +29,21 @@
 # Blink the power LED on some machines to indicate the system load.
 #options 	BLINK
 
-# XXX: uwe: TCX driver doesn't support RASTERCONSOLE, so don't bother
-## Use a faster console than the PROM's slow drawing routines.  Not needed
-## for headless (no framebuffer) machines.
-#options 	RASTERCONSOLE		# fast rasterop console
-#options 	FONT_GALLANT12x22	# the console font
-#options 	FONT_BOLD8x16		# a somewhat smaller font
-## default console colors: black-on-white; this can be changed
-## using the following two options.
-#options 	RASTERCONSOLE_FGCOL=WSCOL_BLACK
-#options 	RASTERCONSOLE_BGCOL=WSCOL_WHITE
+# builtin terminal emulations
+options 	WSEMUL_SUN		# sun terminal emulation
+options 	WSEMUL_VT100		# VT100 / VT220 emulation
+options 	WSEMUL_DEFAULT=\vt100\
+
+# customization of console and kernel output - see dev/wscons/wsdisplayvar.h
+options 	WSDISPLAY_COMPAT_RAWKBD
+options 	WSDISPLAY_CUSTOM_OUTPUT
+options 	WS_DEFAULT_FG=WSCOL_BLACK
+options 	WS_DEFAULT_BG=WSCOL_LIGHT_WHITE
+options 	WS_KERNEL_FG=WSCOL_GREEN
+options 	WS_KERNEL_BG=WSCOL_LIGHT_WHITE
+options 	WSDISPLAY_SCROLLSUPPORT
+options 	FONT_GALLANT12x22	# the console font
+
 
  System options that are the same for all ports
 
@@ -250,9 +255,14 @@
  Keyboard and mouse
 
 pckbc0	at obio0
-kbd0	at pckbc0
-ms0	at pckbc0
-
+#kbd0	at pckbc0
+#ms0	at pckbc0
+#wskbd* 		at kbd? console ?
+#wsmouse*	at ms? mux 0
+pckbd*		at pckbc?		# PC keyboard
+pms*		at pckbc?		# PS/2 mouse for wsmouse
+wskbd* 		at pckbd? console ?
+wsmouse*	at pms? mux 0
 
  Disk controllers and disks
 
@@ -316,7 +326,7 @@
 
 ## Sun tcx accelerated color framebuffer.
 tcx0		at sbus? slot ? offset ?
-
+wsdisplay0	at tcx0
 
  Other device configuration
 
@@ -334,3 +344,6 @@
 
 pseudo-device	clockctl		# user control of clock subsystem
 pseudo-device	ksyms			# /dev/ksyms
+
+pseudo-device	wsmux			# mouse and keyboard multiplexor
+pseudo-device	wsfont



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

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

Modified Files:
src/sys/arch/sparc/conf [netbsd-5]: MRCOFFEE

Log Message:
Back out ticket 990


To generate a diff of this commit:
cvs rdiff -u -r1.23.20.2 -r1.23.20.3 src/sys/arch/sparc/conf/MRCOFFEE

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/conf/MRCOFFEE
diff -u src/sys/arch/sparc/conf/MRCOFFEE:1.23.20.2 src/sys/arch/sparc/conf/MRCOFFEE:1.23.20.3
--- src/sys/arch/sparc/conf/MRCOFFEE:1.23.20.2	Sun Oct 18 14:01:49 2009
+++ src/sys/arch/sparc/conf/MRCOFFEE	Sun Oct 18 14:36:30 2009
@@ -1,4 +1,4 @@
-# $NetBSD: MRCOFFEE,v 1.23.20.2 2009/10/18 14:01:49 bouyer Exp $
+# $NetBSD: MRCOFFEE,v 1.23.20.3 2009/10/18 14:36:30 bouyer Exp $
 # From: NetBSD: GENERIC,v 1.197 2006/12/04 23:43:35 elad Exp
 #
 # Mr.Coffee (JavaStation 1) machine description file
@@ -12,7 +12,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		MRCOFFEE-$Revision: 1.23.20.2 $
+#ident 		MRCOFFEE-$Revision: 1.23.20.3 $
 
 maxusers	32
 
@@ -29,21 +29,16 @@
 # Blink the power LED on some machines to indicate the system load.
 #options 	BLINK
 
-# builtin terminal emulations
-options 	WSEMUL_SUN		# sun terminal emulation
-options 	WSEMUL_VT100		# VT100 / VT220 emulation
-options 	WSEMUL_DEFAULT=\vt100\
-
-# customization of console and kernel output - see dev/wscons/wsdisplayvar.h
-options 	WSDISPLAY_COMPAT_RAWKBD
-options 	WSDISPLAY_CUSTOM_OUTPUT
-options 	WS_DEFAULT_FG=WSCOL_BLACK
-options 	WS_DEFAULT_BG=WSCOL_LIGHT_WHITE
-options 	WS_KERNEL_FG=WSCOL_GREEN
-options 	WS_KERNEL_BG=WSCOL_LIGHT_WHITE
-options 	WSDISPLAY_SCROLLSUPPORT
-options 	FONT_GALLANT12x22	# the console font
-
+# XXX: uwe: TCX driver doesn't support RASTERCONSOLE, so don't bother
+## Use a faster console than the PROM's slow drawing routines.  Not needed
+## for headless (no framebuffer) machines.
+#options 	RASTERCONSOLE		# fast rasterop console
+#options 	FONT_GALLANT12x22	# the console font
+#options 	FONT_BOLD8x16		# a somewhat smaller font
+## default console colors: black-on-white; this can be changed
+## using the following two options.
+#options 	RASTERCONSOLE_FGCOL=WSCOL_BLACK
+#options 	RASTERCONSOLE_BGCOL=WSCOL_WHITE
 
  System options that are the same for all ports
 
@@ -255,14 +250,9 @@
  Keyboard and mouse
 
 pckbc0	at obio0
-#kbd0	at pckbc0
-#ms0	at pckbc0
-#wskbd* 		at kbd? console ?
-#wsmouse*	at ms? mux 0
-pckbd*		at pckbc?		# PC keyboard
-pms*		at pckbc?		# PS/2 mouse for wsmouse
-wskbd* 		at pckbd? console ?
-wsmouse*	at pms? mux 0
+kbd0	at pckbc0
+ms0	at pckbc0
+
 
  Disk controllers and disks
 
@@ -326,7 +316,7 @@
 
 ## Sun tcx accelerated color framebuffer.
 tcx0		at sbus? slot ? offset ?
-wsdisplay0	at tcx0
+
 
  Other device configuration
 
@@ -344,6 +334,3 @@
 
 pseudo-device	clockctl		# user control of clock subsystem
 pseudo-device	ksyms			# /dev/ksyms
-
-pseudo-device	wsmux			# mouse and keyboard multiplexor
-pseudo-device	wsfont



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 sys/cdefs.h
-__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/sparc/conf

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

Modified Files:
src/sys/arch/sparc/conf [netbsd-5]: INSTALL

Log Message:
Back out ticket 968


To generate a diff of this commit:
cvs rdiff -u -r1.62.4.1 -r1.62.4.2 src/sys/arch/sparc/conf/INSTALL

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/conf/INSTALL
diff -u src/sys/arch/sparc/conf/INSTALL:1.62.4.1 src/sys/arch/sparc/conf/INSTALL:1.62.4.2
--- src/sys/arch/sparc/conf/INSTALL:1.62.4.1	Sun Oct 18 13:35:29 2009
+++ src/sys/arch/sparc/conf/INSTALL	Sun Oct 18 14:43:09 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: INSTALL,v 1.62.4.1 2009/10/18 13:35:29 bouyer Exp $
+#	$NetBSD: INSTALL,v 1.62.4.2 2009/10/18 14:43:09 bouyer Exp $
 #
 # from: NetBSD: GENERIC,v 1.84 1999/06/06 13:00:03 mrg Exp
 #
@@ -47,16 +47,6 @@
 #options 	RASTERCONSOLE_FGCOL=WSCOL_BLACK
 #options 	RASTERCONSOLE_BGCOL=WSCOL_WHITE
 
-# wscons stuff
-options		WSEMUL_SUN
-#options		WSEMUL_VT100
-options		WSDISPLAY_COMPAT_RAWKBD
-options		WSDISPLAY_CUSTOM_OUTPUT
-options		WS_DEFAULT_FG=WSCOL_BLACK
-options		WS_DEFAULT_BG=WSCOL_LIGHT_WHITE
-options		WS_KERNEL_FG=WSCOL_GREEN
-options		WS_KERNEL_BG=WSCOL_LIGHT_WHITE
-
  System options that are the same for all ports
 
 ## Root device configuration: change the ?'s if you are going to use a
@@ -280,21 +270,20 @@
 zs0	at obio0	# sun4m
 zs0	at obio0 addr 0xf100 level 12 flags 0x103	# sun4/200 and sun4/300
 zs0	at obio0 addr 0x0100 level 12 flags 0x103	# sun4/100
+zstty0	at zs0 channel 0	# ttya
+zstty1	at zs0 channel 1	# ttyb
 
 zs1	at mainbus0	# sun4c
 zs1	at obio0	# sun4m
 zs1	at obio0 addr 0xf000 level 12 flags 0x103	# sun4/200 and sun4/300
 zs1	at obio0 addr 0x level 12 flags 0x103	# sun4/100
+kbd0	at zs1 channel 0	# keyboard
+ms0	at zs1 channel 1	# mouse
 
-zs2	at obio0 addr 0xe000 level 12		# sun4/300
-
-zstty*	at zs?
+zs2	at obio0 addr 0xe000 level 12 flags 0x103	# sun4/300
+zstty2	at zs2 channel 0	# ttyc
+zstty3	at zs2 channel 1	# ttyd
 
-# these are for wscons
-kbd0	at zstty?
-ms0	at zstty?
-wskbd*	at wskbddev?
-wsmouse* 	at wsmousedev?
 
 ## Magma Serial/Parallel driver
 #magma*	at sbus? slot ? offset ?
@@ -556,28 +545,12 @@
 #cgeight0	at obio0 addr 0x0b30 level 4	# sun4/100 P4
 
 ## Sun tcx accelerated color framebuffer.
-#tcx0		at sbus? slot ? offset ?
-#tcx*		at sbus? slot ? offset ?
+tcx0		at sbus? slot ? offset ?
+tcx*		at sbus? slot ? offset ?
 
 # Sun cgfourteen accelerated 24-bit framebuffer.
-cgfourteen*	at obio0			# sun4m
-
-# P9100-based display on Tadpole SPARCbook 3.
-pnozz0		at sbus? slot ? offset ?
-
-# Sun ZX/Leo 24-bit framebuffer
-# XXX no wsdisplay support
-#zx*		at sbus? slot ? offset ?
+cgfourteen0	at obio0			# sun4m
 
-# Fujitsu AG-10e accelerated graphics 8/24-bit board
-agten*	at sbus? slot ? offset ?
-
-# generic framebuffer console
-genfb*	at sbus? slot ? offset ?
-
-# make sure wsdisplay0 is the console
-wsdisplay0	at wsemuldisplaydev? console 1
-wsdisplay*	at wsemuldisplaydev?
 
  Other device configuration
 
@@ -590,6 +563,3 @@
 
 pseudo-device	rnd
 #pseudo-device	fss		4	# file system snapshot device
-
-pseudo-device	wsmux			# mouse and keyboard multiplexor
-pseudo-device	wsfont



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

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

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

Log Message:
Back out 965


To generate a diff of this commit:
cvs rdiff -u -r1.205.4.2 -r1.205.4.3 src/sys/arch/sparc/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/sparc/conf/GENERIC
diff -u src/sys/arch/sparc/conf/GENERIC:1.205.4.2 src/sys/arch/sparc/conf/GENERIC:1.205.4.3
--- src/sys/arch/sparc/conf/GENERIC:1.205.4.2	Sun Oct 18 13:33:29 2009
+++ src/sys/arch/sparc/conf/GENERIC	Sun Oct 18 14:45:54 2009
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.205.4.2 2009/10/18 13:33:29 bouyer Exp $
+# $NetBSD: GENERIC,v 1.205.4.3 2009/10/18 14:45:54 bouyer Exp $
 #
 # GENERIC machine description file
 # 
@@ -22,7 +22,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		GENERIC-$Revision: 1.205.4.2 $
+#ident 		GENERIC-$Revision: 1.205.4.3 $
 
 maxusers	32
 
@@ -45,29 +45,13 @@
 
 ## Use a faster console than the PROM's slow drawing routines.  Not needed
 ## for headless (no framebuffer) machines.
-## These is obsolete for wscons kernels
-#options 	RASTERCONSOLE		# fast rasterop console
-#options 	RASTERCONSOLE_FGCOL=WSCOL_BLACK
-#options 	RASTERCONSOLE_BGCOL=WSCOL_WHITE
-
-# wscons stuff
-options		WSEMUL_SUN
-#options		WSEMUL_VT100
-options		WSDISPLAY_COMPAT_RAWKBD
-options		WSDISPLAY_CUSTOM_OUTPUT
-options		WS_DEFAULT_FG=WSCOL_BLACK
-options		WS_DEFAULT_BG=WSCOL_LIGHT_WHITE
-options		WS_KERNEL_FG=WSCOL_GREEN
-options		WS_KERNEL_BG=WSCOL_LIGHT_WHITE
-options		WSDISPLAY_COMPAT_PCVT
-options 	WSDISPLAY_COMPAT_SYSCONS
-options		WSDISPLAY_COMPAT_USL
-
-options		WSDISPLAY_SCROLLSUPPORT
-
-# generic options vlid for both wscons and RASTERCONSOLE
+options 	RASTERCONSOLE		# fast rasterop console
 options 	FONT_GALLANT12x22	# the console font
 #options 	FONT_BOLD8x16		# a somewhat smaller font
+## default console colors: black-on-white; this can be changed
+## using the following two options.
+#options 	RASTERCONSOLE_FGCOL=WSCOL_BLACK
+#options 	RASTERCONSOLE_BGCOL=WSCOL_WHITE
 
  System options that are the same for all ports
 
@@ -332,23 +316,16 @@
 zs0	at obio0 addr 0xf100 level 12		# sun4/200 and sun4/300
 zs0	at obio0 addr 0x0100 level 12		# sun4/100
 zs0	at bootbus0	# sun4d
+zstty0	at zs0 channel 0# ttya
+zstty1	at zs0 channel 1# ttyb
 
 zs1	at mainbus0	# sun4c
 zs1	at obio0	# sun4m
 zs1	at obio0 addr 0xf000 level 12		# sun4/200 and sun4/300
 zs1	at obio0 addr 0x level 12		# sun4/100
 zs1	at bootbus0	# sun4d
-
-# old kbd and mouse attachments
-#kbd0	at zs1 channel 0# keyboard
-#ms0	at zs1 channel 1# mouse
-zstty*	at zs?
-
-# these are for wscons
-kbd0	at zstty?
-ms0	at zstty?
-wskbd*	at wskbddev?
-wsmouse* 	at wsmousedev?
+kbd0	at zs1 channel 0# keyboard
+ms0	at zs1 channel 1# mouse
 
 zs2	at obio0 addr 0xe000 level 12		# sun4/300
 zstty2	at zs2 channel 0# ttyc
@@ -660,8 +637,7 @@
 bwtwo0		at obio0 addr 0x0b30 level 4	# sun4/100 in P4 slot
 
 ## Sun cgtwo VME color framebuffer
-# XXX no wsdisplay support
-#cgtwo0		at vme0 addr 0x40 irq ? vect 0xa8
+cgtwo0		at vme0 addr 0x40 irq ? vect 0xa8
 
 ## Sun cgthree Sbus color framebuffer
 cgthree0	at sbus? slot ? offset ?
@@ -670,9 +646,8 @@
 
 ## Sun cgfour color framebuffer with overlay plane.  See above comment
 ## regarding overlay plane.
-# XXX no wsdisplay support
-#cgfour0		at obio0 addr 0xfb30 level 4	# sun4/300 P4
-#cgfour0		at obio0 addr 0x0b30 level 4	# sun4/100 P4
+cgfour0		at obio0 addr 0xfb30 level 4	# sun4/300 P4
+cgfour0		at obio0 addr 0x0b30 level 4	# sun4/100 P4
 
 ## Sun cgsix accelerated color framebuffer.
 cgsix0		at sbus? slot ? offset ?
@@ -681,31 +656,21 @@
 cgsix0		at obio0 addr 0x0b00 level 4	# sun4/100 P4
 
 ## Sun cgeight 24-bit framebuffer
-# XXX no wsdisplay support
-#cgeight0 	at obio0 addr 0xfb30 level 4	# sun4/300 P4
-#cgeight0	at obio0 addr 0x0b30 level 4	# sun4/100 P4
+cgeight0 	at obio0 addr 0xfb30 level 4	# sun4/300 P4
+cgeight0	at obio0 addr 0x0b30 level 4	# sun4/100 P4
 
 ## Sun tcx accelerated color framebuffer.
-# XXX no wsdisplay support
-#tcx0		at sbus? slot ? offset ?
-#tcx*		at sbus? slot ? offset ?
+tcx0		at sbus? slot ? offset ?
+tcx*		at sbus? slot ? offset ?
 
 # Sun cgfourteen accelerated 24-bit framebuffer.
-cgfourteen*	at obio0			# sun4m
+cgfourteen0	at obio0			# sun4m
 
 # P9100-based display on Tadpole SPARCbook 3.
 pnozz0		at sbus? slot ? offset ?
 
 # Sun ZX/Leo 24-bit framebuffer
-# XXX no wsdisplay support
-#zx*		at sbus? slot ? offset ?
-
-# Fujitsu AG-10e accelerated graphics 8/24-bit board
-agten*	at sbus? slot ? offset ?
-
-# make sure wsdisplay0 is the console
-wsdisplay0	at wsemuldisplaydev? console 1
-wsdisplay*	at wsemuldisplaydev?
+zx*		at sbus? slot ? offset ?
 
  Other device configuration
 

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

2009-10-16 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Oct 16 06:30:02 UTC 2009

Modified Files:
src/sys/arch/sparc/conf [netbsd-5]: GENERIC KRUPS MRCOFFEE TADPOLE3GX

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1065):
sys/arch/sparc/conf/GENERIC: revision 1.214
sys/arch/sparc/conf/KRUPS: revision 1.50
sys/arch/sparc/conf/MRCOFFEE: revision 1.28
sys/arch/sparc/conf/TADPOLE3GX: revision 1.47
Enable ddb(4) for sparc GENERIC-like kernels.
Discussed on port-sp...@.


To generate a diff of this commit:
cvs rdiff -u -r1.205 -r1.205.4.1 src/sys/arch/sparc/conf/GENERIC
cvs rdiff -u -r1.45 -r1.45.20.1 src/sys/arch/sparc/conf/KRUPS
cvs rdiff -u -r1.23 -r1.23.20.1 src/sys/arch/sparc/conf/MRCOFFEE
cvs rdiff -u -r1.42 -r1.42.30.1 src/sys/arch/sparc/conf/TADPOLE3GX

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/conf/GENERIC
diff -u src/sys/arch/sparc/conf/GENERIC:1.205 src/sys/arch/sparc/conf/GENERIC:1.205.4.1
--- src/sys/arch/sparc/conf/GENERIC:1.205	Sun Aug 10 15:31:22 2008
+++ src/sys/arch/sparc/conf/GENERIC	Fri Oct 16 06:30:01 2009
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.205 2008/08/10 15:31:22 tls Exp $
+# $NetBSD: GENERIC,v 1.205.4.1 2009/10/16 06:30:01 snj Exp $
 #
 # GENERIC machine description file
 # 
@@ -22,7 +22,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		GENERIC-$Revision: 1.205 $
+#ident 		GENERIC-$Revision: 1.205.4.1 $
 
 maxusers	32
 
@@ -98,8 +98,8 @@
 ## The DDB in-kernel debugger runs at panic (unless DDB_ONPANIC=0), or at
 ## serial console break or keyboard reset, where the PROM would normally
 ## intercept.  DDB_HISTORY_SIZE adds up/down arrow command history.
-#options 	DDB			# kernel dynamic debugger
-#options 	DDB_HISTORY_SIZE=100	# enable history editing in DDB
+options 	DDB			# kernel dynamic debugger
+options 	DDB_HISTORY_SIZE=100	# enable history editing in DDB
 #options 	DDB_ONPANIC=1		# see also sysctl(8): `ddb.onpanic'
 
 ## You may also use gdb, on another computer connected to this machine over

Index: src/sys/arch/sparc/conf/KRUPS
diff -u src/sys/arch/sparc/conf/KRUPS:1.45 src/sys/arch/sparc/conf/KRUPS:1.45.20.1
--- src/sys/arch/sparc/conf/KRUPS:1.45	Mon Dec 31 15:32:06 2007
+++ src/sys/arch/sparc/conf/KRUPS	Fri Oct 16 06:30:01 2009
@@ -1,4 +1,4 @@
-# $NetBSD: KRUPS,v 1.45 2007/12/31 15:32:06 ad Exp $
+# $NetBSD: KRUPS,v 1.45.20.1 2009/10/16 06:30:01 snj Exp $
 # From: NetBSD: GENERIC,v 1.197 2006/12/04 23:43:35 elad Exp
 #
 # Krups (JavaStation-NC) machine description file
@@ -8,7 +8,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		KRUPS-$Revision: 1.45 $
+#ident 		KRUPS-$Revision: 1.45.20.1 $
 
 maxusers	32
 
@@ -119,8 +119,8 @@
 ## The DDB in-kernel debugger runs at panic (unless DDB_ONPANIC=0), or at
 ## serial console break or keyboard reset, where the PROM would normally
 ## intercept.  DDB_HISTORY_SIZE adds up/down arrow command history.
-#options 	DDB			# kernel dynamic debugger
-#options 	DDB_HISTORY_SIZE=100	# enable history editing in DDB
+options 	DDB			# kernel dynamic debugger
+options 	DDB_HISTORY_SIZE=100	# enable history editing in DDB
 #options 	DDB_ONPANIC=1		# see also sysctl(8): `ddb.onpanic'
 
 ## You may also use gdb, on another computer connected to this machine over

Index: src/sys/arch/sparc/conf/MRCOFFEE
diff -u src/sys/arch/sparc/conf/MRCOFFEE:1.23 src/sys/arch/sparc/conf/MRCOFFEE:1.23.20.1
--- src/sys/arch/sparc/conf/MRCOFFEE:1.23	Mon Dec 31 15:32:06 2007
+++ src/sys/arch/sparc/conf/MRCOFFEE	Fri Oct 16 06:30:02 2009
@@ -1,4 +1,4 @@
-# $NetBSD: MRCOFFEE,v 1.23 2007/12/31 15:32:06 ad Exp $
+# $NetBSD: MRCOFFEE,v 1.23.20.1 2009/10/16 06:30:02 snj Exp $
 # From: NetBSD: GENERIC,v 1.197 2006/12/04 23:43:35 elad Exp
 #
 # Mr.Coffee (JavaStation 1) machine description file
@@ -12,7 +12,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		MRCOFFEE-$Revision: 1.23 $
+#ident 		MRCOFFEE-$Revision: 1.23.20.1 $
 
 maxusers	32
 
@@ -90,8 +90,8 @@
 ## The DDB in-kernel debugger runs at panic (unless DDB_ONPANIC=0), or at
 ## serial console break or keyboard reset, where the PROM would normally
 ## intercept.  DDB_HISTORY_SIZE adds up/down arrow command history.
-#options 	DDB			# kernel dynamic debugger
-#options 	DDB_HISTORY_SIZE=100	# enable history editing in DDB
+options 	DDB			# kernel dynamic debugger
+options 	DDB_HISTORY_SIZE=100	# enable history editing in DDB
 #options 	DDB_ONPANIC=1		# see also sysctl(8): `ddb.onpanic'
 
 ## You may also use gdb, on another computer connected to this machine over

Index: src/sys/arch/sparc/conf/TADPOLE3GX
diff -u src/sys/arch/sparc/conf/TADPOLE3GX:1.42 src/sys/arch/sparc/conf/TADPOLE3GX:1.42.30.1
--- src/sys/arch/sparc/conf/TADPOLE3GX:1.42	Wed Oct 17 19:57:11 2007
+++ src/sys/arch/sparc/conf/TADPOLE3GX	Fri Oct 16 06:30:02 2009
@@ -1,4 

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

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

Modified Files:
src/sys/arch/sparc/dev [netbsd-5]: zs.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #800):
sys/arch/sparc/dev/zs.c: revision 1.116
Properly initialize child attach args to zero - we could end up with
various devices having different ideas about being console otherwise.


To generate a diff of this commit:
cvs rdiff -u -r1.111.6.1 -r1.111.6.2 src/sys/arch/sparc/dev/zs.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.1 src/sys/arch/sparc/dev/zs.c:1.111.6.2
--- src/sys/arch/sparc/dev/zs.c:1.111.6.1	Tue Nov 18 02:34:06 2008
+++ src/sys/arch/sparc/dev/zs.c	Tue Jun  9 17:50:34 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: zs.c,v 1.111.6.1 2008/11/18 02:34:06 snj Exp $	*/
+/*	$NetBSD: zs.c,v 1.111.6.2 2009/06/09 17:50:34 snj Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: zs.c,v 1.111.6.1 2008/11/18 02:34:06 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: zs.c,v 1.111.6.2 2009/06/09 17:50:34 snj Exp $);
 
 #include opt_ddb.h
 #include opt_kgdb.h
@@ -401,6 +401,7 @@
 	int ch0_is_cons = 0;
 #endif
 
+	memset(zsc_args, 0, sizeof zsc_args);
 	if (zsd == NULL) {
 		aprint_error(: configuration incomplete\n);
 		return;
@@ -424,6 +425,7 @@
 		int hwflags;
 
 		zsc_args.channel = channel;
+		zsc_args.hwflags = 0;
 		cs = zsc-zsc_cs_store[channel];
 		zsc-zsc_cs[channel] = cs;
 



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

2009-05-30 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat May 30 16:57:19 UTC 2009

Modified Files:
src/sys/arch/sparc/sparc [netbsd-5]: autoconf.c cpu.c cpuvar.h
db_interface.c intr.c pmap.c timer_sun4m.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #776):
sys/arch/sparc/sparc/autoconf.c: revision 1.233 via patch
sys/arch/sparc/sparc/cpu.c: revision 1.213 via patch
sys/arch/sparc/sparc/cpuvar.h: revision 1.76 via patch
sys/arch/sparc/sparc/db_interface.c: revision 1.83 via patch
sys/arch/sparc/sparc/intr.c: revision 1.102 via patch
sys/arch/sparc/sparc/pmap.c: revision 1.325 via patch
sys/arch/sparc/sparc/timer_sun4m.c: revision 1.17 via patch
Work in progress from a colaborative effort of mrg and me (all bugs are
mine) - not quite working, but improves the situation for non-MULTIPROCESSOR
kernels (makes LOCKDEBUG kernels work) and does not make SMP kernels worse:
Rearange cpu_info access and hide the actual implementation of the mapping
from all parts of the code that do not directly deal with it. Do the
mapping early in pmap_bootstrap, so that post-vmlocking2 kernels have
a chance to work.
The actual mapping of the cpus array for SMP kernels has to be fixed still,
but both mrg and me ran out of time and this lay around in our trees far
too long.


To generate a diff of this commit:
cvs rdiff -u -r1.229 -r1.229.4.1 src/sys/arch/sparc/sparc/autoconf.c
cvs rdiff -u -r1.211 -r1.211.8.1 src/sys/arch/sparc/sparc/cpu.c
cvs rdiff -u -r1.75 -r1.75.10.1 src/sys/arch/sparc/sparc/cpuvar.h
cvs rdiff -u -r1.79 -r1.79.4.1 src/sys/arch/sparc/sparc/db_interface.c
cvs rdiff -u -r1.100 -r1.100.20.1 src/sys/arch/sparc/sparc/intr.c
cvs rdiff -u -r1.322 -r1.322.20.1 src/sys/arch/sparc/sparc/pmap.c
cvs rdiff -u -r1.16 -r1.16.56.1 src/sys/arch/sparc/sparc/timer_sun4m.c

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

Modified files:

Index: src/sys/arch/sparc/sparc/autoconf.c
diff -u src/sys/arch/sparc/sparc/autoconf.c:1.229 src/sys/arch/sparc/sparc/autoconf.c:1.229.4.1
--- src/sys/arch/sparc/sparc/autoconf.c:1.229	Thu Jul 17 14:39:26 2008
+++ src/sys/arch/sparc/sparc/autoconf.c	Sat May 30 16:57:18 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.229 2008/07/17 14:39:26 cegger Exp $ */
+/*	$NetBSD: autoconf.c,v 1.229.4.1 2009/05/30 16:57:18 snj Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -48,7 +48,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.229 2008/07/17 14:39:26 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.229.4.1 2009/05/30 16:57:18 snj Exp $);
 
 #include opt_ddb.h
 #include opt_kgdb.h
@@ -279,6 +279,7 @@
 
 	cpuinfo.master = 1;
 	getcpuinfo(cpuinfo, 0);
+	curlwp = lwp0;
 
 #if defined(SUN4M) || defined(SUN4D)
 	/* Switch to sparc v8 multiply/divide functions on v8 machines */
@@ -314,18 +315,6 @@
 	initmsgbuf((void *)KERNBASE, 8192);
 #endif
 
-#if NKSYMS || defined(DDB) || defined(LKM)
-	if ((bi_sym = lookup_bootinfo(BTINFO_SYMTAB)) != NULL) {
-		if (bi_sym-ssym  KERNBASE) {
-			/* Assume low-loading boot loader */
-			bi_sym-ssym += KERNBASE;
-			bi_sym-esym += KERNBASE;
-		}
-		ksyms_init(bi_sym-nsym, (int *)bi_sym-ssym,
-		(int *)bi_sym-esym);
-	}
-#endif
-
 #if defined(SUN4M)
 	/*
 	 * sun4m bootstrap is complex and is totally different for normal 4m
@@ -351,6 +340,19 @@
 		*((unsigned char *)INTRREG_VA) = 0;
 	}
 #endif /* SUN4 || SUN4C */
+
+
+#if NKSYMS || defined(DDB) || defined(LKM)
+	if ((bi_sym = lookup_bootinfo(BTINFO_SYMTAB)) != NULL) {
+		if (bi_sym-ssym  KERNBASE) {
+			/* Assume low-loading boot loader */
+			bi_sym-ssym += KERNBASE;
+			bi_sym-esym += KERNBASE;
+		}
+		ksyms_init(bi_sym-nsym, (int *)bi_sym-ssym,
+		(int *)bi_sym-esym);
+	}
+#endif
 }
 
 #if defined(SUN4M)  !defined(MSIIEP)

Index: src/sys/arch/sparc/sparc/cpu.c
diff -u src/sys/arch/sparc/sparc/cpu.c:1.211 src/sys/arch/sparc/sparc/cpu.c:1.211.8.1
--- src/sys/arch/sparc/sparc/cpu.c:1.211	Wed Jun  4 12:41:41 2008
+++ src/sys/arch/sparc/sparc/cpu.c	Sat May 30 16:57:18 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.211 2008/06/04 12:41:41 ad Exp $ */
+/*	$NetBSD: cpu.c,v 1.211.8.1 2009/05/30 16:57:18 snj Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -52,7 +52,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.211 2008/06/04 12:41:41 ad Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.211.8.1 2009/05/30 16:57:18 snj Exp $);
 
 #include opt_multiprocessor.h
 #include opt_lockdebug.h
@@ -102,10 +102,10 @@
 extern char machine_model[];
 
 int	sparc_ncpus;			/* # of CPUs detected by PROM */
-struct	cpu_info **cpus;
+#ifdef MULTIPROCESSOR
+union cpu_info_pg *cpus;
 u_int	cpu_ready_mask;			/* the set of CPUs marked as READY */
-static	int cpu_instance;		/* current # of CPUs wired by us */
-
+#endif
 
 /* The CPU configuration driver. */
 static void cpu_mainbus_attach(struct device *, struct device *, void *);
@@ -138,117 

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

2009-05-18 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Mon May 18 19:54:56 UTC 2009

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

Log Message:
Pull up following revision(s) (requested by martin in ticket #764):
sys/arch/sparc/include/psl.h: revision 1.45
Add memory clobbers to the inline assembler modifying/testing the %psr
register, to avoid the compiler reordering instructions out of critical
sections. Should fix PR port-sparc/41372.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.44.56.1 src/sys/arch/sparc/include/psl.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/psl.h
diff -u src/sys/arch/sparc/include/psl.h:1.44 src/sys/arch/sparc/include/psl.h:1.44.56.1
--- src/sys/arch/sparc/include/psl.h:1.44	Mon Feb 19 02:57:40 2007
+++ src/sys/arch/sparc/include/psl.h	Mon May 18 19:54:56 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: psl.h,v 1.44 2007/02/19 02:57:40 mrg Exp $ */
+/*	$NetBSD: psl.h,v 1.44.56.1 2009/05/18 19:54:56 bouyer Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -252,7 +252,7 @@
 static __inline void
 setpsr(int newpsr)
 {
-	__asm volatile(wr %0,0,%%psr : : r (newpsr));
+	__asm volatile(wr %0,0,%%psr : : r (newpsr) : memory);
 	__asm volatile(nop; nop; nop);
 }
 
@@ -266,7 +266,7 @@
 	 * which gives us the same value as the old psr but with all
 	 * the old PIL bits turned off.
 	 */
-	__asm volatile(rd %%psr,%0 : =r (psr));
+	__asm volatile(rd %%psr,%0 : =r (psr) : : memory);
 	oldipl = psr  PSR_PIL;
 	__asm volatile(wr %0,%1,%%psr : : r (psr), r (oldipl));
 
@@ -290,7 +290,7 @@
 	psr = ~PSR_PIL; \
 	__asm volatile(wr %0,%1,%%psr : : \
 	r (psr), n ((newipl)  8)); \
-	__asm volatile(nop; nop; nop); \
+	__asm volatile(nop; nop; nop : : : memory); \
 }
 
 _SPLSET(spllowerschedclock, IPL_SCHED)
@@ -324,7 +324,7 @@
 	psr = (psr  ~oldipl) | newipl;
 
 	__asm volatile(wr %0,0,%%psr : : r (psr));
-	__asm volatile(nop; nop; nop);
+	__asm volatile(nop; nop; nop : : : memory);
 
 	return (oldipl);
 }
@@ -345,7 +345,7 @@
 {
 	int psr;
 
-	__asm volatile(rd %%psr,%0 : =r (psr));
+	__asm volatile(rd %%psr,%0 : =r (psr) : : memory);
 	__asm volatile(wr %0,%1,%%psr : : \
 	r (psr  ~PSR_PIL), rn (newipl));
 	__asm volatile(nop; nop; nop);