diff options
Diffstat (limited to 'src/soc/amd/common')
-rw-r--r-- | src/soc/amd/common/block/include/amdblocks/BiosCallOuts.h | 2 | ||||
-rw-r--r-- | src/soc/amd/common/block/pi/heapmanager.c | 9 |
2 files changed, 4 insertions, 7 deletions
diff --git a/src/soc/amd/common/block/include/amdblocks/BiosCallOuts.h b/src/soc/amd/common/block/include/amdblocks/BiosCallOuts.h index 87856003f3..2302889e6b 100644 --- a/src/soc/amd/common/block/include/amdblocks/BiosCallOuts.h +++ b/src/soc/amd/common/block/include/amdblocks/BiosCallOuts.h @@ -34,8 +34,6 @@ typedef struct _BIOS_BUFFER_NODE { UINT32 NextNodeOffset; } 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_DeallocateBuffer(UINT32 Func, UINTN Data, VOID *ConfigPtr); AGESA_STATUS agesa_LocateBuffer(UINT32 Func, UINTN Data, VOID *ConfigPtr); diff --git a/src/soc/amd/common/block/pi/heapmanager.c b/src/soc/amd/common/block/pi/heapmanager.c index d149e9144f..cea3171aa5 100644 --- a/src/soc/amd/common/block/pi/heapmanager.c +++ b/src/soc/amd/common/block/pi/heapmanager.c @@ -159,12 +159,11 @@ AGESA_STATUS agesa_AllocateBuffer (UINT32 Func, UINTN Data, VOID *ConfigPtr) BestFitPrevNodeOffset); /* - * If BestFitNode is larger than the requested buffer and - * has room for another buffer node, fragment the node further. + * If BestFitNode is larger than the requested buffer, + * fragment the node further */ - if (BestFitNodePtr->BufferSize >= - (AllocParams->BufferLength + sizeof(BIOS_BUFFER_NODE) + - MIN_BUFFER_NODE_SIZE)) { + if (BestFitNodePtr->BufferSize > + (AllocParams->BufferLength + sizeof(BIOS_BUFFER_NODE))) { NextFreeOffset = BestFitNodeOffset + AllocParams->BufferLength + sizeof(BIOS_BUFFER_NODE); |