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

2024-03-23 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Mar 23 18:48:31 UTC 2024

Modified Files:
src/sys/arch/sparc/include: pmap.h

Log Message:
s/ignorning/ignoring/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/sys/arch/sparc/include/pmap.h

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

Modified files:

Index: src/sys/arch/sparc/include/pmap.h
diff -u src/sys/arch/sparc/include/pmap.h:1.97 src/sys/arch/sparc/include/pmap.h:1.98
--- src/sys/arch/sparc/include/pmap.h:1.97	Mon Jan 25 20:05:29 2021
+++ src/sys/arch/sparc/include/pmap.h	Sat Mar 23 18:48:31 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.97 2021/01/25 20:05:29 mrg Exp $ */
+/*	$NetBSD: pmap.h,v 1.98 2024/03/23 18:48:31 andvar Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -74,7 +74,7 @@ struct vm_page;
  * User space begins at 0x and runs through 0x1fff,
  * then has a `hole', then resumes at 0xe000 and runs until it
  * hits the kernel space at 0xf800.  This can be mapped
- * contiguously by ignorning the top two bits and pretending the
+ * contiguously by ignoring the top two bits and pretending the
  * space goes from 0 to 37ff.  Typically the lower range is
  * used for text+data and the upper for stack, but the code here
  * makes no such distinction.



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

2024-03-23 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Mar 23 18:48:31 UTC 2024

Modified Files:
src/sys/arch/sparc/include: pmap.h

Log Message:
s/ignorning/ignoring/ in comment.


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

2024-03-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Mar 14 15:51:10 UTC 2024

Modified Files:
src/sys/arch/sparc/include: limits.h

Log Message:
Sync with x86_64 the quad constants. No reason to be different


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

2024-03-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Mar 14 15:51:10 UTC 2024

Modified Files:
src/sys/arch/sparc/include: limits.h

Log Message:
Sync with x86_64 the quad constants. No reason to be different


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

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

Modified files:

Index: src/sys/arch/sparc/include/limits.h
diff -u src/sys/arch/sparc/include/limits.h:1.23 src/sys/arch/sparc/include/limits.h:1.24
--- src/sys/arch/sparc/include/limits.h:1.23	Mon Jan 21 15:28:18 2019
+++ src/sys/arch/sparc/include/limits.h	Thu Mar 14 11:51:10 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: limits.h,v 1.23 2019/01/21 20:28:18 dholland Exp $ */
+/*	$NetBSD: limits.h,v 1.24 2024/03/14 15:51:10 christos Exp $ */
 
 /*
  * Copyright (c) 1988 The Regents of the University of California.
@@ -75,11 +75,9 @@
 #define	SSIZE_MIN	LONG_MIN	/* min value for a ssize_t */
 #define	SIZE_T_MAX	ULONG_MAX	/* max value for a size_t */
 
-/* GCC requires that quad constants be written as expressions. */
-#define	UQUAD_MAX	((u_quad_t)0-1)	/* max value for a uquad_t */
-	/* max value for a quad_t */
-#define	QUAD_MAX	((quad_t)(UQUAD_MAX >> 1))
-#define	QUAD_MIN	(-QUAD_MAX-1)	/* min value for a quad_t */
+#define UQUAD_MAX	0xULL		/* max unsigned quad */
+#define QUAD_MAX	0x7fffLL		/* max signed quad */
+#define QUAD_MIN	(-0x7fffLL-1)	/* min signed quad */
 
 #endif /* _NETBSD_SOURCE */
 #endif /* _POSIX_C_SOURCE || _XOPEN_SOURCE || _NETBSD_SOURCE */



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

2023-07-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jul 11 13:10:08 UTC 2023

Modified Files:
src/sys/arch/sparc/include: psl.h

Log Message:
fix editor mishap in previous


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/sparc/include/psl.h

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



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

2023-07-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jul 11 13:10:08 UTC 2023

Modified Files:
src/sys/arch/sparc/include: psl.h

Log Message:
fix editor mishap in previous


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/sparc/include/psl.h

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

Modified files:

Index: src/sys/arch/sparc/include/psl.h
diff -u src/sys/arch/sparc/include/psl.h:1.51 src/sys/arch/sparc/include/psl.h:1.52
--- src/sys/arch/sparc/include/psl.h:1.51	Tue Jul 11 13:06:23 2023
+++ src/sys/arch/sparc/include/psl.h	Tue Jul 11 13:10:08 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: psl.h,v 1.51 2023/07/11 13:06:23 martin Exp $ */
+/*	$NetBSD: psl.h,v 1.52 2023/07/11 13:10:08 martin Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -232,7 +232,7 @@ typedef uint8_t ipl_t;
 typedef struct {
 	ipl_t _ipl;
 } ipl_cookie_t;
-#endif	/* _KERNEL|_KMEMUSER & !_LOCORE
+#endif	/* _KERNEL|_KMEMUSER & !_LOCORE */
 
 #if defined(_KERNEL) && !defined(_LOCORE)
 



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

2023-07-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jul 11 13:06:23 UTC 2023

Modified Files:
src/sys/arch/sparc/include: psl.h

Log Message:
Make ipl_cookie_t visible for _KMEMUSER userland applications.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/sparc/include/psl.h

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

Modified files:

Index: src/sys/arch/sparc/include/psl.h
diff -u src/sys/arch/sparc/include/psl.h:1.50 src/sys/arch/sparc/include/psl.h:1.51
--- src/sys/arch/sparc/include/psl.h:1.50	Tue Nov  2 11:26:04 2021
+++ src/sys/arch/sparc/include/psl.h	Tue Jul 11 13:06:23 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: psl.h,v 1.50 2021/11/02 11:26:04 ryo Exp $ */
+/*	$NetBSD: psl.h,v 1.51 2023/07/11 13:06:23 martin Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -227,6 +227,13 @@
 #define SPARC64_BLOCK_SIZE	64
 #define SPARC64_BLOCK_ALIGN	0x3f
 
+#if (defined(_KERNEL) || defined(_KMEMUSER)) && !defined(_LOCORE)
+typedef uint8_t ipl_t;
+typedef struct {
+	ipl_t _ipl;
+} ipl_cookie_t;
+#endif	/* _KERNEL|_KMEMUSER & !_LOCORE
+
 #if defined(_KERNEL) && !defined(_LOCORE)
 
 /*
@@ -296,11 +303,6 @@ static __inline __attribute__((__always_
 
 _SPLSET(spllowerschedclock, IPL_SCHED)
 
-typedef uint8_t ipl_t;
-typedef struct {
-	ipl_t _ipl;
-} ipl_cookie_t;
-
 static inline __always_inline ipl_cookie_t
 makeiplcookie(ipl_t ipl)
 {



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

2023-07-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jul 11 13:06:23 UTC 2023

Modified Files:
src/sys/arch/sparc/include: psl.h

Log Message:
Make ipl_cookie_t visible for _KMEMUSER userland applications.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/sparc/include/psl.h

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



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

2023-03-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Mar 20 11:07:33 UTC 2023

Modified Files:
src/sys/arch/sparc/include: types.h

Log Message:
__HAVE_HASHLOCKED_ATOMICS needs to be visible to userland


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/arch/sparc/include/types.h

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

Modified files:

Index: src/sys/arch/sparc/include/types.h
diff -u src/sys/arch/sparc/include/types.h:1.72 src/sys/arch/sparc/include/types.h:1.73
--- src/sys/arch/sparc/include/types.h:1.72	Sat Jul 30 14:13:27 2022
+++ src/sys/arch/sparc/include/types.h	Mon Mar 20 11:07:33 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.72 2022/07/30 14:13:27 riastradh Exp $ */
+/*	$NetBSD: types.h,v 1.73 2023/03/20 11:07:33 martin Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -136,7 +136,7 @@ typedef unsigned long int	__register_t;
 #define	__HAVE_FAST_SOFTINTS
 #else
 #define	__HAVE_MM_MD_READWRITE
-#ifdef MULTIPROCESSOR
+#if !defined(_KERNEL) || defined(MULTIPROCESSOR)
 #define	__HAVE_HASHLOCKED_ATOMICS
 #endif
 #endif



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

2023-03-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Mar 20 11:07:33 UTC 2023

Modified Files:
src/sys/arch/sparc/include: types.h

Log Message:
__HAVE_HASHLOCKED_ATOMICS needs to be visible to userland


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

2022-02-15 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Tue Feb 15 20:35:37 UTC 2022

Modified Files:
src/sys/arch/sparc/include: frame.h

Log Message:
Document the calculation of CC64FSZ


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/sparc/include/frame.h

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

Modified files:

Index: src/sys/arch/sparc/include/frame.h
diff -u src/sys/arch/sparc/include/frame.h:1.10 src/sys/arch/sparc/include/frame.h:1.11
--- src/sys/arch/sparc/include/frame.h:1.10	Wed Apr 11 19:37:58 2018
+++ src/sys/arch/sparc/include/frame.h	Tue Feb 15 20:35:37 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: frame.h,v 1.10 2018/04/11 19:37:58 palle Exp $ */
+/*	$NetBSD: frame.h,v 1.11 2022/02/15 20:35:37 palle Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -125,7 +125,8 @@ struct frame64 {
 
 /*
  * CC64FSZ (C Compiler 64-bit Frame SiZe) is the size of a stack frame used
- * by the compiler in 64-bit mode.  It is (16)*8; space for 8 ins, 8 outs.
+ * by the compiler in 64-bit mode (see struct frame64 above).
+ * It is 8*8 + 6*8 + 8 + 8 + 6*8 + 0*8 = 176 bytes.
  */
 #define CC64FSZ		176
 



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

2022-02-15 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Tue Feb 15 20:35:37 UTC 2022

Modified Files:
src/sys/arch/sparc/include: frame.h

Log Message:
Document the calculation of CC64FSZ


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

2022-02-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Feb 13 13:41:18 UTC 2022

Modified Files:
src/sys/arch/sparc/include: lock.h

Log Message:
sparc: __cpu_simple_lock membar audit.

No functional change -- comments only, to justify the absence of
barriers with reference to chapter & verse.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/sparc/include/lock.h

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

Modified files:

Index: src/sys/arch/sparc/include/lock.h
diff -u src/sys/arch/sparc/include/lock.h:1.33 src/sys/arch/sparc/include/lock.h:1.34
--- src/sys/arch/sparc/include/lock.h:1.33	Fri Nov 29 20:06:34 2019
+++ src/sys/arch/sparc/include/lock.h	Sun Feb 13 13:41:17 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: lock.h,v 1.33 2019/11/29 20:06:34 riastradh Exp $ */
+/*	$NetBSD: lock.h,v 1.34 2022/02/13 13:41:17 riastradh Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2006 The NetBSD Foundation, Inc.
@@ -118,6 +118,12 @@ __cpu_simple_lock(__cpu_simple_lock_t *a
 		while (*alp != __SIMPLELOCK_UNLOCKED)
 			/* spin */ ;
 	}
+
+	/*
+	 * No memory barrier needed here to make this a load-acquire
+	 * operation because LDSTUB already implies that.  See SPARCv8
+	 * Reference Manual, Appendix J.4 `Spin Locks', p. 271.
+	 */
 }
 #endif /* __CPU_SIMPLE_LOCK_NOINLINE */
 
@@ -125,6 +131,10 @@ static __inline int
 __cpu_simple_lock_try(__cpu_simple_lock_t *alp)
 {
 
+	/*
+	 * No memory barrier needed for LDSTUB to be a load-acquire --
+	 * see __cpu_simple_lock.
+	 */
 	return (__ldstub(alp) == __SIMPLELOCK_UNLOCKED);
 }
 
@@ -135,6 +145,9 @@ __cpu_simple_unlock(__cpu_simple_lock_t 
 	/*
 	 * Insert compiler barrier to prevent instruction re-ordering
 	 * around the lock release.
+	 *
+	 * No memory barrier needed because we run the kernel in TSO.
+	 * If we ran the kernel in PSO, this would require STBAR.
 	 */
 	__insn_barrier();
 	*alp = __SIMPLELOCK_UNLOCKED;



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

2022-02-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Feb 13 13:41:18 UTC 2022

Modified Files:
src/sys/arch/sparc/include: lock.h

Log Message:
sparc: __cpu_simple_lock membar audit.

No functional change -- comments only, to justify the absence of
barriers with reference to chapter & verse.


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

2021-10-28 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Oct 28 23:41:06 UTC 2021

Modified Files:
src/sys/arch/sparc/include: signal.h

Log Message:
Making "struct sigcontext" visible only to _LIBC || _KERNEL is too
restrictive for sparc (it's accessed by libasan).


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/sparc/include/signal.h

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

Modified files:

Index: src/sys/arch/sparc/include/signal.h
diff -u src/sys/arch/sparc/include/signal.h:1.25 src/sys/arch/sparc/include/signal.h:1.26
--- src/sys/arch/sparc/include/signal.h:1.25	Wed Oct 27 01:12:23 2021
+++ src/sys/arch/sparc/include/signal.h	Thu Oct 28 23:41:06 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: signal.h,v 1.25 2021/10/27 01:12:23 thorpej Exp $ */
+/*	$NetBSD: signal.h,v 1.26 2021/10/28 23:41:06 thorpej Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,6 +45,8 @@
 
 #include 
 
+#define	__HAVE_STRUCT_SIGCONTEXT
+
 #ifndef _LOCORE
 typedef int sig_atomic_t;
 #endif
@@ -79,8 +81,6 @@ struct sigcontext13 {
 };
 #endif /* _KERNEL */
 
-#if defined(_LIBC) || defined(_KERNEL)
-#define	__HAVE_STRUCT_SIGCONTEXT
 struct sigcontext {
 	int		sc_onstack;	/* sigstack state to restore */
 	int		__sc_mask13;	/* signal mask to restore (old style) */
@@ -97,7 +97,6 @@ struct sigcontext {
 	long		sc_o0;		/* %o0 to restore */
 	sigset_t	sc_mask;	/* signal mask to restore (new style) */
 };
-#endif /* _LIBC || _KERNEL */
 
 #else /* _LOCORE */
 /* X These values don't work for _LP64 */



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

2021-10-28 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Oct 28 23:41:06 UTC 2021

Modified Files:
src/sys/arch/sparc/include: signal.h

Log Message:
Making "struct sigcontext" visible only to _LIBC || _KERNEL is too
restrictive for sparc (it's accessed by libasan).


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

2021-10-26 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Oct 27 01:12:23 UTC 2021

Modified Files:
src/sys/arch/sparc/include: signal.h

Log Message:
Make sigcontext13 visible only to _KERNEL.  Make sigcontext visible only
to _LIBC and _KERNEL.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/sparc/include/signal.h

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

Modified files:

Index: src/sys/arch/sparc/include/signal.h
diff -u src/sys/arch/sparc/include/signal.h:1.24 src/sys/arch/sparc/include/signal.h:1.25
--- src/sys/arch/sparc/include/signal.h:1.24	Tue Oct 26 16:16:35 2021
+++ src/sys/arch/sparc/include/signal.h	Wed Oct 27 01:12:23 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: signal.h,v 1.24 2021/10/26 16:16:35 christos Exp $ */
+/*	$NetBSD: signal.h,v 1.25 2021/10/27 01:12:23 thorpej Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -61,7 +61,7 @@ typedef int sig_atomic_t;
  *
  * All machines must have an sc_onstack and sc_mask.
  */
-#if defined(__LIBC12_SOURCE__) || defined(_KERNEL)
+#if defined(_KERNEL)
 struct sigcontext13 {
 	int	sc_onstack;		/* sigstack state to restore */
 	int	sc_mask;		/* signal mask to restore (old style) */
@@ -77,7 +77,9 @@ struct sigcontext13 {
 	long	sc_g1;			/* %g1 to restore */
 	long	sc_o0;			/* %o0 to restore */
 };
-#endif /* __LIBC12_SOURCE__ || _KERNEL */
+#endif /* _KERNEL */
+
+#if defined(_LIBC) || defined(_KERNEL)
 #define	__HAVE_STRUCT_SIGCONTEXT
 struct sigcontext {
 	int		sc_onstack;	/* sigstack state to restore */
@@ -95,6 +97,7 @@ struct sigcontext {
 	long		sc_o0;		/* %o0 to restore */
 	sigset_t	sc_mask;	/* signal mask to restore (new style) */
 };
+#endif /* _LIBC || _KERNEL */
 
 #else /* _LOCORE */
 /* X These values don't work for _LP64 */



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

2021-10-26 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Oct 27 01:12:23 UTC 2021

Modified Files:
src/sys/arch/sparc/include: signal.h

Log Message:
Make sigcontext13 visible only to _KERNEL.  Make sigcontext visible only
to _LIBC and _KERNEL.


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

2019-11-23 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Nov 23 16:50:39 UTC 2019

Modified Files:
src/sys/arch/sparc/include: userret.h

Log Message:
Looks like sparc clears want_ast with interrupts enabled, so check+clear it
and call mi_userret() in a loop.


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

2019-11-23 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Sat Nov 23 16:50:39 UTC 2019

Modified Files:
src/sys/arch/sparc/include: userret.h

Log Message:
Looks like sparc clears want_ast with interrupts enabled, so check+clear it
and call mi_userret() in a loop.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/sparc/include/userret.h

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

Modified files:

Index: src/sys/arch/sparc/include/userret.h
diff -u src/sys/arch/sparc/include/userret.h:1.9 src/sys/arch/sparc/include/userret.h:1.10
--- src/sys/arch/sparc/include/userret.h:1.9	Thu Nov 21 19:24:01 2019
+++ src/sys/arch/sparc/include/userret.h	Sat Nov 23 16:50:39 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: userret.h,v 1.9 2019/11/21 19:24:01 ad Exp $ */
+/*	$NetBSD: userret.h,v 1.10 2019/11/23 16:50:39 ad Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -62,11 +62,10 @@ static __inline void
 userret(struct lwp *l, int pc, u_quad_t oticks)
 {
 	struct proc *p = l->l_proc;
-	
-	mi_userret(l);
 
-	if (cpuinfo.ci_want_ast) {
+	while (cpuinfo.ci_want_ast) {
 		cpuinfo.ci_want_ast = 0;
+		mi_userret(l);
 		if (l->l_pflag & LP_OWEUPC) {
 			l->l_pflag &= ~LP_OWEUPC;
 			ADDUPROF(l);



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

2011-08-28 Thread matthew green

 Module Name:  src
 Committed By: mrg
 Date: Sun Aug 28 22:30:09 UTC 2011
 
 Modified Files:
   src/sys/arch/sparc/include: psl.h
 
 Log Message:
 apply some always_inline attribute to setpsr and spl*.  while i am
 not yet sure exactly why this is necessary, but does avoid crashes
 seen on sparc INSTALL with gcc 4.5.

uwe@ helped me understand why this fixes the problem.  thanks!
it goes like this:

- srmmu_vcache_flush_context() turns off traps to do
its work.

- at the end, when it is trying to turn on traps again
which happens via the now no longer inlined setpsr()
call, the caller has a tail-call optimisation on the
call to setpsr() and the asm looks like:

0xf0012f08 srmmu_vcache_flush_context+108:b  0xf0012618 setpsr
0xf0012f0c srmmu_vcache_flush_context+112:restore

- but wait, we have traps turned off and we're going
to execute the restore, so any time we need to clean a
register window upon restore we go boom here.

the inlined version calls restore after setting %psr, and the
trap can be handled normally.


.mrg.


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

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

Modified Files:
src/sys/arch/sparc/include: proc.h

Log Message:
make fpu_mtx visible only ifdef _KERNEL.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/sparc/include/proc.h

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/include

2009-05-17 Thread Manuel Bouyer
Hi,

On Sat, May 16, 2009 at 05:16:12PM +, Martin Husemann wrote:
 Module Name:  src
 Committed By: martin
 Date: Sat May 16 17:16:12 UTC 2009
 
 Modified Files:
   src/sys/arch/sparc/include: psl.h
 
 Log Message:
 Add memory clobbers to the inline assembler modifying/testing the %psr
 register, to avoid the compiler reordering instructions out of critical
 sections. Should fix PR port-sparc/41372.

thanks !
can you please request a pullup to netbsd-5 (and older branches if it
applies) ?

-- 
Manuel Bouyer bou...@antioche.eu.org
 NetBSD: 26 ans d'experience feront toujours la difference
--