From a52c64ed19582cfd9232a0d84ba3b28c0f09f105 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Sun, 27 Nov 2016 06:37:52 +0200 Subject: [PATCH] UPSTREAM: AGESA: Log heap initialisation This is useful for debugging S3 issues and in general to understand AGESA memory allocator behaviour. BUG=none BRANCH=none TEST=none Change-Id: I6537ba637e2e7adbaf0f82481ff75cd4cfd110c1 Signed-off-by: Patrick Georgi Original-Commit-Id: 50e6daff95b7bd5c67a12a6b27cfdf7eedf304bd Original-Change-Id: I422f2620ed0023f3920b8d2949ee1c33a6c227e0 Original-Signed-off-by: Kysti Mlkki Original-Reviewed-on: https://review.coreboot.org/18535 Original-Reviewed-by: Nico Huber Original-Tested-by: build bot (Jenkins) Reviewed-on: https://chromium-review.googlesource.com/452465 --- src/cpu/amd/agesa/heapmanager.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/cpu/amd/agesa/heapmanager.c b/src/cpu/amd/agesa/heapmanager.c index 9acd0bd6fc..cc6ee2216d 100644 --- a/src/cpu/amd/agesa/heapmanager.c +++ b/src/cpu/amd/agesa/heapmanager.c @@ -57,6 +57,9 @@ void EmptyHeap(void) { void *base = GetHeapBase(); memset(base, 0, BIOS_HEAP_SIZE); + + printk(BIOS_DEBUG, "Wiped HEAP at [%08x - %08x]\n", + (unsigned int)(uintptr_t) base, (unsigned int)(uintptr_t) base + BIOS_HEAP_SIZE - 1); } void ResumeHeap(void **heap, size_t *len) @@ -64,6 +67,9 @@ void ResumeHeap(void **heap, size_t *len) void *base = GetHeapBase(); *heap = base; *len = BIOS_HEAP_SIZE; + + printk(BIOS_DEBUG, "Using resume HEAP at [%08x - %08x]\n", + (unsigned int)(uintptr_t) base, (unsigned int)(uintptr_t) base + BIOS_HEAP_SIZE - 1); } #if (IS_ENABLED(CONFIG_NORTHBRIDGE_AMD_AGESA_FAMILY15_TN) || \