diff options
author | Aaron Durbin <adurbin@chromium.org> | 2016-03-07 16:05:36 -0600 |
---|---|---|
committer | Martin Roth <martinroth@google.com> | 2016-03-08 16:46:16 +0100 |
commit | e63be8971bac14c50b97602aedcc2a85b7e5f540 (patch) | |
tree | 70211934fc59868accbcb91370840691248edba5 /src/include/cpu | |
parent | e99e2b65cfc594ecfa56cb12660f731a6f88a57a (diff) |
cpu/x86/mtrr: add helper function to detect variable MTRRs
The current MTRR API doesn't allow one to detect variable MTRRs
along with handling fixed MTRRs in one function call. Therefore,
add x86_setup_mtrrs_with_detect() to perform the same actions
as x86_setup_mtrrs() but always do the dynamic detection.
Change-Id: I443909691afa28ce11882e2beab12e836e5bcb3d
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/13935
Reviewed-by: Furquan Shaikh <furquan@google.com>
Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/include/cpu')
-rw-r--r-- | src/include/cpu/x86/mtrr.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/include/cpu/x86/mtrr.h b/src/include/cpu/x86/mtrr.h index 8fd4261081..d15873595e 100644 --- a/src/include/cpu/x86/mtrr.h +++ b/src/include/cpu/x86/mtrr.h @@ -56,14 +56,20 @@ * of the nature of the global MTRR enable flag. Therefore, all direct * or indirect callers of enable_fixed_mtrr() should ensure that the * variable MTRR MSRs do not contain bad ranges. + * + * Note that this function sets up MTRRs for addresses above 4GiB. */ void x86_setup_mtrrs(void); /* + * x86_setup_mtrrs_with_detect() does the same thing as x86_setup_mtrrs(), but + * it always dynamically detects the number of variable MTRRs available. + */ +void x86_setup_mtrrs_with_detect(void); +/* * x86_setup_var_mtrrs() parameters: * address_bits - number of physical address bits supported by cpu - * above4gb - 2 means dynamically detect number of variable MTRRs available. - * non-zero means handle memory ranges above 4GiB. - * 0 means ignore memory ranges above 4GiB + * above4gb - if 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 enable_fixed_mtrr(void); |