Kyösti Mälkki (kyosti.malkki@gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5659
-gerrit
commit e666615d12c7c1e10c0b86c161b3d9b486a854f3 Author: Kyösti Mälkki kyosti.malkki@gmail.com Date: Fri May 2 14:13:37 2014 +0300
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 --- src/mainboard/amd/dinar/agesawrapper.c | 14 +------------- src/mainboard/amd/inagua/agesawrapper.c | 13 +------------ src/mainboard/amd/olivehill/agesawrapper.c | 14 +------------- src/mainboard/amd/parmer/agesawrapper.c | 13 +------------ src/mainboard/amd/persimmon/agesawrapper.c | 13 +------------ src/mainboard/amd/south_station/agesawrapper.c | 13 +------------ src/mainboard/amd/thatcher/agesawrapper.c | 14 +------------- src/mainboard/amd/torpedo/agesawrapper.c | 14 +------------- src/mainboard/amd/union_station/agesawrapper.c | 13 +------------ src/mainboard/asrock/e350m1/agesawrapper.c | 13 +------------ src/mainboard/asrock/imb-a180/agesawrapper.c | 14 +------------- src/mainboard/asus/f2a85-m/agesawrapper.c | 14 +------------- src/mainboard/gizmosphere/gizmo/agesawrapper.c | 13 +------------ src/mainboard/hp/pavilion_m6_1035dx/agesawrapper.c | 14 +------------- src/mainboard/jetway/nf81-t56n-lf/agesawrapper.c | 13 +------------ src/mainboard/lippert/frontrunner-af/agesawrapper.c | 13 +------------ src/mainboard/lippert/toucan-af/agesawrapper.c | 13 +------------ src/mainboard/supermicro/h8qgi/agesawrapper.c | 13 +------------ src/mainboard/supermicro/h8scm/agesawrapper.c | 13 +------------ src/mainboard/tyan/s8226/agesawrapper.c | 13 +------------ src/northbridge/amd/agesa/family12/fam12_callouts.c | 7 +++++++ src/northbridge/amd/agesa/family12/fam12_callouts.h | 1 + src/northbridge/amd/agesa/family14/fam14_callouts.c | 7 +++++++ src/northbridge/amd/agesa/family14/fam14_callouts.h | 1 + src/northbridge/amd/agesa/family15/fam15_callouts.c | 7 +++++++ src/northbridge/amd/agesa/family15/fam15_callouts.h | 1 + src/northbridge/amd/agesa/family15tn/fam15tn_callouts.c | 7 +++++++ src/northbridge/amd/agesa/family15tn/fam15tn_callouts.h | 1 + src/northbridge/amd/agesa/family16kb/fam16kb_callouts.c | 7 +++++++ src/northbridge/amd/agesa/family16kb/fam16kb_callouts.h | 1 + 30 files changed, 60 insertions(+), 247 deletions(-)
diff --git a/src/mainboard/amd/dinar/agesawrapper.c b/src/mainboard/amd/dinar/agesawrapper.c index dc6afc1..7d0a918 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 41278f1..db25279 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 28fd7fb..adcb298 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 908e4b0..345167f 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 de9d16e..14c6cd0 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 f6ee700..d46cee4 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 c8f25d6..a4fdb24 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 eb4da38..1fa49f4 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 f6ee700..d46cee4 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 2ad068d..6e47880 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 7fbe37e..4e9e77b 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 02d2796..fdf7457 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 8b6d201..becfb45 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 b9519c6..0174d42 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 21930e4..7cd3899 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 de9d16e..14c6cd0 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 de9d16e..14c6cd0 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 cc1de34..bf18ec5 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 425b7cc..ef98d81 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 4cd8267..33a4a6a 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 491f3ce..1d55e95 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 387ff30..0572342 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 6a9830d..301f145 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 a1297f7..1f23cef 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 8f47220..fe7c3ed 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 e5109f4..a43c650 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 2bc3b37..5f14e82 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 2392570..0070e6f 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 8cc300c..7dada18 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 3d4e979..57dd554 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);