AGESA f15tn: Drop `IDSOPT_ASSERT_ENABLED`
The `ASSERT` macro is already defined in `src/include/assert.h`, and AGESA's definition is never used. On Asus A88XM-E, toggling the value of the `IDSOPT_ASSERT_ENABLED` macro does not change the resulting binary when using reproducible builds. Attempting to use AGESA's definition of the `ASSERT` macro results in build errors: In file included from src/vendorcode/amd/agesa/f15tn/Proc/CPU/Feature/cpuDmi.c:56: src/vendorcode/amd/agesa/f15tn/Proc/CPU/Feature/cpuDmi.c: In function 'GetType4Type7Info': src/vendorcode/amd/agesa/f15tn/Include/Ids.h:371:33: error: statement with no effect [-Werror=unused-value] #define ASSERT(conditional) ((conditional) ? 0 : IdsAssert (STOP_CODE)); Given that coreboot's definition of `ASSERT` is more useful, drop AGESA's broken definition and the useless `IDSOPT_ASSERT_ENABLED` macro. Also remove the `IdsAssert` function, as it is no longer used anywhere. Tested with BUILD_TIMELESS=1, Asus A88XM-E remains identical. Change-Id: Ia4e5dbfd3d2e5cec979b8b16fbc11d1ca8a0661e Signed-off-by: Angel Pons <th3fanbus@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/53983 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Michał Żygowski <michal.zygowski@3mdeb.com>
This commit is contained in:
parent
2dc73aa4a7
commit
90afa3c28c
|
@ -23,7 +23,6 @@
|
|||
* IDSOPT_CONTROL_ENABLED
|
||||
* IDSOPT_TRACING_ENABLED
|
||||
* IDSOPT_PERF_ANALYSIS
|
||||
* IDSOPT_ASSERT_ENABLED
|
||||
* IDSOPT_CAR_CORRUPTION_CHECK_ENABLED
|
||||
*
|
||||
**/
|
||||
|
@ -33,6 +32,5 @@
|
|||
//#define IDSOPT_TRACING_ENABLED TRUE
|
||||
#define IDSOPT_TRACING_CONSOLE_SERIALPORT TRUE
|
||||
//#define IDSOPT_PERF_ANALYSIS TRUE
|
||||
#define IDSOPT_ASSERT_ENABLED TRUE
|
||||
|
||||
#endif
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
* IDSOPT_CONTROL_ENABLED
|
||||
* IDSOPT_TRACING_ENABLED
|
||||
* IDSOPT_PERF_ANALYSIS
|
||||
* IDSOPT_ASSERT_ENABLED
|
||||
* IDSOPT_CAR_CORRUPTION_CHECK_ENABLED
|
||||
*
|
||||
**/
|
||||
|
@ -33,6 +32,5 @@
|
|||
//#define IDSOPT_TRACING_ENABLED TRUE
|
||||
#define IDSOPT_TRACING_CONSOLE_SERIALPORT TRUE
|
||||
//#define IDSOPT_PERF_ANALYSIS TRUE
|
||||
#define IDSOPT_ASSERT_ENABLED TRUE
|
||||
|
||||
#endif
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
* IDSOPT_CONTROL_ENABLED
|
||||
* IDSOPT_TRACING_ENABLED
|
||||
* IDSOPT_PERF_ANALYSIS
|
||||
* IDSOPT_ASSERT_ENABLED
|
||||
* IDSOPT_CAR_CORRUPTION_CHECK_ENABLED
|
||||
**/
|
||||
|
||||
|
@ -30,6 +29,5 @@
|
|||
//#define IDSOPT_TRACING_ENABLED TRUE
|
||||
#define IDSOPT_TRACING_CONSOLE_SERIALPORT TRUE
|
||||
//#define IDSOPT_PERF_ANALYSIS TRUE
|
||||
#define IDSOPT_ASSERT_ENABLED TRUE
|
||||
|
||||
#endif
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
* IDSOPT_CONTROL_ENABLED
|
||||
* IDSOPT_TRACING_ENABLED
|
||||
* IDSOPT_PERF_ANALYSIS
|
||||
* IDSOPT_ASSERT_ENABLED
|
||||
* IDSOPT_CAR_CORRUPTION_CHECK_ENABLED
|
||||
*
|
||||
**/
|
||||
|
@ -33,6 +32,5 @@
|
|||
//#define IDSOPT_TRACING_ENABLED TRUE
|
||||
#define IDSOPT_TRACING_CONSOLE_SERIALPORT TRUE
|
||||
//#define IDSOPT_PERF_ANALYSIS TRUE
|
||||
#define IDSOPT_ASSERT_ENABLED TRUE
|
||||
|
||||
#endif
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
* IDSOPT_CONTROL_ENABLED
|
||||
* IDSOPT_TRACING_ENABLED
|
||||
* IDSOPT_PERF_ANALYSIS
|
||||
* IDSOPT_ASSERT_ENABLED
|
||||
* IDSOPT_CAR_CORRUPTION_CHECK_ENABLED
|
||||
*
|
||||
**/
|
||||
|
@ -33,6 +32,5 @@
|
|||
//#define IDSOPT_TRACING_ENABLED TRUE
|
||||
#define IDSOPT_TRACING_CONSOLE_SERIALPORT TRUE
|
||||
//#define IDSOPT_PERF_ANALYSIS TRUE
|
||||
#define IDSOPT_ASSERT_ENABLED TRUE
|
||||
|
||||
#endif
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
* IDSOPT_CONTROL_ENABLED
|
||||
* IDSOPT_TRACING_ENABLED
|
||||
* IDSOPT_PERF_ANALYSIS
|
||||
* IDSOPT_ASSERT_ENABLED
|
||||
* IDSOPT_CAR_CORRUPTION_CHECK_ENABLED
|
||||
*
|
||||
**/
|
||||
|
@ -33,6 +32,5 @@
|
|||
//#define IDSOPT_TRACING_ENABLED TRUE
|
||||
#define IDSOPT_TRACING_CONSOLE_SERIALPORT TRUE
|
||||
//#define IDSOPT_PERF_ANALYSIS TRUE
|
||||
#define IDSOPT_ASSERT_ENABLED TRUE
|
||||
|
||||
#endif
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
* IDSOPT_CONTROL_ENABLED
|
||||
* IDSOPT_TRACING_ENABLED
|
||||
* IDSOPT_PERF_ANALYSIS
|
||||
* IDSOPT_ASSERT_ENABLED
|
||||
* IDSOPT_CAR_CORRUPTION_CHECK_ENABLED
|
||||
*
|
||||
**/
|
||||
|
@ -33,6 +32,5 @@
|
|||
//#define IDSOPT_TRACING_ENABLED TRUE
|
||||
#define IDSOPT_TRACING_CONSOLE_SERIALPORT TRUE
|
||||
//#define IDSOPT_PERF_ANALYSIS TRUE
|
||||
#define IDSOPT_ASSERT_ENABLED TRUE
|
||||
|
||||
#endif
|
||||
|
|
|
@ -223,10 +223,6 @@ typedef enum { //vv- for debug reference only
|
|||
#define IDSOPT_HEAP_CHECKING FALSE
|
||||
#endif
|
||||
|
||||
#ifndef IDSOPT_ASSERT_ENABLED
|
||||
#define IDSOPT_ASSERT_ENABLED FALSE
|
||||
#endif
|
||||
|
||||
#ifndef IDSOPT_ERROR_TRAP_ENABLED
|
||||
#define IDSOPT_ERROR_TRAP_ENABLED FALSE
|
||||
#endif
|
||||
|
@ -264,7 +260,6 @@ typedef enum { //vv- for debug reference only
|
|||
#undef IDSOPT_TRACING_ENABLED
|
||||
#undef IDSOPT_PERF_ANALYSIS
|
||||
#undef IDSOPT_HEAP_CHECKING
|
||||
#undef IDSOPT_ASSERT_ENABLED
|
||||
#undef IDSOPT_ERROR_TRAP_ENABLED
|
||||
#undef IDSOPT_CAR_CORRUPTION_CHECK_ENABLED
|
||||
#undef IDSOPT_DEBUG_CODE_ENABLED
|
||||
|
@ -277,7 +272,6 @@ typedef enum { //vv- for debug reference only
|
|||
#define IDSOPT_TRACING_ENABLED FALSE
|
||||
#define IDSOPT_PERF_ANALYSIS FALSE
|
||||
#define IDSOPT_HEAP_CHECKING FALSE
|
||||
#define IDSOPT_ASSERT_ENABLED FALSE
|
||||
#define IDSOPT_ERROR_TRAP_ENABLED FALSE
|
||||
#define IDSOPT_CAR_CORRUPTION_CHECK_ENABLED FALSE
|
||||
#define IDSOPT_DEBUG_CODE_ENABLED FALSE
|
||||
|
@ -345,34 +339,6 @@ typedef enum { //vv- for debug reference only
|
|||
#define STOP_HERE STOP_HERE_Needs_To_Be_Removed //"WARNING: Debug code needs to be removed for production builds."
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def ASSERT
|
||||
* Test an assertion that the given statement is True.
|
||||
*
|
||||
* The statement is evaluated to a boolean value. If the statement is True,
|
||||
* then no action is taken (no error). If the statement is False, a error stop
|
||||
* is generated to halt the program. Used for testing for fatal errors that
|
||||
* must be resolved before production. This is used to do parameter checks,
|
||||
* bounds checking, range checks and 'sanity' checks.
|
||||
*
|
||||
* @param[in] conditional Assert that evaluating this conditional results in TRUE.
|
||||
*
|
||||
**/
|
||||
#ifndef ASSERT
|
||||
#if IDSOPT_ASSERT_ENABLED == TRUE
|
||||
#ifdef STOP_CODE
|
||||
#undef STOP_CODE
|
||||
#endif
|
||||
#define STOP_CODE (((UINT32)FILECODE)*0x10000ul + \
|
||||
((__LINE__) % 10) + (((__LINE__ / 10) % 10)*0x10) + \
|
||||
(((__LINE__ / 100) % 10)*0x100) + (((__LINE__ / 1000) % 10)*0x1000))
|
||||
|
||||
#define ASSERT(conditional) ((conditional) ? 0 : IdsAssert (STOP_CODE));
|
||||
#else
|
||||
#define ASSERT(conditional)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if IDSOPT_CAR_CORRUPTION_CHECK_ENABLED == TRUE
|
||||
#undef IDSOPT_ERROR_TRAP_ENABLED
|
||||
#define IDSOPT_ERROR_TRAP_ENABLED TRUE
|
||||
|
@ -1250,23 +1216,6 @@ IdsAgesaTestPoint (
|
|||
IN OUT AMD_CONFIG_PARAMS *StdHeader
|
||||
);
|
||||
|
||||
/**
|
||||
* IDS Backend Function for ASSERT
|
||||
*
|
||||
* Halt execution with stop code display. Stop Code is displayed on port 80, with rotation so that
|
||||
* it is visible on 8, 16, or 32 bit display. The stop code is alternated with 0xDEAD on the display,
|
||||
* to help distinguish the stop code from a post code loop.
|
||||
* Additional features may be available if using simulation.
|
||||
*
|
||||
* @param[in] FileCode File code(define in FILECODE.h) mix with assert Line num.
|
||||
*
|
||||
* @retval TRUE No error
|
||||
**/
|
||||
BOOLEAN
|
||||
IdsAssert (
|
||||
IN UINT32 FileCode
|
||||
);
|
||||
|
||||
/**
|
||||
* The engine code for ASSERT MACRO
|
||||
*
|
||||
|
|
|
@ -90,7 +90,6 @@
|
|||
* @code
|
||||
* #define IDSOPT_IDS_ENABLED TRUE
|
||||
* #define IDSOPT_ERROR_TRAP_ENABLED TRUE
|
||||
* #define IDSOPT_ASSERT_ENABLED TRUE
|
||||
* @endcode
|
||||
* <li> Edit and modify the option selections in those two files to meet the needs of the specific platform.
|
||||
* <li> Set the environment variable AGESA_ROOT to the root folder of the AGESA code.
|
||||
|
|
|
@ -77,34 +77,6 @@ IdsAgesaTestPoint (
|
|||
LibAmdIoWrite (AccessWidth8, IDS_DEBUG_PORT, &TestPoint, StdHeader);
|
||||
}
|
||||
|
||||
/**
|
||||
* IDS Backend Function for ASSERT
|
||||
*
|
||||
* Halt execution with stop code display. Stop Code is displayed on port 80, with rotation so that
|
||||
* it is visible on 8, 16, or 32 bit display. The stop code is alternated with 0xDEAD on the display,
|
||||
* to help distinguish the stop code from a post code loop.
|
||||
* Additional features may be available if using simulation.
|
||||
*
|
||||
* @param[in] FileCode File code(define in FILECODE.h) mix with assert Line num.
|
||||
*
|
||||
* @retval TRUE No error
|
||||
**/
|
||||
BOOLEAN
|
||||
IdsAssert (
|
||||
IN UINT32 FileCode
|
||||
)
|
||||
{
|
||||
UINT32 file;
|
||||
UINT32 line;
|
||||
|
||||
file = (FileCode >> 16);
|
||||
line = (FileCode & 0xFFFF);
|
||||
IDS_HDT_CONSOLE (MAIN_FLOW, "ASSERT on File[%x] Line[%x]\n", (UINTN) file, (UINTN) line);
|
||||
IDS_HDT_CONSOLE_FLUSH_BUFFER (NULL);
|
||||
IDS_HDT_CONSOLE_ASSERT (FileCode);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* IDS Backend Function for Memory timeout control
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue