diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2018-06-11 08:52:22 +0300 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2019-05-25 08:36:22 +0000 |
commit | c6918f99d73541246f5a7d6d0f5723c674737fbe (patch) | |
tree | 796e55e1586dbe714ca1731988691bd2da825fbe /src/vendorcode/amd/pi | |
parent | 35f9507b08aa8e062b0a1f87eb25b45694378503 (diff) |
AGESA: Move heap_status_name() implementation
Place it within class libagesa to avoid including
AGESA internal header heapManager.h in coreboot
proper build CPPFLAGS.
Change-Id: Iae86d6631d7a6ba6ea2588a53b292b435dfd7861
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/31511
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'src/vendorcode/amd/pi')
-rw-r--r-- | src/vendorcode/amd/pi/Lib/debug_util.c | 24 | ||||
-rw-r--r-- | src/vendorcode/amd/pi/Lib/debug_util.h | 8 |
2 files changed, 32 insertions, 0 deletions
diff --git a/src/vendorcode/amd/pi/Lib/debug_util.c b/src/vendorcode/amd/pi/Lib/debug_util.c new file mode 100644 index 0000000000..29d0841904 --- /dev/null +++ b/src/vendorcode/amd/pi/Lib/debug_util.c @@ -0,0 +1,24 @@ + +#include <AGESA.h> +#include <AMD.h> +#include <heapManager.h> + +#include "debug_util.h" + +static const char undefined[] = "undefined"; + +static const char *HeapStatusStr[] = { + "DoNotExistYet", "LocalCache", "TempMem", "SystemMem", "DoNotExistAnymore","S3Resume" +}; + +/* This function has to match with enumeration of XXXX defined + * inside heapManager.h header file. + */ +const char *heap_status_name(UINT8 HeapStatus) +{ + if ((HeapStatus < HEAP_DO_NOT_EXIST_YET) || (HeapStatus > HEAP_S3_RESUME)) + return undefined; + + int index = HeapStatus - HEAP_DO_NOT_EXIST_YET; + return HeapStatusStr[index]; +} diff --git a/src/vendorcode/amd/pi/Lib/debug_util.h b/src/vendorcode/amd/pi/Lib/debug_util.h new file mode 100644 index 0000000000..a8d9a33c50 --- /dev/null +++ b/src/vendorcode/amd/pi/Lib/debug_util.h @@ -0,0 +1,8 @@ +#ifndef __AGESA_DEBUG_UTIL_H__ +#define __AGESA_DEBUG_UTIL_H__ + +#include "AMD.h" + +const char *heap_status_name(UINT8 HeapStatus); + +#endif |