Attention is currently required from: Jérémy Compostella, Shuo Liu.
Matt DeVillier has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/86942?usp=email )
Change subject: cpu/x86/mtrr: Make 'above4gb' variable a bool ......................................................................
cpu/x86/mtrr: Make 'above4gb' variable a bool
No need for this to be a signed or unsigned int.
TEST=tested with rest of patch train.
Change-Id: I409c04b928211e0e89eec324fdf3fa3997c73576 Signed-off-by: Matt DeVillier matt.devillier@gmail.com --- M src/cpu/x86/mtrr/mtrr.c M src/include/cpu/x86/mtrr.h 2 files changed, 11 insertions(+), 11 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/42/86942/1
diff --git a/src/cpu/x86/mtrr/mtrr.c b/src/cpu/x86/mtrr/mtrr.c index 64ab829..08c7afb 100644 --- a/src/cpu/x86/mtrr/mtrr.c +++ b/src/cpu/x86/mtrr/mtrr.c @@ -361,7 +361,7 @@
struct var_mtrr_state { struct memranges *addr_space; - int above4gb; + bool above4gb; int address_bits; int prepare_msrs; int mtrr_index; @@ -607,7 +607,7 @@ }
static void __calc_var_mtrrs(struct memranges *addr_space, - int above4gb, int address_bits, + bool above4gb, int address_bits, int *num_def_wb_mtrrs, int *num_def_uc_mtrrs) { int wb_deftype_count; @@ -661,7 +661,7 @@ }
static int calc_var_mtrrs(struct memranges *addr_space, - int above4gb, int address_bits) + bool above4gb, int address_bits) { int wb_deftype_count = 0; int uc_deftype_count = 0; @@ -692,7 +692,7 @@ }
static void prepare_var_mtrrs(struct memranges *addr_space, int def_type, - int above4gb, int address_bits, + bool above4gb, int address_bits, struct var_mtrr_solution *sol) { struct range_entry *r; @@ -742,7 +742,7 @@ return 0; }
-void x86_setup_var_mtrrs(unsigned int address_bits, unsigned int above4gb) +void x86_setup_var_mtrrs(unsigned int address_bits, bool above4gb) { static struct var_mtrr_solution *sol = NULL; struct memranges *addr_space; @@ -752,15 +752,15 @@ if (sol == NULL) { sol = &mtrr_global_solution; sol->mtrr_default_type = - calc_var_mtrrs(addr_space, !!above4gb, address_bits); + calc_var_mtrrs(addr_space, above4gb, address_bits); prepare_var_mtrrs(addr_space, sol->mtrr_default_type, - !!above4gb, address_bits, sol); + above4gb, address_bits, sol); }
commit_var_mtrrs(sol); }
-static void _x86_setup_mtrrs(unsigned int above4gb) +static void _x86_setup_mtrrs(bool above4gb) { int address_size;
@@ -827,7 +827,7 @@ const struct memranges *orig; struct var_mtrr_solution sol; struct memranges addr_space; - const int above4gb = 1; /* Cover above 4GiB by default. */ + const bool above4gb = 1; /* Cover above 4GiB by default. */ int address_bits; static struct temp_range { uintptr_t begin; diff --git a/src/include/cpu/x86/mtrr.h b/src/include/cpu/x86/mtrr.h index 16efbb6..930edfd 100644 --- a/src/include/cpu/x86/mtrr.h +++ b/src/include/cpu/x86/mtrr.h @@ -103,10 +103,10 @@ /* * x86_setup_var_mtrrs() parameters: * address_bits - number of physical address bits supported by cpu - * above4gb - if set setup MTRRs for addresses above 4GiB else ignore + * above4gb - if true, set setup MTRRs for addresses above 4GiB else ignore * memory ranges above 4GiB */ -void x86_setup_var_mtrrs(unsigned int address_bits, unsigned int above4gb); +void x86_setup_var_mtrrs(unsigned int address_bits, bool above4gb); void enable_fixed_mtrr(void); /* Unhide Rd/WrDram bits and allow modification for AMD. */ void fixed_mtrrs_expose_amd_rwdram(void);