From 088fd67a38c7030ef0e6434472d64a3607c29100 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Fri, 2 May 2014 14:13:37 +0300 Subject: AGESA: Implement EmptyHeap() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Heap allocation begins with BIOS_HEAP_MANAGER, no need to clear the fields individually. Change-Id: Ia1af84bd09d1edf8f72223752557d44a96dec6e1 Signed-off-by: Kyösti Mälkki Reviewed-on: http://review.coreboot.org/5659 Tested-by: build bot (Jenkins) Reviewed-by: Edward O'Callaghan Reviewed-by: Paul Menzel Reviewed-by: Patrick Georgi --- src/northbridge/amd/agesa/family14/fam14_callouts.c | 7 +++++++ src/northbridge/amd/agesa/family14/fam14_callouts.h | 1 + 2 files changed, 8 insertions(+) (limited to 'src/northbridge/amd/agesa/family14') diff --git a/src/northbridge/amd/agesa/family14/fam14_callouts.c b/src/northbridge/amd/agesa/family14/fam14_callouts.c index 6a9830dd1e..301f145c29 100644 --- a/src/northbridge/amd/agesa/family14/fam14_callouts.c +++ b/src/northbridge/amd/agesa/family14/fam14_callouts.c @@ -25,6 +25,7 @@ #include "dimmSpd.h" #include #include +#include UINT32 GetHeapBase(AMD_CONFIG_PARAMS *StdHeader) { @@ -41,6 +42,12 @@ UINT32 GetHeapBase(AMD_CONFIG_PARAMS *StdHeader) return heap; } +void EmptyHeap(void) +{ + void *BiosManagerPtr = (void *) GetHeapBase(NULL); + memset(BiosManagerPtr, 0, BIOS_HEAP_SIZE); +} + AGESA_STATUS BiosAllocateBuffer (UINT32 Func, UINT32 Data, VOID *ConfigPtr) { UINT32 AvailableHeapSize; diff --git a/src/northbridge/amd/agesa/family14/fam14_callouts.h b/src/northbridge/amd/agesa/family14/fam14_callouts.h index a1297f752b..1f23cef37f 100755 --- a/src/northbridge/amd/agesa/family14/fam14_callouts.h +++ b/src/northbridge/amd/agesa/family14/fam14_callouts.h @@ -40,6 +40,7 @@ typedef struct _BIOS_BUFFER_NODE { } BIOS_BUFFER_NODE; UINT32 GetHeapBase(AMD_CONFIG_PARAMS *StdHeader); +void EmptyHeap(void); /* REQUIRED CALLOUTS * AGESA ADVANCED CALLOUTS - CPU -- cgit v1.2.3