diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2014-05-02 14:13:37 +0300 |
---|---|---|
committer | Patrick Georgi <patrick@georgi-clan.de> | 2014-05-05 08:53:50 +0200 |
commit | 088fd67a38c7030ef0e6434472d64a3607c29100 (patch) | |
tree | 3add215d2b0d6feb54db25d93f59043dc5c9bfc8 | |
parent | 8ef30253e3f117275306a1f977fd42e0470f4f5a (diff) | |
download | coreboot-088fd67a38c7030ef0e6434472d64a3607c29100.tar.xz |
AGESA: Implement EmptyHeap()
Heap allocation begins with BIOS_HEAP_MANAGER, no need to clear
the fields individually.
Change-Id: Ia1af84bd09d1edf8f72223752557d44a96dec6e1
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/5659
Tested-by: build bot (Jenkins)
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
30 files changed, 60 insertions, 247 deletions
diff --git a/src/mainboard/amd/dinar/agesawrapper.c b/src/mainboard/amd/dinar/agesawrapper.c index dc6afc13c2..7d0a9186f7 100644 --- a/src/mainboard/amd/dinar/agesawrapper.c +++ b/src/mainboard/amd/dinar/agesawrapper.c @@ -392,10 +392,7 @@ agesawrapper_amdinitpost ( ) { AGESA_STATUS status; - UINT16 i; - UINT32 *HeadPtr; AMD_INTERFACE_PARAMS AmdParamStruct; - BIOS_HEAP_MANAGER *BiosManagerPtr; LibAmdMemFill (&AmdParamStruct, 0, @@ -419,16 +416,7 @@ agesawrapper_amdinitpost ( AmdReleaseStruct (&AmdParamStruct); /* Initialize heap space */ - BiosManagerPtr = (BIOS_HEAP_MANAGER *)GetHeapBase(&AmdParamStruct.StdHeader); - - HeadPtr = (UINT32 *) ((UINT8 *) BiosManagerPtr + sizeof (BIOS_HEAP_MANAGER)); - for (i = 0; i < ((BIOS_HEAP_SIZE/4) - (sizeof (BIOS_HEAP_MANAGER)/4)); i++) - { - *HeadPtr = 0x00000000; - HeadPtr++; - } - BiosManagerPtr->StartOfAllocatedNodes = 0; - BiosManagerPtr->StartOfFreedNodes = 0; + EmptyHeap(); return (UINT32)status; } diff --git a/src/mainboard/amd/inagua/agesawrapper.c b/src/mainboard/amd/inagua/agesawrapper.c index 41278f1c25..db25279d4b 100644 --- a/src/mainboard/amd/inagua/agesawrapper.c +++ b/src/mainboard/amd/inagua/agesawrapper.c @@ -239,10 +239,7 @@ agesawrapper_amdinitpost ( ) { AGESA_STATUS status; - UINT16 i; - UINT32 *HeadPtr; AMD_INTERFACE_PARAMS AmdParamStruct; - BIOS_HEAP_MANAGER *BiosManagerPtr; memset(&AmdParamStruct, 0, sizeof(AMD_INTERFACE_PARAMS)); @@ -259,15 +256,7 @@ agesawrapper_amdinitpost ( AmdReleaseStruct (&AmdParamStruct); /* Initialize heap space */ - BiosManagerPtr = (BIOS_HEAP_MANAGER *)GetHeapBase(&AmdParamStruct.StdHeader); - - HeadPtr = (UINT32 *) ((UINT8 *) BiosManagerPtr + sizeof (BIOS_HEAP_MANAGER)); - for (i = 0; i < ((BIOS_HEAP_SIZE/4) - (sizeof (BIOS_HEAP_MANAGER)/4)); i++) { - *HeadPtr = 0x00000000; - HeadPtr++; - } - BiosManagerPtr->StartOfAllocatedNodes = 0; - BiosManagerPtr->StartOfFreedNodes = 0; + EmptyHeap(); return (UINT32)status; } diff --git a/src/mainboard/amd/olivehill/agesawrapper.c b/src/mainboard/amd/olivehill/agesawrapper.c index 28fd7fb3ce..adcb298660 100644 --- a/src/mainboard/amd/olivehill/agesawrapper.c +++ b/src/mainboard/amd/olivehill/agesawrapper.c @@ -252,11 +252,8 @@ agesawrapper_amdinitpost ( ) { AGESA_STATUS status; - UINT16 i; - UINT32 *HeadPtr; AMD_INTERFACE_PARAMS AmdParamStruct; AMD_POST_PARAMS *PostParams; - BIOS_HEAP_MANAGER *BiosManagerPtr; LibAmdMemFill (&AmdParamStruct, 0, @@ -276,16 +273,7 @@ agesawrapper_amdinitpost ( if (status != AGESA_SUCCESS) agesawrapper_amdreadeventlog(PostParams->StdHeader.HeapStatus); AmdReleaseStruct (&AmdParamStruct); /* Initialize heap space */ - BiosManagerPtr = (BIOS_HEAP_MANAGER *)GetHeapBase(&AmdParamStruct.StdHeader); - - HeadPtr = (UINT32 *) ((UINT8 *) BiosManagerPtr + sizeof (BIOS_HEAP_MANAGER)); - for (i = 0; i < ((BIOS_HEAP_SIZE/4) - (sizeof (BIOS_HEAP_MANAGER)/4)); i++) - { - *HeadPtr = 0x00000000; - HeadPtr++; - } - BiosManagerPtr->StartOfAllocatedNodes = 0; - BiosManagerPtr->StartOfFreedNodes = 0; + EmptyHeap(); return (UINT32)status; } diff --git a/src/mainboard/amd/parmer/agesawrapper.c b/src/mainboard/amd/parmer/agesawrapper.c index 908e4b0cb5..345167fda3 100644 --- a/src/mainboard/amd/parmer/agesawrapper.c +++ b/src/mainboard/amd/parmer/agesawrapper.c @@ -252,11 +252,8 @@ agesawrapper_amdinitpost ( ) { AGESA_STATUS status; - UINT16 i; - UINT32 *HeadPtr; AMD_INTERFACE_PARAMS AmdParamStruct; AMD_POST_PARAMS *PostParams; - BIOS_HEAP_MANAGER *BiosManagerPtr; LibAmdMemFill (&AmdParamStruct, 0, @@ -276,16 +273,8 @@ agesawrapper_amdinitpost ( if (status != AGESA_SUCCESS) agesawrapper_amdreadeventlog(PostParams->StdHeader.HeapStatus); AmdReleaseStruct (&AmdParamStruct); /* Initialize heap space */ - BiosManagerPtr = (BIOS_HEAP_MANAGER *)GetHeapBase(&AmdParamStruct.StdHeader); + EmptyHeap(); - HeadPtr = (UINT32 *) ((UINT8 *) BiosManagerPtr + sizeof (BIOS_HEAP_MANAGER)); - for (i = 0; i < ((BIOS_HEAP_SIZE/4) - (sizeof (BIOS_HEAP_MANAGER)/4)); i++) - { - *HeadPtr = 0x00000000; - HeadPtr++; - } - BiosManagerPtr->StartOfAllocatedNodes = 0; - BiosManagerPtr->StartOfFreedNodes = 0; return (UINT32)status; } diff --git a/src/mainboard/amd/persimmon/agesawrapper.c b/src/mainboard/amd/persimmon/agesawrapper.c index de9d16edcf..14c6cd0a39 100644 --- a/src/mainboard/amd/persimmon/agesawrapper.c +++ b/src/mainboard/amd/persimmon/agesawrapper.c @@ -228,10 +228,7 @@ agesawrapper_amdinitpost ( ) { AGESA_STATUS status; - UINT16 i; - UINT32 *HeadPtr; AMD_INTERFACE_PARAMS AmdParamStruct; - BIOS_HEAP_MANAGER *BiosManagerPtr; memset(&AmdParamStruct, 0, sizeof(AMD_INTERFACE_PARAMS)); @@ -248,15 +245,7 @@ agesawrapper_amdinitpost ( AmdReleaseStruct (&AmdParamStruct); /* Initialize heap space */ - BiosManagerPtr = (BIOS_HEAP_MANAGER *)GetHeapBase(&AmdParamStruct.StdHeader); - - HeadPtr = (UINT32 *) ((UINT8 *) BiosManagerPtr + sizeof (BIOS_HEAP_MANAGER)); - for (i = 0; i < ((BIOS_HEAP_SIZE/4) - (sizeof (BIOS_HEAP_MANAGER)/4)); i++) { - *HeadPtr = 0x00000000; - HeadPtr++; - } - BiosManagerPtr->StartOfAllocatedNodes = 0; - BiosManagerPtr->StartOfFreedNodes = 0; + EmptyHeap(); return (UINT32)status; } diff --git a/src/mainboard/amd/south_station/agesawrapper.c b/src/mainboard/amd/south_station/agesawrapper.c index f6ee700ddd..d46cee4dc2 100644 --- a/src/mainboard/amd/south_station/agesawrapper.c +++ b/src/mainboard/amd/south_station/agesawrapper.c @@ -239,10 +239,7 @@ agesawrapper_amdinitpost ( ) { AGESA_STATUS status; - UINT16 i; - UINT32 *HeadPtr; AMD_INTERFACE_PARAMS AmdParamStruct; - BIOS_HEAP_MANAGER *BiosManagerPtr; memset(&AmdParamStruct, 0, sizeof(AMD_INTERFACE_PARAMS)); @@ -259,15 +256,7 @@ agesawrapper_amdinitpost ( AmdReleaseStruct (&AmdParamStruct); /* Initialize heap space */ - BiosManagerPtr = (BIOS_HEAP_MANAGER *)GetHeapBase(&AmdParamStruct.StdHeader); - - HeadPtr = (UINT32 *) ((UINT8 *) BiosManagerPtr + sizeof (BIOS_HEAP_MANAGER)); - for (i = 0; i < ((BIOS_HEAP_SIZE/4) - (sizeof (BIOS_HEAP_MANAGER)/4)); i++) { - *HeadPtr = 0x00000000; - HeadPtr++; - } - BiosManagerPtr->StartOfAllocatedNodes = 0; - BiosManagerPtr->StartOfFreedNodes = 0; + EmptyHeap(); return (UINT32)status; } diff --git a/src/mainboard/amd/thatcher/agesawrapper.c b/src/mainboard/amd/thatcher/agesawrapper.c index c8f25d6bb7..a4fdb242b5 100644 --- a/src/mainboard/amd/thatcher/agesawrapper.c +++ b/src/mainboard/amd/thatcher/agesawrapper.c @@ -250,11 +250,8 @@ agesawrapper_amdinitpost ( ) { AGESA_STATUS status; - UINT16 i; - UINT32 *HeadPtr; AMD_INTERFACE_PARAMS AmdParamStruct; AMD_POST_PARAMS *PostParams; - BIOS_HEAP_MANAGER *BiosManagerPtr; LibAmdMemFill (&AmdParamStruct, 0, @@ -274,16 +271,7 @@ agesawrapper_amdinitpost ( if (status != AGESA_SUCCESS) agesawrapper_amdreadeventlog(PostParams->StdHeader.HeapStatus); AmdReleaseStruct (&AmdParamStruct); /* Initialize heap space */ - BiosManagerPtr = (BIOS_HEAP_MANAGER *)GetHeapBase(&AmdParamStruct.StdHeader); - - HeadPtr = (UINT32 *) ((UINT8 *) BiosManagerPtr + sizeof (BIOS_HEAP_MANAGER)); - for (i = 0; i < ((BIOS_HEAP_SIZE/4) - (sizeof (BIOS_HEAP_MANAGER)/4)); i++) - { - *HeadPtr = 0x00000000; - HeadPtr++; - } - BiosManagerPtr->StartOfAllocatedNodes = 0; - BiosManagerPtr->StartOfFreedNodes = 0; + EmptyHeap(); return (UINT32)status; } diff --git a/src/mainboard/amd/torpedo/agesawrapper.c b/src/mainboard/amd/torpedo/agesawrapper.c index eb4da38781..1fa49f4d7d 100644 --- a/src/mainboard/amd/torpedo/agesawrapper.c +++ b/src/mainboard/amd/torpedo/agesawrapper.c @@ -368,10 +368,7 @@ agesawrapper_amdinitpost ( ) { AGESA_STATUS status; - UINT16 i; - UINT32 *HeadPtr; AMD_INTERFACE_PARAMS AmdParamStruct; - BIOS_HEAP_MANAGER *BiosManagerPtr; LibAmdMemFill (&AmdParamStruct, 0, @@ -391,16 +388,7 @@ agesawrapper_amdinitpost ( AmdReleaseStruct (&AmdParamStruct); /* Initialize heap space */ - BiosManagerPtr = (BIOS_HEAP_MANAGER *)GetHeapBase(&AmdParamStruct.StdHeader); - - HeadPtr = (UINT32 *) ((UINT8 *) BiosManagerPtr + sizeof (BIOS_HEAP_MANAGER)); - for (i = 0; i < ((BIOS_HEAP_SIZE/4) - (sizeof (BIOS_HEAP_MANAGER)/4)); i++) - { - *HeadPtr = 0x00000000; - HeadPtr++; - } - BiosManagerPtr->StartOfAllocatedNodes = 0; - BiosManagerPtr->StartOfFreedNodes = 0; + EmptyHeap(); return (UINT32)status; } diff --git a/src/mainboard/amd/union_station/agesawrapper.c b/src/mainboard/amd/union_station/agesawrapper.c index f6ee700ddd..d46cee4dc2 100644 --- a/src/mainboard/amd/union_station/agesawrapper.c +++ b/src/mainboard/amd/union_station/agesawrapper.c @@ -239,10 +239,7 @@ agesawrapper_amdinitpost ( ) { AGESA_STATUS status; - UINT16 i; - UINT32 *HeadPtr; AMD_INTERFACE_PARAMS AmdParamStruct; - BIOS_HEAP_MANAGER *BiosManagerPtr; memset(&AmdParamStruct, 0, sizeof(AMD_INTERFACE_PARAMS)); @@ -259,15 +256,7 @@ agesawrapper_amdinitpost ( AmdReleaseStruct (&AmdParamStruct); /* Initialize heap space */ - BiosManagerPtr = (BIOS_HEAP_MANAGER *)GetHeapBase(&AmdParamStruct.StdHeader); - - HeadPtr = (UINT32 *) ((UINT8 *) BiosManagerPtr + sizeof (BIOS_HEAP_MANAGER)); - for (i = 0; i < ((BIOS_HEAP_SIZE/4) - (sizeof (BIOS_HEAP_MANAGER)/4)); i++) { - *HeadPtr = 0x00000000; - HeadPtr++; - } - BiosManagerPtr->StartOfAllocatedNodes = 0; - BiosManagerPtr->StartOfFreedNodes = 0; + EmptyHeap(); return (UINT32)status; } diff --git a/src/mainboard/asrock/e350m1/agesawrapper.c b/src/mainboard/asrock/e350m1/agesawrapper.c index 2ad068d135..6e47880fbb 100644 --- a/src/mainboard/asrock/e350m1/agesawrapper.c +++ b/src/mainboard/asrock/e350m1/agesawrapper.c @@ -239,10 +239,7 @@ agesawrapper_amdinitpost ( ) { AGESA_STATUS status; - UINT16 i; - UINT32 *HeadPtr; AMD_INTERFACE_PARAMS AmdParamStruct; - BIOS_HEAP_MANAGER *BiosManagerPtr; memset(&AmdParamStruct, 0, sizeof(AMD_INTERFACE_PARAMS)); @@ -259,15 +256,7 @@ agesawrapper_amdinitpost ( AmdReleaseStruct (&AmdParamStruct); /* Initialize heap space */ - BiosManagerPtr = (BIOS_HEAP_MANAGER *)GetHeapBase(&AmdParamStruct.StdHeader); - - HeadPtr = (UINT32 *) ((UINT8 *) BiosManagerPtr + sizeof (BIOS_HEAP_MANAGER)); - for (i = 0; i < ((BIOS_HEAP_SIZE/4) - (sizeof (BIOS_HEAP_MANAGER)/4)); i++) { - *HeadPtr = 0x00000000; - HeadPtr++; - } - BiosManagerPtr->StartOfAllocatedNodes = 0; - BiosManagerPtr->StartOfFreedNodes = 0; + EmptyHeap(); return (UINT32)status; } diff --git a/src/mainboard/asrock/imb-a180/agesawrapper.c b/src/mainboard/asrock/imb-a180/agesawrapper.c index 7fbe37eea4..4e9e77ba8d 100644 --- a/src/mainboard/asrock/imb-a180/agesawrapper.c +++ b/src/mainboard/asrock/imb-a180/agesawrapper.c @@ -252,11 +252,8 @@ agesawrapper_amdinitpost ( ) { AGESA_STATUS status; - UINT16 i; - UINT32 *HeadPtr; AMD_INTERFACE_PARAMS AmdParamStruct; AMD_POST_PARAMS *PostParams; - BIOS_HEAP_MANAGER *BiosManagerPtr; LibAmdMemFill (&AmdParamStruct, 0, @@ -276,16 +273,7 @@ agesawrapper_amdinitpost ( if (status != AGESA_SUCCESS) agesawrapper_amdreadeventlog(PostParams->StdHeader.HeapStatus); AmdReleaseStruct (&AmdParamStruct); /* Initialize heap space */ - BiosManagerPtr = (BIOS_HEAP_MANAGER *)GetHeapBase(&AmdParamStruct.StdHeader); - - HeadPtr = (UINT32 *) ((UINT8 *) BiosManagerPtr + sizeof (BIOS_HEAP_MANAGER)); - for (i = 0; i < ((BIOS_HEAP_SIZE/4) - (sizeof (BIOS_HEAP_MANAGER)/4)); i++) - { - *HeadPtr = 0x00000000; - HeadPtr++; - } - BiosManagerPtr->StartOfAllocatedNodes = 0; - BiosManagerPtr->StartOfFreedNodes = 0; + EmptyHeap(); return (UINT32)status; } diff --git a/src/mainboard/asus/f2a85-m/agesawrapper.c b/src/mainboard/asus/f2a85-m/agesawrapper.c index 02d27964c0..fdf7457550 100644 --- a/src/mainboard/asus/f2a85-m/agesawrapper.c +++ b/src/mainboard/asus/f2a85-m/agesawrapper.c @@ -243,11 +243,8 @@ agesawrapper_amdinitpost ( ) { AGESA_STATUS status; - UINT16 i; - UINT32 *HeadPtr; AMD_INTERFACE_PARAMS AmdParamStruct; AMD_POST_PARAMS *PostParams; - BIOS_HEAP_MANAGER *BiosManagerPtr; LibAmdMemFill (&AmdParamStruct, 0, @@ -267,16 +264,7 @@ agesawrapper_amdinitpost ( if (status != AGESA_SUCCESS) agesawrapper_amdreadeventlog(PostParams->StdHeader.HeapStatus); AmdReleaseStruct (&AmdParamStruct); /* Initialize heap space */ - BiosManagerPtr = (BIOS_HEAP_MANAGER *)GetHeapBase(&AmdParamStruct.StdHeader); - - HeadPtr = (UINT32 *) ((UINT8 *) BiosManagerPtr + sizeof (BIOS_HEAP_MANAGER)); - for (i = 0; i < ((BIOS_HEAP_SIZE/4) - (sizeof (BIOS_HEAP_MANAGER)/4)); i++) - { - *HeadPtr = 0x00000000; - HeadPtr++; - } - BiosManagerPtr->StartOfAllocatedNodes = 0; - BiosManagerPtr->StartOfFreedNodes = 0; + EmptyHeap(); return (UINT32)status; } diff --git a/src/mainboard/gizmosphere/gizmo/agesawrapper.c b/src/mainboard/gizmosphere/gizmo/agesawrapper.c index 8b6d2019de..becfb45d1a 100755 --- a/src/mainboard/gizmosphere/gizmo/agesawrapper.c +++ b/src/mainboard/gizmosphere/gizmo/agesawrapper.c @@ -229,10 +229,7 @@ agesawrapper_amdinitpost ( ) { AGESA_STATUS status; - UINT16 i; - UINT32 *HeadPtr; AMD_INTERFACE_PARAMS AmdParamStruct; - BIOS_HEAP_MANAGER *BiosManagerPtr; memset(&AmdParamStruct, 0, sizeof(AMD_INTERFACE_PARAMS)); @@ -249,15 +246,7 @@ agesawrapper_amdinitpost ( AmdReleaseStruct (&AmdParamStruct); /* Initialize heap space */ - BiosManagerPtr = (BIOS_HEAP_MANAGER *)GetHeapBase(&AmdParamStruct.StdHeader); - - HeadPtr = (UINT32 *) ((UINT8 *) BiosManagerPtr + sizeof (BIOS_HEAP_MANAGER)); - for (i = 0; i < ((BIOS_HEAP_SIZE/4) - (sizeof (BIOS_HEAP_MANAGER)/4)); i++) { - *HeadPtr = 0x00000000; - HeadPtr++; - } - BiosManagerPtr->StartOfAllocatedNodes = 0; - BiosManagerPtr->StartOfFreedNodes = 0; + EmptyHeap(); return (UINT32)status; } diff --git a/src/mainboard/hp/pavilion_m6_1035dx/agesawrapper.c b/src/mainboard/hp/pavilion_m6_1035dx/agesawrapper.c index b9519c6a3a..0174d429a8 100644 --- a/src/mainboard/hp/pavilion_m6_1035dx/agesawrapper.c +++ b/src/mainboard/hp/pavilion_m6_1035dx/agesawrapper.c @@ -234,11 +234,8 @@ agesawrapper_amdinitpost ( ) { AGESA_STATUS status; - UINT16 i; - UINT32 *HeadPtr; AMD_INTERFACE_PARAMS AmdParamStruct; AMD_POST_PARAMS *PostParams; - BIOS_HEAP_MANAGER *BiosManagerPtr; LibAmdMemFill (&AmdParamStruct, 0, @@ -258,16 +255,7 @@ agesawrapper_amdinitpost ( if (status != AGESA_SUCCESS) agesawrapper_amdreadeventlog(PostParams->StdHeader.HeapStatus); AmdReleaseStruct (&AmdParamStruct); /* Initialize heap space */ - BiosManagerPtr = (BIOS_HEAP_MANAGER *)GetHeapBase(&AmdParamStruct.StdHeader); - - HeadPtr = (UINT32 *) ((UINT8 *) BiosManagerPtr + sizeof (BIOS_HEAP_MANAGER)); - for (i = 0; i < ((BIOS_HEAP_SIZE/4) - (sizeof (BIOS_HEAP_MANAGER)/4)); i++) - { - *HeadPtr = 0x00000000; - HeadPtr++; - } - BiosManagerPtr->StartOfAllocatedNodes = 0; - BiosManagerPtr->StartOfFreedNodes = 0; + EmptyHeap(); return (UINT32)status; } diff --git a/src/mainboard/jetway/nf81-t56n-lf/agesawrapper.c b/src/mainboard/jetway/nf81-t56n-lf/agesawrapper.c index 21930e4304..7cd389938f 100644 --- a/src/mainboard/jetway/nf81-t56n-lf/agesawrapper.c +++ b/src/mainboard/jetway/nf81-t56n-lf/agesawrapper.c @@ -182,10 +182,7 @@ AGESA_STATUS agesawrapper_amdinitearly(void) AGESA_STATUS agesawrapper_amdinitpost(void) { AGESA_STATUS status; - uint16_t i; - uint32_t *HeadPtr; AMD_INTERFACE_PARAMS AmdParamStruct; - BIOS_HEAP_MANAGER *BiosManagerPtr; memset(&AmdParamStruct, 0, sizeof(AMD_INTERFACE_PARAMS)); @@ -202,15 +199,7 @@ AGESA_STATUS agesawrapper_amdinitpost(void) AmdReleaseStruct (&AmdParamStruct); /* Initialize heap space */ - BiosManagerPtr = (BIOS_HEAP_MANAGER *)GetHeapBase(&AmdParamStruct.StdHeader); - - HeadPtr = (uint32_t *) ((uint8_t *) BiosManagerPtr + sizeof (BIOS_HEAP_MANAGER)); - for (i = 0; i < ((BIOS_HEAP_SIZE/4) - (sizeof (BIOS_HEAP_MANAGER)/4)); i++) { - *HeadPtr = 0x00000000; - HeadPtr++; - } - BiosManagerPtr->StartOfAllocatedNodes = 0; - BiosManagerPtr->StartOfFreedNodes = 0; + EmptyHeap(); return status; } diff --git a/src/mainboard/lippert/frontrunner-af/agesawrapper.c b/src/mainboard/lippert/frontrunner-af/agesawrapper.c index de9d16edcf..14c6cd0a39 100644 --- a/src/mainboard/lippert/frontrunner-af/agesawrapper.c +++ b/src/mainboard/lippert/frontrunner-af/agesawrapper.c @@ -228,10 +228,7 @@ agesawrapper_amdinitpost ( ) { AGESA_STATUS status; - UINT16 i; - UINT32 *HeadPtr; AMD_INTERFACE_PARAMS AmdParamStruct; - BIOS_HEAP_MANAGER *BiosManagerPtr; memset(&AmdParamStruct, 0, sizeof(AMD_INTERFACE_PARAMS)); @@ -248,15 +245,7 @@ agesawrapper_amdinitpost ( AmdReleaseStruct (&AmdParamStruct); /* Initialize heap space */ - BiosManagerPtr = (BIOS_HEAP_MANAGER *)GetHeapBase(&AmdParamStruct.StdHeader); - - HeadPtr = (UINT32 *) ((UINT8 *) BiosManagerPtr + sizeof (BIOS_HEAP_MANAGER)); - for (i = 0; i < ((BIOS_HEAP_SIZE/4) - (sizeof (BIOS_HEAP_MANAGER)/4)); i++) { - *HeadPtr = 0x00000000; - HeadPtr++; - } - BiosManagerPtr->StartOfAllocatedNodes = 0; - BiosManagerPtr->StartOfFreedNodes = 0; + EmptyHeap(); return (UINT32)status; } diff --git a/src/mainboard/lippert/toucan-af/agesawrapper.c b/src/mainboard/lippert/toucan-af/agesawrapper.c index de9d16edcf..14c6cd0a39 100644 --- a/src/mainboard/lippert/toucan-af/agesawrapper.c +++ b/src/mainboard/lippert/toucan-af/agesawrapper.c @@ -228,10 +228,7 @@ agesawrapper_amdinitpost ( ) { AGESA_STATUS status; - UINT16 i; - UINT32 *HeadPtr; AMD_INTERFACE_PARAMS AmdParamStruct; - BIOS_HEAP_MANAGER *BiosManagerPtr; memset(&AmdParamStruct, 0, sizeof(AMD_INTERFACE_PARAMS)); @@ -248,15 +245,7 @@ agesawrapper_amdinitpost ( AmdReleaseStruct (&AmdParamStruct); /* Initialize heap space */ - BiosManagerPtr = (BIOS_HEAP_MANAGER *)GetHeapBase(&AmdParamStruct.StdHeader); - - HeadPtr = (UINT32 *) ((UINT8 *) BiosManagerPtr + sizeof (BIOS_HEAP_MANAGER)); - for (i = 0; i < ((BIOS_HEAP_SIZE/4) - (sizeof (BIOS_HEAP_MANAGER)/4)); i++) { - *HeadPtr = 0x00000000; - HeadPtr++; - } - BiosManagerPtr->StartOfAllocatedNodes = 0; - BiosManagerPtr->StartOfFreedNodes = 0; + EmptyHeap(); return (UINT32)status; } diff --git a/src/mainboard/supermicro/h8qgi/agesawrapper.c b/src/mainboard/supermicro/h8qgi/agesawrapper.c index cc1de34725..bf18ec5d00 100644 --- a/src/mainboard/supermicro/h8qgi/agesawrapper.c +++ b/src/mainboard/supermicro/h8qgi/agesawrapper.c @@ -286,11 +286,8 @@ UINT32 agesawrapper_amdinitearly(VOID) UINT32 agesawrapper_amdinitpost(VOID) { AGESA_STATUS status; - UINT16 i; - UINT32 *HeadPtr; AMD_INTERFACE_PARAMS AmdParamStruct; AMD_POST_PARAMS *PostParams; - BIOS_HEAP_MANAGER *BiosManagerPtr; UINT32 TscRateInMhz; CPU_SPECIFIC_SERVICES *FamilySpecificServices; @@ -318,15 +315,7 @@ UINT32 agesawrapper_amdinitpost(VOID) AmdReleaseStruct(&AmdParamStruct); /* Initialize heap space */ - BiosManagerPtr = (BIOS_HEAP_MANAGER *)GetHeapBase(&AmdParamStruct.StdHeader); - - HeadPtr = (UINT32 *) ((UINT8 *) BiosManagerPtr + sizeof(BIOS_HEAP_MANAGER)); - for (i = 0; i < ((BIOS_HEAP_SIZE/4) - (sizeof(BIOS_HEAP_MANAGER)/4)); i++) { - *HeadPtr = 0x00000000; - HeadPtr++; - } - BiosManagerPtr->StartOfAllocatedNodes = 0; - BiosManagerPtr->StartOfFreedNodes = 0; + EmptyHeap(); GetCpuServicesOfCurrentCore ((CONST CPU_SPECIFIC_SERVICES **)&FamilySpecificServices, &AmdParamStruct.StdHeader); FamilySpecificServices->GetTscRate (FamilySpecificServices, &TscRateInMhz, &AmdParamStruct.StdHeader); diff --git a/src/mainboard/supermicro/h8scm/agesawrapper.c b/src/mainboard/supermicro/h8scm/agesawrapper.c index 425b7cc880..ef98d81c0d 100644 --- a/src/mainboard/supermicro/h8scm/agesawrapper.c +++ b/src/mainboard/supermicro/h8scm/agesawrapper.c @@ -286,11 +286,8 @@ UINT32 agesawrapper_amdinitearly(VOID) UINT32 agesawrapper_amdinitpost(VOID) { AGESA_STATUS status; - UINT16 i; - UINT32 *HeadPtr; AMD_INTERFACE_PARAMS AmdParamStruct; AMD_POST_PARAMS *PostParams; - BIOS_HEAP_MANAGER *BiosManagerPtr; UINT32 TscRateInMhz; CPU_SPECIFIC_SERVICES *FamilySpecificServices; @@ -318,15 +315,7 @@ UINT32 agesawrapper_amdinitpost(VOID) AmdReleaseStruct(&AmdParamStruct); /* Initialize heap space */ - BiosManagerPtr = (BIOS_HEAP_MANAGER *)GetHeapBase(&AmdParamStruct.StdHeader); - - HeadPtr = (UINT32 *) ((UINT8 *) BiosManagerPtr + sizeof(BIOS_HEAP_MANAGER)); - for (i = 0; i < ((BIOS_HEAP_SIZE/4) - (sizeof(BIOS_HEAP_MANAGER)/4)); i++) { - *HeadPtr = 0x00000000; - HeadPtr++; - } - BiosManagerPtr->StartOfAllocatedNodes = 0; - BiosManagerPtr->StartOfFreedNodes = 0; + EmptyHeap(); GetCpuServicesOfCurrentCore ((CONST CPU_SPECIFIC_SERVICES **)&FamilySpecificServices, &AmdParamStruct.StdHeader); FamilySpecificServices->GetTscRate (FamilySpecificServices, &TscRateInMhz, &AmdParamStruct.StdHeader); diff --git a/src/mainboard/tyan/s8226/agesawrapper.c b/src/mainboard/tyan/s8226/agesawrapper.c index 4cd8267b03..33a4a6af11 100644 --- a/src/mainboard/tyan/s8226/agesawrapper.c +++ b/src/mainboard/tyan/s8226/agesawrapper.c @@ -296,11 +296,8 @@ UINT32 agesawrapper_amdinitearly(VOID) UINT32 agesawrapper_amdinitpost(VOID) { AGESA_STATUS status; - UINT16 i; - UINT32 *HeadPtr; AMD_INTERFACE_PARAMS AmdParamStruct; AMD_POST_PARAMS *PostParams; - BIOS_HEAP_MANAGER *BiosManagerPtr; UINT32 TscRateInMhz; CPU_SPECIFIC_SERVICES *FamilySpecificServices; @@ -328,15 +325,7 @@ UINT32 agesawrapper_amdinitpost(VOID) AmdReleaseStruct(&AmdParamStruct); /* Initialize heap space */ - BiosManagerPtr = (BIOS_HEAP_MANAGER *)GetHeapBase(&AmdParamStruct.StdHeader); - - HeadPtr = (UINT32 *) ((UINT8 *) BiosManagerPtr + sizeof(BIOS_HEAP_MANAGER)); - for (i = 0; i < ((BIOS_HEAP_SIZE/4) - (sizeof(BIOS_HEAP_MANAGER)/4)); i++) { - *HeadPtr = 0x00000000; - HeadPtr++; - } - BiosManagerPtr->StartOfAllocatedNodes = 0; - BiosManagerPtr->StartOfFreedNodes = 0; + EmptyHeap(); GetCpuServicesOfCurrentCore ((CONST CPU_SPECIFIC_SERVICES **)&FamilySpecificServices, &AmdParamStruct.StdHeader); FamilySpecificServices->GetTscRate (FamilySpecificServices, &TscRateInMhz, &AmdParamStruct.StdHeader); diff --git a/src/northbridge/amd/agesa/family12/fam12_callouts.c b/src/northbridge/amd/agesa/family12/fam12_callouts.c index 491f3ce47b..1d55e9584b 100644 --- a/src/northbridge/amd/agesa/family12/fam12_callouts.c +++ b/src/northbridge/amd/agesa/family12/fam12_callouts.c @@ -27,6 +27,7 @@ #include "Hudson-2.h" #include <cbmem.h> #include <arch/acpi.h> +#include <string.h> UINT32 GetHeapBase(AMD_CONFIG_PARAMS *StdHeader) { @@ -43,6 +44,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/family12/fam12_callouts.h b/src/northbridge/amd/agesa/family12/fam12_callouts.h index 387ff303ef..057234239f 100644 --- a/src/northbridge/amd/agesa/family12/fam12_callouts.h +++ b/src/northbridge/amd/agesa/family12/fam12_callouts.h @@ -39,6 +39,7 @@ typedef struct _BIOS_BUFFER_NODE { } BIOS_BUFFER_NODE; UINT32 GetHeapBase(AMD_CONFIG_PARAMS *StdHeader); +void EmptyHeap(void); /* REQUIRED CALLOUTS * AGESA ADVANCED CALLOUTS - CPU 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 <cbmem.h> #include <arch/acpi.h> +#include <string.h> 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 diff --git a/src/northbridge/amd/agesa/family15/fam15_callouts.c b/src/northbridge/amd/agesa/family15/fam15_callouts.c index 8f4722029f..fe7c3ed7c9 100644 --- a/src/northbridge/amd/agesa/family15/fam15_callouts.c +++ b/src/northbridge/amd/agesa/family15/fam15_callouts.c @@ -27,6 +27,7 @@ #include <arch/io.h> #include <arch/acpi.h> #include <cbmem.h> +#include <string.h> UINT32 GetHeapBase(AMD_CONFIG_PARAMS *StdHeader) { @@ -43,6 +44,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/family15/fam15_callouts.h b/src/northbridge/amd/agesa/family15/fam15_callouts.h index e5109f4ee0..a43c65092a 100644 --- a/src/northbridge/amd/agesa/family15/fam15_callouts.h +++ b/src/northbridge/amd/agesa/family15/fam15_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 diff --git a/src/northbridge/amd/agesa/family15tn/fam15tn_callouts.c b/src/northbridge/amd/agesa/family15tn/fam15tn_callouts.c index 2bc3b37ba6..5f14e82a56 100644 --- a/src/northbridge/amd/agesa/family15tn/fam15tn_callouts.c +++ b/src/northbridge/amd/agesa/family15tn/fam15tn_callouts.c @@ -28,6 +28,7 @@ #include "fam15tn_callouts.h" #include <cbmem.h> #include <arch/acpi.h> +#include <string.h> #define AGESA_RUNTIME_SIZE 4096 @@ -66,6 +67,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 fam15tn_AllocateBuffer (UINT32 Func, UINT32 Data, VOID *ConfigPtr) { UINT32 AvailableHeapSize; diff --git a/src/northbridge/amd/agesa/family15tn/fam15tn_callouts.h b/src/northbridge/amd/agesa/family15tn/fam15tn_callouts.h index 2392570a8b..0070e6f570 100644 --- a/src/northbridge/amd/agesa/family15tn/fam15tn_callouts.h +++ b/src/northbridge/amd/agesa/family15tn/fam15tn_callouts.h @@ -40,6 +40,7 @@ typedef struct _BIOS_BUFFER_NODE { } BIOS_BUFFER_NODE; UINT32 GetHeapBase(AMD_CONFIG_PARAMS *StdHeader); +void EmptyHeap(void); AGESA_STATUS fam15tn_AllocateBuffer (UINT32 Func, UINT32 Data, VOID *ConfigPtr); AGESA_STATUS fam15tn_DeallocateBuffer (UINT32 Func, UINT32 Data, VOID *ConfigPtr); diff --git a/src/northbridge/amd/agesa/family16kb/fam16kb_callouts.c b/src/northbridge/amd/agesa/family16kb/fam16kb_callouts.c index 8cc300c977..7dada18d10 100644 --- a/src/northbridge/amd/agesa/family16kb/fam16kb_callouts.c +++ b/src/northbridge/amd/agesa/family16kb/fam16kb_callouts.c @@ -28,6 +28,7 @@ #include "fam16kb_callouts.h" #include <cbmem.h> #include <arch/acpi.h> +#include <string.h> UINT32 GetHeapBase(AMD_CONFIG_PARAMS *StdHeader) { @@ -44,6 +45,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 fam16kb_AllocateBuffer (UINT32 Func, UINT32 Data, VOID *ConfigPtr) { UINT32 AvailableHeapSize; diff --git a/src/northbridge/amd/agesa/family16kb/fam16kb_callouts.h b/src/northbridge/amd/agesa/family16kb/fam16kb_callouts.h index 3d4e9792dd..57dd5546e6 100644 --- a/src/northbridge/amd/agesa/family16kb/fam16kb_callouts.h +++ b/src/northbridge/amd/agesa/family16kb/fam16kb_callouts.h @@ -40,6 +40,7 @@ typedef struct _BIOS_BUFFER_NODE { } BIOS_BUFFER_NODE; UINT32 GetHeapBase(AMD_CONFIG_PARAMS *StdHeader); +void EmptyHeap(void); AGESA_STATUS fam16kb_AllocateBuffer (UINT32 Func, UINT32 Data, VOID *ConfigPtr); AGESA_STATUS fam16kb_DeallocateBuffer (UINT32 Func, UINT32 Data, VOID *ConfigPtr); |