Convert between the TPR and the APIC priority encodings.
Signed-off-by: Mohamed Mediouni <[email protected]>
---
target/i386/whpx/whpx-apic.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/target/i386/whpx/whpx-apic.c b/target/i386/whpx/whpx-apic.c
index efdedbcd77..2d83291fae 100644
--- a/target/i386/whpx/whpx-apic.c
+++ b/target/i386/whpx/whpx-apic.c
@@ -184,12 +184,12 @@ static void whpx_put_apic_base(CPUState *cpu, uint64_t
val)
static void whpx_apic_set_tpr(APICCommonState *s, uint8_t val)
{
- s->tpr = val;
+ s->tpr = (val & APIC_PR_SUB_CLASS) << APIC_PR_CLASS_SHIFT;
}
static uint8_t whpx_apic_get_tpr(APICCommonState *s)
{
- return s->tpr;
+ return s->tpr >> APIC_PR_CLASS_SHIFT;
}
static void whpx_apic_vapic_base_update(APICCommonState *s)
--
2.54.0 (Apple Git-157)