Module Name:    src
Committed By:   simonb
Date:           Thu Jun  4 15:42:31 UTC 2020

Modified Files:
        src/sys/arch/mips/mips: mips_machdep.c

Log Message:
Tidy up some ugly output from mips_page_physload() when a segment starts
and finishes in the same page.


To generate a diff of this commit:
cvs rdiff -u -r1.281 -r1.282 src/sys/arch/mips/mips/mips_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/mips/mips/mips_machdep.c
diff -u src/sys/arch/mips/mips/mips_machdep.c:1.281 src/sys/arch/mips/mips/mips_machdep.c:1.282
--- src/sys/arch/mips/mips/mips_machdep.c:1.281	Sat May 23 11:33:56 2020
+++ src/sys/arch/mips/mips/mips_machdep.c	Thu Jun  4 15:42:31 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips_machdep.c,v 1.281 2020/05/23 11:33:56 simonb Exp $	*/
+/*	$NetBSD: mips_machdep.c,v 1.282 2020/06/04 15:42:31 simonb Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -111,7 +111,7 @@
  */
 
 #include <sys/cdefs.h>			/* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.281 2020/05/23 11:33:56 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.282 2020/06/04 15:42:31 simonb Exp $");
 
 #define __INTR_PRIVATE
 #include "opt_cputype.h"
@@ -2140,6 +2140,17 @@ mips_page_physload(vaddr_t vkernstart, v
 		paddr_t segstart = round_page(segs->start);
 		const paddr_t segfinish = trunc_page(segs->start + segs->size);
 
+		if (segstart >= segfinish) {
+			/*
+			 * This is purely cosmetic, to avoid output like
+			 *    phys segment: 0xffffffffffffe000 @ 0xffb6000
+			 * when a segment starts and finishes in the same page.
+			 */
+			printf("phys segment: %#"PRIxPADDR" @ %#"PRIxPADDR
+			    " (short)\n", (paddr_t)segs->size, segstart);
+			continue;
+		}
+
 		printf("phys segment: %#"PRIxPADDR" @ %#"PRIxPADDR"\n",
 		    segfinish - segstart, segstart);
 

Reply via email to