coreboot/src/include/cpu/x86
Subrata Banik 5f941893ef cpu/x86/mtrr: Introduce mtrrlib with common MTRR helper functions
This change refactors MTRR handling by consolidating helper functions
from `earlymtrr.c` and `mtrr.c` into a new MTRR library (`mtrrlib`).
This approach improves code modularity and reusability, making these
utilities consistently available across different coreboot boot phases.

The following functions are now part of `mtrrlib`:

- `get_free_var_mtrr`: Retrieves the index of the first available
  variable MTRR.
- `set_var_mtrr`: Configures the variable MTRR, specified by an `index`,
  for a memory region defined by `base`, `size`, and `type`.
- `clear_var_mtrr`: Disables the variable MTRR at a given index.
- `acquire_and_configure_mtrr`: Acquires a free variable MTRR, configures
   it with the given `base`, `size`, and `type`.

BUG=b:409718202
TEST=Built and booted google/fatcat successfully.

Change-Id: Iba332b7088221fd930e973fad9410833bff184b9
Signed-off-by: Subrata Banik <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/87539
Reviewed-by: Jérémy Compostella <jeremy.compostella@intel.com>
Reviewed-by: Shuo Liu <shuo.liu@intel.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nick Vaccaro <nvaccaro@google.com>
2025-05-08 16:51:17 +00:00
..
bist.h
cache.h
cr.h
gdt.h arch/x86: Unify GDT entries 2025-05-08 12:29:24 +00:00
lapic.h cpu/x86/lapic: Always have LAPIC enabled 2024-08-11 17:06:41 +00:00
lapic_def.h cpu/x86: Replace LAPIC_DM_* with LAPIC_MT_* 2025-04-05 14:38:22 +00:00
legacy_save_state.h
mp.h
msr.h include/cpu/x86: Add Misc Enable and Thermal Interrupt Register Macro 2024-09-04 04:38:43 +00:00
msr_access.h
mtrr.h cpu/x86/mtrr: Introduce mtrrlib with common MTRR helper functions 2025-05-08 16:51:17 +00:00
name.h
pae.h cpu/x86/pae/pgtbl.c: extract reusable code from memset_pae() 2024-05-29 13:04:30 +00:00
post_code.h
save_state.h
smm.h region: Introduce region_create() functions 2024-08-11 17:07:32 +00:00
topology.h cpu/x86/topology: Simplify CPU topology initialization 2024-12-17 17:24:15 +00:00
tsc.h