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

2010-01-23 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Jan 23 23:06:28 UTC 2010

Modified Files:
src/sys/arch/sparc64/sparc64: locore.s

Log Message:
remove most of the code that writes debugging info DATA_START + offset.


To generate a diff of this commit:
cvs rdiff -u -r1.303 -r1.304 src/sys/arch/sparc64/sparc64/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/sparc64/sparc64/locore.s
diff -u src/sys/arch/sparc64/sparc64/locore.s:1.303 src/sys/arch/sparc64/sparc64/locore.s:1.304
--- src/sys/arch/sparc64/sparc64/locore.s:1.303	Sat Jan 23 22:55:04 2010
+++ src/sys/arch/sparc64/sparc64/locore.s	Sat Jan 23 23:06:27 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.303 2010/01/23 22:55:04 mrg Exp $	*/
+/*	$NetBSD: locore.s,v 1.304 2010/01/23 23:06:27 mrg Exp $	*/
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath
@@ -1774,13 +1774,6 @@
 	stx	%g4, [%g2+8]! Update TSB entry data
 	nop
 
-#ifdef DEBUG
-	set	DATA_START, %g6	! debug
-	stx	%g1, [%g6+0x40]	! debug
-	set	0x88, %g5	! debug
-	stx	%g4, [%g6+0x48]	! debug -- what we tried to enter in TLB
-	stb	%g5, [%g6+0x8]	! debug
-#endif
 #ifdef TRAPSTATS
 	sethi	%hi(_C_LABEL(protfix)), %g1
 	lduw	[%g1+%lo(_C_LABEL(protfix))], %g2
@@ -1902,13 +1895,6 @@
 1:	
 	stx	%g1, [%g2]! Update TSB entry tag
 	stx	%g4, [%g2+8]! Update TSB entry data
-#ifdef DEBUG
-	set	DATA_START, %g6	! debug
-	stx	%g3, [%g6+8]	! debug
-	set	0xa, %g5	! debug
-	stx	%g4, [%g6]	! debug -- what we tried to enter in TLB
-	stb	%g5, [%g6+0x20]	! debug
-#endif
 	stxa	%g4, [%g0] ASI_DMMU_DATA_IN		! Enter new mapping
 	membar	#Sync
 	CLRTT
@@ -2085,12 +2071,6 @@
 #ifdef TRAPS_USE_IG
 	wrpr	%g0, PSTATE_KERN|PSTATE_IG, %pstate	! We need to save volatile stuff to AG regs
 #endif
-#ifdef DEBUG
-	set	DATA_START, %g7! debug
-	set	0x20, %g6! debug
-	stx	%g0, [%g7]! debug
-	stb	%g6, [%g7 + 0x20]			! debug
-#endif
 	wr	%g0, ASI_DMMU, %asi			! We need to re-load trap info
 	ldxa	[%g0 + TLB_TAG_ACCESS] %asi, %g1	! Get fault address from tag access register
 	ldxa	[SFAR] %asi, %g2			! sync virt addr; must be read first
@@ -2127,11 +2107,6 @@
 	inc	%g5
 	stw	%g5, [%g7]
 #endif
-#ifdef DEBUG
-	set	0x12, %g5! debug
-	sethi	%hi(DATA_START), %g7			! debug
-	stb	%g5, [%g7 + 0x20]			! debug
-#endif
 
 	/*
 	 * Traverse kernel map to find paddr of cpcb and only us ASI_PHYS_CACHED to
@@ -2376,12 +2351,6 @@
 
 	and	%g4, CWP, %g4! %g4 = %cwp of trap
 	wrpr	%g4, 0, %cwp! Kernel fault -- restore %cwp and force and trap to debugger
-#ifdef DEBUG
-	set	DATA_START, %g7! debug
-	set	0x11, %g6! debug
-	stb	%g6, [%g7 + 0x20]			! debug
-!	sir
-#endif
 	!!
 	!! Here we managed to fault trying to access a kernel window
 	!! This is a bug.  Switch to the interrupt stack if we aren't
@@ -2416,11 +2385,6 @@
 	 dec	8, %g7
 #endif
 
-#ifdef DEBUG
-	set	DATA_START, %g7! debug
-	set	0x19, %g6! debug
-	stb	%g6, [%g7 + 0x20]			! debug
-#endif
 #ifdef NOTDEF_DEBUG
 	set	panicstack-CC64FSZ, %g5
 	save	%g5, 0, %sp
@@ -2494,12 +2458,6 @@
 #ifdef TRAPS_USE_IG
 	wrpr	%g0, PSTATE_KERN|PSTATE_IG, %pstate	! We need to save volatile stuff to AG regs
 #endif
-#ifdef DEBUG
-	set	DATA_START, %g7! debug
-	set	0x20, %g6! debug
-	stx	%g0, [%g7]! debug
-	stb	%g6, [%g7 + 0x20]			! debug
-#endif
 	wr	%g0, ASI_DMMU, %asi			! We need to re-load trap info
 	ldxa	[%g0 + TLB_TAG_ACCESS] %asi, %g1	! Get fault address from tag access register
 	ldxa	[SFAR] %asi, %g2			! sync virt addr; must be read first
@@ -2535,11 +2493,6 @@
 	rd	%y, %g5		! save y
 	stx	%g7, [%sp + CC64FSZ + STKB + TF_G + (7*8)]	! sneak in g7
 
-#ifdef DEBUG
-	set	DATA_START, %g7	! debug
-	set	0x21, %g6	! debug
-	stb	%g6, [%g7 + 0x20]! debug
-#endif
 	sth	%o1, [%sp + CC64FSZ + STKB + TF_TT]
 	stx	%g1, [%sp + CC64FSZ + STKB + TF_TSTATE]		! set tf.tf_psr, tf.tf_pc
 	stx	%g2, [%sp + CC64FSZ + STKB + TF_PC]		! set tf.tf_npc
@@ -2725,13 +2678,6 @@
 1:
 	stx	%g1, [%g2]! Update TSB entry tag
 	stx	%g4, [%g2+8]! Update TSB entry data
-#ifdef DEBUG
-	set	DATA_START, %g6	! debug
-	stx	%g3, [%g6+8]	! debug
-	set	0xaa, %g3	! debug
-	stx	%g4, [%g6]	! debug -- what we tried to enter in TLB
-	stb	%g3, [%g6+0x20]	! debug
-#endif
 	stxa	%g4, [%g0] ASI_IMMU_DATA_IN		! Enter new mapping
 	membar	#Sync
 	CLRTT
@@ -5222,11 +5168,6 @@
 	.align 8
 ENTRY(sp_tlb_flush_pte)
 #ifdef DEBUG
-	set	DATA_START, %o4! Forget any recent TLB misses
-	stx	%g0, [%o4]
-	stx	%g0, [%o4+16]
-#endif
-#ifdef DEBUG
 	set	pmapdebug, %o3
 	lduw	[%o3], %o3
 !	movrz	%o1, -1, %o3! Print on either pmapdebug  PDB_DEMAP or ctx == 0



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

2010-01-23 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Jan 23 23:39:27 UTC 2010

Modified Files:
src/sys/arch/sparc64/sparc64: locore.s

Log Message:
remove the final uses of DATA_START.

now we can remove the 16KB space reserved at the start of the data segment,
and i now understand why i wrote this now removed comment 3.5 years ago:
this shouldn't be needed... but kernel usually hangs without it


To generate a diff of this commit:
cvs rdiff -u -r1.304 -r1.305 src/sys/arch/sparc64/sparc64/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/sparc64/sparc64/locore.s
diff -u src/sys/arch/sparc64/sparc64/locore.s:1.304 src/sys/arch/sparc64/sparc64/locore.s:1.305
--- src/sys/arch/sparc64/sparc64/locore.s:1.304	Sat Jan 23 23:06:27 2010
+++ src/sys/arch/sparc64/sparc64/locore.s	Sat Jan 23 23:39:27 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.304 2010/01/23 23:06:27 mrg Exp $	*/
+/*	$NetBSD: locore.s,v 1.305 2010/01/23 23:39:27 mrg Exp $	*/
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath
@@ -383,12 +383,6 @@
 	.data
 	.globl	_C_LABEL(data_start)
 _C_LABEL(data_start):	! Start of data segment
-#define DATA_START	_C_LABEL(data_start)
-
-#if 1
-/* XXX this shouldn't be needed... but kernel usually hangs without it */
-	.space	USPACE
-#endif
 
 #ifdef KGDB
 /*
@@ -1848,13 +1842,7 @@
 	set	0x080, %g6! 8MB
 	sub	%g3, %g7, %g7
 	cmp	%g7, %g6
-	sethi	%hi(DATA_START), %g7
-	mov	6, %g6		! debug
-	stb	%g6, [%g7+0x20]	! debug
 	tlu	%xcc, 1; nop
-	blu,pn	%xcc, winfix! Next insn in delay slot is unimportant
-	 mov	7, %g6		! debug
-	stb	%g6, [%g7+0x20]	! debug
 1:	
 #endif
 	srlx	%g3, STSHIFT, %g6
@@ -2626,13 +2614,7 @@
 	set	0x080, %g6! 8MB
 	sub	%g3, %g7, %g7
 	cmp	%g7, %g6
-	mov	6, %g6		! debug
-	sethi	%hi(DATA_START), %g7
-	stb	%g6, [%g7+0x30]	! debug
 	tlu	%xcc, 1; nop
-	blu,pn	%xcc, textfault! Next insn in delay slot is unimportant
-	 mov	7, %g6		! debug
-	stb	%g6, [%g7+0x30]	! debug
 1:	
 #endif
 	srlx	%g3, STSHIFT, %g6



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

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

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

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


To generate a diff of this commit:
cvs rdiff -u -r1.164 -r1.165 src/sys/arch/sparc64/sparc64/autoconf.c

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

Modified files:

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



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

2010-01-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jan 20 15:45:52 UTC 2010

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

Log Message:
Add the mac address as device property mac-address to all devices that
look like a network interface.
Also add a boolean without-seeprom to all apparently on-board network
interface (which usually have no eeprom of their own on Suns), this
latter can be used to enable driver hacks.


To generate a diff of this commit:
cvs rdiff -u -r1.163 -r1.164 src/sys/arch/sparc64/sparc64/autoconf.c

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

Modified files:

Index: src/sys/arch/sparc64/sparc64/autoconf.c
diff -u src/sys/arch/sparc64/sparc64/autoconf.c:1.163 src/sys/arch/sparc64/sparc64/autoconf.c:1.164
--- src/sys/arch/sparc64/sparc64/autoconf.c:1.163	Sun Jan 10 13:52:06 2010
+++ src/sys/arch/sparc64/sparc64/autoconf.c	Wed Jan 20 15:45:52 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.163 2010/01/10 13:52:06 martin Exp $ */
+/*	$NetBSD: autoconf.c,v 1.164 2010/01/20 15:45:52 martin Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -48,7 +48,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.163 2010/01/10 13:52:06 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.164 2010/01/20 15:45:52 martin Exp $);
 
 #include opt_ddb.h
 #include opt_kgdb.h
@@ -76,6 +76,7 @@
 #include prop/proplib.h
 
 #include net/if.h
+#include net/if_ether.h
 
 #include dev/cons.h
 #include sparc64/dev/cons.h
@@ -906,17 +907,45 @@
 		return;
 
 	if (ofnode != 0) {
-		char devtype[32];
+		uint8_t eaddr[ETHER_ADDR_LEN];
+		char tmpstr[32];
 		uint64_t nwwn = 0, pwwn = 0;
 		prop_dictionary_t dict;
+		prop_data_t blob;
 		prop_number_t pwwnd = NULL, nwwnd = NULL;
 
 		device_setofnode(dev, ofnode);
 		dev_path_exact_match(dev, ofnode);
 
+		if (OF_getprop(ofnode, name, tmpstr, sizeof(tmpstr)) = 0)
+			tmpstr[0] = 0;
+
+		/*
+		 * If this is a network interface, note the
+		 * mac address.
+		 */
+		if (strcmp(tmpstr, network) == 0
+		   || strcmp(tmpstr, ethernet) == 0
+		   || OF_getprop(ofnode, mac-address, eaddr, sizeof(eaddr))
+		  == sizeof(eaddr)) {
+			prom_getether(ofnode, eaddr);
+			dict = device_properties(dev);
+			blob = prop_data_create_data(eaddr, ETHER_ADDR_LEN);
+			prop_dictionary_set(dict, mac-address, blob);
+			prop_object_release(blob);
+		}
+		/*
+		 * Is it a network interface with FCode? (others are called
+		 * ethernet by the firmware)
+		 */
+		if (strcmp(tmpstr, network) == 0) {
+			dict = device_properties(dev);
+			prop_dictionary_set_bool(dict, without-seeprom, true);
+		}
+
 		/* is this a FC node? */
-		if (OF_getprop(ofnode, device_type, devtype,
-		sizeof(devtype))  0  strcmp(devtype, scsi-fcp) == 0) {
+		if (OF_getprop(ofnode, device_type, tmpstr,
+		sizeof(tmpstr))  0  strcmp(tmpstr, scsi-fcp) == 0) {
 
 			dict = device_properties(dev);
 



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

2010-01-15 Thread Takeshi Nakayama
Module Name:src
Committed By:   nakayama
Date:   Fri Jan 15 23:57:07 UTC 2010

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

Log Message:
UltraSPARC-IIIi CPUs select the BUSY/NACK pair in the interrupt
vector dispatch status register based on the lower two bits of the
ITID.

From OpenBSD and details are described in the section 10.4.3 of
UltraSPARC IIIi Processor User's Manual.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/sparc64/sparc64/ipifuncs.c

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



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

2010-01-15 Thread Takeshi Nakayama
Module Name:src
Committed By:   nakayama
Date:   Fri Jan 15 23:57:07 UTC 2010

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

Log Message:
UltraSPARC-IIIi CPUs select the BUSY/NACK pair in the interrupt
vector dispatch status register based on the lower two bits of the
ITID.

From OpenBSD and details are described in the section 10.4.3 of
UltraSPARC IIIi Processor User's Manual.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/sparc64/sparc64/ipifuncs.c

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

Modified files:

Index: src/sys/arch/sparc64/sparc64/ipifuncs.c
diff -u src/sys/arch/sparc64/sparc64/ipifuncs.c:1.25 src/sys/arch/sparc64/sparc64/ipifuncs.c:1.26
--- src/sys/arch/sparc64/sparc64/ipifuncs.c:1.25	Mon Nov 30 01:45:04 2009
+++ src/sys/arch/sparc64/sparc64/ipifuncs.c	Fri Jan 15 23:57:07 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipifuncs.c,v 1.25 2009/11/30 01:45:04 mrg Exp $ */
+/*	$NetBSD: ipifuncs.c,v 1.26 2010/01/15 23:57:07 nakayama Exp $ */
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ipifuncs.c,v 1.25 2009/11/30 01:45:04 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: ipifuncs.c,v 1.26 2010/01/15 23:57:07 nakayama Exp $);
 
 #include opt_ddb.h
 
@@ -188,11 +188,19 @@
 void
 sparc64_send_ipi(int upaid, ipifunc_t func, uint64_t arg1, uint64_t arg2)
 {
-	int i, ik;
+	int i, ik, shift = 0;
 	uint64_t intr_func;
 
 	KASSERT(upaid != curcpu()-ci_cpuid);
-	if (ldxa(0, ASR_IDSR)  IDSR_BUSY)
+
+	/*
+	 * UltraSPARC-IIIi CPUs select the BUSY/NACK pair based on the
+	 * lower two bits of the ITID.
+	 */
+	if (((getver()  VER_IMPL)  VER_IMPL_SHIFT) == IMPL_JALAPENO)
+		shift = (upaid  0x3) * 2;
+
+	if (ldxa(0, ASR_IDSR)  (IDSR_BUSY  shift))
 		panic(recursive IPI?);
 
 	intr_func = (uint64_t)(u_long)func;
@@ -211,7 +219,7 @@
 		membar_sync();
 
 		for (ik = 0; ik  100; ik++) {
-			if (ldxa(0, ASR_IDSR)  IDSR_BUSY)
+			if (ldxa(0, ASR_IDSR)  (IDSR_BUSY  shift))
 continue;
 			else
 break;
@@ -221,7 +229,7 @@
 		if (ik == 100)
 			break;
 
-		if ((ldxa(0, ASR_IDSR)  IDSR_NACK) == 0)
+		if ((ldxa(0, ASR_IDSR)  (IDSR_NACK  shift)) == 0)
 			return;
 		/*
 		 * Wait for a while with enabling interrupts to avoid



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

2010-01-10 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Jan 10 15:07:53 UTC 2010

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

Log Message:
s/cpu_switch/cpu_switchto/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.245 -r1.246 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.



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

2010-01-10 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Jan 10 15:07:53 UTC 2010

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

Log Message:
s/cpu_switch/cpu_switchto/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.245 -r1.246 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/sparc64/pmap.c
diff -u src/sys/arch/sparc64/sparc64/pmap.c:1.245 src/sys/arch/sparc64/sparc64/pmap.c:1.246
--- src/sys/arch/sparc64/sparc64/pmap.c:1.245	Sat Dec  5 22:02:53 2009
+++ src/sys/arch/sparc64/sparc64/pmap.c	Sun Jan 10 15:07:53 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.245 2009/12/05 22:02:53 mrg Exp $	*/
+/*	$NetBSD: pmap.c,v 1.246 2010/01/10 15:07:53 skrll Exp $	*/
 /*
  *
  * Copyright (C) 1996-1999 Eduardo Horvath.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.245 2009/12/05 22:02:53 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.246 2010/01/10 15:07:53 skrll Exp $);
 
 #undef	NO_VCACHE /* Don't forget the locked TLB in dostart */
 #define	HWREF
@@ -1436,7 +1436,7 @@
 	}
 
 	/*
-	 * This is essentially the same thing that happens in cpu_switch()
+	 * This is essentially the same thing that happens in cpu_switchto()
 	 * when the newly selected process is about to run, except that we
 	 * have to make sure to clean the register windows before we set
 	 * the new context.



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

2009-12-07 Thread Takeshi Nakayama
Module Name:src
Committed By:   nakayama
Date:   Mon Dec  7 11:28:37 UTC 2009

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

Log Message:
- fix corner case bugs around the segment offsets.
- make sure that on error condition we return no valid mappings.


To generate a diff of this commit:
cvs rdiff -u -r1.249 -r1.250 src/sys/arch/sparc64/sparc64/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/sparc64/machdep.c
diff -u src/sys/arch/sparc64/sparc64/machdep.c:1.249 src/sys/arch/sparc64/sparc64/machdep.c:1.250
--- src/sys/arch/sparc64/sparc64/machdep.c:1.249	Wed Dec  2 10:18:42 2009
+++ src/sys/arch/sparc64/sparc64/machdep.c	Mon Dec  7 11:28:37 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.249 2009/12/02 10:18:42 nakayama Exp $ */
+/*	$NetBSD: machdep.c,v 1.250 2009/12/07 11:28:37 nakayama 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.249 2009/12/02 10:18:42 nakayama Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.250 2009/12/07 11:28:37 nakayama Exp $);
 
 #include opt_ddb.h
 #include opt_multiprocessor.h
@@ -1037,7 +1037,6 @@
 	/*
 	 * We always use just one segment.
 	 */
-	map-dm_mapsize = buflen;
 	i = 0;
 	map-dm_segs[i].ds_addr = 0UL;
 	map-dm_segs[i].ds_len = 0;
@@ -1049,23 +1048,24 @@
 		incr = min(sgsize, incr);
 
 		(void) pmap_extract(pmap_kernel(), vaddr, pa);
-		sgsize -= incr;
-		vaddr += incr;
 		if (map-dm_segs[i].ds_len == 0)
 			map-dm_segs[i].ds_addr = pa;
 		if (pa == (map-dm_segs[i].ds_addr + map-dm_segs[i].ds_len)
 		 ((map-dm_segs[i].ds_len + incr) = map-dm_maxsegsz)) {
 			/* Hey, waddyaknow, they're contiguous */
 			map-dm_segs[i].ds_len += incr;
-			incr = PAGE_SIZE;
-			continue;
+		} else {
+			if (++i = map-_dm_segcnt)
+return (EFBIG);
+			map-dm_segs[i].ds_addr = pa;
+			map-dm_segs[i].ds_len = incr;
 		}
-		if (++i = map-_dm_segcnt)
-			return (EFBIG);
-		map-dm_segs[i].ds_addr = pa;
-		map-dm_segs[i].ds_len = incr = PAGE_SIZE;
+		sgsize -= incr;
+		vaddr += incr;
+		incr = PAGE_SIZE;
 	}
 	map-dm_nsegs = i + 1;
+	map-dm_mapsize = buflen;
 	/* Mapping is bus dependent */
 	return (0);
 }
@@ -1081,8 +1081,15 @@
 	int i;
 	size_t len;
 
+	/*
+	 * Make sure that on error condition we return no valid mappings.
+	 */
+	map-dm_nsegs = 0;
 	KASSERT(map-dm_maxsegsz = map-_dm_maxmaxsegsz);
 
+	if (m-m_pkthdr.len  map-_dm_size)
+		return EINVAL;
+
 	/* Record mbuf for *_unload */
 	map-_dm_type = _DM_TYPE_MBUF;
 	map-_dm_source = (void *)m;
@@ -1194,6 +1201,10 @@
 	struct proc *p = uio-uio_lwp-l_proc;
 	struct pmap *pm;
 
+	/*
+	 * Make sure that on error condition we return no valid mappings.
+	 */
+	map-dm_nsegs = 0;
 	KASSERT(map-dm_maxsegsz = map-_dm_maxmaxsegsz);
 
 	if (uio-uio_segflg == UIO_USERSPACE) {
@@ -1346,16 +1357,21 @@
 
 if (offset  PAGE_SIZE) {
 	start = VM_PAGE_TO_PHYS(pg) + offset;
+	size -= offset;
 	if (size  len)
 		size = len;
 	cache_flush_phys(start, size, 0);
 	len -= size;
+	if (len == 0)
+		goto done;
+	offset = 0;
 	continue;
 }
 offset -= size;
 			}
 		}
 	}
+ done:
 	if (ops  BUS_DMASYNC_POSTWRITE) {
 		/* Nothing to do.  Handled by the bus controller. */
 	}



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

2009-12-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Dec  5 22:02:53 UTC 2009

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

Log Message:
from openbsd:
Don't use u_int to store a 64-bit address. Found with help from miod.
Makes a Sun Fire V490 boot without spending ages in bus_dmamem_alloc(9).


To generate a diff of this commit:
cvs rdiff -u -r1.244 -r1.245 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/sparc64/pmap.c
diff -u src/sys/arch/sparc64/sparc64/pmap.c:1.244 src/sys/arch/sparc64/sparc64/pmap.c:1.245
--- src/sys/arch/sparc64/sparc64/pmap.c:1.244	Fri Nov 27 03:23:14 2009
+++ src/sys/arch/sparc64/sparc64/pmap.c	Sat Dec  5 22:02:53 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.244 2009/11/27 03:23:14 rmind Exp $	*/
+/*	$NetBSD: pmap.c,v 1.245 2009/12/05 22:02:53 mrg Exp $	*/
 /*
  *
  * Copyright (C) 1996-1999 Eduardo Horvath.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.244 2009/11/27 03:23:14 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.245 2009/12/05 22:02:53 mrg Exp $);
 
 #undef	NO_VCACHE /* Don't forget the locked TLB in dostart */
 #define	HWREF
@@ -220,7 +220,6 @@
 extern int kernel_tlb_slots;
 
 static int npgs;
-static u_int nextavail;
 
 vaddr_t	vmmap;			/* one reserved MI vpage for /dev/mem */
 
@@ -1153,8 +1152,7 @@
 	/*
 	 * Set up bounds of allocatable memory for vmstat et al.
 	 */
-	nextavail = avail-start;
-	avail_start = nextavail;
+	avail_start = avail-start;
 	for (mp = avail; mp-size; mp++)
 		avail_end = mp-start+mp-size;
 



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

2009-12-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Dec  5 01:11:18 UTC 2009

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

Log Message:
Refactor device_register code slightly in preparation for further changes.
No functional changes.


To generate a diff of this commit:
cvs rdiff -u -r1.161 -r1.162 src/sys/arch/sparc64/sparc64/autoconf.c

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

Modified files:

Index: src/sys/arch/sparc64/sparc64/autoconf.c
diff -u src/sys/arch/sparc64/sparc64/autoconf.c:1.161 src/sys/arch/sparc64/sparc64/autoconf.c:1.162
--- src/sys/arch/sparc64/sparc64/autoconf.c:1.161	Fri Feb 13 22:41:03 2009
+++ src/sys/arch/sparc64/sparc64/autoconf.c	Sat Dec  5 01:11:18 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.161 2009/02/13 22:41:03 apb Exp $ */
+/*	$NetBSD: autoconf.c,v 1.162 2009/12/05 01:11:18 martin Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -48,7 +48,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.161 2009/02/13 22:41:03 apb Exp $);
+__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.162 2009/12/05 01:11:18 martin Exp $);
 
 #include opt_ddb.h
 #include opt_kgdb.h
@@ -832,7 +832,7 @@
 device_register(struct device *dev, void *aux)
 {
 	struct device *busdev = device_parent(dev);
-	int ofnode;
+	int ofnode = 0;
 
 	/*
 	 * We don't know the type of 'aux' - it depends on the
@@ -848,21 +848,16 @@
 	} else if (device_is_a(busdev, mainbus)) {
 		struct mainbus_attach_args *ma = aux;
 
-		device_setofnode(dev, ma-ma_node);
-		dev_path_exact_match(dev, ma-ma_node);
+		ofnode = ma-ma_node;
 	} else if (device_is_a(busdev, pci)) {
 		struct pci_attach_args *pa = aux;
 
 		ofnode = PCITAG_NODE(pa-pa_tag);
-		device_setofnode(dev, ofnode);
-		dev_path_exact_match(dev, ofnode);
 	} else if (device_is_a(busdev, sbus) || device_is_a(busdev, dma)
 	|| device_is_a(busdev, ledma)) {
 		struct sbus_attach_args *sa = aux;
 
 		ofnode = sa-sa_node;
-		device_setofnode(dev, ofnode);
-		dev_path_exact_match(dev, sa-sa_node);
 	} else if (device_is_a(dev, sd) || device_is_a(dev, cd)) {
 		struct scsipibus_attach_args *sa = aux;
 		struct scsipi_periph *periph = sa-sa_periph;
@@ -889,34 +884,39 @@
 		ofnode = device_ofnode(device_parent(busdev));
 		dev_path_drive_match(dev, ofnode, periph-periph_target + off,
 		periph-periph_lun);
+		return;
 	} else if (device_is_a(dev, wd)) {
 		struct ata_device *adev = aux;
 
 		ofnode = device_ofnode(device_parent(busdev));
 		dev_path_drive_match(dev, ofnode, adev-adev_channel*2+
 		adev-adev_drv_data-drive, 0);
+		return;
 	}
 
-	/* set properties for PCI framebuffers */
 	if (busdev == NULL)
 		return;
 
+	if (ofnode != 0) {
+		device_setofnode(dev, ofnode);
+		dev_path_exact_match(dev, ofnode);
+	}
+
+	/* set properties for PCI framebuffers */
 	if (device_is_a(busdev, pci)) {
 		/* see if this is going to be console */
 		struct pci_attach_args *pa = aux;
 		prop_dictionary_t dict;
-		int node, sub;
+		int sub;
 		int console = 0;
 
 		dict = device_properties(dev);
-		node = PCITAG_NODE(pa-pa_tag);
-		device_setofnode(dev, node);
 
 		/* we only care about display devices from here on */
 		if (PCI_CLASS(pa-pa_class) != PCI_CLASS_DISPLAY)
 			return;
 
-		console = (node == console_node);
+		console = (ofnode == console_node);
 
 		if (!console) {
 			/*
@@ -925,7 +925,7 @@
 			 * points to the head rather than the device
 			 * itself in this case
 			 */
-			sub = OF_child(node);
+			sub = OF_child(ofnode);
 			while ((sub != 0)  (sub != console_node)) {
 sub = OF_peer(sub);
 			}



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

2009-12-02 Thread Takeshi Nakayama
Module Name:src
Committed By:   nakayama
Date:   Wed Dec  2 10:18:42 UTC 2009

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

Log Message:
In calculating initial tstate, cast to 64-bit first to avoid sign extension.


To generate a diff of this commit:
cvs rdiff -u -r1.248 -r1.249 src/sys/arch/sparc64/sparc64/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/sparc64/machdep.c
diff -u src/sys/arch/sparc64/sparc64/machdep.c:1.248 src/sys/arch/sparc64/sparc64/machdep.c:1.249
--- src/sys/arch/sparc64/sparc64/machdep.c:1.248	Sat Nov 21 04:16:52 2009
+++ src/sys/arch/sparc64/sparc64/machdep.c	Wed Dec  2 10:18:42 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.248 2009/11/21 04:16:52 rmind Exp $ */
+/*	$NetBSD: machdep.c,v 1.249 2009/12/02 10:18:42 nakayama 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.248 2009/11/21 04:16:52 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.249 2009/12/02 10:18:42 nakayama Exp $);
 
 #include opt_ddb.h
 #include opt_multiprocessor.h
@@ -270,9 +270,8 @@
 		break;
 	}
 #endif
-	tstate = (ASI_PRIMARY_NO_FAULTTSTATE_ASI_SHIFT) |
-		((pstate)TSTATE_PSTATE_SHIFT) | 
-		(tf-tf_tstate  TSTATE_CWP);
+	tstate = ((int64_t)ASI_PRIMARY_NO_FAULT  TSTATE_ASI_SHIFT) |
+	(pstate  TSTATE_PSTATE_SHIFT) | (tf-tf_tstate  TSTATE_CWP);
 	if ((fs = l-l_md.md_fpstate) != NULL) {
 		/*
 		 * We hold an FPU state.  If we own *the* FPU chip state



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

2009-12-02 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Dec  3 05:06:17 UTC 2009

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

Log Message:
s/DEBUG/NOT_DEBUG/ on the intr_establish() re-used message.
it triggers all the time on more-modern systems.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/sparc64/sparc64/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/sparc64/sparc64/intr.c
diff -u src/sys/arch/sparc64/sparc64/intr.c:1.61 src/sys/arch/sparc64/sparc64/intr.c:1.62
--- src/sys/arch/sparc64/sparc64/intr.c:1.61	Tue Dec 16 22:35:27 2008
+++ src/sys/arch/sparc64/sparc64/intr.c	Thu Dec  3 05:06:16 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.c,v 1.61 2008/12/16 22:35:27 christos Exp $ */
+/*	$NetBSD: intr.c,v 1.62 2009/12/03 05:06:16 mrg Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -41,7 +41,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: intr.c,v 1.61 2008/12/16 22:35:27 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: intr.c,v 1.62 2009/12/03 05:06:16 mrg Exp $);
 
 #include opt_ddb.h
 #include opt_multiprocessor.h
@@ -203,7 +203,7 @@
 			 * Interrupt is already there.  We need to create a
 			 * new interrupt handler and interpose it.
 			 */
-#ifdef DEBUG
+#ifdef NOT_DEBUG
 			printf(intr_establish: intr reused %x\n, 
 ih-ih_number);
 #endif



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

2009-12-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Dec  1 09:26:36 UTC 2009

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

Log Message:
Revert part of previous - the removal of the first cpu to attach is
bootstrap cpu requirement already fixed everything - no need to use
cf_unit for a bogus test here.


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.87 src/sys/arch/sparc64/sparc64/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/sparc64/sparc64/cpu.c
diff -u src/sys/arch/sparc64/sparc64/cpu.c:1.86 src/sys/arch/sparc64/sparc64/cpu.c:1.87
--- src/sys/arch/sparc64/sparc64/cpu.c:1.86	Tue Dec  1 00:06:31 2009
+++ src/sys/arch/sparc64/sparc64/cpu.c	Tue Dec  1 09:26:36 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.86 2009/12/01 00:06:31 martin Exp $ */
+/*	$NetBSD: cpu.c,v 1.87 2009/12/01 09:26:36 martin Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -52,7 +52,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.86 2009/12/01 00:06:31 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.87 2009/12/01 09:26:36 martin Exp $);
 
 #include opt_multiprocessor.h
 
@@ -190,12 +190,14 @@
 	if (strcmp(cf-cf_name, ma-ma_name) != 0)
 		return 0;
 
+#ifndef MULTIPROCESSOR
 	/*
-	 * Make sure cpu0 attaches to the currently running cpu (which
-	 * is the boot cpu always, as we did not fire up others at this point)
+	 * If we are going to only attach a single cpu, make sure
+	 * to pick the one we are running on right now.
 	 */
-	if (cf-cf_unit == 0  upaid_from_node(ma-ma_node) != CPU_UPAID)
+	if (upaid_from_node(ma-ma_node) != CPU_UPAID)
 		return 0;
+#endif
 
 	return 1;
 }



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

2009-12-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Dec  1 18:51:20 UTC 2009

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

Log Message:
Remove restriction of mach prom to cpu0 - it does not make sense now
that cpu0 is not always the bootstrap cpu, and in the majority of cases
the prom abort will just work fine on any cpu.


To generate a diff of this commit:
cvs rdiff -u -r1.118 -r1.119 src/sys/arch/sparc64/sparc64/db_interface.c

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

Modified files:

Index: src/sys/arch/sparc64/sparc64/db_interface.c
diff -u src/sys/arch/sparc64/sparc64/db_interface.c:1.118 src/sys/arch/sparc64/sparc64/db_interface.c:1.119
--- src/sys/arch/sparc64/sparc64/db_interface.c:1.118	Sat Nov 21 04:16:52 2009
+++ src/sys/arch/sparc64/sparc64/db_interface.c	Tue Dec  1 18:51:20 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_interface.c,v 1.118 2009/11/21 04:16:52 rmind Exp $ */
+/*	$NetBSD: db_interface.c,v 1.119 2009/12/01 18:51:20 martin Exp $ */
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath.  All rights reserved.
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: db_interface.c,v 1.118 2009/11/21 04:16:52 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: db_interface.c,v 1.119 2009/12/01 18:51:20 martin Exp $);
 
 #include opt_ddb.h
 #include opt_multiprocessor.h
@@ -568,12 +568,6 @@
 void
 db_prom_cmd(db_expr_t addr, bool have_addr, db_expr_t count, const char *modif)
 {
-
-	if (cpu_number()) {
-		printf(this command is not safe while running on another 
-		CPU, please do\n\mach cpu 0\ and then try again\n);
-		return;
-	}
 	prom_abort();
 }
 



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

2009-12-01 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Dec  2 07:34:57 UTC 2009

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

Log Message:
print pid, lid and p_comm in some diag messages that indicate killed processes.


To generate a diff of this commit:
cvs rdiff -u -r1.159 -r1.160 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/sparc64/trap.c
diff -u src/sys/arch/sparc64/sparc64/trap.c:1.159 src/sys/arch/sparc64/sparc64/trap.c:1.160
--- src/sys/arch/sparc64/sparc64/trap.c:1.159	Sat Nov 21 04:16:52 2009
+++ src/sys/arch/sparc64/sparc64/trap.c	Wed Dec  2 07:34:57 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.159 2009/11/21 04:16:52 rmind Exp $ */
+/*	$NetBSD: trap.c,v 1.160 2009/12/02 07:34:57 mrg Exp $ */
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath.  All rights reserved.
@@ -50,7 +50,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.159 2009/11/21 04:16:52 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.160 2009/12/02 07:34:57 mrg Exp $);
 
 #include opt_ddb.h
 #include opt_multiprocessor.h
@@ -620,7 +620,8 @@
 	case T_INST_EXCEPT:
 	case T_TEXTFAULT:
 		/* This is not an MMU issue */
-		printf(trap: textfault at %lx!! sending SIGILL due to trap %d: %s\n, 
+		printf(trap: pid=%d.%d comm=%s textfault at %lx!! sending SIGILL due to trap %d: %s\n, 
+		   l-l_proc-p_pid, l-l_lid, l-l_proc-p_comm,
 		   pc, type, type  N_TRAP_TYPES ? trap_type[type] : T);
 #if defined(DDB)  defined(DEBUG)
 		if (trapdebug  TDB_STOPSIG)
@@ -634,7 +635,8 @@
 		break;
 
 	case T_PRIVINST:
-		printf(trap: privinst!! sending SIGILL due to trap %d: %s\n, 
+		printf(trap: pid=%d.%d comm=%s privinst!! sending SIGILL due to trap %d: %s\n, 
+		   l-l_proc-p_pid, l-l_lid, l-l_proc-p_comm,
 		   type, type  N_TRAP_TYPES ? trap_type[type] : T);
 #if defined(DDB)  defined(DEBUG)
 		if (trapdebug  TDB_STOPSIG)



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

2009-12-01 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Dec  2 07:55:01 UTC 2009

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

Log Message:
count IPI's as interrupts, not misc counters.


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/sys/arch/sparc64/sparc64/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/sparc64/sparc64/cpu.c
diff -u src/sys/arch/sparc64/sparc64/cpu.c:1.87 src/sys/arch/sparc64/sparc64/cpu.c:1.88
--- src/sys/arch/sparc64/sparc64/cpu.c:1.87	Tue Dec  1 09:26:36 2009
+++ src/sys/arch/sparc64/sparc64/cpu.c	Wed Dec  2 07:55:01 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.87 2009/12/01 09:26:36 martin Exp $ */
+/*	$NetBSD: cpu.c,v 1.88 2009/12/02 07:55:01 mrg Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -52,7 +52,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.87 2009/12/01 09:26:36 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.88 2009/12/02 07:55:01 mrg Exp $);
 
 #include opt_multiprocessor.h
 
@@ -267,10 +267,10 @@
 		ci-ci_cpcb = lwp_getpcb(ci-ci_data.cpu_idlelwp);
 	}
 	for (i = 0; i  IPI_EVCNT_NUM; ++i)
-		evcnt_attach_dynamic(ci-ci_ipi_evcnt[i], EVCNT_TYPE_MISC,
+		evcnt_attach_dynamic(ci-ci_ipi_evcnt[i], EVCNT_TYPE_INTR,
  NULL, device_xname(dev), ipi_evcnt_names[i]);
 #endif
-	evcnt_attach_dynamic(ci-ci_tick_evcnt, EVCNT_TYPE_MISC, NULL,
+	evcnt_attach_dynamic(ci-ci_tick_evcnt, EVCNT_TYPE_INTR, NULL,
 			 device_xname(dev), timer);
 
 	clk = prom_getpropint(node, clock-frequency, 0);



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

2009-12-01 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Dec  2 07:55:53 UTC 2009

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

Log Message:
print the fplwp in mach cpu list.


To generate a diff of this commit:
cvs rdiff -u -r1.119 -r1.120 src/sys/arch/sparc64/sparc64/db_interface.c

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

Modified files:

Index: src/sys/arch/sparc64/sparc64/db_interface.c
diff -u src/sys/arch/sparc64/sparc64/db_interface.c:1.119 src/sys/arch/sparc64/sparc64/db_interface.c:1.120
--- src/sys/arch/sparc64/sparc64/db_interface.c:1.119	Tue Dec  1 18:51:20 2009
+++ src/sys/arch/sparc64/sparc64/db_interface.c	Wed Dec  2 07:55:53 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_interface.c,v 1.119 2009/12/01 18:51:20 martin Exp $ */
+/*	$NetBSD: db_interface.c,v 1.120 2009/12/02 07:55:53 mrg Exp $ */
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath.  All rights reserved.
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: db_interface.c,v 1.119 2009/12/01 18:51:20 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: db_interface.c,v 1.120 2009/12/02 07:55:53 mrg Exp $);
 
 #include opt_ddb.h
 #include opt_multiprocessor.h
@@ -1141,9 +1141,10 @@
 	struct cpu_info *ci;
 
 	for (ci = cpus; ci; ci = ci-ci_next) {
-		db_printf(cpu%d: self 0x%08lx lwp 0x%08lx pcb 0x%08lx\n,
-			  ci-ci_index, (u_long)ci-ci_self,
-			  (u_long)ci-ci_curlwp, (u_long)ci-ci_cpcb);
+		db_printf(cpu%d: self 0x%08lx lwp 0x%08lx pcb 0x%08lx 
+			  fplwp 0x%08lx\n, ci-ci_index, (u_long)ci-ci_self,
+			  (u_long)ci-ci_curlwp, (u_long)ci-ci_cpcb,
+			  (u_long)ci-ci_fplwp);
 	}
 }
 



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

2009-11-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Dec  1 00:06:32 UTC 2009

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

Log Message:
Remove restriction that cpu0 has to attach first.
Make sure cpu0 attaches to the bootstrap cpu only (equivalent of previous
change but not restricted to UP kernels).


To generate a diff of this commit:
cvs rdiff -u -r1.85 -r1.86 src/sys/arch/sparc64/sparc64/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/sparc64/sparc64/cpu.c
diff -u src/sys/arch/sparc64/sparc64/cpu.c:1.85 src/sys/arch/sparc64/sparc64/cpu.c:1.86
--- src/sys/arch/sparc64/sparc64/cpu.c:1.85	Sun Nov 29 19:38:45 2009
+++ src/sys/arch/sparc64/sparc64/cpu.c	Tue Dec  1 00:06:31 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.85 2009/11/29 19:38:45 martin Exp $ */
+/*	$NetBSD: cpu.c,v 1.86 2009/12/01 00:06:31 martin Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -52,7 +52,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.85 2009/11/29 19:38:45 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.86 2009/12/01 00:06:31 martin Exp $);
 
 #include opt_multiprocessor.h
 
@@ -190,14 +190,13 @@
 	if (strcmp(cf-cf_name, ma-ma_name) != 0)
 		return 0;
 
-#ifndef MULTIPROCESSOR
 	/*
-	 * If we are going to only attach a single cpu, make sure
-	 * to pick the one we are running on right now.
+	 * Make sure cpu0 attaches to the currently running cpu (which
+	 * is the boot cpu always, as we did not fire up others at this point)
 	 */
-	if (upaid_from_node(ma-ma_node) != CPU_UPAID)
+	if (cf-cf_unit == 0  upaid_from_node(ma-ma_node) != CPU_UPAID)
 		return 0;
-#endif
+
 	return 1;
 }
 
@@ -238,7 +237,6 @@
 	char buf[100];
 	int 	totalsize = 0;
 	int 	linesize;
-	static bool passed = false;
 
 	/* tell them what we have */
 	node = ma-ma_node;
@@ -255,8 +253,7 @@
 	 * For other cpus, we need to call mi_cpu_attach()
 	 * and complete setting up cpcb.
 	 */
-	if (!passed) {
-		passed = true;
+	if (ci-ci_flags  CPUF_PRIMARY) {
 		fpstate_cache = pool_cache_init(sizeof(struct fpstate64),
 	BLOCK_SIZE, 0, 0, fpstate, NULL,
 	IPL_NONE, NULL, NULL, NULL);



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

2009-11-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Nov 29 19:38:46 UTC 2009

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

Log Message:
On non-multiprocessor kernels, when running on SMP machines, make sure to
attach cpu0 (the one and only cpu* ever) to the firmware node describing
the cpu we are currently running on.
Otherwise we will have a mismatch on the UPA-ID in the cpuinfo and
eventually allocate a second cpuinfo overriding all the initializations
done early for the boot cpu.


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 src/sys/arch/sparc64/sparc64/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/sparc64/sparc64/cpu.c
diff -u src/sys/arch/sparc64/sparc64/cpu.c:1.84 src/sys/arch/sparc64/sparc64/cpu.c:1.85
--- src/sys/arch/sparc64/sparc64/cpu.c:1.84	Sat Nov 21 04:16:52 2009
+++ src/sys/arch/sparc64/sparc64/cpu.c	Sun Nov 29 19:38:45 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.84 2009/11/21 04:16:52 rmind Exp $ */
+/*	$NetBSD: cpu.c,v 1.85 2009/11/29 19:38:45 martin Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -52,7 +52,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.84 2009/11/21 04:16:52 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.85 2009/11/29 19:38:45 martin Exp $);
 
 #include opt_multiprocessor.h
 
@@ -105,6 +105,18 @@
 CFATTACH_DECL(cpu, sizeof(struct device),
 cpu_match, cpu_attach, NULL, NULL);
 
+static int
+upaid_from_node(u_int cpu_node)
+{
+	int portid;
+
+	if (OF_getprop(cpu_node, upa-portid, portid, sizeof(portid)) = 0 
+	OF_getprop(cpu_node, portid, portid, sizeof(portid)) = 0)
+		panic(cpu node w/o upa-portid);
+
+	return portid;
+}
+
 struct cpu_info *
 alloc_cpuinfo(u_int cpu_node)
 {
@@ -118,9 +130,7 @@
 	/*
 	 * Check for UPAID in the cpus list.
 	 */
-	if (OF_getprop(cpu_node, upa-portid, portid, sizeof(portid)) = 0 
-	OF_getprop(cpu_node, portid, portid, sizeof(portid)) = 0)
-		panic(alloc_cpuinfo: upa-portid);
+	portid = upaid_from_node(cpu_node);
 
 	for (cpi = cpus; cpi != NULL; cpi = cpi-ci_next)
 		if (cpi-ci_cpuid == portid)
@@ -177,7 +187,18 @@
 {
 	struct mainbus_attach_args *ma = aux;
 
-	return (strcmp(cf-cf_name, ma-ma_name) == 0);
+	if (strcmp(cf-cf_name, ma-ma_name) != 0)
+		return 0;
+
+#ifndef MULTIPROCESSOR
+	/*
+	 * If we are going to only attach a single cpu, make sure
+	 * to pick the one we are running on right now.
+	 */
+	if (upaid_from_node(ma-ma_node) != CPU_UPAID)
+		return 0;
+#endif
+	return 1;
 }
 
 static void



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

2009-11-29 Thread Takeshi Nakayama
Module Name:src
Committed By:   nakayama
Date:   Mon Nov 30 05:22:55 UTC 2009

Modified Files:
src/sys/arch/sparc64/sparc64: locore.s

Log Message:
sp_tlb_flush_pte for cheetah:
- restore interrupts properly in case of %tl  0.


To generate a diff of this commit:
cvs rdiff -u -r1.298 -r1.299 src/sys/arch/sparc64/sparc64/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/sparc64/sparc64/locore.s
diff -u src/sys/arch/sparc64/sparc64/locore.s:1.298 src/sys/arch/sparc64/sparc64/locore.s:1.299
--- src/sys/arch/sparc64/sparc64/locore.s:1.298	Mon Nov 30 01:58:49 2009
+++ src/sys/arch/sparc64/sparc64/locore.s	Mon Nov 30 05:22:55 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.298 2009/11/30 01:58:49 mrg Exp $	*/
+/*	$NetBSD: locore.s,v 1.299 2009/11/30 05:22:55 nakayama Exp $	*/
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath
@@ -5464,14 +5464,12 @@
 #endif
 	flush	%o1
 	stxa	%o5, [%o2] ASI_DMMU			! Restore primary context
-	brz,pt	%o3, 1f
+	brnz,pt	%o3, 1f
 	 flush	%o1
-	retl
-	 nop
+	wrpr	%g0, %o3, %tl! Return to kernel mode.
 1:	
-	wrpr	%o4, %pstate! restore interrupts
 	retl
-	 wrpr	%g0, %o3, %tl! Return to kernel mode.
+	 wrpr	%o4, %pstate! restore interrupts
 #endif
 
 



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

2009-11-28 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Nov 28 21:38:56 UTC 2009

Modified Files:
src/sys/arch/sparc64/sparc64: locore.s

Log Message:
implement enough code to get SB2000/SB2500 booting to multiuser.  does
not last long if you use it, but an idle machine has stayed up 10 hours.

- for the !SPITFIRE case, use ASI_DCACHE_INVALIDATE instead of
  ASI_DCACHE_TAG when clearing tlb entries.  from openbsd.

- convert some comment ! Not yet into WRITEME, so that attempting
  to build a USIII MULTIPROCESSOR kernel fails to build until the code
  is written.

- add some more WRITEME's for the above.

- implement a !SPITFIRE version of sp_tlb_flush_all().  since there are
  no spare regs, for now just always increase %tl around this call.  (we
  could maybe store a token in %o3 along with the saved %pstate info.)


To generate a diff of this commit:
cvs rdiff -u -r1.294 -r1.295 src/sys/arch/sparc64/sparc64/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/sparc64/sparc64/locore.s
diff -u src/sys/arch/sparc64/sparc64/locore.s:1.294 src/sys/arch/sparc64/sparc64/locore.s:1.295
--- src/sys/arch/sparc64/sparc64/locore.s:1.294	Thu Nov 26 00:19:22 2009
+++ src/sys/arch/sparc64/sparc64/locore.s	Sat Nov 28 21:38:55 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.294 2009/11/26 00:19:22 matt Exp $	*/
+/*	$NetBSD: locore.s,v 1.295 2009/11/28 21:38:55 mrg Exp $	*/
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath
@@ -55,7 +55,9 @@
  *	@(#)locore.s	8.4 (Berkeley) 12/10/93
  */
 
+#ifndef SCHIZO_BUS_SPACE_BROKEN /* Need phys access for USIII so far */
 #define	SPITFIRE		/* We don't support Cheetah (USIII) yet */
+#endif
 #undef	PARANOID		/* Extremely expensive consistency checks */
 #undef	NO_VCACHE		/* Map w/D$ disabled */
 #undef	TRAPSTATS		/* Count traps */
@@ -2529,7 +2531,11 @@
 1:
 #if 1
 	/* Now we need to blast away the D$ to make sure we're in sync */
+#ifdef SPITFIRE
 	stxa	%g0, [%g7] ASI_DCACHE_TAG
+#else
+	stxa	%g0, [%g7] ASI_DCACHE_INVALIDATE
+#endif
 	brnz,pt	%g7, 1b
 	 dec	8, %g7
 #endif
@@ -3811,7 +3817,7 @@
 	membar	#Sync
 	IPIEVC_INC(IPI_EVCNT_TLB_PTE,%g2,%g3)
 #else
-	! Not yet
+	WRITEME
 #endif
 	 
 	ba,a	ret_from_intr_vector
@@ -3845,7 +3851,7 @@
 	membar	#Sync
 	IPIEVC_INC(IPI_EVCNT_TLB_CTX,%g2,%g3)
 #else
-	! Not yet
+	WRITEME
 #endif
 	 
 	ba,a	ret_from_intr_vector
@@ -5491,6 +5497,9 @@
 	 nop
 #endif
 #else
+#ifdef MULTIPROCESSOR
+	WRITEME
+#endif
 	!!
 	!! Cheetahs do not support flushing the IMMU from secondary context
 	!!
@@ -5519,7 +5528,7 @@
 	 nop
 1:	
 	retl
-	 wrpr	%g0, 0, %tl! Return to kernel mode.
+	 wrpr	%g0, %o3, %tl! Return to kernel mode.
 #endif
 
 /*
@@ -5585,6 +5594,9 @@
 	 nop
 #endif
 #else
+#ifdef MULTIPROCESSOR
+	WRITEME
+#endif
 	rdpr	%tl, %o3
 	mov	CTX_PRIMARY, %o2
 	brnz	%o3, 1f
@@ -5607,7 +5619,7 @@
 	 nop
 1:	
 	retl
-	 wrpr	%g0, 0, %tl			! Return to kernel mode.
+	 wrpr	%g0, %o3, %tl			! Return to kernel mode.
 #endif
 
 /*
@@ -5631,8 +5643,9 @@
 	! %o1 = ctx value
 	! %o2 = TLB tag value
 	! %o3 = saved %pstate
-	! %o4 = saved secondary ctx
+	! %o4 = saved primary ctx
 	! %o5 = CTX_MASK
+	! %xx = saved %tl
 
 0:
 	ldxa	[%o0] ASI_DMMU_TLB_TAG, %o2		! fetch the TLB tag
@@ -5682,7 +5695,82 @@
 	retl
 	 wrpr	%o3, %pstate
 #else
-	WRITEME
+	! XXX bump up %tl around this call always
+	rdpr	%tl, %o4
+	inc	%o4
+	wrpr	%o4, 0, %tl
+
+	rdpr	%pstate, %o3
+	andn	%o3, PSTATE_IE, %o4			! disable interrupts
+	wrpr	%o4, 0, %pstate
+	set	(63 * 8), %o0! last TLB entry
+	set	CTX_PRIMARY, %o4
+	ldxa	[%o4] ASI_DMMU, %o4			! save secondary context
+	set	CTX_MASK, %o5
+	membar	#Sync
+
+	! %o0 = loop counter
+	! %o1 = ctx value
+	! %o2 = TLB tag value
+	! %o3 = saved %pstate
+	! %o4 = saved primary ctx
+	! %o5 = CTX_MASK
+	! %xx = saved %tl
+
+0:
+	ldxa	[%o0] ASI_DMMU_TLB_TAG, %o2		! fetch the TLB tag
+	andcc	%o2, %o5, %o1! context 0?
+	bz,pt	%xcc, 1f! if so, skip
+	 mov	CTX_PRIMARY, %o2
+
+	stxa	%o1, [%o2] ASI_DMMU			! set the context
+	set	DEMAP_CTX_PRIMARY, %o2
+	membar	#Sync
+	stxa	%o2, [%o2] ASI_DMMU_DEMAP		! do the demap
+	membar	#Sync
+
+1:
+	dec	8, %o0
+	brgz,pt %o0, 0b	! loop over all entries
+	 nop
+
+/*
+ * now do the IMMU
+ */
+
+	set	(63 * 8), %o0! last TLB entry
+
+0:
+	ldxa	[%o0] ASI_IMMU_TLB_TAG, %o2		! fetch the TLB tag
+	andcc	%o2, %o5, %o1! context 0?
+	bz,pt	%xcc, 1f! if so, skip
+	 mov	CTX_PRIMARY, %o2
+
+	stxa	%o1, [%o2] ASI_DMMU			! set the context
+	set	DEMAP_CTX_PRIMARY, %o2
+	membar	#Sync
+	stxa	%o2, [%o2] ASI_IMMU_DEMAP		! do the demap
+	membar	#Sync
+
+1:
+	dec	8, %o0
+	brgz,pt %o0, 0b	! loop over all entries
+	 nop
+
+	set	CTX_PRIMARY, %o2
+	stxa	%o4, [%o2] ASI_DMMU			! restore secondary ctx
+	sethi	%hi(KERNBASE), %o4
+	membar	#Sync
+	flush	%o4
+
+	! XXX bump up %tl around this call always
+	rdpr	%tl, %o4
+	dec	%o4
+	wrpr	%o4, 0, %tl
+
+	retl
+	 wrpr	%o3, %pstate
+
 #endif
 
 /*
@@ -5706,7 +5794,11 

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

2009-11-28 Thread Takeshi Nakayama
Module Name:src
Committed By:   nakayama
Date:   Sun Nov 29 03:31:33 UTC 2009

Modified Files:
src/sys/arch/sparc64/sparc64: locore.s

Log Message:
- calculate end PA correctly.
- wrap more spitfire specific (flushing I$) code.
- fix inverted #if condition for flushing I$ (and restore ASI_ICACHE_TAG).


To generate a diff of this commit:
cvs rdiff -u -r1.295 -r1.296 src/sys/arch/sparc64/sparc64/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/sparc64/sparc64/locore.s
diff -u src/sys/arch/sparc64/sparc64/locore.s:1.295 src/sys/arch/sparc64/sparc64/locore.s:1.296
--- src/sys/arch/sparc64/sparc64/locore.s:1.295	Sat Nov 28 21:38:55 2009
+++ src/sys/arch/sparc64/sparc64/locore.s	Sun Nov 29 03:31:33 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.295 2009/11/28 21:38:55 mrg Exp $	*/
+/*	$NetBSD: locore.s,v 1.296 2009/11/29 03:31:33 nakayama Exp $	*/
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath
@@ -5948,6 +5948,7 @@
 	tnz	1		! Error!
 #endif
 	add	%o0, %o1, %o1	! End PA
+	dec	%o1
 
 	!!
 	!! Both D$ and I$ tags match pa bits 40-13, but
@@ -5973,7 +5974,9 @@
 	and	%o3, %o2, %o3	! Mask out trash
 	cmp	%o0, %o3
 	blt,pt	%xcc, 2f	! Too low
+#ifdef SPITFIRE
 	 sllx	%g1, 40-35, %g1	! Shift I$ tag into place
+#endif
 	cmp	%o1, %o3
 	bgt,pt	%xcc, 2f	! Too high
 	 nop
@@ -5985,13 +5988,14 @@
 	stxa	%g0, [%o4] ASI_DCACHE_INVALIDATE ! Just right
 #endif
 2:
-#ifndef SPITFIRE
+#ifdef SPITFIRE
+	and	%g1, %o2, %g1	! Mask out trash
 	cmp	%o0, %g1
 	blt,pt	%xcc, 3f
 	 cmp	%o1, %g1
-	bgt,pt	%icc, 3f
+	bgt,pt	%xcc, 3f
 	 nop
-	stxa	%g0, [%o4] ASI_DCACHE_INVALIDATE
+	stxa	%g0, [%o4] ASI_ICACHE_TAG
 3:
 #endif
 	membar	#StoreLoad



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

2009-11-26 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Nov 26 20:15:20 UTC 2009

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

Log Message:
report the old - new interrupt mapping when swizzling.  minor KNF.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/sparc64/sparc64/ofw_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/sparc64/ofw_machdep.c
diff -u src/sys/arch/sparc64/sparc64/ofw_machdep.c:1.35 src/sys/arch/sparc64/sparc64/ofw_machdep.c:1.36
--- src/sys/arch/sparc64/sparc64/ofw_machdep.c:1.35	Mon May 18 12:15:26 2009
+++ src/sys/arch/sparc64/sparc64/ofw_machdep.c	Thu Nov 26 20:15:20 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ofw_machdep.c,v 1.35 2009/05/18 12:15:26 nakayama Exp $	*/
+/*	$NetBSD: ofw_machdep.c,v 1.36 2009/11/26 20:15:20 mrg Exp $	*/
 
 /*
  * Copyright (C) 1996 Wolfgang Solfrank.
@@ -34,7 +34,7 @@
 #include opt_multiprocessor.h
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ofw_machdep.c,v 1.35 2009/05/18 12:15:26 nakayama Exp $);
+__KERNEL_RCSID(0, $NetBSD: ofw_machdep.c,v 1.36 2009/11/26 20:15:20 mrg Exp $);
 
 #include sys/param.h
 #include sys/buf.h
@@ -714,10 +714,14 @@
 	  sizeof(dev_type)))  0) 
 			!strcmp(dev_type, pci) 
 			(node != phc_node)) {
+#ifdef DEBUG
+int ointerrupt = *interrupt;
+#endif
+
 *interrupt = ((*interrupt +
 OFW_PCI_PHYS_HI_DEVICE(reg[0]) - 1)  3) + 1;
-DPRINTF((OF_mapintr: interrupt %x, reg[0] %x\n,
-	 *interrupt, reg[0]));
+DPRINTF((OF_mapintr: interrupt %x - %x, reg[0] %x\n,
+	 ointerrupt, *interrupt, reg[0]));
 			}
 
 			/* Get reg for next level compare. */
@@ -746,13 +750,13 @@
 			/* How should I know. */
 			address_cells = 2;
 		}
-		DPRINTF((#address-cells = %d len %d, address_cells, len));
+		DPRINTF((#address-cells = %d len %d , address_cells, len));
 		if ((len = OF_searchprop(node, #size-cells, size_cells,
 			sizeof(size_cells))) = 0) {
 			/* How should I know. */
 			size_cells = 2;
 		}
-		DPRINTF((#size-cells = %d len %d, size_cells, len));
+		DPRINTF((#size-cells = %d len %d , size_cells, len));
 		if ((len = OF_getprop(node, #interrupt-cells, interrupt_cells,
 			sizeof(interrupt_cells))) = 0) {
 			/* How should I know. */
@@ -780,18 +784,18 @@
 #endif
 
 		/* finally we can attempt the compare */
-		i=0;
-		while ( i  interrupt_map_len ) {
+		i = 0;
+		while (i  interrupt_map_len) {
 			int pintr_cells;
 			int *imap = interrupt_map[i];
 			int *parent = imap[address_cells + interrupt_cells];
 
 #ifdef DEBUG
 			DPRINTF((\ninterrupt-map addr ));
-			for (len=0; lenaddress_cells; len++)
+			for (len = 0; len  address_cells; len++)
 DPRINTF((%x., imap[len]));
 			DPRINTF(( intr ));
-			for (; len(address_cells+interrupt_cells); len++)
+			for (; len  (address_cells+interrupt_cells); len++)
 DPRINTF((%x., imap[len]));
 			DPRINTF((\nnode %x vs parent %x\n,
 imap[len], *parent));
@@ -821,10 +825,11 @@
 parent++;
 #ifdef DEBUG
 DPRINTF((Match! using ));
-for (len=0; lenpintr_cells; len++)
+for (len = 0; len  pintr_cells; len++)
 	DPRINTF((%x., parent[len]));
+DPRINTF((\n));
 #endif
-for (i=0; ipintr_cells; i++)
+for (i = 0; i  pintr_cells; i++)
 	interrupt[i] = parent[i];
 rc = validlen = pintr_cells;
 break;
@@ -834,7 +839,7 @@
 			DPRINTF((skip %d cells:,
 address_cells + interrupt_cells +
 pintr_cells + 1));
-			for (len=0; len(address_cells +
+			for (len = 0; len  (address_cells +
 interrupt_cells + pintr_cells + 1); len++)
 DPRINTF((%x., imap[len]));
 #endif



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

2009-11-24 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Nov 25 02:34:35 UTC 2009

Modified Files:
src/sys/arch/sparc64/sparc64: genassym.cf locore.s

Log Message:
s/L_ADDR/L_PCB/, requested by rmind.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/sparc64/sparc64/genassym.cf
cvs rdiff -u -r1.292 -r1.293 src/sys/arch/sparc64/sparc64/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/sparc64/sparc64/genassym.cf
diff -u src/sys/arch/sparc64/sparc64/genassym.cf:1.60 src/sys/arch/sparc64/sparc64/genassym.cf:1.61
--- src/sys/arch/sparc64/sparc64/genassym.cf:1.60	Sat Sep 20 18:29:05 2008
+++ src/sys/arch/sparc64/sparc64/genassym.cf	Wed Nov 25 02:34:34 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.60 2008/09/20 18:29:05 tsutsui Exp $
+#	$NetBSD: genassym.cf,v 1.61 2009/11/25 02:34:34 mrg Exp $
 
 #
 # Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -112,7 +112,7 @@
 define	PAGE_SIZE	PAGE_SIZE
 
 # Important offsets into the lwp and proc structs  associated constants
-define	L_ADDR			offsetof(struct lwp, l_addr)
+define	L_PCB			offsetof(struct lwp, l_addr)
 define	L_PROC			offsetof(struct lwp, l_proc)
 define	L_TF			offsetof(struct lwp, l_md.md_tf)
 define	L_FPSTATE		offsetof(struct lwp, l_md.md_fpstate)

Index: src/sys/arch/sparc64/sparc64/locore.s
diff -u src/sys/arch/sparc64/sparc64/locore.s:1.292 src/sys/arch/sparc64/sparc64/locore.s:1.293
--- src/sys/arch/sparc64/sparc64/locore.s:1.292	Sat Oct 17 20:03:06 2009
+++ src/sys/arch/sparc64/sparc64/locore.s	Wed Nov 25 02:34:34 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.292 2009/10/17 20:03:06 nakayama Exp $	*/
+/*	$NetBSD: locore.s,v 1.293 2009/11/25 02:34:34 mrg Exp $	*/
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath
@@ -5062,7 +5062,7 @@
 	sethi	%hi(CPUINFO_VA+CI_CURLWP), %l0
 	LDPTR	[%l0 + %lo(CPUINFO_VA+CI_CURLWP)], %l0
 	set	USPACE - TF_SIZE - CC64FSZ, %l1
-	LDPTR	[%l0 + L_ADDR], %l0
+	LDPTR	[%l0 + L_PCB], %l0
  	add	%l1, %l0, %l0
 #ifdef _LP64
 	andn	%l0, 0x0f, %l0			! Needs to be 16-byte aligned
@@ -5266,7 +5266,7 @@
 	sethi	%hi(CPUINFO_VA+CI_IDLELWP), %l0
 	LDPTR	[%l0 + %lo(CPUINFO_VA+CI_IDLELWP)], %l0
 	set	USPACE - TF_SIZE - CC64FSZ, %l1
-	LDPTR	[%l0 + L_ADDR], %l0
+	LDPTR	[%l0 + L_PCB], %l0
 	add	%l0, %l1, %l0
 #ifdef _LP64
 	andn	%l0, 0x0f, %l0			! Needs to be 16-byte aligned
@@ -6717,7 +6717,7 @@
 	 sethi	%hi(CPCB), %l6
 
 	rdpr	%pstate, %o1			! oldpstate = %pstate;
-	LDPTR	[%i0 + L_ADDR], %l5
+	LDPTR	[%i0 + L_PCB], %l5
 
 	stx	%i7, [%l5 + PCB_PC]
 	stx	%i6, [%l5 + PCB_SP]
@@ -6729,7 +6729,7 @@
 1:
 	sethi	%hi(CURLWP), %l7
 
-	LDPTR   [%i1 + L_ADDR], %l1	! newpcb = l-l_addr;
+	LDPTR   [%i1 + L_PCB], %l1	! newpcb = l-l_pcb;
 
 	/*
 	 * Load the new lwp.  To load, we must change stacks and



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

2009-10-17 Thread Takeshi Nakayama
Module Name:src
Committed By:   nakayama
Date:   Sat Oct 17 20:03:06 UTC 2009

Modified Files:
src/sys/arch/sparc64/sparc64: locore.s

Log Message:
Wrap unused code with #if 0 which is called from #if 0'ed code.


To generate a diff of this commit:
cvs rdiff -u -r1.291 -r1.292 src/sys/arch/sparc64/sparc64/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/sparc64/sparc64/locore.s
diff -u src/sys/arch/sparc64/sparc64/locore.s:1.291 src/sys/arch/sparc64/sparc64/locore.s:1.292
--- src/sys/arch/sparc64/sparc64/locore.s:1.291	Sat May 30 16:52:32 2009
+++ src/sys/arch/sparc64/sparc64/locore.s	Sat Oct 17 20:03:06 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.291 2009/05/30 16:52:32 martin Exp $	*/
+/*	$NetBSD: locore.s,v 1.292 2009/10/17 20:03:06 nakayama Exp $	*/
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath
@@ -1165,6 +1165,7 @@
 	UTRAP(0x1f0); UTRAP(0x1f1); UTRAP(0x1f2); UTRAP(0x1f3); UTRAP(0x1f4); UTRAP(0x1f5); UTRAP(0x1f6); UTRAP(0x1f7)
 	UTRAP(0x1f8); UTRAP(0x1f9); UTRAP(0x1fa); UTRAP(0x1fb); UTRAP(0x1fc); UTRAP(0x1fd); UTRAP(0x1fe); UTRAP(0x1ff)
 
+#if 0
 /*
  * If the cleanwin trap handler detects an overfow we come here.
  * We need to fix up the window registers, switch to the interrupt
@@ -1190,6 +1191,7 @@
 	.asciz	Kernel stack overflow!
 	_ALIGN
 	.text
+#endif
 
 #ifdef DEBUG
 #define CHKREG(r) \
@@ -4155,7 +4157,6 @@
 	bne,pn	CCCR, 1b
 	 EMPTY
 2:
-
 	add	%sp, CC64FSZ+STKB, %o2	! tf = %sp + CC64FSZ + STKB
 	LDPTR	[%l2 + IH_PEND], %l7	! save ih-ih_pending
 	membar	#LoadStore



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

2009-08-17 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue Aug 18 00:15:37 UTC 2009

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

Log Message:
we need sys/exec_aout.h here
CV: Enter Log.  Lines beginning with `CVS:' are removed automatically


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/sys/arch/sparc64/sparc64/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/sparc64/sparc64/netbsd32_machdep.c
diff -u src/sys/arch/sparc64/sparc64/netbsd32_machdep.c:1.88 src/sys/arch/sparc64/sparc64/netbsd32_machdep.c:1.89
--- src/sys/arch/sparc64/sparc64/netbsd32_machdep.c:1.88	Sat Aug 15 23:45:00 2009
+++ src/sys/arch/sparc64/sparc64/netbsd32_machdep.c	Tue Aug 18 00:15:37 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep.c,v 1.88 2009/08/15 23:45:00 matt Exp $	*/
+/*	$NetBSD: netbsd32_machdep.c,v 1.89 2009/08/18 00:15:37 macallan Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: netbsd32_machdep.c,v 1.88 2009/08/15 23:45:00 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: netbsd32_machdep.c,v 1.89 2009/08/18 00:15:37 macallan Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_compat_netbsd.h
@@ -39,6 +39,7 @@
 
 #include sys/param.h
 #include sys/exec.h
+#include sys/exec_aout.h
 #include sys/filedesc.h
 #include sys/file.h
 #include sys/proc.h



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

2009-08-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Aug  9 13:15:05 UTC 2009

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

Log Message:
Fix misplaced #endif, from Henning Petersen in PR port-sparc64/41856


To generate a diff of this commit:
cvs rdiff -u -r1.236 -r1.237 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/sparc64/pmap.c
diff -u src/sys/arch/sparc64/sparc64/pmap.c:1.236 src/sys/arch/sparc64/sparc64/pmap.c:1.237
--- src/sys/arch/sparc64/sparc64/pmap.c:1.236	Tue Apr 21 21:30:00 2009
+++ src/sys/arch/sparc64/sparc64/pmap.c	Sun Aug  9 13:15:05 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.236 2009/04/21 21:30:00 cegger Exp $	*/
+/*	$NetBSD: pmap.c,v 1.237 2009/08/09 13:15:05 martin Exp $	*/
 /*
  *
  * Copyright (C) 1996-1999 Eduardo Horvath.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.236 2009/04/21 21:30:00 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.237 2009/08/09 13:15:05 martin Exp $);
 
 #undef	NO_VCACHE /* Don't forget the locked TLB in dostart */
 #define	HWREF
@@ -2687,9 +2687,9 @@
 		if (res)
 			pv-pv_va |= PV_WE;
 #endif
-#endif
 		mutex_exit(pmap_lock);
 	}
+#endif
 
 	DPRINTF(PDB_CHANGEPROT|PDB_REF, (pmap_is_modified(%p) = %d\n, pg,
 	res));



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

2009-05-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat May 30 17:20:45 UTC 2009

Removed Files:
src/sys/arch/sparc64/sparc64: intersil7170.h

Log Message:
Remove unused file (merge error?)


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r0 src/sys/arch/sparc64/sparc64/intersil7170.h

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



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

2009-05-21 Thread John Nemeth
Module Name:src
Committed By:   jnemeth
Date:   Thu May 21 08:07:18 UTC 2009

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

Log Message:
add a dummy module_init_md()

XXX if we ever teach the boot loader to load module, we'll have to
make this actually do something


To generate a diff of this commit:
cvs rdiff -u -r1.240 -r1.241 src/sys/arch/sparc64/sparc64/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/sparc64/machdep.c
diff -u src/sys/arch/sparc64/sparc64/machdep.c:1.240 src/sys/arch/sparc64/sparc64/machdep.c:1.241
--- src/sys/arch/sparc64/sparc64/machdep.c:1.240	Tue May 19 22:03:16 2009
+++ src/sys/arch/sparc64/sparc64/machdep.c	Thu May 21 08:07:18 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.240 2009/05/19 22:03:16 dyoung Exp $ */
+/*	$NetBSD: machdep.c,v 1.241 2009/05/21 08:07:18 jnemeth 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.240 2009/05/19 22:03:16 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.241 2009/05/21 08:07:18 jnemeth Exp $);
 
 #include opt_ddb.h
 #include opt_multiprocessor.h
@@ -2011,3 +2011,10 @@
 
 	return curcpu()-ci_idepth = 0;
 }
+
+#ifdef MODULAR
+void
+module_init_md(void)
+{
+}
+#endif



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

2009-05-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu May 21 13:24:38 UTC 2009

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

Log Message:
Deja Vu: when preparing the initial trap frame for a new forked lwp,
explicitly clear condition code. Otherwise we might catch a signal
(handlers are inherited from the parent) before we ever return to
userland. The current trapframe is converted into a ucontext and after
the signal handler returns, the lwp stays in userland and directly
uses the ucontext to return to the fork call.
Fixes PR 41302.


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 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/sparc64/vm_machdep.c
diff -u src/sys/arch/sparc64/sparc64/vm_machdep.c:1.87 src/sys/arch/sparc64/sparc64/vm_machdep.c:1.88
--- src/sys/arch/sparc64/sparc64/vm_machdep.c:1.87	Mon Mar 16 23:11:15 2009
+++ src/sys/arch/sparc64/sparc64/vm_machdep.c	Thu May 21 13:24:38 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm_machdep.c,v 1.87 2009/03/16 23:11:15 dsl Exp $ */
+/*	$NetBSD: vm_machdep.c,v 1.88 2009/05/21 13:24:38 martin Exp $ */
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath.  All rights reserved.
@@ -50,7 +50,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vm_machdep.c,v 1.87 2009/03/16 23:11:15 dsl Exp $);
+__KERNEL_RCSID(0, $NetBSD: vm_machdep.c,v 1.88 2009/05/21 13:24:38 martin Exp $);
 
 #include opt_multiprocessor.h
 
@@ -261,9 +261,14 @@
 	if (stack != NULL)
 		tf2-tf_out[6] = (uint64_t)(u_long)stack + stacksize;
 
-	/* Set return values in child mode */
+	/*
+	 * Set return values in child mode and clear condition code,
+	 * in case we end up running a signal handler before returning
+	 * to userland.
+	 */
 	tf2-tf_out[0] = 0;
 	tf2-tf_out[1] = 1;
+	tf2-tf_tstate = ~TSTATE_CCR;
 
 	/* Construct kernel frame to return to in cpu_switch() */
 	rp = (struct rwindow *)((u_long)npcb + TOPFRAMEOFF);



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

2009-05-18 Thread Takeshi Nakayama
Module Name:src
Committed By:   nakayama
Date:   Mon May 18 11:42:30 UTC 2009

Modified Files:
src/sys/arch/sparc64/sparc64: locore.s

Log Message:
Remove random() from locore.s since it is in libkern.


To generate a diff of this commit:
cvs rdiff -u -r1.289 -r1.290 src/sys/arch/sparc64/sparc64/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/sparc64/sparc64/locore.s
diff -u src/sys/arch/sparc64/sparc64/locore.s:1.289 src/sys/arch/sparc64/sparc64/locore.s:1.290
--- src/sys/arch/sparc64/sparc64/locore.s:1.289	Sat May 16 19:19:04 2009
+++ src/sys/arch/sparc64/sparc64/locore.s	Mon May 18 11:42:30 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.289 2009/05/16 19:19:04 nakayama Exp $	*/
+/*	$NetBSD: locore.s,v 1.290 2009/05/18 11:42:30 nakayama Exp $	*/
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath
@@ -9796,61 +9796,6 @@
 	retl
 	 wrpr	%g1, 0, %pstate		! restore PSTATE.IE
 
-/*
- * Here is a very good random number generator.  This implementation is
- * based on _Two Fast Implementations of the `Minimal Standard' Random
- * Number Generator_, David G. Carta, Communications of the ACM, Jan 1990,
- * Vol 33 No 1.
- */
-/*
- * This should be rewritten using the mulx instr. if I ever understand what it
- * does.
- */
-	.data
-randseed:
-	.word	1
-	.text
-ENTRY(random)
-	sethi	%hi(16807), %o1
-	wr	%o1, %lo(16807), %y
-	 sethi	%hi(randseed), %o5
-	 ld	[%o5 + %lo(randseed)], %o0
-	 andcc	%g0, 0, %o2
-	mulscc  %o2, %o0, %o2
-	mulscc  %o2, %o0, %o2
-	mulscc  %o2, %o0, %o2
-	mulscc  %o2, %o0, %o2
-	mulscc  %o2, %o0, %o2
-	mulscc  %o2, %o0, %o2
-	mulscc  %o2, %o0, %o2
-	mulscc  %o2, %o0, %o2
-	mulscc  %o2, %o0, %o2
-	mulscc  %o2, %o0, %o2
-	mulscc  %o2, %o0, %o2
-	mulscc  %o2, %o0, %o2
-	mulscc  %o2, %o0, %o2
-	mulscc  %o2, %o0, %o2
-	mulscc  %o2, %o0, %o2
-	mulscc  %o2, %g0, %o2
-	rd	%y, %o3
-	srl	%o2, 16, %o1
-	set	0x, %o4
-	and	%o4, %o2, %o0
-	sll	%o0, 15, %o0
-	srl	%o3, 17, %o3
-	or	%o3, %o0, %o0
-	addcc	%o0, %o1, %o0
-	bneg	1f
-	 sethi	%hi(0x7fff), %o1
-	retl
-	 st	%o0, [%o5 + %lo(randseed)]
-1:
-	or	%o1, %lo(0x7fff), %o1
-	add	%o0, 1, %o0
-	and	%o1, %o0, %o0
-	retl
-	 st	%o0, [%o5 + %lo(randseed)]
-
 
 #define MICROPERSEC	(100)
 



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

2009-05-18 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Mon May 18 20:20:42 UTC 2009

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

Log Message:
Remove 'register' qualifier from several variables.  The object
file did not change.


To generate a diff of this commit:
cvs rdiff -u -r1.237 -r1.238 src/sys/arch/sparc64/sparc64/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/sparc64/machdep.c
diff -u src/sys/arch/sparc64/sparc64/machdep.c:1.237 src/sys/arch/sparc64/sparc64/machdep.c:1.238
--- src/sys/arch/sparc64/sparc64/machdep.c:1.237	Sat May 16 03:23:23 2009
+++ src/sys/arch/sparc64/sparc64/machdep.c	Mon May 18 20:20:42 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.237 2009/05/16 03:23:23 nakayama Exp $ */
+/*	$NetBSD: machdep.c,v 1.238 2009/05/18 20:20:42 dyoung 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.237 2009/05/16 03:23:23 nakayama Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.238 2009/05/18 20:20:42 dyoung Exp $);
 
 #include opt_ddb.h
 #include opt_multiprocessor.h
@@ -229,9 +229,9 @@
 void
 setregs(struct lwp *l, struct exec_package *pack, vaddr_t stack)
 {
-	register struct trapframe64 *tf = l-l_md.md_tf;
-	register struct fpstate64 *fs;
-	register int64_t tstate;
+	struct trapframe64 *tf = l-l_md.md_tf;
+	struct fpstate64 *fs;
+	int64_t tstate;
 	int pstate = PSTATE_USER;
 #ifdef __arch64__
 	Elf_Ehdr *eh = pack-ep_hdr;
@@ -561,7 +561,7 @@
 struct pcb dumppcb;
 
 void
-cpu_reboot(register int howto, char *user_boot_string)
+cpu_reboot(int howto, char *user_boot_string)
 {
 	int i;
 	static char str[128];
@@ -673,7 +673,7 @@
 cpu_dumpconf(void)
 {
 	const struct bdevsw *bdev;
-	register int nblks, dumpblks;
+	int nblks, dumpblks;
 
 	if (dumpdev == NODEV)
 		/* No usable dump device */
@@ -722,12 +722,12 @@
 dumpsys(void)
 {
 	const struct bdevsw *bdev;
-	register int psize;
+	int psize;
 	daddr_t blkno;
-	register int (*dump)(dev_t, daddr_t, void *, size_t);
+	int (*dump)(dev_t, daddr_t, void *, size_t);
 	int j, error = 0;
 	uint64_t todo;
-	register struct mem_region *mp;
+	struct mem_region *mp;
 
 	/* copy registers to dumppcb and flush windows */
 	memset(dumppcb, 0, sizeof(struct pcb));



<    2   3   4   5   6   7