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>
This commit is contained in:
parent
6ea6775fa3
commit
ca74f8fe0e
|
@ -2,6 +2,10 @@
|
||||||
#define CPU_X86_MTRR_H
|
#define CPU_X86_MTRR_H
|
||||||
|
|
||||||
#include <commonlib/helpers.h>
|
#include <commonlib/helpers.h>
|
||||||
|
#ifndef __ASSEMBLER__
|
||||||
|
#include <cpu/x86/msr.h>
|
||||||
|
#include <arch/cpu.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/* These are the region types */
|
/* These are the region types */
|
||||||
#define MTRR_TYPE_UNCACHEABLE 0
|
#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);
|
unsigned int type);
|
||||||
int get_free_var_mtrr(void);
|
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. */
|
/* fms: find most significant bit set, stolen from Linux Kernel Source. */
|
||||||
static inline unsigned int fms(unsigned int x)
|
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)
|
#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 */
|
#endif /* CPU_X86_MTRR_H */
|
||||||
|
|
Loading…
Reference in New Issue