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>
This commit is contained in:
parent
8ef30253e3
commit
088fd67a38
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue