aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2023-09-19 17:59:03 +0200
committerFelix Held <felix-coreboot@felixheld.de>2023-09-20 18:17:45 +0000
commit45343719c1be8e557156c8636f4baef3215cd133 (patch)
treef540e91904d38d42f927a0572f920a1ace93833b
parent1663d188f3620a1c10ca5b4e9784d7dc225483f8 (diff)
cpu/x86/mtrr/debug: use msr_t parameter in display_mtrr_fixed_types
Now that no local union definitions are used any more, pass the msr data to display_mtrr_fixed_types as an msr_t type parameter instead of a uint64_t parameter. Also rename the parameter from msr to msr_data to be more specific that this parameter is the MSR contents and not the MSR number. Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Change-Id: Iafde64129acc4bf9f01816de21c7793edfc1a799 Reviewed-on: https://review.coreboot.org/c/coreboot/+/78005 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
-rw-r--r--src/cpu/x86/mtrr/debug.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/cpu/x86/mtrr/debug.c b/src/cpu/x86/mtrr/debug.c
index c74e71b0ac..0f20a32c1d 100644
--- a/src/cpu/x86/mtrr/debug.c
+++ b/src/cpu/x86/mtrr/debug.c
@@ -19,7 +19,7 @@ static const char *display_mtrr_type(uint32_t type)
}
}
-static void display_mtrr_fixed_types(uint64_t msr,
+static void display_mtrr_fixed_types(msr_t msr_data,
uint32_t starting_address, uint32_t memory_size)
{
uint32_t base_address;
@@ -28,13 +28,13 @@ static void display_mtrr_fixed_types(uint64_t msr,
uint32_t next_type;
uint32_t type;
- type = msr & MTRR_DEF_TYPE_MASK;
+ type = msr_data.raw & MTRR_DEF_TYPE_MASK;
base_address = starting_address;
next_address = base_address;
for (index = 0; index < 64; index += 8) {
next_address = starting_address + (memory_size *
((index >> 3) + 1));
- next_type = (msr >> index) & MTRR_DEF_TYPE_MASK;
+ next_type = (msr_data.raw >> index) & MTRR_DEF_TYPE_MASK;
if (next_type != type) {
printk(BIOS_DEBUG, " 0x%08x - 0x%08x: %s\n",
base_address, next_address - 1,
@@ -54,7 +54,7 @@ static void display_4k_mtrr(uint32_t msr_reg, uint32_t starting_address,
{
const msr_t msr = rdmsr(msr_reg);
printk(BIOS_DEBUG, "0x%016llx: %s\n", msr.raw, name);
- display_mtrr_fixed_types(msr.raw, starting_address, 0x1000);
+ display_mtrr_fixed_types(msr, starting_address, 0x1000);
}
static void display_16k_mtrr(uint32_t msr_reg, uint32_t starting_address,
@@ -62,14 +62,14 @@ static void display_16k_mtrr(uint32_t msr_reg, uint32_t starting_address,
{
const msr_t msr = rdmsr(msr_reg);
printk(BIOS_DEBUG, "0x%016llx: %s\n", msr.raw, name);
- display_mtrr_fixed_types(msr.raw, starting_address, 0x4000);
+ display_mtrr_fixed_types(msr, starting_address, 0x4000);
}
static void display_64k_mtrr(void)
{
const msr_t msr = rdmsr(MTRR_FIX_64K_00000);
printk(BIOS_DEBUG, "0x%016llx: IA32_MTRR_FIX64K_00000\n", msr.raw);
- display_mtrr_fixed_types(msr.raw, 0, 0x10000);
+ display_mtrr_fixed_types(msr, 0, 0x10000);
}
static void display_mtrrcap(void)