Revert "soc/amd/common/pi: Fix issue in AGESA heap allocator"
This reverts commit 0f5651584ebb8e2ccfa151275bfd2f70e74bae9b. This is not the correct fix for the heap allocator. It looks like the root cause is in the buffer size of the deallocate function. Change-Id: I33c479a30d89a665677d3e4914194ae8136504af Signed-off-by: Marc Jones <marcj303@gmail.com> Reviewed-on: https://review.coreboot.org/23245 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Chris Ching <chingcodes@chromium.org> Reviewed-by: Martin Roth <martinroth@google.com>
This commit is contained in:
parent
f46fca4bef
commit
a273753c72
|
@ -34,8 +34,6 @@ typedef struct _BIOS_BUFFER_NODE {
|
||||||
UINT32 NextNodeOffset;
|
UINT32 NextNodeOffset;
|
||||||
} BIOS_BUFFER_NODE;
|
} BIOS_BUFFER_NODE;
|
||||||
|
|
||||||
#define MIN_BUFFER_NODE_SIZE (sizeof(BIOS_BUFFER_NODE) + sizeof(uint32_t))
|
|
||||||
|
|
||||||
AGESA_STATUS agesa_AllocateBuffer(UINT32 Func, UINTN Data, VOID *ConfigPtr);
|
AGESA_STATUS agesa_AllocateBuffer(UINT32 Func, UINTN Data, VOID *ConfigPtr);
|
||||||
AGESA_STATUS agesa_DeallocateBuffer(UINT32 Func, UINTN Data, VOID *ConfigPtr);
|
AGESA_STATUS agesa_DeallocateBuffer(UINT32 Func, UINTN Data, VOID *ConfigPtr);
|
||||||
AGESA_STATUS agesa_LocateBuffer(UINT32 Func, UINTN Data, VOID *ConfigPtr);
|
AGESA_STATUS agesa_LocateBuffer(UINT32 Func, UINTN Data, VOID *ConfigPtr);
|
||||||
|
|
|
@ -159,12 +159,11 @@ AGESA_STATUS agesa_AllocateBuffer (UINT32 Func, UINTN Data, VOID *ConfigPtr)
|
||||||
BestFitPrevNodeOffset);
|
BestFitPrevNodeOffset);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If BestFitNode is larger than the requested buffer and
|
* If BestFitNode is larger than the requested buffer,
|
||||||
* has room for another buffer node, fragment the node further.
|
* fragment the node further
|
||||||
*/
|
*/
|
||||||
if (BestFitNodePtr->BufferSize >=
|
if (BestFitNodePtr->BufferSize >
|
||||||
(AllocParams->BufferLength + sizeof(BIOS_BUFFER_NODE) +
|
(AllocParams->BufferLength + sizeof(BIOS_BUFFER_NODE))) {
|
||||||
MIN_BUFFER_NODE_SIZE)) {
|
|
||||||
NextFreeOffset = BestFitNodeOffset +
|
NextFreeOffset = BestFitNodeOffset +
|
||||||
AllocParams->BufferLength +
|
AllocParams->BufferLength +
|
||||||
sizeof(BIOS_BUFFER_NODE);
|
sizeof(BIOS_BUFFER_NODE);
|
||||||
|
|
Loading…
Reference in New Issue