aboutsummaryrefslogtreecommitdiffstats
path: root/src/arch/x86
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2015-03-09 15:41:16 -0500
committerAaron Durbin <adurbin@google.com>2015-03-10 14:26:14 +0100
commit1a7da5c3ee4e2492dd021cefdcc72ab17c85f164 (patch)
treed73116f4cb5f8f59fd4bdbb84099d39f777264bc /src/arch/x86
parentdb9d169ddb1cda58d1d42f20c2d6c1b99e0200ed (diff)
downloadcoreboot-1a7da5c3ee4e2492dd021cefdcc72ab17c85f164.tar.gz
coreboot-1a7da5c3ee4e2492dd021cefdcc72ab17c85f164.tar.xz
coreboot-1a7da5c3ee4e2492dd021cefdcc72ab17c85f164.zip
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@chromium.org> Reviewed-on: http://review.coreboot.org/8634 Tested-by: build bot (Jenkins) Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Diffstat (limited to 'src/arch/x86')
-rw-r--r--src/arch/x86/include/arch/early_variables.h16
1 files 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 5394af342..c6afceb70 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