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>
This commit is contained in:
committed by
Patrick Georgi
parent
35f9507b08
commit
c6918f99d7
@ -30,6 +30,7 @@
|
||||
romstage-y += agesa-entry.c
|
||||
ramstage-y += agesa-entry.c
|
||||
|
||||
libagesa-y += debug_util.c
|
||||
libagesa-y += amdlib.c
|
||||
|
||||
# Do not optimise performance-critical low-level IO for size with -Os,
|
||||
|
24
src/vendorcode/amd/agesa/common/debug_util.c
Normal file
24
src/vendorcode/amd/agesa/common/debug_util.c
Normal file
@ -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];
|
||||
}
|
8
src/vendorcode/amd/agesa/common/debug_util.h
Normal file
8
src/vendorcode/amd/agesa/common/debug_util.h
Normal file
@ -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
|
@ -46,7 +46,6 @@ CFLAGS_x86_64 += -march=k8-sse3 -mtune=k8-sse3 -fno-zero-initialized-in-bss -fno
|
||||
# These are invalid, coreboot proper should not require
|
||||
# use of AGESA internal header files.
|
||||
CPPFLAGS_x86_ANY =
|
||||
CPPFLAGS_x86_ANY += -I$(AGESA_ROOT)/Proc/CPU # heapManager.h
|
||||
|
||||
CPPFLAGS_x86_32 += $(AGESA_INC) $(CPPFLAGS_x86_ANY)
|
||||
CPPFLAGS_x86_64 += $(AGESA_INC) $(CPPFLAGS_x86_ANY)
|
||||
|
@ -46,8 +46,6 @@ CFLAGS_x86_64 += -march=k8-sse3 -mtune=k8-sse3 -fno-zero-initialized-in-bss -fno
|
||||
# These are invalid, coreboot proper should not require
|
||||
# use of AGESA internal header files.
|
||||
CPPFLAGS_x86_ANY =
|
||||
CPPFLAGS_x86_ANY += -I$(AGESA_ROOT)/Proc/CPU # heapManager.h
|
||||
CPPFLAGS_x86_ANY += -I$(AGESA_ROOT)/Proc/CPU/Family
|
||||
|
||||
CPPFLAGS_x86_32 += $(AGESA_INC) $(CPPFLAGS_x86_ANY)
|
||||
CPPFLAGS_x86_64 += $(AGESA_INC) $(CPPFLAGS_x86_ANY)
|
||||
|
@ -46,8 +46,6 @@ CFLAGS_x86_64 += -march=k8-sse3 -mtune=k8-sse3 -fno-zero-initialized-in-bss -fno
|
||||
# These are invalid, coreboot proper should not require
|
||||
# use of AGESA internal header files.
|
||||
CPPFLAGS_x86_ANY =
|
||||
CPPFLAGS_x86_ANY += -I$(AGESA_ROOT)/Proc/CPU # heapManager.h
|
||||
CPPFLAGS_x86_ANY += -I$(AGESA_ROOT)/Proc/CPU/Family
|
||||
|
||||
CPPFLAGS_x86_ANY += -I$(AGESA_ROOT)/Proc/Fch # FchPlatform.h
|
||||
CPPFLAGS_x86_ANY += -I$(AGESA_ROOT)/Proc/Fch/Common # FchCommonCfg.h
|
||||
|
@ -46,8 +46,6 @@ CFLAGS_x86_64 += -march=k8-sse3 -mtune=k8-sse3 -fno-zero-initialized-in-bss -fno
|
||||
# These are invalid, coreboot proper should not require
|
||||
# use of AGESA internal header files.
|
||||
CPPFLAGS_x86_ANY =
|
||||
CPPFLAGS_x86_ANY += -I$(AGESA_ROOT)/Proc/CPU # heapManager.h
|
||||
CPPFLAGS_x86_ANY += -I$(AGESA_ROOT)/Proc/CPU/Family
|
||||
|
||||
CPPFLAGS_x86_ANY += -I$(AGESA_ROOT)/Proc/Fch # FchPlatform.h
|
||||
CPPFLAGS_x86_ANY += -I$(AGESA_ROOT)/Proc/Fch/Common # FchCommonCfg.h
|
||||
|
24
src/vendorcode/amd/pi/Lib/debug_util.c
Normal file
24
src/vendorcode/amd/pi/Lib/debug_util.c
Normal file
@ -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];
|
||||
}
|
8
src/vendorcode/amd/pi/Lib/debug_util.h
Normal file
8
src/vendorcode/amd/pi/Lib/debug_util.h
Normal file
@ -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
|
Reference in New Issue
Block a user