From 1a7da5c3ee4e2492dd021cefdcc72ab17c85f164 Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Mon, 9 Mar 2015 15:41:16 -0500 Subject: [PATCH] x86: simplify early_variables.h header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The CAR macros and the associated functions are only employed under the following conditions: - chipsets which have CAR - compilation during romstage Therefore clean up the build-time conditionals to use those 2 constructs. Change-Id: I2b923feeb68f2b964c5ac57e11391313d9c8ffc5 Signed-off-by: Aaron Durbin Reviewed-on: http://review.coreboot.org/8634 Tested-by: build bot (Jenkins) Reviewed-by: Kyösti Mälkki Reviewed-by: Alexandru Gagniuc --- src/arch/x86/include/arch/early_variables.h | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/arch/x86/include/arch/early_variables.h b/src/arch/x86/include/arch/early_variables.h index 5394af342a..c6afceb700 100644 --- a/src/arch/x86/include/arch/early_variables.h +++ b/src/arch/x86/include/arch/early_variables.h @@ -20,7 +20,7 @@ #ifndef ARCH_EARLY_VARIABLES_H #define ARCH_EARLY_VARIABLES_H -#ifdef __PRE_RAM__ +#if defined(__PRE_RAM__) && IS_ENABLED(CONFIG_CACHE_AS_RAM) asm(".section .car.global_data,\"w\",@nobits"); asm(".previous"); #ifdef __clang__ @@ -28,11 +28,7 @@ asm(".previous"); #else #define CAR_GLOBAL __attribute__((used,section(".car.global_data#"))) #endif /* __clang__ */ -#else -#define CAR_GLOBAL -#endif -#if defined(__PRE_RAM__) #define CAR_MIGRATE_ATTR __attribute__ ((used,section (".car.migrate"))) /* Call migrate_fn_() when CAR globals are migrated. */ @@ -54,18 +50,16 @@ void *car_sync_var_ptr(void *var); #define car_set_var(var, val) \ do { car_get_var(var) = (val); } while(0) +/* Migrate the CAR variables to memory. */ +void car_migrate_variables(void); + #else +#define CAR_GLOBAL #define CAR_MIGRATE(migrate_fn_) static inline void *car_get_var_ptr(void *var) { return var; } #define car_get_var(var) (var) #define car_sync_var(var) (var) #define car_set_var(var, val) do { (var) = (val); } while (0) -#endif - -#if defined(__PRE_RAM__) && IS_ENABLED(CONFIG_CACHE_AS_RAM) -/* Migrate the CAR variables to memory. */ -void car_migrate_variables(void); -#else static inline void car_migrate_variables(void) { } #endif