Author: markj
Date: Mon Jul 20 13:30:42 2020
New Revision: 363364
URL: https://svnweb.freebsd.org/changeset/base/363364

Log:
  MFC r363162:
  Print arm64 physmem info during boot.
  
  PR:   243682

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

Modified: stable/12/sys/arm64/arm64/machdep.c
==============================================================================
--- stable/12/sys/arm64/arm64/machdep.c Mon Jul 20 13:24:50 2020        
(r363363)
+++ stable/12/sys/arm64/arm64/machdep.c Mon Jul 20 13:30:42 2020        
(r363364)
@@ -60,11 +60,14 @@ __FBSDID("$FreeBSD$");
 #include <sys/sysproto.h>
 #include <sys/ucontext.h>
 #include <sys/vdso.h>
+#include <sys/vmmeter.h>
 
 #include <vm/vm.h>
+#include <vm/vm_param.h>
 #include <vm/vm_kern.h>
 #include <vm/vm_object.h>
 #include <vm/vm_page.h>
+#include <vm/vm_phys.h>
 #include <vm/pmap.h>
 #include <vm/vm_map.h>
 #include <vm/vm_pager.h>
@@ -162,6 +165,26 @@ pan_enable(void)
 static void
 cpu_startup(void *dummy)
 {
+       vm_paddr_t size;
+       int i;
+
+       printf("real memory  = %ju (%ju MB)\n", ptoa((uintmax_t)realmem),
+           ptoa((uintmax_t)realmem) / 1024 / 1024);
+
+       if (bootverbose) {
+               printf("Physical memory chunk(s):\n");
+               for (i = 0; phys_avail[i + 1] != 0; i += 2) {
+                       size = phys_avail[i + 1] - phys_avail[i];
+                       printf("%#016jx - %#016jx, %ju bytes (%ju pages)\n",
+                           (uintmax_t)phys_avail[i],
+                           (uintmax_t)phys_avail[i + 1] - 1,
+                           (uintmax_t)size, (uintmax_t)size / PAGE_SIZE);
+               }
+       }
+
+       printf("avail memory = %ju (%ju MB)\n",
+           ptoa((uintmax_t)vm_free_count()),
+           ptoa((uintmax_t)vm_free_count()) / 1024 / 1024);
 
        undef_init();
        identify_cpu();
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to