cpu/x86: Add function to set `put_back_original_solution` variable
`put_back_original_solution` variable in mtrr.c is static, but there is a need to set put_back_original_solution outside of mtrr.c in order to let `remove_temp_solution` to drop any temporary MTRRs being set outside `mtrr_use_temp_range()`, for example: `set_var_mtrr()` function is used to set MTRRs for the ROM caching. BUG=b:225766934 TEST=Able to build and boot google/redrix. Change-Id: Ic6b5683b2aa7398a5e141f710394ab772e9775e7 Signed-off-by: Kane Chen <kane.chen@intel.corp-partner.google.com> Signed-off-by: Subrata Banik <subratabanik@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/63485 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
This commit is contained in:
parent
985faa873c
commit
00aaffaf47
|
@ -860,6 +860,11 @@ void x86_mtrr_check(void)
|
||||||
|
|
||||||
static bool put_back_original_solution;
|
static bool put_back_original_solution;
|
||||||
|
|
||||||
|
void need_restore_mtrr(void)
|
||||||
|
{
|
||||||
|
put_back_original_solution = true;
|
||||||
|
}
|
||||||
|
|
||||||
void mtrr_use_temp_range(uintptr_t begin, size_t size, int type)
|
void mtrr_use_temp_range(uintptr_t begin, size_t size, int type)
|
||||||
{
|
{
|
||||||
const struct range_entry *r;
|
const struct range_entry *r;
|
||||||
|
|
|
@ -96,6 +96,7 @@ void x86_setup_fixed_mtrrs(void);
|
||||||
/* Set up fixed MTRRs but do not enable them. */
|
/* Set up fixed MTRRs but do not enable them. */
|
||||||
void x86_setup_fixed_mtrrs_no_enable(void);
|
void x86_setup_fixed_mtrrs_no_enable(void);
|
||||||
void x86_mtrr_check(void);
|
void x86_mtrr_check(void);
|
||||||
|
void need_restore_mtrr(void);
|
||||||
|
|
||||||
/* Insert a temporary MTRR range for the duration of coreboot's runtime.
|
/* Insert a temporary MTRR range for the duration of coreboot's runtime.
|
||||||
* This function needs to be called after the first MTRR solution is derived. */
|
* This function needs to be called after the first MTRR solution is derived. */
|
||||||
|
|
Loading…
Reference in New Issue