[coreboot-gerrit] New patch to review for coreboot: cc1ba28 x86: simplify early_variables.h header

Aaron Durbin (adurbin@google.com) gerrit at coreboot.org
Mon Mar 9 21:43:54 CET 2015


Aaron Durbin (adurbin at google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/8634

-gerrit

commit cc1ba28193b0de504cbf22c762d851dbaefbc122
Author: Aaron Durbin <adurbin at chromium.org>
Date:   Mon Mar 9 15:41:16 2015 -0500

    x86: simplify early_variables.h header
    
    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 <adurbin at chromium.org>
---
 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 5394af3..c6afceb 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\", at 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
 



More information about the coreboot-gerrit mailing list