From 58d98ba82db1bea008c7c02c44b7b626b2455a35 Mon Sep 17 00:00:00 2001 From: Govindraj Raja Date: Tue, 21 Jan 2025 12:13:20 -0600 Subject: [PATCH] chore(cpus): fix incorrect header macro - errata.h is using incorrect header macro ERRATA_REPORT_H fix this. - Group errata function utilities. Change-Id: I6a4a8ec6546adb41e24d8885cb445fa8be830148 Signed-off-by: Govindraj Raja --- include/lib/cpus/errata.h | 41 +++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/include/lib/cpus/errata.h b/include/lib/cpus/errata.h index a2f2fc641..18ddc836d 100644 --- a/include/lib/cpus/errata.h +++ b/include/lib/cpus/errata.h @@ -4,12 +4,11 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#ifndef ERRATA_REPORT_H -#define ERRATA_REPORT_H +#ifndef ERRATA_H +#define ERRATA_H #include - #define ERRATUM_WA_FUNC_SIZE CPU_WORD_SIZE #define ERRATUM_CHECK_FUNC_SIZE CPU_WORD_SIZE #define ERRATUM_ID_SIZE 4 @@ -35,21 +34,6 @@ void print_errata_status(void); -#if ERRATA_A75_764081 -bool errata_a75_764081_applies(void); -#else -static inline bool errata_a75_764081_applies(void) -{ - return false; -} -#endif - -#if ERRATA_A520_2938996 || ERRATA_X4_2726228 -unsigned int check_if_affected_core(void); -#endif - -int check_wa_cve_2024_7881(void); - /* * NOTE that this structure will be different on AArch32 and AArch64. The * uintptr_t will reflect the change and the alignment will be correct in both. @@ -68,6 +52,25 @@ struct erratum_entry { CASSERT(sizeof(struct erratum_entry) == ERRATUM_ENTRY_SIZE, assert_erratum_entry_asm_c_different_sizes); + +/* + * Runtime errata helpers. + */ +#if ERRATA_A75_764081 +bool errata_a75_764081_applies(void); +#else +static inline bool errata_a75_764081_applies(void) +{ + return false; +} +#endif + +#if ERRATA_A520_2938996 || ERRATA_X4_2726228 +unsigned int check_if_affected_core(void); +#endif + +int check_wa_cve_2024_7881(void); + #else /* @@ -96,4 +99,4 @@ CASSERT(sizeof(struct erratum_entry) == ERRATUM_ENTRY_SIZE, /* Macro to get CPU revision code for checking errata version compatibility. */ #define CPU_REV(r, p) ((r << 4) | p) -#endif /* ERRATA_REPORT_H */ +#endif /* ERRATA_H */