summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorNico Huber <nico.h@gmx.de>2018-06-01 21:57:54 +0200
committerPatrick Georgi <pgeorgi@google.com>2018-06-04 08:22:45 +0000
commitca74f8fe0e4fddb84c1ef411783d5c16bca0adeb (patch)
treeef1a09ffd8833b3c14fcc407e0849ccd296a31c2 /src/include
parent6ea6775fa3eaa78b5322833940b9ba32d784556b (diff)
cpu/x86/mtrr.h: Clean up some guards
Move #includes to the top and remove unnecessary guards. Hopefully this prevents future surprises. Change-Id: Id4571c46a0c05a080b2b1cfec64b4eda07d793bb Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/26761 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/cpu/x86/mtrr.h24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/include/cpu/x86/mtrr.h b/src/include/cpu/x86/mtrr.h
index dde9a2888b..f52a77b1a7 100644
--- a/src/include/cpu/x86/mtrr.h
+++ b/src/include/cpu/x86/mtrr.h
@@ -2,6 +2,10 @@
#define CPU_X86_MTRR_H
#include <commonlib/helpers.h>
+#ifndef __ASSEMBLER__
+#include <cpu/x86/msr.h>
+#include <arch/cpu.h>
+#endif
/* These are the region types */
#define MTRR_TYPE_UNCACHEABLE 0
@@ -95,6 +99,13 @@ void set_var_mtrr(unsigned int reg, unsigned int base, unsigned int size,
unsigned int type);
int get_free_var_mtrr(void);
+/*
+ * Set the MTRRs using the data on the stack from setup_stack_and_mtrrs.
+ * Return a new top_of_stack value which removes the setup_stack_and_mtrrs data.
+ */
+asmlinkage void *soc_set_mtrrs(void *top_of_stack);
+asmlinkage void soc_enable_mtrrs(void);
+
/* fms: find most significant bit set, stolen from Linux Kernel Source. */
static inline unsigned int fms(unsigned int x)
{
@@ -172,17 +183,4 @@ static inline unsigned int fls(unsigned int x)
#define CACHE_ROM_BASE _FROM_4G_TOP(CACHE_ROM_SIZE)
-#if (IS_ENABLED(CONFIG_SOC_SETS_MSRS) && !defined(__ASSEMBLER__) \
- && !defined(__ROMCC__))
-#include <cpu/x86/msr.h>
-#include <arch/cpu.h>
-
-/*
- * Set the MTRRs using the data on the stack from setup_stack_and_mtrrs.
- * Return a new top_of_stack value which removes the setup_stack_and_mtrrs data.
- */
-asmlinkage void *soc_set_mtrrs(void *top_of_stack);
-asmlinkage void soc_enable_mtrrs(void);
-#endif /* CONFIG_SOC_SETS_MSRS ... */
-
#endif /* CPU_X86_MTRR_H */