svn commit: r349487 - stable/12/sys/riscv/riscv

Mitchell Horne mhorne at FreeBSD.org
Fri Jun 28 00:53:28 UTC 2019


Author: mhorne
Date: Fri Jun 28 00:53:27 2019
New Revision: 349487
URL: https://svnweb.freebsd.org/changeset/base/349487

Log:
  MFC r348838:
  Announce real and available memory at boot
  
  Approved by:	markj (mentor, implicit)

Modified:
  stable/12/sys/riscv/riscv/machdep.c
  stable/12/sys/riscv/riscv/pmap.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/riscv/riscv/machdep.c
==============================================================================
--- stable/12/sys/riscv/riscv/machdep.c	Fri Jun 28 00:50:00 2019	(r349486)
+++ stable/12/sys/riscv/riscv/machdep.c	Fri Jun 28 00:53:27 2019	(r349487)
@@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/sysproto.h>
 #include <sys/tslog.h>
 #include <sys/ucontext.h>
+#include <sys/vmmeter.h>
 
 #include <vm/vm.h>
 #include <vm/vm_kern.h>
@@ -139,7 +140,34 @@ cpu_startup(void *dummy)
 
 	identify_cpu();
 
+	printf("real memory  = %ju (%ju MB)\n", ptoa((uintmax_t)realmem),
+	    ptoa((uintmax_t)realmem) / (1024 * 1024));
+
+	/*
+	 * Display any holes after the first chunk of extended memory.
+	 */
+	if (bootverbose) {
+		int indx;
+
+		printf("Physical memory chunk(s):\n");
+		for (indx = 0; phys_avail[indx + 1] != 0; indx += 2) {
+			vm_paddr_t size;
+
+			size = phys_avail[indx + 1] - phys_avail[indx];
+			printf(
+			    "0x%016jx - 0x%016jx, %ju bytes (%ju pages)\n",
+			    (uintmax_t)phys_avail[indx],
+			    (uintmax_t)phys_avail[indx + 1] - 1,
+			    (uintmax_t)size, (uintmax_t)size / PAGE_SIZE);
+		}
+	}
+
 	vm_ksubmap_init(&kmi);
+
+	printf("avail memory = %ju (%ju MB)\n",
+	    ptoa((uintmax_t)vm_free_count()),
+	    ptoa((uintmax_t)vm_free_count()) / (1024 * 1024));
+
 	bufinit();
 	vm_pager_bufferinit();
 }

Modified: stable/12/sys/riscv/riscv/pmap.c
==============================================================================
--- stable/12/sys/riscv/riscv/pmap.c	Fri Jun 28 00:50:00 2019	(r349486)
+++ stable/12/sys/riscv/riscv/pmap.c	Fri Jun 28 00:53:27 2019	(r349487)
@@ -640,6 +640,7 @@ pmap_bootstrap(vm_offset_t l1pt, vm_paddr_t kernstart,
 			continue;
 		dump_avail[map_slot] = start;
 		dump_avail[map_slot + 1] = end;
+		realmem += atop((vm_offset_t)(end - start));
 
 		if (start >= kernstart && end <= pa)
 			continue;


More information about the svn-src-all mailing list