aboutsummaryrefslogtreecommitdiff
path: root/src/vendorcode/amd/agesa/common/debug_util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vendorcode/amd/agesa/common/debug_util.c')
-rw-r--r--src/vendorcode/amd/agesa/common/debug_util.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/vendorcode/amd/agesa/common/debug_util.c b/src/vendorcode/amd/agesa/common/debug_util.c
new file mode 100644
index 0000000000..29d0841904
--- /dev/null
+++ b/src/vendorcode/amd/agesa/common/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];
+}