]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
target/arm: Replace magic GIC values by proper definitions
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Thu, 25 Sep 2025 03:21:51 +0000 (05:21 +0200)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 26 Sep 2025 10:06:30 +0000 (11:06 +0100)
Prefer the FIELD_DP64() macro and self-describing GIC
definitions over magic values.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
target/arm/helper.c

index c5a8ef50493a1a8ce0f4bde48767e700fd31a845..a18d920ac18f8eab39d6b5ce144b13ad929c2f9c 100644 (file)
@@ -5007,7 +5007,7 @@ static uint64_t id_pfr1_read(CPUARMState *env, const ARMCPRegInfo *ri)
     uint64_t pfr1 = GET_IDREG(&cpu->isar, ID_PFR1);
 
     if (env->gicv3state) {
-        pfr1 |= 1 << 28;
+        pfr1 = FIELD_DP64(pfr1, ID_PFR1, GIC, 1);
     }
     return pfr1;
 }
@@ -5018,7 +5018,7 @@ static uint64_t id_aa64pfr0_read(CPUARMState *env, const ARMCPRegInfo *ri)
     uint64_t pfr0 = GET_IDREG(&cpu->isar, ID_AA64PFR0);
 
     if (env->gicv3state) {
-        pfr0 |= 1 << 24;
+        pfr0 = FIELD_DP64(pfr0, ID_AA64PFR0, GIC, 1);
     }
     return pfr0;
 }