CVS commit: src/sys/arch/sun3/sun3

2024-01-12 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Jan 13 00:43:31 UTC 2024

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

Log Message:
Fix a comment.


To generate a diff of this commit:
cvs rdiff -u -r1.177 -r1.178 src/sys/arch/sun3/sun3/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/sun3/sun3/pmap.c
diff -u src/sys/arch/sun3/sun3/pmap.c:1.177 src/sys/arch/sun3/sun3/pmap.c:1.178
--- src/sys/arch/sun3/sun3/pmap.c:1.177	Wed Dec 27 17:35:37 2023
+++ src/sys/arch/sun3/sun3/pmap.c	Sat Jan 13 00:43:31 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.177 2023/12/27 17:35:37 thorpej Exp $	*/
+/*	$NetBSD: pmap.c,v 1.178 2024/01/13 00:43:31 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -80,7 +80,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.177 2023/12/27 17:35:37 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.178 2024/01/13 00:43:31 thorpej Exp $");
 
 #include "opt_ddb.h"
 #include "opt_pmap_debug.h"
@@ -1690,7 +1690,7 @@ pmap_bootstrap(vaddr_t nextva)
 	 * the job using hardware-dependent tricks...
 	 */
 #ifdef	DIAGNOSTIC
-	/* Note: PROM setcxsegmap function needs sfc=dfs=FC_CONTROL */
+	/* Note: PROM setcxsegmap function needs sfc=dfc=FC_CONTROL */
 	if ((getsfc() != FC_CONTROL) || (getdfc() != FC_CONTROL)) {
 		mon_printf("pmap_bootstrap: bad dfc or sfc\n");
 		sunmon_abort();



CVS commit: src/sys/arch/sun3/sun3

2024-01-12 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Jan 13 00:43:31 UTC 2024

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

Log Message:
Fix a comment.


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

2023-12-17 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sun Dec 17 13:28:59 UTC 2023

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

Log Message:
Reshuffle ifdef HAVECACHE/DIAGNOSTIC blocks with the main purpose to make
code build without HAVECACHE/DIAGNOSTIC options, as well as some cleanup:
flags in pv_link is used for HAVECACHE only, declare/define it in the block.
flush_by_page declaration can omit ifdef when only conditional body is guarded.
segva is used only in DIAGNOSTIC/HAVECACHE in pmap_protect_mmu.
combine consecutive DIAGNOSTIC/HAVECACHE blocks were possible.

No functional changes intended.


To generate a diff of this commit:
cvs rdiff -u -r1.174 -r1.175 src/sys/arch/sun3/sun3/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/sun3/sun3/pmap.c
diff -u src/sys/arch/sun3/sun3/pmap.c:1.174 src/sys/arch/sun3/sun3/pmap.c:1.175
--- src/sys/arch/sun3/sun3/pmap.c:1.174	Fri Jun  2 08:51:47 2023
+++ src/sys/arch/sun3/sun3/pmap.c	Sun Dec 17 13:28:59 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.174 2023/06/02 08:51:47 andvar Exp $	*/
+/*	$NetBSD: pmap.c,v 1.175 2023/12/17 13:28:59 andvar Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -80,7 +80,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.174 2023/06/02 08:51:47 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.175 2023/12/17 13:28:59 andvar Exp $");
 
 #include "opt_ddb.h"
 #include "opt_pmap_debug.h"
@@ -1328,15 +1328,15 @@ pv_link(pmap_t pmap, int pte, vaddr_t va
 	paddr_t pa;
 	pv_entry_t *head, pv;
 	u_char *pv_flags;
+#ifdef HAVECACHE
 	int flags;
+#endif
 
 	if (!pv_initialized)
 		return 0;
 
 	CHECK_SPL();
 
-	/* Only the non-cached bit is of interest here. */
-	flags = (pte & PG_NC) ? PV_NC : 0;
 	pa = PG_PA(pte);
 
 #ifdef PMAP_DEBUG
@@ -1362,6 +1362,8 @@ pv_link(pmap_t pmap, int pte, vaddr_t va
 	 * Does this new mapping cause VAC alias problems?
 	 */
 
+	/* Only the non-cached bit is of interest here. */
+	flags = (pte & PG_NC) ? PV_NC : 0;
 	*pv_flags |= flags;
 	if ((*pv_flags & PV_NC) == 0) {
 		for (pv = *head; pv != NULL; pv = pv->pv_next) {
@@ -2439,9 +2441,7 @@ pmap_kremove(vaddr_t va, vsize_t len)
 	vaddr_t eva, neva, pgva, segva, segnum;
 	int pte, sme;
 	pmeg_t pmegp;
-#ifdef	HAVECACHE
 	int flush_by_page = 0;
-#endif
 	int s;
 
 	s = splvm();
@@ -2480,14 +2480,14 @@ pmap_kremove(vaddr_t va, vsize_t len)
 		for (pgva = va; pgva < neva; pgva += PAGE_SIZE) {
 			pte = get_pte(pgva);
 			if (pte & PG_VALID) {
-#ifdef	HAVECACHE
 if (flush_by_page) {
+#ifdef	HAVECACHE
 	cache_flush_page(pgva);
 	/* Get fresh mod/ref bits
 	   from write-back. */
 	pte = get_pte(pgva);
-}
 #endif
+}
 #ifdef	PMAP_DEBUG
 if ((pmap_debug & PMD_SETPTE) ||
 (pgva == pmap_db_watchva)) {
@@ -3044,10 +3044,11 @@ out:
 void
 pmap_protect_mmu(pmap_t pmap, vaddr_t sva, vaddr_t eva)
 {
-	vaddr_t pgva, segva;
+	vaddr_t pgva;
 	int pte;
-#ifdef	HAVECACHE
 	int flush_by_page = 0;
+#if defined(HAVECACHE) || defined(DIAGNOSTIC)
+	vaddr_t segva = sun3_trunc_seg(sva); 
 #endif
 
 	CHECK_SPL();
@@ -3057,21 +3058,14 @@ pmap_protect_mmu(pmap_t pmap, vaddr_t sv
 		if (pmap->pm_ctxnum != get_context())
 			panic("pmap_protect_mmu: wrong context");
 	}
-#endif
 
-	segva = sun3_trunc_seg(sva);
-
-#ifdef	DIAGNOSTIC
 	int sme = get_segmap(segva);
 	/* Make sure it is valid and known. */
 	if (sme == SEGINV)
 		panic("pmap_protect_mmu: SEGINV");
 	if (pmap->pm_segmap && (pmap->pm_segmap[VA_SEGNUM(segva)] != sme))
 		panic("pmap_protect_mmu: incorrect sme, va=0x%lx", segva);
-#endif
 
-
-#ifdef	DIAGNOSTIC
 	/* have pmeg, will travel */
 	pmeg_t pmegp = pmeg_p(sme);
 	/* Make sure we own the pmeg, right va, etc. */
@@ -3085,7 +3079,7 @@ pmap_protect_mmu(pmap_t pmap, vaddr_t sv
 		panic("pmap_protect_mmu: npages corrupted");
 	if (pmegp->pmeg_vpages == 0)
 		panic("pmap_protect_mmu: no valid pages?");
-#endif
+#endif /* DIAGNOSTIC */
 
 #ifdef	HAVECACHE
 	if (cache_size) {
@@ -3106,13 +3100,13 @@ pmap_protect_mmu(pmap_t pmap, vaddr_t sv
 	for (pgva = sva; pgva < eva; pgva += PAGE_SIZE) {
 		pte = get_pte(pgva);
 		if (pte & PG_VALID) {
-#ifdef	HAVECACHE
 			if (flush_by_page) {
+#ifdef	HAVECACHE
 cache_flush_page(pgva);
 /* Get fresh mod/ref bits from write-back. */
 pte = get_pte(pgva);
-			}
 #endif
+			}
 			if (IS_MAIN_MEM(pte)) {
 save_modref_bits(pte);
 			}
@@ -3273,9 +3267,7 @@ pmap_remove_mmu(pmap_t pmap, vaddr_t sva
 	pmeg_t pmegp;
 	vaddr_t pgva, segva;
 	int pte, sme;
-#ifdef	HAVECACHE
 	int flush_by_page = 0;
-#endif
 
 	CHECK_SPL();
 
@@ -,13 +3325,13 @@ pmap_remove_mmu(pmap_t pmap, vaddr_t sva
 	for (pgva = sva; pgva < eva; pgva += PAGE_SIZE) {
 		pte = get_pte(pgva);
 		if (pte & PG_VALID) {
-#ifdef	HAVECACHE
 			if (flush_by_page) {
+#ifdef	HAVECACHE
 cache_flush_page(pgva);
 /* Get fresh mod/ref bits from write-back. */
 pte = 

CVS commit: src/sys/arch/sun3/sun3

2023-12-17 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sun Dec 17 13:28:59 UTC 2023

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

Log Message:
Reshuffle ifdef HAVECACHE/DIAGNOSTIC blocks with the main purpose to make
code build without HAVECACHE/DIAGNOSTIC options, as well as some cleanup:
flags in pv_link is used for HAVECACHE only, declare/define it in the block.
flush_by_page declaration can omit ifdef when only conditional body is guarded.
segva is used only in DIAGNOSTIC/HAVECACHE in pmap_protect_mmu.
combine consecutive DIAGNOSTIC/HAVECACHE blocks were possible.

No functional changes intended.


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

2010-03-02 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Mar  3 06:53:35 UTC 2010

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

Log Message:
s/cpu_fork/cpu_lwp_fork/ in comment.


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

2010-03-02 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Mar  3 06:53:35 UTC 2010

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

Log Message:
s/cpu_fork/cpu_lwp_fork/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.92 src/sys/arch/sun3/sun3/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/sun3/sun3/locore.s
diff -u src/sys/arch/sun3/sun3/locore.s:1.91 src/sys/arch/sun3/sun3/locore.s:1.92
--- src/sys/arch/sun3/sun3/locore.s:1.91	Thu Dec 10 05:10:04 2009
+++ src/sys/arch/sun3/sun3/locore.s	Wed Mar  3 06:53:34 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.91 2009/12/10 05:10:04 rmind Exp $	*/
+/*	$NetBSD: locore.s,v 1.92 2010/03/03 06:53:34 skrll Exp $	*/
 
 /*
  * Copyright (c) 1980, 1990, 1993
@@ -165,7 +165,7 @@
 | is finished, to avoid spurrious interrupts.
 
 /*
- * Create a fake exception frame so that cpu_fork() can copy it.
+ * Create a fake exception frame so that cpu_lwp_fork() can copy it.
  * main() nevers returns; we exit to user mode from a forked process
  * later on.
  */