xref: /aosp_15_r20/external/coreboot/src/vendorcode/amd/pi/Lib/debug_util.c (revision b9411a12aaaa7e1e6a6fb7c5e057f44ee179a49c)
1 
2 #include <AGESA.h>
3 #include <AMD.h>
4 #include <heapManager.h>
5 
6 #include "debug_util.h"
7 
8 static const char undefined[] = "undefined";
9 
10 static const char *HeapStatusStr[] = {
11 	"DoNotExistYet", "LocalCache", "TempMem", "SystemMem", "DoNotExistAnymore","S3Resume"
12 };
13 
14 /* This function has to match with enumeration of XXXX defined
15  * inside heapManager.h header file.
16  */
heap_status_name(UINT8 HeapStatus)17 const char *heap_status_name(UINT8 HeapStatus)
18 {
19 	if ((HeapStatus < HEAP_DO_NOT_EXIST_YET) || (HeapStatus > HEAP_S3_RESUME))
20 		return undefined;
21 
22 	int index = HeapStatus - HEAP_DO_NOT_EXIST_YET;
23 	return HeapStatusStr[index];
24 }
25