From ca74f8fe0e4fddb84c1ef411783d5c16bca0adeb Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Fri, 1 Jun 2018 21:57:54 +0200 Subject: 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 Reviewed-on: https://review.coreboot.org/26761 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin --- src/include/cpu/x86/mtrr.h | 24 +++++++++++------------- 1 file 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 +#ifndef __ASSEMBLER__ +#include +#include +#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 -#include - -/* - * 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 */ -- cgit v1.2.3