soc/amd/common/pi: Fix issue in AGESA heap allocator

The heap allocator would try to split a buffer node that
was too small for another node. In the failing case, the buffer
node was 0x140 bytes and the requested size was 0x133 bytes.
The logic would check that there was room for the header and
buffer and try to split the buffer node. The buffer node header
is 0xC bytes, so 0x13F bytes are need. The problem is that it didn't
leave room for another node header and a little space for a buffer.

TEST= Boot grunt.

Change-Id: Iece5e12d5787415a335bb953985331a5dc312152
Signed-off-by: Marc Jones <>
Tested-by: build bot (Jenkins) <>
Reviewed-by: Martin Roth <>
Reviewed-by: Daniel Kurtz <>
2 files changed