From b484ea8c692ea4733116f659ddbfeb362b8c6216 Mon Sep 17 00:00:00 2001 From: Marcel Moolenaar Date: Wed, 3 Apr 2002 05:11:59 +0000 Subject: [PATCH] Use a twiddle to show that we're busy dumping. The initial code emitted the total number of pages it still had to dump prior to dumping a block of up to 16 pages. For a 128MB region this would result in 8M number of printf()s. Barf! The problem in general is that memory typically has one really big region and a number of "scattered" smaller regions. Some may even be just a few pages. The twiddle works best for now, but it doesn't really give a good progress indication for the large regions. Those are the cases where you definitely want good PI to avoid having the user turn into a twiddle :-) --- sys/ia64/ia64/dump_machdep.c | 12 +++++++----- sys/ia64/ia64/ia64dump.c | 12 +++++++----- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/sys/ia64/ia64/dump_machdep.c b/sys/ia64/ia64/dump_machdep.c index a407070bfb89..d49265db7871 100644 --- a/sys/ia64/ia64/dump_machdep.c +++ b/sys/ia64/ia64/dump_machdep.c @@ -124,17 +124,19 @@ cb_dumpdata(EFI_MEMORY_DESCRIPTOR *mdp, int seqnr, void *arg) vm_offset_t pa; uint64_t pgs; size_t sz; - int error; - - printf(" region %d:", seqnr); + int error, twiddle; error = 0; /* catch case in which mdp->NumberOfPages is 0 */ + twiddle = 0; pgs = mdp->NumberOfPages; pa = IA64_PHYS_TO_RR7(mdp->PhysicalStart); + + printf(" region %d: %ld pages ", seqnr, (long)pgs); + while (pgs) { sz = (pgs > (DFLTPHYS >> EFI_PAGE_SHIFT)) ? DFLTPHYS : pgs << EFI_PAGE_SHIFT; - printf(" %lld", pgs); + printf("%c\b", "|/-\\"[twiddle++ & 3]); error = di->dumper(di->priv, (void*)pa, NULL, dumplo, sz); if (error) break; @@ -142,7 +144,7 @@ cb_dumpdata(EFI_MEMORY_DESCRIPTOR *mdp, int seqnr, void *arg) pgs -= sz >> EFI_PAGE_SHIFT; pa += sz; } - printf("\n"); + printf("... %s\n", (error) ? "fail" : "ok"); return (error); } diff --git a/sys/ia64/ia64/ia64dump.c b/sys/ia64/ia64/ia64dump.c index a407070bfb89..d49265db7871 100644 --- a/sys/ia64/ia64/ia64dump.c +++ b/sys/ia64/ia64/ia64dump.c @@ -124,17 +124,19 @@ cb_dumpdata(EFI_MEMORY_DESCRIPTOR *mdp, int seqnr, void *arg) vm_offset_t pa; uint64_t pgs; size_t sz; - int error; - - printf(" region %d:", seqnr); + int error, twiddle; error = 0; /* catch case in which mdp->NumberOfPages is 0 */ + twiddle = 0; pgs = mdp->NumberOfPages; pa = IA64_PHYS_TO_RR7(mdp->PhysicalStart); + + printf(" region %d: %ld pages ", seqnr, (long)pgs); + while (pgs) { sz = (pgs > (DFLTPHYS >> EFI_PAGE_SHIFT)) ? DFLTPHYS : pgs << EFI_PAGE_SHIFT; - printf(" %lld", pgs); + printf("%c\b", "|/-\\"[twiddle++ & 3]); error = di->dumper(di->priv, (void*)pa, NULL, dumplo, sz); if (error) break; @@ -142,7 +144,7 @@ cb_dumpdata(EFI_MEMORY_DESCRIPTOR *mdp, int seqnr, void *arg) pgs -= sz >> EFI_PAGE_SHIFT; pa += sz; } - printf("\n"); + printf("... %s\n", (error) ? "fail" : "ok"); return (error); }