Date: Thu, 12 Mar 2015 15:08:24 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r279921 - in stable: 10/sys/amd64/amd64 9/sys/amd64/amd64 Message-ID: <201503121508.t2CF8Onx046660@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jhb Date: Thu Mar 12 15:08:23 2015 New Revision: 279921 URL: https://svnweb.freebsd.org/changeset/base/279921 Log: MFC 277713: If the boot-time memory test is enabled, output a dot ('.') for each GB of RAM tested so people watching the console can see that the machine is making progress and not hung. PR: 196650 Modified: stable/10/sys/amd64/amd64/machdep.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/amd64/amd64/machdep.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/10/sys/amd64/amd64/machdep.c ============================================================================== --- stable/10/sys/amd64/amd64/machdep.c Thu Mar 12 14:55:33 2015 (r279920) +++ stable/10/sys/amd64/amd64/machdep.c Thu Mar 12 15:08:23 2015 (r279921) @@ -1521,6 +1521,8 @@ static char bootmethod[16] = ""; SYSCTL_STRING(_machdep, OID_AUTO, bootmethod, CTLFLAG_RD, bootmethod, 0, "System firmware boot method"); +#define PAGES_PER_GB (1024 * 1024 * 1024 / PAGE_SIZE) + /* * Populate the (physmap) array with base/bound pairs describing the * available physical memory in the system, then test this memory and @@ -1541,6 +1543,7 @@ getmemsize(caddr_t kmdp, u_int64_t first struct bios_smap *smapbase; struct efi_map_header *efihdr; quad_t dcons_addr, dcons_size; + int page_counter; bzero(physmap, sizeof(physmap)); basemem = 0; @@ -1651,6 +1654,9 @@ getmemsize(caddr_t kmdp, u_int64_t first * physmap is in bytes, so when converting to page boundaries, * round up the start address and round down the end address. */ + page_counter = 0; + if (memtest != 0) + printf("Testing system memory"); for (i = 0; i <= physmap_idx; i += 2) { vm_paddr_t end; @@ -1681,6 +1687,14 @@ getmemsize(caddr_t kmdp, u_int64_t first goto skip_memtest; /* + * Print a "." every GB to show we're making + * progress. + */ + page_counter++; + if ((page_counter % PAGES_PER_GB) == 0) + printf("."); + + /* * map page into kernel: valid, read/write,non-cacheable */ *pte = pa | PG_V | PG_RW | PG_NC_PWT | PG_NC_PCD; @@ -1767,6 +1781,8 @@ do_next: } *pte = 0; invltlb(); + if (memtest != 0) + printf("\n"); /* * XXX
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201503121508.t2CF8Onx046660>