diff options
author | Oliver O'Halloran <oohall@gmail.com> | 2017-05-26 16:28:39 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-06-06 17:59:45 +1000 |
commit | cc7b746192f04df04cce5737771d2e7703006142 (patch) | |
tree | 66ab18687ca8b7b30d2ccf4a746afc9bfc40e17a /core/mem_region.c | |
parent | 23ca5d4fe40fea454b0a1c120d4a4a33aa3f2476 (diff) | |
download | skiboot-cc7b746192f04df04cce5737771d2e7703006142.zip skiboot-cc7b746192f04df04cce5737771d2e7703006142.tar.gz skiboot-cc7b746192f04df04cce5737771d2e7703006142.tar.bz2 |
hdata/test: Add memory reservations to hdata_to_dt
Currently memory reservations are parsed, but since they are not
processed until mem_region_init() they don't appear in the output
device tree blob. Several bugs have been found with memory reservations
so we want them to be part of the test output.
Add them and clean up several usages of printf() since we want only the
dtb to appear in standard out.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Reviewed-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core/mem_region.c')
-rw-r--r-- | core/mem_region.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/core/mem_region.c b/core/mem_region.c index ebca447..ec38b24 100644 --- a/core/mem_region.c +++ b/core/mem_region.c @@ -291,23 +291,23 @@ void mem_dump_allocs(void) struct alloc_hdr *hdr; /* Second pass: populate property data */ - printf("Memory regions:\n"); + prlog(PR_INFO, "Memory regions:\n"); list_for_each(®ions, region, list) { if (!(region->type == REGION_SKIBOOT_HEAP || region->type == REGION_MEMORY)) continue; - printf(" 0x%012llx..%012llx : %s\n", + prlog(PR_INFO, " 0x%012llx..%012llx : %s\n", (long long)region->start, (long long)(region->start + region->len - 1), region->name); if (region->free_list.n.next == NULL) { - printf(" no allocs\n"); + prlog(PR_INFO, " no allocs\n"); continue; } for (hdr = region_start(region); hdr; hdr = next_hdr(region, hdr)) { if (hdr->free) continue; - printf(" 0x%.8lx %s\n", hdr->num_longs * sizeof(long), + prlog(PR_INFO, " 0x%.8lx %s\n", hdr->num_longs * sizeof(long), hdr_location(hdr)); } } @@ -322,7 +322,7 @@ int64_t mem_dump_free(void) total_free = 0; - printf("Free space in HEAP memory regions:\n"); + prlog(PR_INFO, "Free space in HEAP memory regions:\n"); list_for_each(®ions, region, list) { if (!(region->type == REGION_SKIBOOT_HEAP || region->type == REGION_MEMORY)) @@ -338,12 +338,12 @@ int64_t mem_dump_free(void) region_free+= hdr->num_longs * sizeof(long); } - printf("Region %s free: %"PRIx64"\n", + prlog(PR_INFO, "Region %s free: %"PRIx64"\n", region->name, region_free); total_free += region_free; } - printf("Total free: %"PRIu64"\n", total_free); + prlog(PR_INFO, "Total free: %"PRIu64"\n", total_free); return total_free; } @@ -1107,7 +1107,7 @@ void mem_region_release_unused(void) lock(&mem_region_lock); assert(!mem_regions_finalised); - printf("Releasing unused memory:\n"); + prlog(PR_INFO, "Releasing unused memory:\n"); list_for_each(®ions, r, list) { uint64_t used_len; @@ -1118,7 +1118,7 @@ void mem_region_release_unused(void) used_len = allocated_length(r); - printf(" %s: %llu/%llu used\n", + prlog(PR_INFO, " %s: %llu/%llu used\n", r->name, (long long)used_len, (long long)r->len); /* We keep the skiboot heap. */ @@ -1230,7 +1230,7 @@ void mem_region_add_dt_reserved(void) name = names = malloc(names_len); range = ranges = malloc(ranges_len); - printf("Reserved regions:\n"); + prlog(PR_INFO, "Reserved regions:\n"); /* Second pass: populate property data */ list_for_each(®ions, region, list) { if (!region_is_reservable(region)) @@ -1239,7 +1239,7 @@ void mem_region_add_dt_reserved(void) memcpy(name, region->name, len); name += len; - printf(" 0x%012llx..%012llx : %s\n", + prlog(PR_INFO, " 0x%012llx..%012llx : %s\n", (long long)region->start, (long long)(region->start + region->len - 1), region->name); |