CVS commit: src/sys/arch/sparc/sparc

2023-02-23 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Feb 23 14:56:37 UTC 2023

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

Log Message:
sparc: Add missing barriers in cpu_switchto.

PR kern/57240

XXX pullup-8
XXX pullup-9
XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.283 -r1.284 src/sys/arch/sparc/sparc/locore.s

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



CVS commit: src/sys/arch/sparc/sparc

2023-02-23 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Feb 23 14:56:37 UTC 2023

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

Log Message:
sparc: Add missing barriers in cpu_switchto.

PR kern/57240

XXX pullup-8
XXX pullup-9
XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.283 -r1.284 src/sys/arch/sparc/sparc/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/sparc/sparc/locore.s
diff -u src/sys/arch/sparc/sparc/locore.s:1.283 src/sys/arch/sparc/sparc/locore.s:1.284
--- src/sys/arch/sparc/sparc/locore.s:1.283	Sun May 15 02:14:15 2022
+++ src/sys/arch/sparc/sparc/locore.s	Thu Feb 23 14:56:37 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.283 2022/05/15 02:14:15 mrg Exp $	*/
+/*	$NetBSD: locore.s,v 1.284 2023/02/23 14:56:37 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1996 Paul Kranenburg
@@ -4889,7 +4889,30 @@ Lwb1:	SAVE; SAVE; SAVE; SAVE; SAVE; SAVE
 	/* set new cpcb, and curlwp */
 	sethi	%hi(curlwp), %l7
 	st	%g5, [%l6 + %lo(cpcb)]		! cpcb = newpcb;
+
+	/*
+	 * Issue barriers to coordinate mutex_exit on this CPU with
+	 * mutex_vector_enter on another CPU.
+	 *
+	 * 1. Any prior mutex_exit by oldlwp must be visible to other
+	 *CPUs before we set ci_curlwp := newlwp on this one,
+	 *requiring a store-before-store barrier.
+	 *
+	 * 2. ci_curlwp := newlwp must be visible on all other CPUs
+	 *before any subsequent mutex_exit by newlwp can even test
+	 *whether there might be waiters, requiring a
+	 *store-before-load barrier.
+	 *
+	 * See kern_mutex.c for details -- this is necessary for
+	 * adaptive mutexes to detect whether the lwp is on the CPU in
+	 * order to safely block without requiring atomic r/m/w in
+	 * mutex_exit.
+	 */
+	/* stbar -- store-before-store, not needed on TSO */
 	st  %g3, [%l7 + %lo(curlwp)]! curlwp = l;
+#ifdef MULTIPROCESSOR
+	ldstub	[%sp - 4], %g0	/* makeshift store-before-load barrier */
+#endif
 
 	/* compute new wim */
 	ld	[%g5 + PCB_WIM], %o0



CVS commit: src/sys/arch/sparc/sparc

2022-09-30 Thread Julian Coleman
Module Name:src
Committed By:   jdc
Date:   Fri Sep 30 14:32:45 UTC 2022

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

Log Message:
Make this compile for SUN4-only kernels
(move namebuf inside the SUN4C/SUN4M/SUN4D ifdef to match where it's used).


To generate a diff of this commit:
cvs rdiff -u -r1.270 -r1.271 src/sys/arch/sparc/sparc/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/sparc/sparc/autoconf.c
diff -u src/sys/arch/sparc/sparc/autoconf.c:1.270 src/sys/arch/sparc/sparc/autoconf.c:1.271
--- src/sys/arch/sparc/sparc/autoconf.c:1.270	Sat Jan 22 11:49:16 2022
+++ src/sys/arch/sparc/sparc/autoconf.c	Fri Sep 30 14:32:45 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.270 2022/01/22 11:49:16 thorpej Exp $ */
+/*	$NetBSD: autoconf.c,v 1.271 2022/09/30 14:32:45 jdc Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.270 2022/01/22 11:49:16 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.271 2022/09/30 14:32:45 jdc Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -1119,8 +1119,8 @@ mainbus_attach(device_t parent, device_t
 	};
 
 	struct mainbus_attach_args ma;
-	char namebuf[32];
 #if defined(SUN4C) || defined(SUN4M) || defined(SUN4D)
+	char namebuf[32];
 	const char *sp = NULL;
 	int node0, node;
 	const struct boot_special *openboot_special, *ssp;



CVS commit: src/sys/arch/sparc/sparc

2022-09-30 Thread Julian Coleman
Module Name:src
Committed By:   jdc
Date:   Fri Sep 30 14:32:45 UTC 2022

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

Log Message:
Make this compile for SUN4-only kernels
(move namebuf inside the SUN4C/SUN4M/SUN4D ifdef to match where it's used).


To generate a diff of this commit:
cvs rdiff -u -r1.270 -r1.271 src/sys/arch/sparc/sparc/autoconf.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/sparc/sparc

2022-05-14 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun May 15 02:14:15 UTC 2022

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

Log Message:
remove unused Lpanic_savefpstate.


To generate a diff of this commit:
cvs rdiff -u -r1.282 -r1.283 src/sys/arch/sparc/sparc/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/sparc/sparc/locore.s
diff -u src/sys/arch/sparc/sparc/locore.s:1.282 src/sys/arch/sparc/sparc/locore.s:1.283
--- src/sys/arch/sparc/sparc/locore.s:1.282	Sat Apr 16 18:15:21 2022
+++ src/sys/arch/sparc/sparc/locore.s	Sun May 15 02:14:15 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.282 2022/04/16 18:15:21 andvar Exp $	*/
+/*	$NetBSD: locore.s,v 1.283 2022/05/15 02:14:15 mrg Exp $	*/
 
 /*
  * Copyright (c) 1996 Paul Kranenburg
@@ -5621,10 +5621,6 @@ Lkcerr:
  *
  * The IPI version just deals with updating event counters first.
  */
-Lpanic_savefpstate:
-	.asciz	"cpu%d: NULL fpstate"
-	_ALIGN
-
 ENTRY(ipi_savefpstate)
 	sethi	%hi(CPUINFO_VA+CPUINFO_SAVEFPSTATE), %o5
 	ldd	[%o5 + %lo(CPUINFO_VA+CPUINFO_SAVEFPSTATE)], %o2



CVS commit: src/sys/arch/sparc/sparc

2022-05-14 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun May 15 02:14:15 UTC 2022

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

Log Message:
remove unused Lpanic_savefpstate.


To generate a diff of this commit:
cvs rdiff -u -r1.282 -r1.283 src/sys/arch/sparc/sparc/locore.s

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



CVS commit: src/sys/arch/sparc/sparc

2022-04-20 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Apr 20 23:32:17 UTC 2022

Modified Files:
src/sys/arch/sparc/sparc: clkctrl.c

Log Message:
the register is only one byte, act like it


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/sparc/sparc/clkctrl.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/clkctrl.c
diff -u src/sys/arch/sparc/sparc/clkctrl.c:1.6 src/sys/arch/sparc/sparc/clkctrl.c:1.7
--- src/sys/arch/sparc/sparc/clkctrl.c:1.6	Mon Dec 30 22:13:47 2019
+++ src/sys/arch/sparc/sparc/clkctrl.c	Wed Apr 20 23:32:17 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: clkctrl.c,v 1.6 2019/12/30 22:13:47 ad Exp $	*/
+/*	$NetBSD: clkctrl.c,v 1.7 2022/04/20 23:32:17 macallan Exp $	*/
 
 /*
  * Copyright (c) 2005 Michael Lorenz
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: clkctrl.c,v 1.6 2019/12/30 22:13:47 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clkctrl.c,v 1.7 2022/04/20 23:32:17 macallan Exp $");
 
 #include 
 #include 
@@ -72,7 +72,7 @@ clkctrl_attach(device_t parent, device_t
 	}
 	if (sbus_bus_map(sa->sa_bustag,
 			 sa->sa_slot, sa->sa_offset,
-			 sizeof(long),
+			 1,
 			 BUS_SPACE_MAP_LINEAR, &bh) != 0) {
 		aprint_error("unable to map register\n");
 		return;



CVS commit: src/sys/arch/sparc/sparc

2022-04-20 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Apr 20 23:32:17 UTC 2022

Modified Files:
src/sys/arch/sparc/sparc: clkctrl.c

Log Message:
the register is only one byte, act like it


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/sparc/sparc/clkctrl.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/sparc/sparc

2021-09-17 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri Sep 17 16:16:18 UTC 2021

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

Log Message:
Don't include  in the _STANDALONE case.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/sparc/sparc/promlib.c

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

Modified files:

Index: src/sys/arch/sparc/sparc/promlib.c
diff -u src/sys/arch/sparc/sparc/promlib.c:1.49 src/sys/arch/sparc/sparc/promlib.c:1.50
--- src/sys/arch/sparc/sparc/promlib.c:1.49	Wed Sep 15 17:33:08 2021
+++ src/sys/arch/sparc/sparc/promlib.c	Fri Sep 17 16:16:18 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: promlib.c,v 1.49 2021/09/15 17:33:08 thorpej Exp $ */
+/*	$NetBSD: promlib.c,v 1.50 2021/09/17 16:16:18 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: promlib.c,v 1.49 2021/09/15 17:33:08 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: promlib.c,v 1.50 2021/09/17 16:16:18 thorpej Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_sparc_arch.h"
@@ -45,12 +45,11 @@ __KERNEL_RCSID(0, "$NetBSD: promlib.c,v 
 #include 
 #include 
 
-#include 
-
 #ifdef _STANDALONE
 #include 
 #define malloc(s,t,f)	alloc(s)
 #else
+#include 
 #include 
 #include 
 #endif /* _STANDALONE */



CVS commit: src/sys/arch/sparc/sparc

2021-09-17 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri Sep 17 16:16:18 UTC 2021

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

Log Message:
Don't include  in the _STANDALONE case.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/sparc/sparc/promlib.c

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



Re: CVS commit: src/sys/arch/sparc/sparc

2020-03-15 Thread Andrew Doran
On Sun, Mar 15, 2020 at 11:38:03AM +1100, matthew green wrote:
> "Andrew Doran" writes:
> > Module Name:src
> > Committed By:   ad
> > Date:   Sat Mar 14 13:34:44 UTC 2020
> > 
> > Modified Files:
> > src/sys/arch/sparc/sparc: intr.c
> > 
> > Log Message:
> > sparc cpu_intr_p(): try to work around l_cpu not being set early on by
> > using curcpu().
> 
> ah, good idea.  this will involve one fewer deref, curcpu()
> is mapped at a fixed address, so it might even be faster now
> than it used to be.

Oh, hm..  Given that it's a fixed address is there a way the compiler can
screw this up in the face of a kernel preemption (theoretical right now for
sparc*)?  I don't think so..  None of the fanciness is required then.

bool
cpu_intr_p(void)
{

return curcpu()->ci_idepth != 0;
}

Andrew


re: CVS commit: src/sys/arch/sparc/sparc

2020-03-14 Thread matthew green
"Andrew Doran" writes:
> Module Name:  src
> Committed By: ad
> Date: Sat Mar 14 13:34:44 UTC 2020
> 
> Modified Files:
>   src/sys/arch/sparc/sparc: intr.c
> 
> Log Message:
> sparc cpu_intr_p(): try to work around l_cpu not being set early on by
> using curcpu().

ah, good idea.  this will involve one fewer deref, curcpu()
is mapped at a fixed address, so it might even be faster now
than it used to be.


.mrg.


CVS commit: src/sys/arch/sparc/sparc

2019-06-06 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Jun  7 00:18:26 UTC 2019

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

Log Message:
remove code to directly check for NULL savefpstate() calls.
it has not triggered for years now, and if it comes back,
you still get a normal kernel fault.


To generate a diff of this commit:
cvs rdiff -u -r1.273 -r1.274 src/sys/arch/sparc/sparc/locore.s

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



CVS commit: src/sys/arch/sparc/sparc

2019-06-06 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Jun  7 00:18:26 UTC 2019

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

Log Message:
remove code to directly check for NULL savefpstate() calls.
it has not triggered for years now, and if it comes back,
you still get a normal kernel fault.


To generate a diff of this commit:
cvs rdiff -u -r1.273 -r1.274 src/sys/arch/sparc/sparc/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/sparc/sparc/locore.s
diff -u src/sys/arch/sparc/sparc/locore.s:1.273 src/sys/arch/sparc/sparc/locore.s:1.274
--- src/sys/arch/sparc/sparc/locore.s:1.273	Sat Apr  6 03:06:27 2019
+++ src/sys/arch/sparc/sparc/locore.s	Fri Jun  7 00:18:26 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.273 2019/04/06 03:06:27 thorpej Exp $	*/
+/*	$NetBSD: locore.s,v 1.274 2019/06/07 00:18:26 mrg Exp $	*/
 
 /*
  * Copyright (c) 1996 Paul Kranenburg
@@ -5649,8 +5649,6 @@ ENTRY(ipi_savefpstate)
 
 ENTRY(savefpstate)
 	cmp	%o0, 0
-	bz	Lfp_null_fpstate
-	 nop
 	rd	%psr, %o1		! enable FP before we begin
 	set	PSR_EF, %o2
 	or	%o1, %o2, %o1
@@ -5692,22 +5690,6 @@ Lfp_finish:
 	retl
 	 std	%f30, [%o0 + FS_REGS + (4*30)]
 
-/* Handle NULL fpstate argument for savefpstate */
-Lfp_null_fpstate:
-#ifdef DIAGNOSTIC
-	ld	[%o5 + CPUINFO_CPUNO], %o1
-	sethi	%hi(Lpanic_savefpstate), %o0
-	call	_C_LABEL(panic)
-	 or	%o0, %lo(Lpanic_savefpstate), %o0
-#else
-	sethi	%hi(CPUINFO_VA), %o5
-	ldd	[%o5 + CPUINFO_SAVEFPSTATE_NULL], %o2
-	inccc   %o3
-	addx%o2, 0, %o2
-	retl
-	 std	%o2, [%o5 + CPUINFO_SAVEFPSTATE_NULL]
-#endif
-
 /*
  * Store the (now known nonempty) FP queue.
  * We have to reread the fsr each time in order to get the new QNE bit.



re: CVS commit: src/sys/arch/sparc/sparc

2018-01-16 Thread matthew green
"Christos Zoulas" writes:
> Module Name:  src
> Committed By: christos
> Date: Wed Jan 17 02:39:16 UTC 2018
> 
> Modified Files:
>   src/sys/arch/sparc/sparc: cpuvar.h
> 
> Log Message:
> fix compilation

actually, this was renamed and moved, so this is also wrong.
i'll fix it.


.mrg.


Re: CVS commit: src/sys/arch/sparc/sparc

2012-11-04 Thread Chuck Silvers
On Sun, Nov 04, 2012 at 01:35:04PM +1100, matthew green wrote:
> 
> > Module Name:src
> > Committed By:   chs
> > Date:   Sun Nov  4 00:32:47 UTC 2012
> > 
> > Modified Files:
> > src/sys/arch/sparc/sparc: locore.s pmap.c
> > 
> > Log Message:
> > in cpu_switchto(), remove the MP-unsafe code to mark a pmap active on a CPU,
> > pmap_activate() already does this.  add MP locking to pmap_activate()
> > and pmap_deactivate().  move flushing of user windows and virtual caches
> > from pamp_activate() to pmap_deactivate().
> 
> 
> hmm.  this makes pmap_deactivate() do things in UP that weren't being
> done before at all.  switching to/from kernel/lwp for the same lwp will
> now be flushing the ctx every time.  that seems suboptimal?

do you just mean that I should have left the #ifdef MULTIPROCESSOR
around the sp_tlb_flush()?  or something more than that?


> we should really update PMAP_LOCK() to not be kernel lock.

agreed.

beyond that, there's still plenty of room for improvement on most platforms.
I think the best example in our tree at this point is the x86 scheme
of deferring the MMU-switch work to points where we're actually about to
reference user mappings, eg. returning to user mode, copyin/copyout, etc.


-Chuck


re: CVS commit: src/sys/arch/sparc/sparc

2012-11-03 Thread matthew green

> Module Name:  src
> Committed By: chs
> Date: Sun Nov  4 00:32:47 UTC 2012
> 
> Modified Files:
>   src/sys/arch/sparc/sparc: locore.s pmap.c
> 
> Log Message:
> in cpu_switchto(), remove the MP-unsafe code to mark a pmap active on a CPU,
> pmap_activate() already does this.  add MP locking to pmap_activate()
> and pmap_deactivate().  move flushing of user windows and virtual caches
> from pamp_activate() to pmap_deactivate().


hmm.  this makes pmap_deactivate() do things in UP that weren't being
done before at all.  switching to/from kernel/lwp for the same lwp will
now be flushing the ctx every time.  that seems suboptimal?

we should really update PMAP_LOCK() to not be kernel lock.


.mrg.


re: CVS commit: src/sys/arch/sparc/sparc

2011-09-06 Thread matthew green

> Module Name:  src
> Committed By: martin
> Date: Thu Sep  1 08:47:56 UTC 2011
> 
> Modified Files:
>   src/sys/arch/sparc/sparc: pmap.c
> 
> Log Message:
> In pmap_unwire() fix an obvious editor mishap - enable kernel preemption
> before returning, not the other way around.
> Might fix PR kern/45137.
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.345 -r1.346 src/sys/arch/sparc/sparc/pmap.c

thanks for fixing this.

hmm... code was like:

{
return;
foo();
}

it would be nice if we got warnings about this.


.mrg.


CVS commit: src/sys/arch/sparc/sparc

2010-03-06 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Mar  7 00:42:08 UTC 2010

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

Log Message:
gas has supported SPARC ".empty" for a long while; get rid of an
ancient workaround.


To generate a diff of this commit:
cvs rdiff -u -r1.255 -r1.256 src/sys/arch/sparc/sparc/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/sparc/sparc/locore.s
diff -u src/sys/arch/sparc/sparc/locore.s:1.255 src/sys/arch/sparc/sparc/locore.s:1.256
--- src/sys/arch/sparc/sparc/locore.s:1.255	Thu Jan 28 05:08:11 2010
+++ src/sys/arch/sparc/sparc/locore.s	Sun Mar  7 00:42:08 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.255 2010/01/28 05:08:11 mrg Exp $	*/
+/*	$NetBSD: locore.s,v 1.256 2010/03/07 00:42:08 mrg Exp $	*/
 
 /*
  * Copyright (c) 1996 Paul Kranenburg
@@ -75,18 +75,6 @@
 	
 #include 
 
-/*
- * GNU assembler does not understand `.empty' directive; Sun assembler
- * gripes about labels without it.  To allow cross-compilation using
- * the Sun assembler, and because .empty directives are useful documentation,
- * we use this trick.
- */
-#ifdef SUN_AS
-#define	EMPTY	.empty
-#else
-#define	EMPTY	/* .empty */
-#endif
-
 /* use as needed to align things on longword boundaries */
 #define	_ALIGN	.align 4
 
@@ -1276,7 +1264,7 @@
 	cmp	pte, -1; \
 	be,a	1f; andn addr, page_offset, pte; \
 	tst	pte; \
-	bne	bad; EMPTY; \
+	bne	bad; .empty; \
 	andn	addr, page_offset, pte; \
 1:
 
@@ -1703,14 +1691,14 @@
 	st	%g7, [%g6 + PCB_UW]	! cpcb->pcb_uw--;
 	btst	7, %sp			! if not aligned,
 	bne	ctw_invalid		! choke on it
-	 EMPTY
+	 .empty
 
 	sethi	%hi(_C_LABEL(pgofset)), %g6	! trash %g6=curpcb
 	ld	[%g6 + %lo(_C_LABEL(pgofset))], %g6
 	PTE_OF_ADDR(%sp, %g7, ctw_invalid, %g6, NOP_ON_4M_1)
 	CMP_PTE_USER_WRITE(%g7, %g5, NOP_ON_4M_2) ! likewise if not writable
 	bne	ctw_invalid
-	 EMPTY
+	 .empty
 	/* Note side-effect of SLT_IF_1PAGE_RW: decrements %g6 by 62 */
 	SLT_IF_1PAGE_RW(%sp, %g7, %g6)
 	bl,a	ctw_merge		! all ok if only 1
@@ -2076,7 +2064,7 @@
 
 	btst	PSR_PS, %l0		! slowtrap() if from kernel
 	bnz	slowtrap
-	 EMPTY
+	 .empty
 
 	! clear fault status
 	set	SRMMU_SFSR, %l7
@@ -2099,7 +2087,7 @@
 	lda	[%l7]ASI_SRMMU, %l6		! fault status
 	andcc	%l6, SFSR_FAV, %l6		! get fault status bits
 	bnz	slowtrap
-	 EMPTY
+	 .empty
 
 	! we got the insn; check whether it was a FLUSH
 	! instruction format: op=2, op3=0x3b (see also instr.h)
@@ -2129,7 +2117,7 @@
 	set	special_fp_store, %l4	! see if we came from the special one
 	cmp	%l1, %l4		! pc == special_fp_store?
 	bne	slowtrap		! no, go handle per usual
-	 EMPTY
+	 .empty
 	sethi	%hi(savefpcont), %l4	! yes, "return" to the special code
 	or	%lo(savefpcont), %l4, %l4
 	jmp	%l4
@@ -2205,17 +2193,17 @@
 	ld	[%l6 + %lo(_EINTSTACKP)], %l7
 	cmp	%sp, %l7
 	bge	Lslowtrap_reenter
-	 EMPTY
+	 .empty
 	set	INT_STACK_SIZE, %l6
 	sub	%l7, %l6, %l7
 	cmp	%sp, %l7
 	blu	Lslowtrap_reenter
-	 EMPTY
+	 .empty
 #else
 	sethi	%hi(_C_LABEL(eintstack)), %l7
 	cmp	%sp, %l7
 	bge	Lslowtrap_reenter
-	 EMPTY
+	 .empty
 #endif
 	sethi	%hi(cpcb), %l6
 	ld	[%l6 + %lo(cpcb)], %l6
@@ -3413,14 +3401,14 @@
 	 */
 	btst	7, %sp			! if unaligned, it is invalid
 	bne	winuf_invalid
-	 EMPTY
+	 .empty
 
 	sethi	%hi(_C_LABEL(pgofset)), %l4
 	ld	[%l4 + %lo(_C_LABEL(pgofset))], %l4
 	PTE_OF_ADDR(%sp, %l7, winuf_invalid, %l4, NOP_ON_4M_5)
 	CMP_PTE_USER_READ(%l7, %l5, NOP_ON_4M_6) ! if first page not readable,
 	bne	winuf_invalid		! it is invalid
-	 EMPTY
+	 .empty
 	SLT_IF_1PAGE_RW(%sp, %l7, %l4)	! first page is readable
 	bl,a	winuf_ok		! if only one page, enter window X
 	 restore %g0, 1, %l1		! and goto ok, & set %l1 to 1
@@ -3637,14 +3625,14 @@
 1:
 	btst	7, %fp			! if unaligned, address is invalid
 	bne	rft_invalid
-	 EMPTY
+	 .empty
 
 	sethi	%hi(_C_LABEL(pgofset)), %l3
 	ld	[%l3 + %lo(_C_LABEL(pgofset))], %l3
 	PTE_OF_ADDR(%fp, %l7, rft_invalid, %l3, NOP_ON_4M_9)
 	CMP_PTE_USER_READ(%l7, %l5, NOP_ON_4M_10)	! try first page
 	bne	rft_invalid		! no good
-	 EMPTY
+	 .empty
 	SLT_IF_1PAGE_RW(%fp, %l7, %l3)
 	bl,a	rft_user_ok		! only 1 page: ok
 	 wr	%g0, 0, %wim
@@ -5053,10 +5041,10 @@
 	set	KERNBASE, %o2
 	cmp	%o0, %o2		! if addr >= KERNBASE...
 	bgeu	Lfsbadaddr
-	EMPTY
+	 .empty
 	btst	3, %o0			! or has low bits set...
 	bnz	Lfsbadaddr		!	go return -1
-	EMPTY
+	 .empty
 	sethi	%hi(cpcb), %o2		! cpcb->pcb_onfault = Lfserr;
 	ld	[%o2 + %lo(cpcb)], %o2
 	set	Lfserr, %o3
@@ -5090,7 +5078,7 @@
 	set	KERNBASE, %o2
 	cmp	%o0, %o2		! if addr >= KERNBASE
 	bgeu	Lfsbadaddr		!	return error
-	EMPTY
+	 .empty
 	sethi	%hi(cpcb), %o2		! cpcb->pcb_onfault = Lfsbail;
 	ld	[%o2 + %lo(cpcb)], %o2
 	set	_C_LABEL(Lfsbail), %o3
@@ -5103,7 +5091,7 @@
 	set	KERNBASE, %o2
 	cmp	%o0, %o2		! if addr >= KERNBASE
 	bgeu	Lfsbadaddr		!	return error
-	EMPTY
+	 .empty
 	sethi	%hi(cpcb), %o2		! cpcb->pcb_onfault = Lfserr;
 	ld	[%o2 + %lo(cpcb)], %o2
 	set	Lfserr, %o3
@@ -5117,7 +5105,7 @@

CVS commit: src/sys/arch/sparc/sparc

2010-03-06 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Mar  7 00:42:08 UTC 2010

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

Log Message:
gas has supported SPARC ".empty" for a long while; get rid of an
ancient workaround.


To generate a diff of this commit:
cvs rdiff -u -r1.255 -r1.256 src/sys/arch/sparc/sparc/locore.s

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



CVS commit: src/sys/arch/sparc/sparc

2010-01-28 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Jan 29 05:17:36 UTC 2010

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

Log Message:
don't set ksi_errno here.  no other MD code does, and one
of the pthread tests demands it.


To generate a diff of this commit:
cvs rdiff -u -r1.180 -r1.181 src/sys/arch/sparc/sparc/trap.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/sparc/sparc

2010-01-27 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Jan 28 05:08:11 UTC 2010

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

Log Message:
in savefpstate(), make sure we fill in the _first_ read of %fsr into
the fpstate structure, not the last one.  avoids fs->fs_fsr lacking the
traptype field later when fpu_cleanup() is processing it, which leads
to a panic() occuring.

idea, and code suggestions from uwe.


To generate a diff of this commit:
cvs rdiff -u -r1.254 -r1.255 src/sys/arch/sparc/sparc/locore.s

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



CVS commit: src/sys/arch/sparc/sparc

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

Modified Files:
src/sys/arch/sparc/sparc: cpu.c cpuvar.h

Log Message:
rename cpu_info{}::cpu_name member to cpu_longname, to avoid a potential 
conflict
with .


To generate a diff of this commit:
cvs rdiff -u -r1.220 -r1.221 src/sys/arch/sparc/sparc/cpu.c
cvs rdiff -u -r1.82 -r1.83 src/sys/arch/sparc/sparc/cpuvar.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/sparc/sparc

2010-01-22 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jan 22 16:11:26 UTC 2010

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

Log Message:
Recognize ie @ vme as a network device.


To generate a diff of this commit:
cvs rdiff -u -r1.238 -r1.239 src/sys/arch/sparc/sparc/autoconf.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/sparc/sparc

2010-01-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jan 20 22:54:23 UTC 2010

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

Log Message:
Add the mac-address as device property for all network devices


To generate a diff of this commit:
cvs rdiff -u -r1.237 -r1.238 src/sys/arch/sparc/sparc/autoconf.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/sparc/sparc

2010-01-13 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Jan 13 12:43:06 UTC 2010

Modified Files:
src/sys/arch/sparc/sparc: auxreg.h

Log Message:
Explicitly clear AUXIO4M_FTC bit in FTC_FLIP macro used on
pseudo-dma for floppy, as well as AUXIO4C_FTC bit for sun4c.
A comment in the macro says AUXIO4M_FTC bit is auto-clear,
but my two SS20s (including compatible) with 150MHz hyperSPARCs
get data_overrun without it, and no bad side effect on SS5
(works with and without this change).

Closes PR port-sparc/42516, which is the last one of a bunch of
floppy issue on NetBSD/sparc since NetBSD 2.0 days. See
http://mail-index.NetBSD.org/port-sparc/2009/12/20/msg000484.html
for details.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/sparc/sparc/auxreg.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/sparc/sparc

2010-01-12 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Jan 13 02:17:12 UTC 2010

Modified Files:
src/sys/arch/sparc/sparc: cpuvar.h timer_sun4m.c

Log Message:
replace local ci_cpuname[] and use new cpu_name().


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/sys/arch/sparc/sparc/cpuvar.h
cvs rdiff -u -r1.21 -r1.22 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.



CVS commit: src/sys/arch/sparc/sparc

2010-01-09 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Jan 10 03:36:30 UTC 2010

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

Log Message:
put the cpu_number() into some messages.


To generate a diff of this commit:
cvs rdiff -u -r1.179 -r1.180 src/sys/arch/sparc/sparc/trap.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/sparc/sparc

2010-01-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Jan  6 06:15:09 UTC 2010

Modified Files:
src/sys/arch/sparc/sparc: timer_sun4m.c

Log Message:
fix an incomplete comment.


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



CVS commit: src/sys/arch/sparc/sparc

2010-01-05 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue Jan  5 21:38:50 UTC 2010

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

Log Message:
fix a typo - we need to check classipl vs. IPL_VM, not the SBus interrupt
level


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/sys/arch/sparc/sparc/intr.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/sparc/sparc

2010-01-03 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Jan  4 04:21:35 UTC 2010

Modified Files:
src/sys/arch/sparc/sparc: timer.c timer_sun4m.c timervar.h

Log Message:
rework the timer interrupt usage on MP sun4m systems a little.  use
either schedintr() or schedintr_4m() and make sure we call hardclock()
and schedclock() appropriately.  the level10 interrupt isn't used much
for MP sun4m systems anymore..

now, besides crazy interrupts panics, sparc smp is functionaly again.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/sparc/sparc/timer.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/sparc/sparc/timer_sun4m.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/sparc/sparc/timervar.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/sparc/sparc

2010-01-03 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Jan  4 04:06:58 UTC 2010

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

Log Message:
use the idle lwp's uarea for stack, not the interrupt stack.  this works
now, and it fixes up idle vs interrupt time measurement for cpu>0.


To generate a diff of this commit:
cvs rdiff -u -r1.253 -r1.254 src/sys/arch/sparc/sparc/locore.s

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



CVS commit: src/sys/arch/sparc/sparc

2010-01-03 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Jan  4 03:54:42 UTC 2010

Modified Files:
src/sys/arch/sparc/sparc: timer_msiiep.c timer_sun4.c

Log Message:
curlwp is never NULL any more.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/sparc/sparc/timer_msiiep.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/sparc/sparc/timer_sun4.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/sparc/sparc

2010-01-03 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Jan  3 12:44:34 UTC 2010

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

Log Message:
reinsert part of the code accidentally deleted by the previous change.


To generate a diff of this commit:
cvs rdiff -u -r1.252 -r1.253 src/sys/arch/sparc/sparc/locore.s

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



CVS commit: src/sys/arch/sparc/sparc

2010-01-03 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Jan  3 11:44:58 UTC 2010

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

Log Message:
use genassym generated names for struct intrhand elements and avoid magic.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/sparc/sparc/genassym.cf
cvs rdiff -u -r1.250 -r1.251 src/sys/arch/sparc/sparc/locore.s

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



CVS commit: src/sys/arch/sparc/sparc

2010-01-01 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Jan  1 08:00:02 UTC 2010

Modified Files:
src/sys/arch/sparc/sparc: timer_sun4m.c

Log Message:
remove wrong if 0ed code


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



Re: CVS commit: src/sys/arch/sparc/sparc

2009-05-27 Thread Martin Husemann
On Wed, May 27, 2009 at 01:35:49PM +0400, Valeriy E. Ushakov wrote:
> Is that correct?  It used to be in 4.0, but in 5.0 lwp trampoline
> calls lwp_startup before calling the lwp function.  For SA the
> trampoline used to be used for recycling lwps for upcalls.  Is that
> correct to call lwp_startup in that case?  There never was any
> official note on that when SA became undead.

Good catch - lwp_startup() should only be called at "lwp birth time" 
(according to Andrew) - we need to review all ports and split the
trampolines used.

Martin


Re: CVS commit: src/sys/arch/sparc/sparc

2009-05-27 Thread Valeriy E. Ushakov
On Wed, May 27, 2009 at 04:08:06 +, matthew green wrote:

> Modified Files:
>   src/sys/arch/sparc/sparc: vm_machdep.c
> 
> Log Message:
> 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.98 -r1.99 src/sys/arch/sparc/sparc/vm_machdep.c

Is that correct?  It used to be in 4.0, but in 5.0 lwp trampoline
calls lwp_startup before calling the lwp function.  For SA the
trampoline used to be used for recycling lwps for upcalls.  Is that
correct to call lwp_startup in that case?  There never was any
official note on that when SA became undead.

SY, Uwe
-- 
u...@stderr.spb.ru   |   Zu Grunde kommen
http://snark.ptc.spbu.ru/~uwe/  |   Ist zu Grunde gehen


re: CVS commit: src/sys/arch/sparc/sparc

2009-05-16 Thread matthew green

   >Modified Files:
   >src/sys/arch/sparc/sparc: machdep.c process_machdep.c 
svr4_machdep.c
   >vm_machdep.c
   >
   >Log Message:
   >KNF, same object code generated.
   > 
   > 
   > why are you doing this?  are you planning on touching all of these
   > files or are you doing a "KNF rototill" that you shouldn't?
   
   The log message should be:
   "remove extra whitespace accidentally added on bcopy -> memcpy changes"

ah, thanks!


.mrg.


Re: CVS commit: src/sys/arch/sparc/sparc

2009-05-16 Thread Izumi Tsutsui
>Modified Files:
>   src/sys/arch/sparc/sparc: machdep.c process_machdep.c svr4_machdep.c
>   vm_machdep.c
>
>Log Message:
>KNF, same object code generated.
> 
> 
> why are you doing this?  are you planning on touching all of these
> files or are you doing a "KNF rototill" that you shouldn't?

The log message should be:
"remove extra whitespace accidentally added on bcopy -> memcpy changes"

---
Izumi Tsutsui


re: CVS commit: src/sys/arch/sparc/sparc

2009-05-16 Thread matthew green

   Module Name: src
   Committed By:cegger
   Date:Sat May 16 17:01:16 UTC 2009
   
   Modified Files:
src/sys/arch/sparc/sparc: machdep.c process_machdep.c svr4_machdep.c
vm_machdep.c
   
   Log Message:
   KNF, same object code generated.


why are you doing this?  are you planning on touching all of these
files or are you doing a "KNF rototill" that you shouldn't?


.mrg.