summaryrefslogtreecommitdiff
path: root/src/arch/x86
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2019-11-20 22:50:33 +0100
committerPatrick Georgi <pgeorgi@google.com>2019-11-30 16:10:27 +0000
commit706251d91375241630a4e753512ebeefad56c2bc (patch)
tree44ce1f906e83c34158669bdf49ead9e619c1eedc /src/arch/x86
parent6ea3a13a17c0c9021fe871feada360ab55ceb6bf (diff)
downloadcoreboot-706251d91375241630a4e753512ebeefad56c2bc.tar.xz
arch/x86/cache.h: Use ENV_CACHE_AS_RAM macro
Change-Id: Ic7b088a04165bb24b9ebcebc1580a96ce0fdfcc8 Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/37063 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src/arch/x86')
-rw-r--r--src/arch/x86/include/arch/cache.h5
-rw-r--r--src/arch/x86/include/arch/early_variables.h8
2 files changed, 2 insertions, 11 deletions
diff --git a/src/arch/x86/include/arch/cache.h b/src/arch/x86/include/arch/cache.h
index c0d50e650d..36476fd0ab 100644
--- a/src/arch/x86/include/arch/cache.h
+++ b/src/arch/x86/include/arch/cache.h
@@ -31,13 +31,12 @@
#ifndef ARCH_CACHE_H
#define ARCH_CACHE_H
-#include <arch/early_variables.h>
#include <cpu/x86/cache.h>
/* Executing WBINVD when running out of CAR would not be good, prevent that. */
static inline void dcache_clean_invalidate_all(void)
{
- if (!car_active())
+ if (!ENV_CACHE_AS_RAM)
wbinvd();
}
static inline void dcache_clean_all(void)
@@ -47,7 +46,7 @@ static inline void dcache_clean_all(void)
}
static inline void dcache_invalidate_all(void)
{
- if (!car_active())
+ if (!ENV_CACHE_AS_RAM)
invd();
}
diff --git a/src/arch/x86/include/arch/early_variables.h b/src/arch/x86/include/arch/early_variables.h
index 7393cc94e0..0c4c37b7c9 100644
--- a/src/arch/x86/include/arch/early_variables.h
+++ b/src/arch/x86/include/arch/early_variables.h
@@ -40,9 +40,6 @@ asm(".previous");
/* Get the correct pointer for the CAR global variable. */
void *car_get_var_ptr(void *var);
-/* Return 1 when currently running with globals in Cache-as-RAM, 0 otherwise. */
-int car_active(void);
-
/* Get and set a primitive type global variable. */
#define car_get_var(var) \
(*(typeof(var) *)car_get_var_ptr(&(var)))
@@ -81,11 +78,6 @@ static inline void *car_get_var_ptr(void *var)
return var;
}
-static inline int car_active(void)
-{
- return ENV_CACHE_AS_RAM;
-}
-
#endif
#endif /* ARCH_EARLY_VARIABLES_H */